Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Sql Server Programming

disabled triggers on a table.


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

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...

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...

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc