Monday, August 12, 2013

SQL Server - How to create an assembly in SQL Server that references a .DLL file

CREATE ASSEMBLY uploads an assembly from  .dll file to use inside an instance of SQL Server. Below is the code mentioning how to create an assembly in SQL Server instance that references a .DLL file:
IF  EXISTS (SELECT * FROM sys.assemblies ASM WHERE ASM.name = N'EmailSubscriptionAssembly'
AND ASM.is_user_defined = 1)

DROP ASSEMBLY [SendEMailNotificationAssembly]
GO

CREATE ASSEMBLY EmailSubscriptionAssembly FROM 'G:\MyApplication_DLL\EmailSubscription.dll'
WITH PERMISSION_SET = External_Access;
 

No comments:

Post a Comment