Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to update a database structure?
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01524837
Message ID:
01524959
Views:
44
>>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
>
Hi Vladimir,

That is pretty cool to be able update the SQL Server right from the VFP exe. Thank you for your help!
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform