When I use SqlCommand.ExecuteNonQuery()
and its CommandText
has a GO
(commit) it it, I get an SQLException.
I removed it and the SQL worked, but the whole SQL has many statements and I'd like to commit after each of them run. And I don't wanna split them in multiple SqlCommand
objects.
Is there a better solution to keep commiting and keep a unique SqlCommand
object?