---
title: "What is the best way to check whether a trigger exists in SQL Server?"  
description: "What is the best way to check whether a trigger exists in SQL Server?"  
author: "John Smith"  
published: 2012-10-16  
updated: 2012-10-16  
canonical: https://www.mindstick.com/forum/457/what-is-the-best-way-to-check-whether-a-trigger-exists-in-sql-server  
category: "mssql server"  
tags: ["mssql server"]  
reading_time: 2 minutes  

---

# What is the best way to check whether a trigger exists in SQL Server?

I [am looking](https://answers.mindstick.com/qa/115463/i-am-looking-for-to-joining-the-mindstick-internship-program-how-to-apply) for the most [portable](https://www.mindstick.com/interview/148/what-is-portable-executable-pe) method to check for existance of a [trigger](https://www.mindstick.com/blog/167/triggers-in-wpf) in MS [SQL Server](https://www.mindstick.com/articles/12999/what-is-table-valued-function-in-sql-server). It needs to work on at least SQL Server 2000, 2005 and preferably 2008.\
\
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) beginend
```

\
But I am not sure whether it works on all SQL Server versions.\
\
**So my [questions](https://www.mindstick.com/blog/124895/hp-hpe0-s54-cheat-sheet-exam-questions-bank-for-guaranteed-success) are:**\
\
Is the above the "best" way?\
Are there any [alternative](https://www.mindstick.com/forum/2324/what-is-the-alternative-to-the-mvc) [methods](https://www.mindstick.com/articles/13060/runny-nose-remedy-methods-that-work-best)?\
What are their [pros and cons](https://www.mindstick.com/blog/11048/pros-and-cons-of-hadoop-system)?\
\

## Replies

### Reply by Anonymous User

There's also the preferred "sys.triggers" catalog view:\
\
select * 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:\
\

```
SELECT    (list of columns)FROM sys.triggers trINNER JOIN sys.tables t ON tr.parent_id = t.object_idWHERE t.schema_id = SCHEMA_ID('dbo')   -- or whatever you need
```


---

Original Source: https://www.mindstick.com/forum/457/what-is-the-best-way-to-check-whether-a-trigger-exists-in-sql-server

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
