Disable Enable Trigger SQL server for a table

后端 未结 7 1829
粉色の甜心
粉色の甜心 2020-12-12 14:24

I want to create one proc like below but it has error on syntax. Could anyone pointing out the problem?

Create PROCEDURE [dbo].[my_proc] AS

BEGIN

DISABLE T         


        
相关标签:
7条回答
  • 2020-12-12 15:21

    Below is the Dynamic Script to enable or disable the Triggers.

    select 'alter table '+ (select Schema_name(schema_id) from sys.objects o 
    where o.object_id = parent_id) + '.'+object_name(parent_id) + ' ENABLE TRIGGER '+
    Name as EnableScript,*
    from sys.triggers t 
    where is_disabled = 1
    
    0 讨论(0)
提交回复
热议问题