GO is not a keyword recognized by SQL Server. AFAIK, Query Analyzer and OSQL/ISQL are the only tools that recognize it. You'd have to experiment with SQL-DMO.
If you want to use the SqlClient, you'll have to parse the script and break it into multiple batches yourself.
-Mike
>Hi, everybody.
>
>Is there any way to run SQL scripts in .NET? The detail is that the scripts has several transactions (GOs spreaded all over the thing...)...
>
>I know that I could:
>
>a. Use SQLDMO
>b. Parse the string and execute each block at a time
>
>but I think it shall have some way to execute it all at once...
>
>TIA