Integrate DLL in SQL server

Here is mechanism through which we can import the DLL into the SQL server database.

These steps are only for the Microsoft SQL Server Management Studio

First of all you need to import that assembly into your database inside SQL Server Management Studio by navigating to the New Assembly dialog window:

  1. Go to your Database.
  2. Then expand your database folder. You will see the Programmability.
  3. The expand the programmability folder. You will see the Assemblies
No alt text provided for this image

4.Right click on the assemblies. select New assembly.

No alt text provided for this image

5. Fill the details in the assembly configurations. You will be able to integrate the DLL in the SQL.

Through following code you can wrap assembly methods in the SQL functions.

CREATE FUNCTION [dbo].[fn_funcName](@str [varchar](max))
RETURNS 
   varchar(max) 
WITH EXECUTE AS CALLER
AS 
EXTERNAL NAME [YourSqlAssemblyName].[YourAssemblyName.Class1].[GetName]




要查看或添加评论,请登录

社区洞察

其他会员也浏览了