B
Ben
Hi all,
I want to retrieve the execution plan for a SQL statement, so need to
prepend the SET SHOWPLAN_ALL ON command to the statement before submission,
but am not sure how to do so. Any ideas?
SqlCommand command = connection.CreateCommand();
command.CommandType = CommandType.Text;
command.CommandText = "SET SHOWPLAN_ALL ON; SELECT * FROM some_table; SET
SHOWPLAN_ALL OFF";
IDataReader reader = command.ExecuteReader();
etc...doesn't work, because SHOWPLAN_ALL must be the only command in a
batch?
Thanks in advance,
Ben
I want to retrieve the execution plan for a SQL statement, so need to
prepend the SET SHOWPLAN_ALL ON command to the statement before submission,
but am not sure how to do so. Any ideas?
SqlCommand command = connection.CreateCommand();
command.CommandType = CommandType.Text;
command.CommandText = "SET SHOWPLAN_ALL ON; SELECT * FROM some_table; SET
SHOWPLAN_ALL OFF";
IDataReader reader = command.ExecuteReader();
etc...doesn't work, because SHOWPLAN_ALL must be the only command in a
batch?
Thanks in advance,
Ben