Using extended stored procedures or SP_OA stored procedures to load CLR in SQL Server is not supported
SQL Server 2005 and later versions host Common Language Runtime (CLR) and support procedures, functions, triggers, types, and aggregates that are written in CLR langauges. In these versions, you cannot load CLR by using extended stored proceduress or sp_OA stored procedures.
ThreadingTo increase performance, the CLR implements Thread Local Storage. For more information about issues that are related to the use of Thread Local Storage in extended stored procedures, click the following article numbers to view the articles in the Microsoft Knowledge Base:
- Run the sp_configure stored procedure by using the lightweight pooling option.
- In SQL Server 2000 or in SQL Server 7.0, you can configure this property in SQL Server Enterprise Manager. To do this, follow these steps:
- In Enterprise Manager, expand Microsoft SQL Servers, expand SQL Server Group, and then right-click the instance of SQL Server 2000 or of SQL Server 7.0.
- In the SQL Server Properties (Configure) dialog box, click the Processor tab.
- Click to select the Use Windows NT fibers check box.
- In SQL Server 2005, you can configure this property in SQL Server Management Studio. To do this, follow these steps:
- In Management Studio, connect to the instance of SQL Server 2005.
- In Object Explorer, right-click the SQL Server instance, and then click Properties.
- In the Server Properties dialog box, click Processors.
- Click to select the Use Windows fibers (lightweight pooling) check box.
MemoryThe use of extended stored procedures and OLE Automation both run in the virtual memory address space of the memory of SQL Server. The default SQL Server memory is only a fraction of the memory that SQL Server can potentially use and CLR competes with any existing implementations for these memory resources. For more information about SQL Server memory management, click the following article number to view the article in the Microsoft Knowledge Base:
COM interoperabilityThis section specifically addresses the use of OLE Automation in SQL Server and it applies to both in-process and out-of-process COM objects. Assembly meta data for function interfaces implements a strongly-typed mechanism for any invocations.
As part of this design, the COM Callable wrapper for an assembly must use an external mechanism of mapping a ClassID to a member of a managed class. Because of this explicit mapping, there is no ability from an unmanaged perspective to establish a root list of available interfaces.
The extended stored procedure sp_oaCreate uses the IUnknown::QueryInterface interface to determine the object's support for a particular interface. The interoperability between CLR and unmanaged code relies on the IDispatch interface for implementing interfaces. Because there is no equivalent to a QueryInterface method to a CLR-based assembly, you cannot create an instance of the object.
Article ID: 322884 - Last Review: 07/30/2007 16:20:52 - Revision: 8.2
- kbinfo KB322884