SQL Profiler

  • How can I run a trace against only one database?  I tried to filter by database name and nt login name, but I'm still seeing events for every database on the sql server.  Any suggestions would be appreciated.

  • Laura,

    On Profiler properties - Go to Filter tab - choose DatabaseID - equals - <enter the database id>

    To find the database id, enter the following in QA.

    select db_id()

    I hope this helps.

    Gopal

  • As db_id with no parameters returns only the ID for the current database, if you need to know the id's of all databases use this T-SQL

    select name,dbid from master..sysdatabases

     

    hth

     

    Neil.

     

     

  • That did it.  Thanks!

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply