February 12, 2002 at 5:08 am
Hi...
Is it possible get the trigger's name associated to table through ADO/OLE-Db without know internal structure of Database.
Something as "ADO.OpenSchema" or similar. Thanks.
Marco
February 12, 2002 at 5:49 am
I don't know of a way to get this from an ADO object but you can query a SQL database this way as far as 7 and 2000 go.
This will return all triggers and their associated table:
select OBJECT_NAME(parent_obj) tblTriggerOn, [name] from sysobjects where xtype = 'TR' and [name] not like '#%'
This will help you find it for a specific table:
select [name] from sysobjects where xtype = 'TR' AND parent_obj = OBJECT_ID('Inv_Equipment') and [name] not like '#%'
But I have not checked to see what permissions you will need, nor can I guarantee this will work in any other version of SQL Server.
February 12, 2002 at 5:52 am
I dont see a way to do it using native functionality in either ADO or ADOX. Querying the system table makes sense to me.
Andy
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply