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 for the ‘exception’ Category

FIX: An access violation exception may occur when you try to access SQL Server on a computer that is running under low memory conditions

Symptoms
SummarySymptomsResolution
Service pack information
Hotfix information
Prerequisites
Restart information
Hotfix file informationWorkaroundStatusMore Information
Stack information
Resolution
This article describes the following about this hotfix release:The issues that are fixed by this hotfix package.The prerequisites for installing the hotfix package.Whether you must restart your computer after you install the hotfix package.Whether the hotfix package is replaced by any other hotfix package.Whether you must make any registry changes. The files that are contained in the hotfix package.

FIX: An access violation exception may occur when you run a SELECT statement that contains complex JOIN operations in SQL Server 7.0

Symptoms
When you run a SELECT Transact-SQL statement to fetch data from your Microsoft SQL Server 7.0 database, an access violation exception may occurif the query contains complex JOIN operations.Additionally, you may receive the following error message:

SqlDumpExceptionHandler: Process 9 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.
You may also notice a short stack dump that is similar to the following in the SQL Server error log:

*******************************************************************************——————————————————————————-Short Stack Dump0×004b74ff Module(sqlservr+b74ff) (CValSwitch::GetDataWithBuffer+17)0×0041fb1f Module(sqlservr+1fb1f) (GetDataWithBuffer+28)0×0041faf7 Module(sqlservr+1faf7) (GetDataWithBuffer+0)0×00420da8 Module(sqlservr+20da8) (CValSwitch::GetDataX+19)0×0066c8e6 Module(sqlservr+26c8e6) (CQScanSpool::GetRow+19f)0×0042bcfd Module(sqlservr+2bcfd) (CQScanNLJoin::GetRow+121)0×004142d5 Module(sqlservr+142d5) (CQueryScan::GetRow+11)0×00413a37 Module(sqlservr+13a37) (CStmtQuery::FExecuteQuery+303)0×00418724 Module(sqlservr+18724) (CStmtSelect::XretExecute+1f8)0×00412f1e Module(sqlservr+12f1e) (CMsqlExecContext::ExecuteStmts+11b)0×00412a33 Module(sqlservr+12a33) (CMsqlExecContext::Execute+1be)——————————————————————————-2004-06-10 13:02:13.95 spid9Error: 0, Severity: 19, State: 02004-06-10 13:02:13.95 spid9language_exec: Process 9 generated an access violation. SQL Server is terminating this process.
Note This problem does not occur on an instance of Microsoft SQL Server 2000.
Resolution
A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem.
If the hotfix is available for download, there is a “Hotfix download available” section at the top of this Knowledge Base article. If this section does not appear, submit a request to Microsoft Customer Service and Support to obtain the hotfix.
Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or tocreate a separate service request, visit the following Microsoft Web site:
http://support.microsoft.com/contactus/?ws=support(http://support.microsoft.com/contactus/?ws=support)Note The “Hotfix download available” form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language. The English version of this fix 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————————————————————–04-Oct-200211:297.00.108128,944Dbmssocn.dll06-Sep-200211:257.00.107753,520Distrib.exe06-Sep-200211:257.00.107798,576Logread.exe05-May-200306:0454,904Opends60.dbg05-May-200306:047.00.1093155,920Opends60.dll06-Sep-200211:267.00.1077250,128Rdistcom.dll06-Sep-200211:257.00.107782,192Replmerg.exe06-Sep-200211:267.00.107778,096Replres.dll17-Sep-200210:227,941Securityhotfix.sql06-Sep-200211:267.00.1077160,016Snapshot.exe29-May-200315:5159,214Sp4_serv_uni.sql14-Jan-200313:037.00.1085344,064Sqlagent.exe06-Sep-200211:257.00.107745,056Sqlcmdss.dll15-May-200311:487.00.10942,629,632Sqldmo.dll16-May-200300:597.00.109481,920Sqlmap70.dll22-Jun-200412:487.00.11495,062,928Sqlservr.exe15-Oct-200304:397.00.1144315,392Sqltrace.dll04-Oct-200211:297.00.108145,328Ssmsso70.dll15-May-200311:487.00.109424,848Ssnmpn70.dll26-Sep-200208:0028,408Ums.dbg26-Sep-200207:577.00.107957,616Ums.dll16-May-200301:017.00.1094151,552Xpweb70.dllNoteBecause of file dependencies, the most recent hotfix that contains these files may also contain additional files.

FIX: An access violation exception may occur when you insert a row in a table that is referenced by indexed views in SQL Server 2000

