Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 475
  • Last Modified:

sql trace activity for a database

how can I trace anything connecting to a database abc... I started a default trace and added a filter database name 'abc'. However, I run a select and it doesn't return anything in the trace.
Additionally, is it possible to exclude sql service account also.?

Please let me know the events and the filters that are required to identify activity in a database, excluding events from the sql service account.
0
sqlserverdba
Asked:
sqlserverdba
  • 2
2 Solutions
 
Saqib KhanSenior DeveloperCommented:
Under Trace properties > Events Selection tab > select show all columns. Now under column filters, you should see the database name. Enter the database name for the Like section and you should see traces only for that database.

You can also try by databaseID:
SELECT [name],[dbid] FROM [master].[dbo].[sysdatabases] ORDER BY [name]
0
 
sqlserverdbaAuthor Commented:
That was what I tried and then ran a select against a table in the database and it did not show in the trace.. so I wanted to know what events and what filters I need.
0
 
Saqib KhanSenior DeveloperCommented:
above is exactaly what you need...did you try the DatabaseID filter instead (as suggested above)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now