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 ‘access’

FIX: Scripting Object with Several Extended Properties May Cause Exception

Symptoms
When you attempt to script an object that has a number of large, string descriptions for the value field of its extended properties, an access violation exception may occur, resulting in failure to generate the script. This problem only occurs if you have requested to script the object’s extended properties when generating the script.
An error message similar to the following occurs:

[SQL-DMO]Code execution exception: EXCEPTION_ACCESS_VIOLATIONYou may encounter this problem when you try to script the object by using SQL Server Enterprise Manager or the Query Analyzer Object Browser, or if you are using the Script method in a SQL Distributed Management Objects (DMO) application.
Resolution
The length of the text for the values of the extended properties are long enough so that an internal buffer being used for building the script text is overrun.

FIX: AV When You Call MSXML 2.6 Parser from a Stored Procedure

Symptoms
When you use the MSXML 2.6 parser from a stored procedure, you may encounter an access violation in the parser (Msxml2.dll). This particular exception is characterized by the call stack shown in the “More Information” section of this article.
Resolution
This is an issue with the garbage collection subsystem of MSXML2.

FIX: SELECT * FROM SYSINDEXES on a database that is upgraded to SQL Server 2000 may cause an access violation

Symptoms
Executing a SELECT * FROM SYSINDEXES query against a database that has been upgraded from Microsoft SQL Server 7.0 may cause an Access Violation. If an Access Violation occurs, an error message similar to the following displays in the query window:

ODBC: Msg 0, Level 19, State 1
SqlDumpExceptionHandler: Process 51 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.
Server: Msg 1203, Level 20, State 1, Line 1
Process ID 51 attempting to unlock unowned resource KEY: 7:2:1 (790023da5d09).
Resolution
The maximum length defined for the keys column in the sysindexes system table in SQL Server 2000 is 1088, while in SQL Server 7.0, it is only 816. When a database is upgraded from SQL Server 7.0, the maximum length defined for the keys column is not updated. As a result, when an index whose keys column exceeds 816 bytes is created and the index is subsequently fetched, as in a SELECT * FROM SYSINDEXES query, the prefetch buffer is written past the 816 bytes that have been allocated, which causes the Access Violation.

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

FIX: Exists with Full Outer Join May Generate Access Violation

Symptoms
When you execute a statement in which an EXISTS clause contains a FULL OUTER JOIN, an access violation may be raised, and you may receive the following error message:

SqlDumpExceptionHandler: Process 51 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.Connection BrokenThe SQL Server error log may contain an error similar to the following:

********************************************************************************* BEGIN STACK DUMP:*02/28/01 21:58:41 spid 51**Exception Address = 0055A73F (COptExpr::DeriveGroupProperties(unsigned long) + 00000016 Line 0+00000000)*Exception Code= c0000005 EXCEPTION_ACCESS_VIOLATION*Access Violation occurred reading address 00000014
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: An access violation is logged in the SQL Server Errorlog file when you run a query that uses a plan guide in SQL Server 2005

Symptoms
This article describes the following about this hotfix release:The issues that are fixed by this hotfix packageThe prerequisites for installing the hotfix packageInformation about whether you must restart the computer after you install the hotfix packageInformation about whether the hotfix package is replaced by any other hotfix packageInformation about whether you must make any registry changesThe files that are contained in the hotfix package
Resolution
When you run a query that uses a plan guide in SQL Server 2005, the query may intermittently fail. Additionally, an access violation that resembles the following is logged in the SQL Server Errorlog file:

2006-08-23 13:34:10.48 spid438***Stack Dump being sent to H:\MSSQL\LOG\SQLDump0016.txt
2006-08-23 13:34:10.48 spid438SqlDumpExceptionHandler: Process 438 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.
2006-08-23 13:34:10.48 spid438* *******************************************************************************
2006-08-23 13:34:10.48 spid438*
2006-08-23 13:34:10.48 spid438* BEGIN STACK DUMP:
2006-08-23 13:34:10.48 spid438*08/23/06 13:34:10 spid 438
2006-08-23 13:34:10.48 spid438*
2006-08-23 13:34:10.48 spid438*
2006-08-23 13:34:10.48 spid438*Exception Address = 00000000034CE1D0 Module(sqlservr+00000000024CE1D0)
2006-08-23 13:34:10.48 spid438*Exception Code= c0000005 EXCEPTION_ACCESS_VIOLATION
2006-08-23 13:34:10.48 spid438*Access Violation occurred reading address 0000000000000010 This problem occurs if the following conditions are true:The query uses a plan guide.The query accepts some parameters.The plan guide applies the OPTIMIZE FOR hint for the query. The query is recompiled before you run the query .