0

I am developing a small utility for my team which I want to use while deploying a database release. The developers are using management studio and whenever they make changes in an SP or table, they are creating scripts from management studio (DROP and CREATE) option.

In my utility, I use that script and when I run that script with ADO.Net execute non query, it throws several exceptions like - 'GO' is not correct keyword etc.

Can anyone please suggest what could be a way to run those scripts as is?

Thanks

saarthak
  • 1,004
  • 2
  • 12
  • 26
  • 2
    I had a similar issue http://stackoverflow.com/questions/971177/using-go-within-a-transaction – Greg B Jun 15 '11 at 15:41

1 Answers1

0

Use of the Microsoft tools to run these scripts - they understand the GO command (which is not SQL) and strip it out before sending to SQL Server.

See sqlcmd and the older (deprecated) osql utilities.

Oded
  • 489,969
  • 99
  • 883
  • 1,009