EEE SQL Server Errors in Microsoft .NET Framework

From EnablerWiki

Jump to: navigation, search

Created: 03 March 2009. Last Reviewed: 9 March 2009


The EEE database in SQL Server utilises a .NET assembly (DLL) to provide extended functionality which is accessible from within SQL Server. For example, to provide access to the local file system on the SQL Server from inside TSQL stored procedures.

If the registration of this assembly with SQL Server is incorrect or inadvertantly damaged then some features of EEE may stop working. For example, inter-store transfer requests will fail, because SQL Server uses the assembly to send the stock request notification to the target store. If this happens, store users will see a message to the effect that the stock transfer request was not successful.

SQL Server will return error messages similar to:

Msg 10314, Level 16, State 11, Line 1An error occurred in the Microsoft .NET Framework while trying to load assembly id 65544. The server may be running out of resources, or the assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE. Run the query again, or check documentation to see how to solve the assembly trust issues. For more information about this error: System.IO.FileLoadException: Could not load file or assembly 'magenta_sql, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Exception from HRESULT: 0x80FC0E21System.IO.FileLoadException:    at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)   at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)   at System.Reflection.Assembly.Load(String assemblyString)

The error messages may be logged in the Windows application event log or returned to the user, depending on where the error occurs.

To test if this problem is present, open SQL Server Management Studio and open a new query against the EEE database. Run this query:

select dbo.ufn_CLRFileExists ('c:\myfile.txt')

This query should return 0 or 1 depending if the file exists. If the assembly registration with SQL Server is incorrect an error message, possibly similar to the above, will be returned.


To Resolve This Issue:

  1. Determine the location of Magenta_SQL.DLL. Usually this is installed in c:\EEE\SQLDLL.
  2. Run the SQL Server Command:
EXEC usp_ClrUpdate 'EEE', 'C:\EEE\SQLDLL\Magenta_SQL.DLL'

Substitute the correct database name and file path as required.

Note that these settings are required for each EEE database, so if a server hosts a test database or separate databases for different brands/chains, these steps should be repeated for each database. If these steps fail to resolve the problem, contact Magenta Support. Please try to have full details of error messages available.

See Also:

Personal tools