I need to execute a large set of SQL statements (creating a bunch of tables, views and stored procedures) from within a C# program.
These statements need to be separated by
GO statements, but
SqlCommand.ExecuteNonQuery() does not like
GO statements. My solution, which I suppose I'll post for reference, was to split the SQL string on
GO lines, and execute each batch separately.
Is there an easier/better way?