GO is not a Transact-SQL statement; it is a command recognized by the osql and isql utilities and SQL Query Analyzer.
This is a bit of a pain.
I work on a three tier application that makes heavy use of stored procedures (600 and growing).
I have a set of expect scripts that I use to refresh the stored procedures.
These are great – it puts a gui onto the batch files that actually run osql commands.
This takes away a lot of the support issues involved in having people misstype complex commands.
The only problem is the scripts are slow to run. It can take 5 mins to refresh the lot.
This is not really that big a problem – but I am trying to put together a continuous integration server and it would be good if the database could be rebuilt very quickly.
To advance my C# knowledge I have started an ADO.NET app that reads the same batch files and then executes the stored procedures (one per file).
This is where I found the above problem. OleDBCommand objects don’t understand the GO command. It looks like I am going to have to preprocess the script and replace GO with ;