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

FIX: Unhandled exception during upgrade when excluding database with 30-character name

Symptoms
When running the Version Upgrade Wizard to upgrade SQL Server 6.x to SQL Server 7.0, if a database whose name is 30 characters long is excluded from the upgrade, the wizard generates an unhandled exception and stops running.
If Dr. Watson is set as the default debugger, an error message similar to the following will be displayed immediately after clicking the EXCLUDE button:

An application error has occurred
and an application error log is being generated.
upgrade.exe
Exception: privileged instruction (0xc0000065), Address: 0×007f1a80
Resolution
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in SQL Server 7.0 Service Pack 1. For more information, contact your primary support provider.

FIX: Unable to Connect to SQL Server 2000 When Certificate Authority Name Is the Same As the Host Name of the Windows 2000 Computer

Symptoms
If the Certificate Server is installed on a Microsoft Windows 2000 computer and the Certificate Authority (CA) name is the same as or starts with the machine host name, an attempt to connect to SQL Server 2000 fails.
The following error message appears when you try to connect from SQL Server Query Analyzer:

Unable to connect to server. Server msg 18, level 16, state 1. [Microsoft] [ODBC SQL Server Driver} [Shared Memory] SSL security error The following error message appears when you try to connect from SQL Enterprise Manager:

Unable to connect to server. Reason: SSL security error. ConnectionOpen (SECDoClientHandShake())… The SQLServerAgent service also fails with the following error message:

Could not start SQLserverAgent Service on local computer. The service did not return an error. This could be an internal Windows error or an internal service error. If this error persists, contact your system administrator. Due to the same connectivity errors indicated previously, an attempt to install Microsoft SQL Server 2000 may also fail.
If you attempt the Microsoft SQL Server installation on a computer on which the Certificate Server and the Certificate Authority(CA) name is the same name as or starts with the machine host name, the SQL Server installation on that computer may fail at the configuration stage. During the configuration stage of the installation process, the setup program makes a connection to SQL Server.
This problem applies to any edition of Microsoft SQL Server, including the Microsoft Desktop Engine (MSDE) installation.
The Microsoft SQL Server installation may fail with the following error message:

Setup failed to configure the server. Refer to the server error logs and C:\WINNT\sqlstp.log for more information. If the error message occurs, SQL Server writes the following information in the Cnfgsvr.out file located in the SQL Server Install subfolder:

###############################################################################Starting Service …SQL_Latin1_General_CP1_CI_AS-m -Q -T4022 -T3659Connecting to Server …driver={sql server};server=Instance_Name;UID=<username>;PWD=<strong password>;database=master[Microsoft][ODBC SQL Server Driver][Shared Memory]SSL Security error[Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionOpen (SECDoClientHandshake()).driver={sql server};server=ORLANDO;UID=<username>;PWD=<strong password>;database=master[Microsoft][ODBC SQL Server Driver][Shared Memory]SSL Security error[Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionOpen (SECDoClientHandshake()).driver={sql server};server=ORLANDO;UID=<username>;PWD=<strong password>;database=master[Microsoft][ODBC SQL Server Driver][Shared Memory]SSL Security error[Microsoft][ODBC SQL Server Driver][Shared Memory]ConnectionOpen (SECDoClientHandshake()).SQL Server configuration failed.###############################################################################
By default, the Microsoft SQL Server Desktop Engine setup does not generate a Cnfgsvr.out file. The setup program may fail to configure SQL Server and the following error message may appear:

Setup failed to configure the server. Refer to the server error logs and setup error logs for more information. However, note that a configuration failure can occur due to reasons other than the one described in this article.
Resolution
The Certificate Authority (CA) name of the Certificate Server is critical when you have SQL Server 2000 on the same host. When SQL Server 2000 starts and finds a certificate with the same machine name as the subject, SQL Server tries to use it for encryption, even though it is not a valid SQL Server encryption certificate. Therefore, any attempt to connect to that SQL Server computer fails with the error shown in the “Symptoms” section.
The removal of the Certificate Server from the Microsoft Windows 2000 server does not remove the Certification Authority keys. The previously installed keys still affect the computer that is running SQL Server.

FIX: The performance of the statement that raises an error differs from the performance of the statement that does not raise an error when you trace exception events in SQL Server 2000 on an IA-6 …

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
When you trace exception events in Microsoft SQL Server 2000 on an IA-64 computer,the performance of the statement that raises an error differs from the performance of the statement that does not raise an error.
Note For more information about how to trace exception events in SQL Server 2000, see the “More information” section.
For example, you have a statement that inserts an already existing value into a primary key column of a table. When you run the insert statement, you receive an error message that resembles the following:

