The Sql.log file may consume all disk space and cause SQL Server to run slowly when you turn on ODBC Tracing


Open Database Connectivity (ODBC) Tracing can be used to trace calls to ODBC functions from ODBC applications. The ODBC Driver Manager can trace calls continuously or for one connection only, can perform tracing dynamically, or can allow tracing to be performed by a custom trace .dll file. ODBC Tracing stores information in a file on the local hard drive. By default, the file name is "SQL.LOG" and its physical location is the root of the system partition (that is, where the %windows% directory resides. For example C:\sql.log). The file location and name can be edited in the ODBC Data Source Administrator.

The user needs to be aware that having ODBC Tracing turned on can result in two problems:

  • The SQL.LOG file can grow very large and consume all existing disk space on the drive where it resides.
  • There may be a high input/output (I/O) overhead associated with ODBC Trace, and that can seriously impact the performance of the ODBC application or any application running on the computer where the trace is done.


To turn off ODBC Tracing and remove the associated file, follow these steps:

  1. To disable ODBC Tracing:
    1. For Microsoft Windows NT 4.0:
      • On the Start menu, click on Control Panel, and then click on Data Sources(ODBC).
      • Click on the Tracing tab, and choose Stop Tracing Now.
    2. For Microsoft Windows 2000:
      • On the Start menu, click on Control Panel, click on Administrative Tools, and then click on Data Sources (ODBC).
      • Click on the Tracing tab, and choose Stop Tracing Now.
  2. Stop all ODBC applications, and stop SQL Server. In some cases it may be necessary to reboot the server to free up the file so that it can be deleted.
  3. Delete the ODBC Tracing file, usually called "C:\SQL.LOG."
  4. Restart SQL Server.

More Information

For additional information on ODBC Tracing and SQL Server, click the article numbers below to view the articles in the Microsoft Knowledge Base:

140895 INF: Diagnostic Tips for the Microsoft SQL Server ODBC Driver
139655 INF: Tracing SQL Generated by MS SQL Server ODBC Driver
248704 Open Database Connectivity Performance Slow When Tracing Enabled