Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INFORMATION_SCHEMA

Status
Not open for further replies.

ptheriault

IS-IT--Management
Aug 28, 2006
2,699
US
Does anyone know which INFORMATION_SCHEMA view would have information on Triggers? I thought it would be ROUTINES but that only has functions and procedures.

- Paul
- If at first you don't succeed, find out if the loser gets anything.
 
2005 or 2000 in 2005 you can use sys.triggers

In order to list DDL triggers you need to use parent_id = 0
SELECT * FROM sys.triggers
WHERE parent_id = 0

In order to list DML triggers you need to use parent_id <> 0
SELECT * FROM sys.triggers
WHERE parent_id <> 0

in 2000
you can use sysobjects

select * from sysobjects
where xtype ='tr'

Denis The SQL Menace
SQL blog:
 
Thanks Denis. I knew about sysobjects but I really like using the INFORMATION_SCHEMA views in 2005. I was hoping there would be some information about triggers in one of them.

But I didn't know about sys.triggers.

Thanks

- Paul
- If at first you don't succeed, find out if the loser gets anything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top