Executing multiple DDL statements using C#

  • Thread starter Thread starter rudykayna
  • Start date Start date
R

rudykayna

I'm having trouble executing multiple DDL statements in one SQL file. I've been using ExecuteNonQuery() but it does not seem to like the "GO" statements in my SQL file. I need to keep the "GO" statements because its DDL. Anyone know a way around this?
 
GO is not DDL, it is SQL Query Analyzer specific.

One option is to split the SQL DDL using String.Split on the GO keyword and
execute each segment array element.

rudykayna said:
I'm having trouble executing multiple DDL statements in one SQL file. I've
been using ExecuteNonQuery() but it does not seem to like the "GO"
statements in my SQL file. I need to keep the "GO" statements because its
DDL. Anyone know a way around this?Community Website: http://www.dotnetjunkies.com/newsgroups/
 
Back
Top