.NET Reference Assembly from SQL Server Stored Procedure or Function

Is it possible to reference a .NET assembly from a stored procedure or function of SQL Server or otherwise access the CLR code from SQL Server?

EDIT Although this solution will require a few things in common, I am pretty sure about the expectation of SQL 2005 +

+4
source share
3 answers

It depends on your version of SQL Server. SQL Server 2005 and above support CLR stored procedures. If you have an older version, you need to register the assembly as a COM class (using attributes for objects / methods / assemblies), and then register it with regasm. Then you can call it like any other COM object.

http://dn.codegear.com/article/32754

SQL 6.5 is a bit corrupted (sometimes a memory leak), so you may need to register it as a COM + component (in my experience). This may not stop the memory leak, but it may help prevent "Class not found" errors. I'm not quite sure why this happens in 6.5

http://msdn.microsoft.com/en-us/library/ms189763.aspx

+4
source

You really can.

Some info here .

+2
source

CLR Stored Procedures

Requires Sql Server 2005 or later.

+2
source

Source: https://habr.com/ru/post/1277189/


All Articles