vielkacarolina1239
asked on
How can I view the code on a trigger?
Lest asume that I have used the following syntax to find the name of a trigger in Computers DB and I need to modify it.
Select * From [Computers].dbo.sysobjects Where xtype = 'TR'
Also, asume that I don't know were the code file resides for the trigger.
How can I get to view the code on this trigger? Is there a sql syntax for this?
I am using SQL Server Express.
Select * From [Computers].dbo.sysobjects
Also, asume that I don't know were the code file resides for the trigger.
How can I get to view the code on this trigger? Is there a sql syntax for this?
I am using SQL Server Express.
sp_help 'triggername'
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I ran the syntax: sp_help 'myTrgger'
The Result pane returns the Name of the trigger, Woner, Type, Create_Date.
However, I need to see the code on this trigger. When I run the above syntax, is there a pane I need to open to view and alter the code on this trigger?
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I told you wrong . bungHoc got it right with sp_helptext
ASKER
Thanks guys, you are great. Both solutions work. buhgHoc solution is a little cleaner than marting. But, both work.