SQL Server Q&A

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘sqlservr’

FIX: An access violation may occur when you remove all elements from the procedure cache for a linked server over an interrupted remote access connection

Symptoms
You may receive an access violation exception if all the following conditions are true:You connect to a linked SQL server by using remote access.You run the DBCC FREEPROCCACHE Transact-SQL statement on the linked server to remove all elements from the procedure cache.The remote access connection is interrupted when you remove all elements from the procedure cache.You may notice the following short stack dump file that corresponds to the access violation:

* Short Stack Dump* 004AE996 Module(sqlservr+000AE996) (CLob::DestroyDeep+00000026 Line 907+0000000F)* 008CB71E Module(sqlservr+004CB71E) (CXVariant::ClearDeep+00000116 Line 4519+00000000)* 004A4D82 Module(sqlservr+000A4D82) (CXVariant::Clear+00000022 Line 325+00000000)* 004C6F66 Module(sqlservr+000C6F66) (CAutoClearXVariant::~CAutoClearXVariant+00000016 Line 2020+00000016)* 006936A8 Module(sqlservr+002936A8) (CParamExchange::RestoreFromDbParams+00000588 Line 1168+0000000F)* 00692787 Module(sqlservr+00292787) (CRpcInterfaces::Relay+00000AC1 Line 814+00000000)* 00691C80 Module(sqlservr+00291C80) (CStmtExec::XretRemoteExec+00000422 Line 579+00000000)* 00674325 Module(sqlservr+00274325) (CStmtExec::XretExecute+00000465 Line 561+00000041)* 00608FD2 Module(sqlservr+00208FD2) (CMsqlExecContext::ExecuteStmts+00000560 Line 1578+00000010)* 00608657 Module(sqlservr+00208657) (CMsqlExecContext::Execute+00000368 Line 1227+0000000C)* 0063FAA0 Module(sqlservr+0023FAA0) (CSQLSource::Execute+000006D6 Line 1265+00000013)* 007DEAFE Module(sqlservr+003DEAFE) (language_exec+00000A2B Line 735+00000000)* 007E075E Module(sqlservr+003E075E) (process_commands+000001A1 Line 1765+00000009)* 04CF74BD Module(ums+000074BD) (ProcessWorkRequests+00000292 Line 449+0000000D)* 04CF6852 Module(ums+00006852) (ThreadStartRoutine+000000BD Line 263+00000007)* 77C07E53 Module(MSVCRT+00027E53) (endthread+000000AA)* 77E5D33B Module(kernel32+0001D33B) (RegisterWaitForInputIdle+00000043)
Resolution
Service pack informationTo 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?(http://support.microsoft.com/kb/290211/) How to obtain the latest SQL Server 2000 service pack
Hotfix informationThe English version of this hotfix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.

DateTimeVersionSizeFile name——————————————————————-31-May-200318:452000.80.818.078,400Console.exe25-Jun-200301:012000.80.818.033,340Dbmslpcn.dll25-Apr-200302:12786,432Distmdl.ldf25-Apr-200302:122,359,296Distmdl.mdf30-Jan-200301:55180Drop_repl_hotfix.sql23-Jun-200322:402000.80.837.01,557,052Dtsui.dll23-Jun-200322:402000.80.837.0639,552Dtswiz.dll24-Apr-200302:51747,927Instdist.sql03-May-200301:561,581Inst_repl_hotfix.sql08-Feb-200306:402000.80.765.090,692Msgprox.dll01-Apr-200302:071,873Odsole.sql05-Apr-200301:462000.80.800.062,024Odsole70.dll07-May-200320:412000.80.819.025,144Opends60.dll07-May-200318:47132,096Opends60.pdb02-Apr-200321:482000.80.796.057,904Osql.exe02-Apr-200323:152000.80.797.0279,104Pfutil80.dll22-May-200322:5719,195Qfe469571.sql11-Jul-200317:041,084,147Replmerg.sql04-Apr-200321:532000.80.798.0221,768Replprov.dll08-Feb-200306:402000.80.765.0307,784Replrec.dll11-Jul-200316:561,085,925Replsys.sql01-Jun-200301:012000.80.818.0492,096Semobj.dll31-May-200318:272000.80.818.0172,032Semobj.rll29-May-200300:29115,944Sp3_serv_uni.sql01-Jun-200301:012000.80.818.04,215,360Sqldmo.dll07-Apr-200317:4425,172Sqldumper.exe19-Mar-200318:202000.80.789.028,672Sqlevn70.rll02-Jul-200300:182000.80.834.0180,736Sqlmap70.dll08-Feb-200306:402000.80.765.057,920Sqlrepss.dll25-Jul-200321:452000.80.845.07,553,105Sqlservr.exe25-Jul-200321:4512,755,968Sqlservr.pdb25-Jul-200321:442000.80.845.0590,396Sqlsort.dll08-Feb-200306:402000.80.765.045,644Sqlvdi.dll25-Jun-200301:012000.80.818.033,340Ssmslpcn.dll01-Jun-200301:012000.80.818.082,492Ssnetlib.dll01-Jun-200301:012000.80.818.025,148Ssnmpn70.dll01-Jun-200301:012000.80.818.0158,240Svrnetcn.dll31-May-200318:592000.80.818.076,416Svrnetcn.exe30-Apr-200323:522000.80.816.045,132Ums.dll30-Apr-200323:52132,096Ums.pdb02-Jul-200300:192000.80.834.098,816Xpweb70.dllNote Because of file dependencies, the most recent hotfix or feature that contains these files may also contain additional files.

FIX: SQL Server Process Terminates Attempting to Reset from an sp_OA Based Batch

Symptoms
The SQL Server process may unexpectedly terminate while attempting a ResetFromBatch after performing sp_OA based activities. ResetFromBatch is an internal routine used by SQL Server to make sure that a server process ID (spid) has successfully completed the processing of the current batch and is set up to receive the next client request.
If this error occurs the following stack trace may be seen in the SQL Server error log:

77F97AC6 Module(ntdll+00017AC6) (ZwGetContextThread+0000000B)009261F2 Module(sqlservr+005261F2) (ex_raise2(int,int,int,int,void *,char *)+000003F7)00926302 Module(sqlservr+00526302) (ex_raisecontrol(class SQLError,…)+00000087)00925A26 Module(sqlservr+00525A26) (ex_trans_cexcept(unsigned int,struct _EXCEPTION_POINTERS *)+000001FC)7800AFC3 Module(MSVCRT+0000AFC3) (__CxxLongjmpUnwind+00000115)7800A739 Module(MSVCRT+0000A739) (__unDNameEx+00004D0A)7800A708 Module(MSVCRT+0000A708) (__unDNameEx+00004CD9)7800A559 Module(MSVCRT+0000A559) (__unDNameEx+00004B2A)7800AE9E Module(MSVCRT+0000AE9E) (__CxxFrameHandler+00000026)77F92538 Module(ntdll+00012538) (RtlSetDaclSecurityDescriptor+00000174)77F8AF89 Module(ntdll+0000AF89) (RtlConsoleMultiByteToUnicodeN+0000045C)77F9FB9A Module(ntdll+0001FB9A) (KiUserExceptionDispatcher+0000000E)22DF38FF Module(odsole70+000038FF) (CCachedTypeInfo::`scalar deleting destructor’(unsigned int)+0000000F)22DF29DE Module(odsole70+000029DE) (CODSOLEThreadInfo::UnlinkCTypeInfo(class CCachedTypeInfo *)+00000046 Line 118+0000001C)22DF27DD Module(odsole70+000027DD) (CODSOLEThreadInfo::~CODSOLEThreadInfo(void)+0000007A Line 41+0000000F)22DF6BFF Module(odsole70+00006BFF) (CODSOLEThreadInfo::`scalar deleting destructor’(unsigned int)+0000000F)22DF49EB Module(odsole70+000049EB) (OAUninitialize(void *)+0000003D Line 214+0000001C)0086A624 Module(sqlservr+0046A624) (PSS::ResetFromBatch(class ExecutionContext *,struct srv_proc *)+00000020)00459B11 Module(sqlservr+00059B11) (language_exec(struct srv_proc *)+000006BF) 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)77E92CA8 Module(KERNEL32+00012CA8) (CreateFileA+0000011B)
Resolution
The ResetFromBatch code line does not implement appropriate structured exception handling, which leads to an unhanded exception condition.

FIX: SQL Server 2000 stops responding when you cancel a query or when a query time-out occurs, and error messages are logged in the SQL Server error log file

Symptoms
This article describes the following about this hotfix release:The issues that are fixed by the hotfix packageThe prerequisites for installing the hotfix packageWhether you must restart the computer after you install the hotfix packageWhether the hotfix package is replaced by any other hotfix packageWhether you must make any registry changesThe files that are contained in the hotfix package
Resolution
In rare situations, MicrosoftSQL Server 2000 stops responding when you cancel a query or when a query time-out occurs. Additionally, error messages that resemble the following are logged in the SQL Server error log file:

2006-07-06 11:04:11.82 spid59clean_tables_xact: active sdes for tabid 457768688
2006-07-06 11:04:12.23 spid59Using ‘dbghelp.dll’ version ‘4.0.5′ *Stack Dump being sent to e:\fastnet\MSSQL\log\SQLDump0009.txt
2006-07-06 11:04:12.51 spid59Error: 0, Severity: 19, State: 0
2006-07-06 11:04:12.51 spid59SqlDumpExceptionHandler: Process 59 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process..
* BEGIN STACK DUMP: *07/06/06 11:04:12 spid 59
*Exception Address = 00402836
*Exception Code= c0000005 EXCEPTION_ACCESS_VIOLATION
*Access Violation occurred writing address 00000004
* Input Buffer 514 bytes -
<Some query statements>
*******************************************************************************
* Short Stack Dump
* 00402836 Module(sqlservr+00002836)
* 00407EF3 Module(sqlservr+00007EF3)
* 0041CB9F Module(sqlservr+0001CB9F)
* 00414C76 Module(sqlservr+00014C76)
* 00404F9D Module(sqlservr+00004F9D)
* 006E732B Module(sqlservr+002E732B) (SQLExit+0017F834)
* 00642592 Module(sqlservr+00242592) (SQLExit+000DAA9B)
* 0049C46A Module(sqlservr+0009C46A)
* 41075309 Module(ums+00005309) (ProcessWorkRequests+000002D9 Line 456+00000000)
* 41074978 Module(ums+00004978) (ThreadStartRoutine+00000098 Line 263+00000007)
* 7C34940F Module(MSVCR71+0000940F) (endthread+000000AA)
* 7C57438B Module(KERNEL32+0000438B) (TlsSetValue+000000F0)
2006-07-06 11:04:31.18 spid59Stack Signature for the dump is 0×79DB129D
2006-07-06 11:04:31.34 spid59clean_tables_xact: active sdes for tabid 457768688
2006-07-06 11:06:01.39 serverStack Signature for the dump is 0×00000000
2006-07-06 11:06:01.39 serverError: 17883, Severity: 1, State: 0
2006-07-06 11:06:01.39 serverProcess 53:0 (b68) UMS Context 0×27F80DE8 appears to be non-yielding on Scheduler 1.This problem occurs if the following conditions are true: The query performs operations on binary large object (BLOB) data types. Examples of binary large object data types include the Text data type, the NText data type, and the Image data type. The query contains the UNION operator or the OUTER JOIN operator. The query spends significant time processing the binary large object data types.

FIX: Reading Perflib Registry Values Terminates SQL Server Startup with Fatal Exception

Symptoms
During SQL Server startup, a “fatal exception” may occur when SQL Server reads the following Perflib registry values:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\009\COUNTERThe SQL Server 7.0 SP1 Errorlog shows the following stack dump during startup:

Short Stack Dump0×004fe58d Module(sqlservr+fe58d) (RegGetCntrList+1be)0×004fe278 Module(sqlservr+fe278) (LoadObjects+38)0×004fe18e Module(sqlservr+fe18e) (pm_InitializeSharedMemory+1a7)0×004fcc8a Module(sqlservr+fcc8a) (sqlservr_main+40c)0×77dd8c10 Module(ADVAPI32+18c10) (RegisterServiceCtrlHandlerA+532)2000-06-22 16:52:07.54 serverCImageHelper::GetSym Error – The specified module could not be found.
Resolution
To resolve this problem, obtain the latest service pack for SQL Server 2000. For additional information, click the following article number to view the article in theMicrosoft Knowledge Base:
290211?(http://support.microsoft.com/kb/290211/EN-US/) INF: How to Obtain the Latest SQL Server 2000 Service Pack

FIX: Query with SET NO_BROWSETABLE Option Set ON May Generate Access Violation

Symptoms
When you execute an INSERT, DELETE or UPDATE query that operates on objects with underlying triggers, the query may terminate with the following error message and an Access Violation occurs:

ODBC: Msg 0, Level 19, State 1
SqlDumpExceptionHandler: Process 52 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.The Access Violation may occur when the following conditions are true:The table has underlying triggers for the INSERT, UPDATE or DELETE.The trigger queries the inserted or deleted trigger tables.The NO_BROWSETABLE option is set ON.The following stack dump appears in the SQL Server 7.0 error log:

———————————————————————Short Stack Dump 0×0041012f Module(sqlservr+1012f) (FHasObjPermissions+37)0×005c4e7f Module(sqlservr+1c4e7f) (CBrowseTablePerms::FSchemaChanged+66) 0×005c5094 Module(sqlservr+1c5094) (CBrowseMode::FSchemaChanged+20) 0×0053a072 Module(sqlservr+13a072) (CStmtSelect::XretExecute+9b)0×0040fd90 Module(sqlservr+fd90) (CMsqlExecContext::ExecuteStmts+11b) 0×0040f7d0 Module(sqlservr+f7d0) (CMsqlExecContext::Execute+16b) ———————————————————————
The following stack dump appears in the SQL Server 2000 error log:

———————————————————————-Short Stack Dump004181A1 Module(sqlservr+000181A1) (FHasObjPermissions+00000050)0056BD62 Module(sqlservr+0016BD62) (CBrowseTablePerms::FSchemaChanged+00000059)0056BFC2 Module(sqlservr+0016BFC2) (CBrowseMode::FSchemaChanged+00000020)005F6F05 Module(sqlservr+001F6F05) (CStmtSelect::XretExecute+000000C2)00413CEE Module(sqlservr+00013CEE) (CMsqlExecContext::ExecuteStmts+000002D2)004133E9 Module(sqlservr+000133E9) (CMsqlExecContext::Execute+000001B6)00412918 Module(sqlservr+00012918) (CSQLSource::Execute+00000331)005F663D Module(sqlservr+001F663D) (ExecTrigger+000000C9)005F6824 Module(sqlservr+001F6824) (ExecAfterTrigs+0000019D)005F6922 Module(sqlservr+001F6922) (ExecAfterTrigsIfAny+0000007A)0041A5ED Module(sqlservr+0001A5ED) (CStmtDML::XretExecuteNormal+0000052A)0041A346 Module(sqlservr+0001A346) (CStmtDML::XretExecute+0000001C)00413CEE Module(sqlservr+00013CEE) (CMsqlExecContext::ExecuteStmts+000002D2)004133E9 Module(sqlservr+000133E9) (CMsqlExecContext::Execute+000001B6)00412918 Module(sqlservr+00012918) (CSQLSource::Execute+00000331)0044AFA7 Module(sqlservr+0004AFA7) (CStmtPrepQuery::XretExecute+00000200)00413CEE Module(sqlservr+00013CEE) (CMsqlExecContext::ExecuteStmts+000002D2)004133E9 Module(sqlservr+000133E9) (CMsqlExecContext::Execute+000001B6)00412918 Module(sqlservr+00012918) (CSQLSource::Execute+00000331)00448916 Module(sqlservr+00048916) (language_exec+000003E1)00411D4C Module(sqlservr+00011D4C) (process_commands+000000E0 Line 712+00000002)41073379 Module(UMS+00003379) (ProcessWorkRequests+0000024A)41073071 Module(UMS+00003071) (ThreadStartRoutine+000000BD)7800A27B Module(MSVCRT+0000A27B) (_unDNameEx+0000484C)77E8758A Module(KERNEL32+0000758A) (FileTimeToSystemTime+0000012F)———————————————————————-
Resolution
SQL Server 2000To 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 theMicrosoft Knowledge Base:
290211?(http://support.microsoft.com/kb/290211/EN-US/) INF: How to Obtain the Latest SQL Server 2000 Service Pack
SQL Server 7.0To resolve this problem, obtain the latest service pack for Microsoft SQL Server 7.0. For additional information, click the following article number to view the article in theMicrosoft Knowledge Base:
301511?(http://support.microsoft.com/kb/301511/EN-US/) INF: How to Obtain the Latest SQL Server 7.0 Service Pack

FIX: Invalid Use of the Getdate Function May Cause Access Violation

Symptoms
An invalid use of the Getdate function within a function may cause an access violation and the following error message appears in Query Analyzer:

Server: Msg 443, Level 16, State 1, Procedure fnTestDate, Line 4
Invalid use of ‘getdate’ within a function.
ODBC: Msg 0, Level 19, State 1
SqlDumpExceptionHandler: Process 51 generated fatal exception c0000005
EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.
Connection BrokenYou may find the following error messages in the SQL Server error log when the access violation occurs:

00603513 Module(sqlservr+00203513) (walk_exp_tree+00000016)006034BD Module(sqlservr+002034BD) (get_expression_str+00000038)005C679A Module(sqlservr+001C679A) (yyparse+0000145C)00444BEC Module(sqlservr+00044BEC) (sqlpars+0000003C)00411685 Module(sqlservr+00011685) (CSQLSource::FTransform+0000013C)00449527 Module(sqlservr+00049527) (CSQLStrings::FTransform+000001A1)00413632 Module(sqlservr+00013632) (CSQLSource::Execute+0000015B)0044912C Module(sqlservr+0004912C) (language_exec+000003E1)00412B1F Module(sqlservr+00012B1F) (process_commands+000000E0)41073537 Module(UMS+00003537) (ProcessWorkRequests+0000024A)41073355 Module(UMS+00003355) (ThreadStartRoutine+000000BC)7800A27B Module(MSVCRT+0000A27B) (beginthread+000000CE)77DB2C18 Module(KERNEL32+00002C18) (GetModuleHandleA+0000007A)
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 theMicrosoft Knowledge Base:
290211?(http://support.microsoft.com/kb/290211/EN-US/) INF: How to Obtain the Latest SQL Server 2000 Service Pack