Is there any way how to convert SqlCommand object to actual T-SQL command, which is sent to the SQL Server?
I was actually thinking about something like this extension (not working well, just idea):
public static string ToQuery(this SqlCommand command)
{
StringBuilder sb = new StringBuilder();
sb.Append("exec ");
sb.Append(command.CommandText);
List parameters = new List();
for (int i=0; i 0) sb.Append(string.Join(",", parameters.ToArray()));
return sb.ToString();
}