Symptoms
If you run a Transact-SQL INSERT statement that tries to insert a row in a table that is referenced in several indexed views, an access violation exception may occur. When the access violation exception occurs, SQL Server terminates the client connection that ran the INSERT statement.
After you run the Transact-SQL INSERT statement, you may see a short stack dump that is similar to the following.

* Short Stack Dump* 00000000 Module(sqlservr+FFC00000)* 00490A0C Module(sqlservr+00090A0C) (+00000136)* 004908B6 Module(sqlservr+000908B6) (CXteFetch::QScanGet+000000AE)* 00423E92 Module(sqlservr+00023E92) (CXteProject::QScanGet+00000092)* 0047A078 Module(sqlservr+0007A078) (CQScanUpdate::CQScanUpdate+000000E6)* 00479F74 Module(sqlservr+00079F74) (CXteUpdate::QScanGet+00000053)* 006F73A3 Module(sqlservr+002F73A3) (CQScanSpool::CQScanSpool+00000167)* 006F70DA Module(sqlservr+002F70DA) (CXteSpool::QScanGet+000000A5)* 0047A078 Module(sqlservr+0007A078) (CQScanUpdate::CQScanUpdate+000000E6)* 00479F74 Module(sqlservr+00079F74) (CXteUpdate::QScanGet+00000053)* 006F9A10 Module(sqlservr+002F9A10) (CQScanSequence::CQScanSequence+0000007C)* 006F9958 Module(sqlservr+002F9958) (CXteSequence::QScanGet+0000004F)* 006F9A10 Module(sqlservr+002F9A10) (CQScanSequence::CQScanSequence+0000007C)* 006F9958 Module(sqlservr+002F9958) (CXteSequence::QScanGet+0000004F)* 004217F3 Module(sqlservr+000217F3) (CQueryScan::CQueryScan+0000028E)* 004215DD Module(sqlservr+000215DD) (CQuery::Execute+0000006A)* 0041D4D9 Module(sqlservr+0001D4D9) (CStmtQuery::ErsqExecuteQuery+0000022C)* 0041E09C Module(sqlservr+0001E09C) (CStmtDML::XretExecuteNormal+000002AE)* 0041DECA Module(sqlservr+0001DECA) (CStmtDML::XretExecute+0000001C)* 0041B442 Module(sqlservr+0001B442) (CMsqlExecContext::ExecuteStmts+000003B9)* 0041AA88 Module(sqlservr+0001AA88) (CMsqlExecContext::Execute+000001B6)* 0041B9B6 Module(sqlservr+0001B9B6) (CSQLSource::Execute+00000357)* 00498A8A Module(sqlservr+00098A8A) (CStmtExec::XretLocalExec+0000014D)* 00498926 Module(sqlservr+00098926) (CStmtExec::XretExecute+0000031A)* 0041B442 Module(sqlservr+0001B442) (CMsqlExecContext::ExecuteStmts+000003B9)* 0041AA88 Module(sqlservr+0001AA88) (CMsqlExecContext::Execute+000001B6)* 0041B9B6 Module(sqlservr+0001B9B6) (CSQLSource::Execute+00000357)* 0048A63B Module(sqlservr+0008A63B) (language_exec+000003E1)* 0042708C Module(sqlservr+0002708C) (process_commands+0000010E)* 41075002 Module(UMS+00005002) (ProcessWorkRequests+00000272)* 41074698 Module(UMS+00004698) (ThreadStartRoutine+00000098)* 7800C9EB Module(MSVCRT+0000C9EB) (beginthread+000000CE)* 77E8B2D8 Module(KERNEL32+0000B2D8) (lstrcmpiW+000000B7)
Note This problem does not occur in the original release version ofMicrosoft SQL Server 2000.
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 fix 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———————————————————————-25-Feb-200315:112000.80.777.029,244Dbmslpcn.dll07-Feb-200317:14786,432Distmdl.ldf07-Feb-200317:142,359,296Distmdl.mdf29-Jan-200313:25180Drop_repl_hotfix.sql07-Apr-200306:452000.80.801.01,557,052Dtsui.dll23-Apr-200314:21747,927Instdist.sql29-Jan-200313:251,402Inst_repl_hotfix.sql07-Feb-200318:102000.80.765.090,692Msgprox.dll31-Mar-200313:371,873Odsole.sql04-Apr-200313:162000.80.800.062,024Odsole70.dll02-Apr-200309:182000.80.796.057,904Osql.exe02-Apr-200310:452000.80.797.0279,104Pfutil80.dll04-Apr-200308:571,083,467Replmerg.sql04-Apr-200309:232000.80.798.0221,768Replprov.dll07-Feb-200318:102000.80.765.0307,784Replrec.dll31-Mar-200313:531,084,828Replsys.sql16-Apr-200310:09115,892Sp3_serv_uni.sql07-Apr-200305:1425,172Sqldumper.exe19-Mar-200305:502000.80.789.028,672Sqlevn70.rll23-Apr-200317:092000.80.811.0176,696Sqlmap70.dll07-Feb-200318:102000.80.765.057,920Sqlrepss.dll23-Apr-200317:092000.80.811.07,540,817Sqlservr.exe07-Feb-200318:102000.80.765.045,644Sqlvdi.dll25-Feb-200315:112000.80.777.029,244Ssmslpcn.dll25-Feb-200315:112000.80.777.082,492Ssnetlib.dll27-Feb-200313:042000.80.778.098,872Xpweb70.dll
Note Because of file dependencies, the most recent hotfix or feature that contains these files may also contain additional files.

FIX: ALTER DATABASE SET READ_ONLY Statement May Lead to an Assertion If the Transaction Log is Full

Symptoms
If the following conditions are true, SQL Server may encounter an assertion followed by an Access Violation (AV), which may then cause the server to either shut down or become unresponsive:
An ALTER DATABASE Set Read_Only statement has been issued on a database.The transaction log of the database on which the ALTER DATABASE statement is being run is full.
Resolution
When an ALTER DATABASE SET READ_ONLY statement is executed on a database, SQL Server must: Shut down the database cleanly by issuing a CHECKPOINT statement.Update the status in the Master..Sysdatabases system table for that database.Bring the database back up with the new status. However, if the transaction log is full, a CHECKPOINT record cannot be written to the database and it raises an error. SQL Server ignores this error and incorrectly continues to update the status in Master..Sysdatabases. As a result, when the database is brought back up again, the status is set to read-only but SQL Server continues to try to perform a recovery on a read-only database; therefore, an Assertion occurs.

FIX: Access Violation When Using Generate SQL Scripts Option in SQL Server Enterprise Manager

Symptoms
In SQL Server Enterprise Manager, when you use the Generate Sql Scripts… menu item to generate scripts for all objects in a database with both Script Full Text Indexes and Create one File per Object selected from the Options tab, you may receive the following error message:

An error occurred during scripting.
ERROR 5: [SQL-DMO]Code execution exception: EXCEPTION_ACCESS_VIOLATION
Resolution
To work around this problem, clear either Script Full Text Indexes or Create one File per Object.

FIX: A stack overflow exception may occur, and SQL Server 2000 may unexpectedly close when you submit a query that uses the UNION ALL operator more than 255 times

Symptoms
This article describes the following about this hotfix release:The issues that are fixed by this hotfix packageThe prerequisites for applying 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 changes The files that are contained in the hotfix package
Resolution
Consider the following scenario. You create a query that uses the UNION ALL operator more than 255 times. You submit this query from a client application to Microsoft SQL Server 2000. In this scenario, a stack overflow exception may occur, and then SQL Server unexpectedly closes. When this problem occurs, the client application receives the following error message:

Server: Msg 8621, Severity 17, State 1, Line 1 Internal Query Processor Error: The query processor ran out of stack space during query optimization. Additionally, the following error is written to the SQL Server error log:

Date Time spid52 Date Time Stack Overflow Dump not possible – Exception c00000fd E at 0×00000000005A8C70
Date Time spid52 Address=5a8c70 Exception Code = c00000fd
Date Time spid52 <the query statement (only part of the statement will be saved here due to length consideration>
Date Time spid52
Date Time spid52 TotalPhysicalMemory = 2139881472, AvailablePhysicalMemory = 1585553408
Date Time spid52 AvailableVirtualMemory = 7677010944000, AvailablePagingFile = 3594182656 On computers that run on the IA-64 architecture, the client application may receive the following error message:

[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionCheckForData (CheckforData()).
Server: Msg 11, Severity 16, State 1, Line 0 General Network Error. Connection broken Finally, the following error is written to the SQL Server event log:
Event type: Error
Event source: Service Control Manager
Event catalog: None
Event ID: 7034
Date: Date
Time: Date
User: N/A
Computer: ComputerName
Description: The MSSQLSERVER service terminated unexpectedly. It has done this 1 time(s). For a list of all publicly released SQL Server 2000 Post-Service Pack 3a hotfixes, see the following article in the Microsoft Knowledge Base:
810185?(http://support.microsoft.com/kb/810185/) SQL Server 2000 hotfix update for SQL Server 2000 Service Pack 3 and 3a