Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

I am trying to disable Triggers but this script not working?

$
0
0
CREATE PROC DisableTriggers

AS
DECLARE @Table_Triggers SYSNAME
DECLARE Cursor_Disabletriggers CURSOR FOR   
  SELECT  object_name(parent_id)  
  FROM   sys.triggers  
OPEN Cursor_Disabletriggers
FETCH NEXT FROM   Cursor_Disabletriggers   
 INTO @Table_Triggers  
 WHILE @@FETCH_STATUS = 0   
BEGIN  
ALTER TABLE @Table_Triggers DISABLE TRIGGER ALL 
 END  
CLOSE Cursor_Disabletriggers
DEALLOCATE Cursor_Disabletriggers

Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>