Viewing the source text of a procedure with sp_helptext

To display the source text of the create procedure statement, execute sp_helptext:

sp_helptext byroyalty 
# Lines of Text
---------------
              1
 
(1 row affected) 
 
text 
--------------------------------------------------- 
create procedure byroyalty @percentage int 
as 
select au_id from titleauthor 
where titleauthor.royaltyper = @percentage 
 
(1 row affected, return status = 0)

You can view the source text of a system procedure by executing sp_helptext when using the sybsystemprocs database.

If the source text of a stored procedure was encrypted using sp_hidetext, Adaptive Server displays a message advising you that the text is hidden. See the Reference Manual: Procedures.