question

jhunu avatar image
jhunu asked

how to finf ddl triggers through query

how to finf ddl triggers through query
sql-server-2012
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

salum avatar image
salum answered
You can use sys.server_triggers to get list of triggers on server scope. http://www.java-forums.org/database/
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

KenJ avatar image KenJ commented ·
The link doesn't seem to pertain to DDL triggers. Is there a DDL trigger answer on that site I missed?
0 Likes 0 ·
Pavel Pawlowski avatar image
Pavel Pawlowski answered
The system view `sys.triggers` contains information about all triggers in a database. DDL triggers have a `parent_class = 0` as are database scoped so to retrieve all database level DDL trigers, you can issue SELECT * FROM sys.triggers where parent_class = 0 The system view `sys.server_triggers` contains all Server scped DDL triggers. SELECT * FROM sys.server_triggers
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.