Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Check to see if a trigger exists

Author  Topic 

GavinD1977
Yak Posting Veteran

83 Posts

Posted - 2007-03-19 : 10:16:43
Hello all.

Can anyone advise me how to check to see if a particual triggers exists through a SQL script?

Thanks

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-03-19 : 10:20:31
SQL 2005 :
select * from sys.triggers where name = 'trigger_name'


SQL 2000 :
select * from sysobjects where xtype = 'TR' and name = 'trigger_name'




KH

Go to Top of Page

GavinD1977
Yak Posting Veteran

83 Posts

Posted - 2007-03-19 : 10:25:20
Great stuff. Thank you very much.
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2007-03-19 : 10:25:33
sp_helptrigger [ @tabname = ] 'table'
[ , [ @triggertype = ] 'type' ]



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam



Go to Top of Page
   

- Advertisement -