Microsoft KB Archive/308723

= FIX: Access Violation Occurs When You Use SQL Profiler or SQL Trace =

Article ID: 308723

Article Last Modified on 10/17/2003

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition

-



This article was previously published under Q308723



BUG #: 352859 (SHILOH_BUGS)

BUG #: 355397 (SHILOH_BUGS)



SYMPTOMS
A handled access violation (AV) and/or the following error message may occur when you use SQL Server Profiler or SQL Trace:

Failed to read trace data

The AV only occurs if all of the following conditions are true:
 * You select a TextData column as a data column in SQL Trace.
 * Text data is sent from a non-Unicode client such as Isql.exe.
 * The text data contains double-byte character set (DBCS) characters.

Here is the short stack trace for the AV: Short Stack Dump 004D8C1C Module(sqlservr+000D8C1C) (CShortConstLockBytesSS::ReadAt(union _ULARGE_INTEGER,void *,unsigned long,unsigned long *)+0000002B) 006550EA Module(sqlservr+002550EA) (CLockBytesToLBSS::ReadAt(union _ULARGE_INTEGER,void *,unsigned long,unsigned long *)+00000035) 006E2C2C Module(sqlservr+002E2C2C) (TSendRowClass<3,0>::TSendLOB(struct srv_proc *,class CTypeInfo const *,class CXVariant *)+0000026E) 006E087C Module(sqlservr+002E087C) (CValOdsRow::SetDataX(unsigned long *,class CXVariant *)+00000221) 00426566 Module(sqlservr+00026566) (SetDataWithPop(class CEsExec *,class CXVariant *)+0000001C) 00416524 Module(sqlservr+00016524) (CEs::GeneralEval4(unsigned long *,class CEsExec *,class CXVariant *)+0000003D) 004270DA Module(sqlservr+000270DA) (CStmtQuery::ErsqExecuteQuery(class CMsqlExecContext *,class CEsComp const *,class CEsComp const *,unsigned long *,int,int)const +00000451) 00441A34 Module(sqlservr+00041A34) (CStmtSelect::XretExecute(class CMsqlExecContext *)const +0000021C) 004160DB Module(sqlservr+000160DB) (CMsqlExecContext::ExecuteStmts(class ExecutionContext *)+0000027E) 00415765 Module(sqlservr+00015765) (CMsqlExecContext::Execute(class CCompPlan *,class CParamExchange *)+000001C7) 00415410 Module(sqlservr+00015410) (CSQLSource::Execute(class CParamExchange *)+00000343) 0049CD0A Module(sqlservr+0009CD0A) (CStmtExec::XretLocalExec(class CMsqlExecContext *,unsigned short *,int,class WParseName *)const +00000154) 0049CB9F Module(sqlservr+0009CB9F) (CStmtExec::XretExecute(class CMsqlExecContext *)const +00000322) 004160DB Module(sqlservr+000160DB) (CMsqlExecContext::ExecuteStmts(class ExecutionContext *)+0000027E) 00415765 Module(sqlservr+00015765) (CMsqlExecContext::Execute(class CCompPlan *,class CParamExchange *)+000001C7) 00415410 Module(sqlservr+00015410) (CSQLSource::Execute(class CParamExchange *)+00000343) 00459A54 Module(sqlservr+00059A54) (language_exec(struct srv_proc *)+000003C8) 004175D8 Module(sqlservr+000175D8) (process_commands(struct srv_proc *)+000000E0) 410735D0 Module(UMS+000035D0) (ProcessWorkRequests(class UmsWorkQueue *)+00000264) 4107382C Module(UMS+0000382C) (ThreadStartRoutine(void *)+000000BC) 7800BEA1 Module(MSVCRT+0000BEA1) (_beginthread+000000CE) 77E637CD Module(KERNEL32+000037CD) (TlsSetValue+000000F0) If the trace is written to a file, SQL Server Profiler reports the following error message when you attempt to open the trace file:

Failed to read file data. File may be corrupt. Or it may have a wrong data format.

If the TextData column is not included, no errors occur.



CAUSE
When SQL Server converts the non-unicode text to Unicode, SQL Server overestimates the size of the converted string.



RESOLUTION
To resolve this problem, obtain the latest service pack for Microsoft SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack



STATUS
Microsoft has confirmed that this is a problem in Microsoft SQL Server 2000. This problem was first corrected in Microsoft SQL Server 2000 Service Pack 2.

Additional query words: single dual double byte

Keywords: kbbug kbfix KB308723

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.