Saturday, July 23, 2011

Link Triggers & Tables

Triggers and thier corresponding Tables

--sybase
select * from systrigger

-- SQL Server
select * from sys.triggers

-- Triggers and Tables
If you want to know the triggers for each table or trigger for a
corresponding table use the following:

-- Sybase
Select stab.table_name, strig.trigger_name from systable stab, systrigger strig
where stab.table_id = strig.table_id

-- SQL Server
Select stab.name, strig.name from sys.tables stab, sys.triggers strig
where stab.object_id = strig.parent_id

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Deep's | Bloggerized by Deep - Deep's Templates | ElearSQL-Server