Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to update a database structure?
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01524837
Message ID:
01524955
Vues:
39
>Hi,
>
>How do you update a database structure (default keys, constraint, etc) installed on the customer site with the changes you have made to your copy of SQL Server database? That is, I understand that I have to create some script and send it to the customer and instruct them to run this script, correct? How do you create such a script? TIA.

Hi Dmitry.
We use this way to update a database structure:
1. We have Upgrade.exe
2. In this Upgrade.exe we have for example such a code
        TEXT TO lcSQL NOSHOW TEXTMERGE
                IF NOT EXISTS(SELECT * FROM MyDb.INFORMATION_SCHEMA.Columns 
                                     WHERE Table_Name  = 'Signatures' AND
                                           Column_Name = 'BolnBossName')
                   ALTER TABLE MyDb.dbo.Signatures ADD
                         BolnBossName      varchar(40) NOT NULL CONSTRAINT DF_Signatures_BolnBossName      DEFAULT '',
                         BolnBossDlj       varchar(30) NOT NULL CONSTRAINT DF_Signatures_BolnBossDlj       DEFAULT '',
                         BolnBossEgn       varchar(10) NOT NULL CONSTRAINT DF_Signatures_BolnBossEgn       DEFAULT '',
                         BolnBossKarta     varchar(9)  NOT NULL CONSTRAINT DF_Signatures_BolnBossKarta     DEFAULT '',
                         BolnBossIzdaden   datetime        NULL                                                      ,
                         BolnBossIzdadenOt varchar(25) NOT NULL CONSTRAINT DF_Signatures_BolnBossIzdadenOt DEFAULT ''                                           
        ENDTEXT
       
       IF SQLEXEC(lnSQLHandler,lcSQL)   < 0
            AERROR(laError)
            MESSAGEBOX([Error:]+CRLF+laError[1,2])
            RETURN .f.
        ENDIF
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform