Skip to content

prabhatsharma/CLRTrigger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Steps to follow:

  1. enable CLR for triggers
EXEC sp_configure 'clr enabled', 1;
GO
    reconfigure
GO
  1. Change strict security to 0 Modify installation to account for "CLR strict security" in SQL Server 2017 tSQLt-org/tSQLt#25
EXEC sp_configure 'show advanced options', 1;
RECONFIGURE;
EXEC sp_configure 'clr strict security', 0;
RECONFIGURE;
  1. build assembly using visual studio

after you have built the assembly using visual studio (This will give you a dll file), create assembly in SQL server using following command

alter database epglobal  set trustworthy on;
GO
CREATE ASSEMBLY CLRTrigger
FROM 'path of the dll file'
WITH PERMISSION_SET = ALL
GO 

now create the trigger

CREATE TRIGGER test
ON dbo.customer
FOR INSERT, UPDATE, DELETE
AS
EXTERNAL NAME CLRTrigger.Triggers.SqlTrigger1;

About

SQL Server CLR Trigger

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages