Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL Server 2000 Triggers Expand / Collapse
Author
Message
Posted Monday, April 12, 2010 11:23 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Monday, April 12, 2010 11:09 PM
Points: 15, Visits: 44
hi,
I am wondering that SQL server 2000 has any facility to disable or enable triggers.

how can we look at disabled triggers in sql server2000?

How can we find which trigger is attached to which table?


when i ran following TSQL in appropriate data base,

SELECT * FROM SYSOBJECTS WHERE TYPE='TR'

i can see the trigger that i am after,but can't see which table it's attached to.

when I right click the table/all tasks/manage triggers and then clicked drop down box to see triggers,i could able to see before,but i can't see now for some known triggers.why?

any help is much appreciated.
thanks in advance

regards,

thaya
Post #902134
Posted Friday, April 16, 2010 11:07 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, April 19, 2012 10:25 PM
Points: 1,231, Visits: 3,483
--==To find out the all triggers in the DB==--
SELECT
OBJECT_NAME(parent_obj)TbName ,
[name] TrName,
(CASE WHEN (STATUS & 2048) = 2048 THEN 'Disabled' ELSE 'Enabled' END) Status
FROM sysobjects
WHERE xtype = 'TR'
order by 1, 2

--==To find out a selected trigger status in the DB==--
use DB
GO
IF (OBJECTPROPERTY (object_id(<TrName>),'ExecIsTriggerDisabled') = 1)
PRINT 'Trigger disabled'
ELSE
PRINT 'Trigger enabled'

Post #905342
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse