June 12, 2009 at 7:50 am
How To Enable or Disable ALL Triggers on a Single Database?
June 12, 2009 at 7:54 am
Example
DISABLE TRIGGER employee.uAddress ON Employee.Address;
GO
ENABLE Trigger employee.uAddress ON Employee.Address;
Syntax
ENABLE TRIGGER { [ schema_name . ] trigger_name [ ,...n ] | ALL }
ON { object_name | DATABASE | ALL SERVER } [ ; ]
June 12, 2009 at 7:54 am
http://www.mssqltips.com/tip.asp?tip=1380
has lots of tips for disabling. u can use similar steps for enabling.
June 12, 2009 at 11:35 pm
Like this...
[font="Courier New"]--===== Disable all triggers on user tables in database
DECLARE @SQL VARCHAR(MAX)
SELECT @SQL =''
SELECT @SQL = @SQL +
+ 'DISABLE TRIGGER ALL ON ' + Table_Schema + '.' +Table_Name +';'
FROM Information_Schema.Tables
WHERE Table_Type = 'BASE TABLE'
EXEC (@SQL)
--===== Enable all triggers on user tables in database
DECLARE @SQL VARCHAR(MAX)
SELECT @SQL =''
SELECT @SQL = @SQL +
+ 'ENABLE TRIGGER ALL ON ' + Table_Schema + '.' +Table_Name +';'
FROM Information_Schema.Tables
WHERE Table_Type = 'BASE TABLE'
EXEC (@SQL)[/font]
--Jeff Moden
Change is inevitable... Change for the better is not.
June 13, 2009 at 12:35 am
Thanks Jeff Moden,
Thank u very much for my help
June 13, 2009 at 1:11 am
Thanks Pradeep Singh,
Thank u very much:-)
June 13, 2009 at 1:30 am
Thanks Pradeep Singh,
Thank u very much:-)
June 13, 2009 at 11:25 am
vishal_mca2005 (6/13/2009)
Thanks Jeff Moden,Thank u very much for my help
Thank you for the feedback.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply