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.

FIX: 17883 errors may be written to the SQL Server error log when you run a query that generates many floating point exception errors in SQL Server 2000

Symptoms
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 the 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.
Resolution
In Microsoft SQL Server 2000, when you run a query that generates many floating point exception errors, you may experience slow performance and query timeouts when you run other queries. This problem typically occurs when more than 1,000 floating point exceptions are generated.
Additionally, 17883 error reports that are similar to the following may be written to the SQL Server 2000 error log:

Error: 17883, Severity: 1, State: 0
Process 51:0 (dbc) UMS Context 0×018DA930 appears to be non-yielding on Scheduler 0. You may also receive one or more error messages that are similar to the following on a computer where a 64-bit version of SQL Server 2000 is installed:

Server: Msg 3628, Level 16, State 1, Line 2
A floating point exception occurred in the user process. Current transaction is canceledFor 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

FIX: An exception occurs when you try to perform a one-phase commit on an XA-enabled JDBC connection in SQL Server 2005

Symptoms
When you try to perform a one-phase commit on an XA-, or two phase-, enabled JDBC connection in Microsoft SQL Server 2005, the following exception occurs:

Exception in thread “main” com.microsoft.sqlserver.jdbc.SQLServerException: The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(Unknown Source)
at com.microsoft.sqlserver.jdbc.IOBuffer.processPackets(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectionCommand(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.sendCommit(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.commit(Unknown Source)
Resolution
This problem occurs because SQL Server 2005 does not allow a one-phase commit on a two-phase-enabled data source.

Error message when you use a common language runtime object in SQL Server 2005: “Cannot load dynamically generated serialization assembly”

Symptoms
When you use a common language runtime (CLR) object in Microsoft SQL Server 2005, you may receive an error message that is similar to the following:

Msg 6522, Level 16, State 2, Line 1
A .NET Framework error occurred during execution of user defined routine or aggregate ‘ObjectName’:
System.InvalidOperationException: Cannot load dynamically generated serialization assembly. In some hosting environments assembly load functionality is restricted, consider using pre-generated serializer. Please see inner exception for more information. —> System.IO.FileLoadException: LoadFrom(), LoadFile(), Load(byte[]) and LoadModule() have been disabled by the host.
System.IO.FileLoadException:
at System.Reflection.Assembly.nLoadImage(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence evidence, StackCrawlMark& stackMark, Boolean fIntrospection)
at System.Reflection.Assembly.Load(Byte[] rawAssembly, Byte[] rawSymbolStore, Evidence securityEvidence)
at Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames)
at Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters options, String[] sources)
at Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSourceBatch(CompilerParameters options, String[] sources)
at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromSource(CompilerParameters options, String[] s
System.InvalidOperationException:
at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, CompilerParameters parameters, Evidence evidence)
at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, CompilerParameters parameters, Assembly assembly, Hashtable assemblies)
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)
at System.Xml.Serialization.XmlSerializer.GenerateTempAssembly(XmlMapping xmlMapping, Type type, String defaultNamespace)
at System.Xml.Serialization.XmlSerializer..ctor(Type type, String defaultNamespace)
at System.Xml.Serialization.XmlSe…For example, you may receive the error message when you use a CLR object that calls a Web service or performs conversion from user-defined types to XML inside SQL Server.
Resolution
This issue occurs when a CLR object is converted to the XML data type. When this conversion occurs, the Windows Communication Foundation (formerly code-named “Indigo”) tries to do the following: Generate a new XML serialization assembly.Save the assembly to disk.Load the assembly into the current application domain. However, SQL Server does not allow for this kind of disk access in the SQL CLR for security reasons. Therefore, you receive the error message that is mentioned in the “Symptoms” section. Several scenarios may cause the CLR object to be converted to the XML data type.
For more information about the Windows Communication Foundation, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/library/ms735119.aspx(http://msdn2.microsoft.com/en-us/library/ms735119.aspx)You may receive the error message that is mentioned in the “Symptoms” section in the following scenarios: The CLR code that implements CLR objects explicitly uses the XmlSerializer class. These CLR objects may include stored procedures, functions, user-defined types, aggregates, and triggers.You use a Web service in the CLR code.You send or receive CLR objects to or from SQL Server by using direct HTTP/SOAP access to SQL Server. The CLR object converts a user-defined type to the XML data type.

Error message when you try to set a witness in a database mirroring session in SQL Server 2005: “The ALTER DATABASE command could not be sent to the remote server instance ‘TCP://<ServerName&g …

Symptoms
Consider the following scenario:You have a database mirroring session in Microsoft SQL Server 2005. The database mirroring session does not have a witness. You set up a witness server. On the principal server and on the witness server, you do not use DNS together with DHCP for name resolution. Instead, you specify that a host file should be used for name resolution. On the principal server instance, you try to set the witness.In this scenario, you receive the following error message:

Msg 1456, Level 16, State 3, Line 1
The ALTER DATABASE command could not be sent to the remote server instance ‘TCP://ServerName:port’. The database mirroring configuration was not changed. Verify that the server is connected, and try again.
Resolution
A database mirroring session must use a fully qualified domain name (FQDN) to resolve the name of the witness server.

Error message when you try to reinstall SQL Server 2005 after you uninstall a clustered instance of SQL Server 2008: “This application has failed to start because the application configuration is …

Symptoms
You upgrade a clustered instance of Microsoft SQL Server 2005 to Microsoft SQL Server 2008. Then, you uninstall the clustered instance of SQL Server 2008 and all the remaining components of SQL Server 2005. When you try to reinstall SQL Server 2005, you receive the following error message:

This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.
Resolution
This problem occurs because the runtime components of Microsoft Visual C++ 2005 Service Pack 1 (SP1) are uninstalled when you uninstall SQL Server 2008. When you uninstall SQL Server 2008, the cluster resource files (.dll files) are not uninstalled and are shared by the later SQL Server 2005 installation. However, the runtime components of Visual C++ 2005 SP1 are required for you to use these .dll files.
When you install a clustered instance of SQL Server 2005, these .dll files are used to cluster the instance. However, SQL Server 2005 includes only the release version of the Visual C++ 2005 runtime. Therefore, an error occurs when the Setup program tries to load these .dll files.

Error message when you try to restore a database by using SQL Server Management Studio in SQL Server 2005 after you use the Backup tool: “Restore failed for Server ‘<ServerName>’ (Microsoft …

Symptoms
Consider the following scenario. The SQL Writer service is running on a computer that has Microsoft SQL Server 2005 installed. You use SQL Server Management Studio to back up a database. Additionally, you use the Backup tool (NTBackup.exe) to back up the database files. Then, you try to restore the database from the backup set by using SQL Server Management Studio. In this scenario, you receive an error message that resembles the following:

Restore failed for Server ‘<ServerName>’.(Microsoft.SqlServer.Smo)
ADDITIONAL INFORMATION:
System.Data.SqlClient.SqlError: Cannot open backup device ‘<GUID of the device>’. Operating system error 2(The system cannot find the file specified.). (Microsoft.SqlServer.Smo)If you examine the start date and the finish date of the backup set, you find that the dates are updated to the date that you used the Backup tool.
Resolution
This problem occurs because the Backup tool uses the SQL Writer service to back up SQL Server 2005 databases. The Backup tool triggers the SQL Writer service to create a snapshot. After the SQL Writer service creates the snapshot, the Backup tool determines whether the database files are on the exclude list. The database files include .ldf files and .mdf files. If the database files are on the exclude list, the Backup tool deletes the database files from the snapshot. However, the Backup tool adds entries in the backupset table in the msdb database.