Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How to find tables with triggers??

Author  Topic 

nishita_s
Yak Posting Veteran

61 Posts

Posted - 2008-12-31 : 01:26:19
How to find tables with triggers??

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2008-12-31 : 01:32:42
to get the details of triggers present in database
select * from sys.objects where type = 'tr'

to get the tables used in this trigger
exec sp_depends 'triggername'
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-12-31 : 01:33:39
select object_name(parent_id) as table_name,name as trigger_name from sys.triggers

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Jai Krishna
Constraint Violating Yak Guru

333 Posts

Posted - 2008-12-31 : 01:40:13
select object_name(parent_object_id) as tablename from sys.objects where type = 'tr'


Jai Krishna
Go to Top of Page

nishita_s
Yak Posting Veteran

61 Posts

Posted - 2008-12-31 : 02:35:21
Madhivanan ur suggested query helped me to give desired o/p.
Thanks to all for replying.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-12-31 : 03:16:01
quote:
Originally posted by nishita_s

Madhivanan ur suggested query helped me to give desired o/p.
Thanks to all for replying.


You are welcome

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Jai Krishna
Constraint Violating Yak Guru

333 Posts

Posted - 2008-12-31 : 03:17:45
Welcome

Jai Krishna
Go to Top of Page
   

- Advertisement -