Skip navigation

Bugs in BOL's SQL Trace Table

In Books Online (BOL), Example F of the xp_sqltrace entry contains a table similar to SQL Trace. Unfortunately, the example table contains two serious bugs you need to know about. The BOL SQL Trace Application column is defined as NOT NULL, which causes your bcp operation to fail if the client doesn't provide this information in its ODBC or DB-Lib connection string.

The second problem is with the Hostprocess column, which BOL defines as INT. Windows NT's hostprocess is a 32-bit number that can exceed the defined range for INT of ±2,147,483,648. Hostprocess usually falls within SQL's INT range, but it could exceed the maximum value, which would also cause bcp to fail. Discovering these bugs wasn't easy, so don't forget to fix the Application and Hostprocess datatypes if you copy the SQL Trace table directly from BOL. If you're working with large trace files, check out my article "Seven Tips for Speeding Large Data Loads with Bulk Copy Program," February 1997, for information about tuning bcp.

TAGS: SQL
Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish