Create a trace using SQL-Profiler:
- On the SQL-Profiler File menu, click New Trace and connect to the instance of SQL Server. The Trace Properties dialog box opens.
- In the Trace Name field, enter a name for the trace.
- In the Use Template list, select the trace template on which to base the trace, or select Null if you do not want to use the template.
- If you do not use the template, you can click the "Show all events" button and select which events you want to track, there you can choose whether errors, logins, etc. will be tracked. For more information, take on: Specify the event and data columns for the trace file (SQL Server Profiler) . For example, you have a category. Errors and warnings that include special Error events.
See the documentation for more information.
If you need to do this for ODBC , you can check the following two questions:
Hope this helps.
source share