SQL Server Profiler does not filter with TextData Column Filter

I have a stored procedure, let me call it "MyStoredProc" that gets called every few seconds.

I want to filter it out because it clutters the view.

Prose is invoked as exec sp_executesql N'Exec @Return = [dbo].[MyStoredProc]....

I already have two filters Not Like

on the TextData column that work great for other texts. However, this third doesn't work. Calls are still displayed.

I entered different options:% [MyStoredProc]% or% MyStoredProc% or MyStoredProc.

They do not work.
What's the correct syntax for this? Also can TextData filter work with variable name?

I am using Profiler 2014 to target the 2012 engine.

+9


source to share


3 answers


How Filtering String From profiler textData As you can see, you must put the procedure name (I recommend witout the schema name, dbo.) Between %% (no parentheses)



+2


source


Not sure if this will help the OP, but I've come across this scenario many times and just had to "tinker" with different types of queries, export the data to Excel, and then manually filter the results.

However, I found a way around this that seems to work consistently. First, create a new profiler template (File> Templates> New Template ...) Install the template with all desired settings or use the "Base New Template" option on an existing one. I know I used these parameters for my templates at first and I think this could be the problem.

Now when you add new filters, you need to add them by editing the template. I was unable to get the TextData filter to work if I update the tracing property values. Instead, go to File> Templates> Edit Templates ... and select and update your template.



Save the template, close Profiler and reopen the template. The filter should work when the template is run.

I'm not sure if there is an easier way, but I know that, essentially, I couldn't get my filter to work before I saved, closed and reopened my template. I'm not sure what the problem is, but I think SQL Server Profiler is caching some old filter values ​​that are not updated in the TextData field. Restarting the app seems to be the only fix when this happens.

+2


source


Since the filter didn't work, I used SQL profiler> Menu> Edit> Find> "StoredProcName" to find the rows containing it.

0


source







All Articles