SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software SQL Server and T-SQL Development Tutorials
Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Windows, Windows Phone, SAP and ABAP, like SAP UI5, Screen Personas, etc.




download SQL Server 2016
download SQL Server 2014
download SQL Server 2012



List of SQL Server Triggers created on Database Tables

SQL Server database administrators and T-SQL developers can query sys.triggers system catalog view for database table triggers and table names. This SQL tutorial shares the source codes of a SQL query that list all triggers created on database tables with the table names that they are created on.

SQL Server database administrator or T-SQL programmer can query sys.triggers system catalog to see the full list of SQL triggers created on that SQL database.

select * from sys.triggers

sys.triggers catalog view to list all triggers created on that database
SQL Server sys.triggers catalog view to list all triggers created on that database

Let's modify the above SQL Select statement and add additional field for table name and remove unnecessary columns to simplfy the query.

select
 name 'Trigger Name',
 OBJECT_NAME(parent_id) 'Table Name'
from sys.triggers
where OBJECTPROPERTY(parent_id,'IsUserTable') = 1

all triggers and corresponding table names
All triggers and corresponding table names on a SQL Server database

You can add additional WHERE clause criteria list to filter for a specific database table name to return the list of triggers created on that specific sql table.

select
 name 'Trigger Name',
 OBJECT_NAME(parent_id) 'Table Name'
from sys.triggers
where OBJECTPROPERTY(parent_id,'IsUserTable') = 1
 and OBJECT_NAME(parent_id) = 'Person'






Related SQL Resources

SQL Server Articles

SQL Server 2012

SQL Server Tools

SQL Blog

SQL Server 2008 Blog

Certification Exams Blog

Reporting Services Blog

Analysis Services Blog

MS SQL Server Forums







Copyright © 2004 - 2017 Eralper YILMAZ. All rights reserved.
Community Server by Telligent Systems