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?