I want to get trigger script source from vb6. the database is using sql s开发者_如何学Cerver2000. i have trigger in a table. i just want to get trigger script at run time from vb6. this is possible? if yes please can anybody help me. advance in thanks
You can get all triggers on a table (or view) with something like this
SELECT name FROM sysobjects
WHERE parent_obj = OBJECT_ID('MyTableName') AND xtype = 'TR'
Than you can get source T-SQL of any trigger (or any stored procedure) using this
EXEC sp_helptext 'MyTriggerName'
精彩评论