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:
- Go to your Database.
- Then expand your database folder. You will see the Programmability.
- The expand the programmability folder. You will see the Assemblies.
4.Right click on the assemblies. select New assembly.
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]