...
> how can i find triggers which are only enabled on table t1. ?
> thx
> create table t1(id int,c1 int)
> go
> create trigger t1_ins on t1 for insert
> as
> select count(*) from inserted
> go
> create trigger t1_upd on t1 for update
> as
> select count(*) from inserted
> go
> alter table t1 disable trigger t1_upd
> go
Or, as an alternative iv you have SQL Server 2005:
SELECT name, is_disabled
FROM sys.triggers
--
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
Download the latest version of Books Online from
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
'
"Vt" <vinu.t.1
@googlemail.com> wrote in message
news:%235YttS7pHHA.196@TK2MSFTNGP05.phx.gbl...
> HI
> 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 OBJECTPROPERTY (id, 'ExecIsTriggerDisabled') = 1
> Regards
> Vt
> Knowledge is power;Share it
> http://oneplace4sql.blogspot.com
> "nkg" <x@yahoo.com> wrote in message
> news:OhAuDC7pHHA.3952@TK2MSFTNGP03.phx.gbl...
>> how can i find triggers which are only enabled on table t1. ?
>> thx
>> create table t1(id int,c1 int)
>> go
>> create trigger t1_ins on t1 for insert
>> as
>> select count(*) from inserted
>> go
>> create trigger t1_upd on t1 for update
>> as
>> select count(*) from inserted
>> go
>> alter table t1 disable trigger t1_upd
>> go