The information does not appear to be in INFORMATION_SCHEMA, but if it is in there somewhere, I would prefer to use it from there.
I do know of this method:
if exists (
select * from dbo.sysobjects
where name = 'MyTrigger'
and OBJECTPROPERTY(id, 'IsTrigger') = 1
)
begin
end
But I am not sure whether it works on all SQL Server versions.
So my questions are:
Is the above the "best" way?
Are there any alternative methods?
What are their pros and cons?
Anonymous User
16-Oct-2012select * from sys.triggers where name = 'MyTrigger'
or call the sp_Helptrigger stored proc:
exec sp_helptrigger 'MyTableName'
But other than that, I guess that's about it :-)
Marc
Update (for Jakub Januszkiewicz):
If you need to include the schema information, you could also do something like this: