How to get Sql Server Trigger code using TSQL

Sometimes upstream (place to collect data) or your vendor may give you the permission on some Triggers. Or you may have restricted SQL management Studio installed in your PC to view the Trigger code visually. Or you may can not view those Triggers from Management studio. So at that moment how one can view the code. The solution is simple. Use builtin sp_helptext from Query Analyzer or from provider query interface.

sp_helptext syntax to view Trigger Code:

sp_helptext 'your Trigger name'

sp_helptext SQL Example to view Trigger Code:

sp_helptext 'myTrigger'

sp_helptext Trigger

Posted in Database, SQL Server

Leave a Reply

Your email address will not be published. Required fields are marked *