| Author |
Message |
rwillemain
Joined: 04 Jan 2010 Posts: 5 Location: Louisville, KY USA
|
Posted: Tue Jan 05, 2010 12:46 am Post subject: Status of trigger : enabled / disabled |
|
|
In a comparison of what are identical dbs, I can see triggers as such, but in no apparent way can I determine if there are enabled or disabled.
Bummer ! Missed a big problem in this case ... Any ideas ?
Thanks, Rick |
|
| Back to top |
|
 |
Anu Deshpande
Joined: 20 Apr 2009 Posts: 590 Location: Cambridge
|
Posted: Wed Jan 06, 2010 11:58 am Post subject: |
|
|
Thanks for your post.
Unfortunately SQL Compare doesn't display a difference if the trigger is enabled on one database and not on another.
Displaying the difference in trigger status is currently on the wishlist for SQL Compare, and will hopefully be added to a future version. The feature tracking code for this is SC-3996.
As a workaround, you can query the status of all triggers on a database using the following:
SELECT T.[name] as TableName, TR.[Name] as TriggerName,
CASE WHEN 1=OBJECTPROPERTY(TR.[id], 'ExecIsTriggerDisabled')THEN 'Disabled' ELSE 'Enabled' END Status
FROM sysobjects T INNER JOIN sysobjects TR on t.[ID] = TR.parent_obj WHERE (T.xtype = 'U' or T.XType = 'V')
AND (TR.xtype = 'TR') ORDER BY T.[name], TR.[name]
I hope this is helpful. _________________ Anuradha Deshpande
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com |
|
| Back to top |
|
 |
FrankKalis
Joined: 25 Mar 2008 Posts: 5
|
Posted: Mon Jan 18, 2010 9:44 am Post subject: |
|
|
+1 on showing the difference in trigger status while comparisons. Could save a lot of time troubleshooting issues.
Is there a way to use the feature tracking code to see what the status is please? _________________ --
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org |
|
| Back to top |
|
 |
rwillemain
Joined: 04 Jan 2010 Posts: 5 Location: Louisville, KY USA
|
Posted: Sat Feb 11, 2012 9:24 pm Post subject: trigger state |
|
|
Thank you very much for the query to derive thsi information.
It is appreciated and vgery useful.
Sincerely, Rick |
|
| Back to top |
|
 |
|
|
All times are GMT + 1 Hour
|
| Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group