Register ODBC, SQL Server

How to register, track or receive queries sent by an application to Microsoft SQL Server 2008 through the ODBC driver (without changing the application ...)

Maybe this can be done with SQL Server itself, or does ODBC have some query logging?

+4
source share
2 answers

@davispuh, you can use SQL Profiler to track SQL statements. You can also use ODBC Tracing .

+4
source

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.

+1
source

Source: https://habr.com/ru/post/1308287/


All Articles