Friday, February 24, 2012

SQL Server Profiler: Trace events from one database

I always seems to forget how to configure SQL Server Profiler to trace only a specific database. So therefore this post.

  • Open SQL Server Profiler
  • Click on New Trace.
  • Connect to the database server you want to trace.
  • The Trace Properties window is shown. Go to the Events Selection tab.


  • On the Events Selection tab select show all columns.


  • Now you have an extra column DatabaseName.


  • Click on Column Filters… to add a filter. Specify the name of the database in the Like section.


  • That’s it!


Anonymous said...

Thank you, I respect all who who use profiler, noticed heaps of developers who never used it before

lp said...

Thanks for the post, Bart. It was really straightforward.

My biggest questions after I stepped through the article were:
1. What elements should I include in my trace to make a performance difference?
2. How do I read the trace results?
3 How do I make specific improvements for performance?

It took a little trial and error to figure out #1. I answered #2 and #3 by trying out different software tools out there. One useful tool was SQL Trace Analyzer (although the interface was a little clunky).

Pe Xju said...

hello guy, i have problem. i don't see database name on column filter!! what should i do!!!

Unknown said...

That was awesome! Straight to the solution I needed. Thanks!

Anil Singh said...
This comment has been removed by a blog administrator.