Server: Msg 2627, Level 14, State 1, Line 1
Violation of PRIMARY KEY constraint ‘PK_Table1′. Cannot insert duplicate key in object ‘Table1′.
The statement has been terminated.Additionally, you can see the error in the SQL Profiler trace output. If you repeatedly run this insert statement for several hours, some executions of the statement take a much longer time to display this error message. Alternatively, you can use the SQL:StmtCompleted event class to record the duration for every execution of the statement. The duration of some executions of the statement are much longer than the duration of the rest.
This example shows a scenario in which you encounter this problem. This problem may be observed with other error numbers in addition to error 2627.
For a list of all publicly released SQL Server 2000 post-Service Pack 4 hotfixes, click the following article number to view the article in the Microsoft Knowledge Base:
894905?(http://support.microsoft.com/kb/894905/) Cumulative list of the hotfixes that are available for SQL Server 2000 Service Pack 4

FIX: Parallel Hash Join with Empty Result Set Incorrectly Flows Error Back on Client Connection

Symptoms
If you run a SQL Server Data Manipulation Language (DML) statement from a DB-Library based application against a Microsoft SQL Server 7.0 server, the error handler for the application may incorrectly fire and only report the following error message:

DB-LIBRARY Error 10007, Severity 5:
General SQL Server error: Check messages from the SQL Server.Note that this error message accompanies a wide range of SQL Server errors that are reported back to the client from the server. However, in this scenario the preceding error message is the only error reported and it is not accompanied by any other specific error messages.
Resolution
If a parallel hash join produces an empty result set, internal exception 3602 is used to coordinate the shutdown of worker threads that were created to process the parallel hash plan. The internal 3602 exception is an internal control exception that is used to direct processing flow inside SQL Server and is expected behavior in this case.
However, the fact that it is causing an error to be sent back on the client connection, which in turn causes the DB-Library error handler to fire is not expected behavior.

FIX: Index Tuning Wizard Execution May Generate Floating Point Exception

Symptoms
When you run the Index Tuning Wizard, this error message may occur:

Server: Msg 3628, Level 16, State 1, Line 2
A floating point exception occurred in the user process. Current transaction is canceled.
Resolution
When a double was out of range from an underflow or overflow, the Index Tuning Wizard incorrectly converted the number into the maximum or minimum float value.

FIX: Error messages after SQL Server 2005 or SQL Server 2000 has been running for some time on Windows Server 2003 or on Windows 2000: “Failed to load FileName.dll” and “Attempts to load any type …

Symptoms
When you run Microsoft SQL Server 2005 or Microsoft SQL Server 2000 on a Windows Server 2003-based computer or on a Windows 2000-based computer, you may receive an error message that contains the following error messages:

Failed to load FileName.dll

Attempts to load any type of dll might fail within the SQL Server process with errors pointing to LoadLibrary failure.This problem usually occurs after SQL Server has been running for some time.
The complete error message that you receive resembles the following:

Exception Type: Microsoft.SqlServer.Management.SqlIMail.Server.Common.BaseException
Message: The read on the database failed. Reason: Failed to load Msxmlsql.dll.
Data: System.Collections.ListDictionaryI,4092,NULL,NULL,2007-04-13 09:44:11.640,DB\SQLServer5,warning,2007-04-13 09:44:13.153,
The activated proc [dbo].[sp_sysmail_activate] running on queue msdb.dbo.ExternalMailQueue output the following:’The service queue “ExternalMailQueue” is currently disabled.’
Attempts to use XML related activity in TSQL fails.
Msg 6610, Level 16, State 1, Procedure sp_xml_preparedocument, Line 1
Failed to load Msxmlsql.dll.
Msg 6607, Level 16, State 3, Procedure
sp_xml_removedocument, Line 1sp_xml_removedocument: The value supplied for parameter number 1 is invalid.
Attempts to load any type of dll might fail within the SQL Server process with errors pointing to LoadLibrary failure.
Attempts to use extended stored procedures will result in
Msg 0, Level 16, State 0, Procedure xp_ss_backup, Line 1
Cannot load the DLL C:\Program Files\Microsoft SQL Server\MSSQL\Binn\SQLsafe_ExtendedStoredProc.dll, or one of the DLLs it references. Reason: 1114(A dynamic link library (DLL) initialization routine failed.).
Error: 18210, Severity: 16, State: 1.
BackupVirtualDeviceSet::Initialize: CoCreateInstance failure on backup device ‘d4630f27-03a1-47ae-b7a7-4813a6809908′. Operating system error 0×8007045a(A dynamic link library (DLL) initialization routine failed.).
Resolution
This problem occurs because no thread local storage (TLS) slot is available for the SQL Server process (Sqlservr.exe). This is a problem in Windows Server 2003 and in Windows 2000.
When SQL Server unloads a DLL, the TLS slots that the DLL uses may not be released because of a problem in the TlsFree function. If SQL Server frequently loads various DLLs, and then unloads these DLLs, these DLLs use up all the available TLS slots. Eventually, SQL Server can no longer load a DLL that requires TLS slots.