I am new to SQL Server. I am logged into my database through SQL Server Management Studio.
I have a list of stored procedures. How do I view the stored procedure code?
This is another way of viewing definition of stored procedure
SELECT OBJECT_DEFINITION (OBJECT_ID(N'Your_SP'))
The option is called Modify
:
This will show you the T-SQL code for your stored procedure in a new query window, with an ALTER PROCEDURE ...
lead-in, so you can easily change or amend your procedure and update it
I guess this is a better way to view a stored procedure's code:
sp_helptext <name of your sp>