Steps:
SQL Server Management Studio
- Go to MS SQL Server Management Studio and select the database you want to trace in the Profiler.
- Right click the database and select New Query.
- In the query window type select db_id() then execute... and remember the number generated
SQL Server Profiler
- File - New Trace then choose server, Authentication Mode provide UserName and Password and click connect.
- In the trace properties go to events selection tab.
- click Show all events and Show all columns.
- Click Column Filters button
- click DatabaseID
- click Equals then input the DB ID generated before in the Mangement Studio
- Click Ok then click the Run Button