We normally usa a UDF (you can use Enterprise Manager if you want quick
n dirty)cto disable triggers - though to be honest we hardly use them as
there is rarely a need these days.
NOTE: You can also do it with straight SQL:
ALTER TABLE yourtable DISABLE TRIGGER yourknowntrigger
Here is the UDF
===========
IF (OBJECT_ID ('dbo.GetTriggerStatus') IS NOT NULL)
DROP FUNCTION dbo.GetTriggerStatus
GO
CREATE FUNCTION dbo.GetTriggerStatus (@tcTableName SYSNAME)
RETURNS TABLE AS
RETURN
(
SELECT
name,
status = CASE WHEN OBJECTPROPERTY (id, 'ExecIsTriggerDisabled') = 0
THEN 'Enabled' ELSE 'Disabled' END,
owner = OBJECT_NAME (parent_obj)
FROM
sysobjects
WHERE
type = 'TR' AND
parent_obj = CASE WHEN @tcTableName IS NULL THEN parent_obj
ELSE OBJECT_ID (@tcTableName) END
)
GO
and can be called thus;
SELECT * FROM dbo.GetTriggerStatus ('yourtable')
-- or table name can be Null.
HTH
N
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49
Message: http://www.houseoffusion.com/lists.cfm/link=i:6:2337
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/6
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:6
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.6
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54