Correct Answer : Set the Command.CommandTextproperty to multiple SQL statements delimited by a semicolon.
Explanation :
You can execute more than one SQL statements delimited by a semicolon.
For this you have to set the CommandText property of a Command object to multipleSQL statements separated by semicolons (;). After calling the ExecuteReader method, theDataReader will hold the number of result sets equal to the number of SQL statements executed.
Example :
String sqlQuery = ”select * from table1; select * from table2”;
SqlConnection con = new SqlConnection(connectionString);
SqlCommandcmd = new SqlCommand ();
Con.Open();
SqlDataReaderdr = cmd.ExecuteReader();
While(dr.read())
{
// Process the table1
}
Dr.NextResult();
While(dr.read())
{
// Process the table2
}