Remove all Triggers - B M SOLUTION
  • Remove all Triggers


     -- drop all user defined triggers

    Declare @trgName varchar(500) 

    Declare cur Cursor For Select [name] From sys.objects where type = 'tr' 

    Open cur 

    Fetch Next From cur Into @trgName 

    While @@fetch_status = 0 

    Begin 

     Exec('drop trigger ' + @trgName) 

     Fetch Next From cur Into @trgName 

    End

    Close cur 

    Deallocate cur 

  • You might also like

    No comments :

    Post a Comment