>>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