Article ID: 941105 - Last Review: March 23, 2012 - Revision: 6.0 FIX: Error messages after SQL Server 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 of dll might fail within the SQL Server process"
On This PageSYMPTOMSWhen you run Microsoft SQL Server 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:
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 1 sp_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 0x8007045a(A dynamic link library (DLL) initialization routine failed.). Error: 6512, Severity: 16, State: 27. Failed to initialize the Common Language Runtime (CLR) v2.0.50727 with HRESULT 0x80004005. You need to restart SQL Server to use CLR integration features. CAUSEThis 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. RESOLUTIONNote This resolution is only for Windows Server 2003. If you are using Windows 2000, follow the steps in the "Workaround" section." Hotfix information for Windows Server 2003A 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. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next software update that contains this hotfix.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, contact 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 to create a separate service request, visit the following Microsoft website: 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.PrerequisitesYou must have Windows Server 2003 Service Pack 2 installed on the server.For more information, click the following article number to view the article in the Microsoft Knowledge Base: 889100
(http://support.microsoft.com/kb/889100/
)
How to obtain the latest service pack for Windows Server 2003
Restart informationYou must restart the computer after you apply this hotfix.Hotfix replacement informationThis hotfix does not replace any other hotfixes.File informationThe English version of this hotfix has the file attributes (or later file attributes) 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 item in Control Panel.Windows Server 2003 with Service Pack 2, x86-based versions Collapse this table
Windows Server 2003 with Service Pack 2, x64-based versions Collapse this table
Windows Server 2003 with Service Pack 2, IA64-based versions Collapse this table
WORKAROUNDYou can use one of the following methods to work around this problem. We recommend that you use method 1 because the extended stored procedure feature may be removed in future releases of SQL Server. Method 1
Method 2
STATUSThis is not a problem in SQL Server. This is a problem in Windows Server 2003 and in Windows 2000. This problem does not occur in Windows Vista or in Windows Server 2008. REFERENCESFor more information about the TlsAlloc function, visit the following Microsoft Developer Network (MSDN) website: http://msdn2.microsoft.com/en-US/library/ms686801.aspx
(http://msdn2.microsoft.com/en-US/library/ms686801.aspx)
For more information about the TlsFree function, visit the following MSDN website: http://msdn2.microsoft.com/en-us/library/ms686804.aspx
(http://msdn2.microsoft.com/en-us/library/ms686804.aspx)
For more information about the sp_OACreate stored procedure, visit the following MSDN website: http://msdn2.microsoft.com/en-us/library/ms189763.aspx
(http://msdn2.microsoft.com/en-us/library/ms189763.aspx)
| Other Resources Other Support Sites
CommunityArticle Translations
|






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email
Back to the top