VirtualObjectives

Search Default Trace

The default trace in SQL Server contains useful information which can help administrators with finding out when events happen. This script will allow you to display the server's default trace.

By default, the default trace runs all the time and captures the following information:

  • security auditing events
  • database events
  • errors and warnings
  • full text events
  • object create\delete\alter events
  • server memory events

SQL Server controls how much information is stored in the default trace, so this trace can go back a few days to several months depending on how busy your server is.
Nevertheless, it can help track what when and who made changes on a server.

Script

The following script will return the last two days, however, you can easily change it to search on other columns.