Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trigger retreiving and manipulation

Status
Not open for further replies.

schwankieog

Programmer
Jul 25, 2001
43
US
I have a database with multiple tables that have multiple triggers associated with each table. i am accessing the database in c# through a dataset, but can obviously run sql queries to get neccassarry information. i have the table names, what i need is a way to get all of the trigger names associated with that table through sql if possible. (for the sake of the problem pretend i DO NOT have access to the database except through code). is there a way to get the information i need? thanks in advance for any help
 
You should be able to ADO(connection|command|recordset objects) to retrieve info about the table in question.

Just call the proc sp_helptrigger 'table_name'.

It will return a list of the triggers defined on the table, the owner, and whether the trigger isupdate|isdelete|isinsert|isafter|isinsteadof
 
thanks, it works in sql server, but sadly thats not the answer i need. to expand the problem a bit. the code i have to write needs to be able to connect to any type of database. is the standard sql to do what i need ?(no proc)
 
Since that would have to query the master tables of any type of database, you would have to write that code yourself as each database stores their meta data in it's own idiosyncratic fashion.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top