Using SQL Server Profiler
SQL Server Profile is a multi purpose tool that can be used for either logging/audited or for performance tuning. You use SQL Server Profiler to create a SQL Server trace.
SQL Server traces can be either saved to a file or to a table:
* If to a file, you will be creating a ".trc" file
* The .trc file can be created on any server anywhere on the network (i.e. it doesn't have to be local)
* If to a table, it can be a table on any database, even on a different database server
You can setup the trace to track events in one of two ways:
* You can pick from one of several pre-defined templates
* You can custom build a trace to log only what you want to log
If you start a trace, and find it has too many events being logged, one approach is to set a filter in the trace:
* Stop the trace.
* Execute sp_trace_setfilter
* Start the trace
Logging to a file has less impact on SQL Server performance than logging to a table.