Skip to main content
added 143 characters in body
Source Link
Hannah Vernon
  • 70.5k
  • 22
  • 177
  • 321

For SQL Server 2008 R2 or earlier, I'd recommend running a SQL Server Profiler session against the server.

On the General tab, in the template dropdown, select "Blank", then on the Events Selection tab, choose "SQL_StmtStarting" from the list of events. Click the "Column Filters" button, and fill it out similar to this:

enter image description here

When you run this profiler session, the results will only show you rows where the TextData column contains the text you entered. Alternately, if you have a sql handle you specifically want to track you can enter that in the filter under SqlHandle instead of TextData.

On SQL Server 2012 and above, I'd recommend using Extended Events to do this, however that is out of the scope of this question.

For SQL Server 2008 R2 or earlier, I'd recommend running a SQL Server Profiler session against the server.

On the General tab, in the template dropdown, select "Blank", then on the Events Selection tab, choose "SQL_StmtStarting" from the list of events. Click the "Column Filters" button, and fill it out similar to this:

enter image description here

When you run this profiler session, the results will only show you rows where the TextData column contains the text you entered.

On SQL Server 2012 and above, I'd recommend using Extended Events to do this, however that is out of the scope of this question.

For SQL Server 2008 R2 or earlier, I'd recommend running a SQL Server Profiler session against the server.

On the General tab, in the template dropdown, select "Blank", then on the Events Selection tab, choose "SQL_StmtStarting" from the list of events. Click the "Column Filters" button, and fill it out similar to this:

enter image description here

When you run this profiler session, the results will only show you rows where the TextData column contains the text you entered. Alternately, if you have a sql handle you specifically want to track you can enter that in the filter under SqlHandle instead of TextData.

On SQL Server 2012 and above, I'd recommend using Extended Events to do this, however that is out of the scope of this question.

Source Link
Hannah Vernon
  • 70.5k
  • 22
  • 177
  • 321

For SQL Server 2008 R2 or earlier, I'd recommend running a SQL Server Profiler session against the server.

On the General tab, in the template dropdown, select "Blank", then on the Events Selection tab, choose "SQL_StmtStarting" from the list of events. Click the "Column Filters" button, and fill it out similar to this:

enter image description here

When you run this profiler session, the results will only show you rows where the TextData column contains the text you entered.

On SQL Server 2012 and above, I'd recommend using Extended Events to do this, however that is out of the scope of this question.