SQL Compare - How to Generate Script to be Executed with Installer that cannot use GO statement
gwruck
Posts: 1 New member
in SQL Compare
I am developing an application using C# and want to execute the output of the SQL Compare script directly to create the database. However, the generated script uses GO statements to batch the SQL commands, which are not able to be parsed directly by SQL Server. (GO Statements are not part of the TSQL definition, but instead are used by SSMS to pass batches to SQL Server)
There are options that I can use in my c# project (eg. use SMO, or split the statements at GO), but I'd prefer not to have that dependency. I thought of generating separate files, but I would like to be able to control the order of processing the files.
Has anyone else faced this problem?
There are options that I can use in my c# project (eg. use SMO, or split the statements at GO), but I'd prefer not to have that dependency. I thought of generating separate files, but I would like to be able to control the order of processing the files.
Has anyone else faced this problem?
Answers
Given you case, it is recommended that you try using SQL Change Automation instead. You can see more details in the following documentation: https://documentation.red-gate.com/sca3/tutorials/worked-examples/embed-change-script-into-application
Sean Quigley | Product Support Engineer | Redgate Software
Have you visited our Help Center?