Web Analytics Made Easy - Statcounter

SQL Script to find triggers in SQL Database

Sometime we need to find all the triggers defined on the database. So in this case, we can use the below SQL Query:-SELECT
tbl.name as [Table Name]
, trig.name as [Trigger Name]
, trig.is_disabled
FROM [sys].[triggers] as trig
INNER JOIN sys.tables as tbl
ON trig.parent_id = tbl.object_idIn case, if we need to find out all the triggers defined on a particular table then we can use the below SQL script

SELECT
tbl.name as [Table Name]
, trig.name as [Trigger Name]
, trig.is_disabled
FROM [sys].[triggers] as trig
inner join sys.tables as tbl
on trig.parent_id = tbl.object_id
where tbl.name=’Tblname’

/*  where Tblname name is the name of the table*/

Related article


SQL Triggers – An Introduction

Keep learning and don’t forget to gives feedback on the article. You can also send feedback to me on my mailid  askvivekjohari@gmail.com

 


Discover more from Technology with Vivek Johari

Subscribe to get the latest posts sent to your email.

By vivekjohari

I am currently working as a Senior Database Professional and have around 18 years of experience in database. Degree:- Master Degree in Computer(MCA) Certification course in Data Science & Machine Learning from Indian Institute of Technology (IIT), Delhi Work experience:- Designing of the database. Database Optimization. Writing Complex Stored Procedures,Functions,Triggers etc. Designing and developing SSIS & DTS packages. Designing SQL Reports using SSRS. Database Server Maintenance. Certification:- MCTS: DA-100: Analysing Data with Microsoft Power BI MCTS: DP-300: Administering Relational Databases on Microsoft Azure Microsoft certified Sql DBA in Sql server 2008 (MCTS). Microsoft certified BI professional in Sql server 2008 (MCTS). Oracle certified profession DBA in ORACLE 10g (OCP) certified profession DBA in ORACLE 9i (OCP) My other publication Technical Blog:- Technologies with Vivek Johari Guest Author and Blogger at sqlservercentral.com

30 thought on “SQL Script to find all the triggers defined on a database or on a single table”
  1. … [Trackback]

    […] Find More Info here to that Topic: techmixing.com/2015/08/sql-script-to-find-all-triggers-defined.html […]

  2. … [Trackback]

    […] Read More Info here on that Topic: techmixing.com/2015/08/sql-script-to-find-all-triggers-defined.html […]

  3. … [Trackback]

    […] Information to that Topic: techmixing.com/2015/08/sql-script-to-find-all-triggers-defined.html […]

  4. … [Trackback]

    […] There you will find 97864 additional Info to that Topic: techmixing.com/2015/08/sql-script-to-find-all-triggers-defined.html […]

  5. … [Trackback]

    […] There you will find 46102 additional Info on that Topic: techmixing.com/2015/08/sql-script-to-find-all-triggers-defined.html […]

  6. … [Trackback]

    […] Read More Information here on that Topic: techmixing.com/2015/08/sql-script-to-find-all-triggers-defined.html […]

Leave a Reply

Discover more from Technology with Vivek Johari

Subscribe now to keep reading and get access to the full archive.

Continue reading