Execute multiple SQL commands in one round trip
Something like this. The example is probably not very good as it doesn’t properly dispose objects but you get the idea. Here’s a cleaned up version: using (var connection = new SqlConnection(ConnectionString)) using (var command = connection.CreateCommand()) { connection.Open(); command.CommandText = “select id from test1; select id from test2”; using (var reader = command.ExecuteReader()) { … Read more