GO statements blowing up sql execution in .NET

前端 未结 11 1023
南笙
南笙 2020-12-05 09:48

I have a very simple C# command shell app that executes a sql script generated by SQL Server for scripting schema and data. It\'s blowing up on the \"GO\" statements. Error

11条回答
  •  独厮守ぢ
    2020-12-05 10:13

    As an alternative to massaging the scripts to make them runnable through C#, you could just run them as-is by using the sqlcmd utility. Lot of details at:

    http://technet.microsoft.com/en-us/library/ms180944.aspx

    By using sqlcmd, you can script out the execution of any number of your SQL Server generated scripts, without stripping out the Go statements.

提交回复
热议问题