How to find the definition or structure of stored procedure without using sp_helptext?


 Following query can be used to find out the structure of a stored procedure without using sp_helptext:

select text from syscomments 
where id =(SELECT id from sysobjects where name =<Stored Procedure Name>
 






Text column in syscomments table will contain the definition for all the database objects in sql server.

Syscomments table will not hold the object name. It will contain just object id. So, object id for a particular object can be fetched from sysobjects table.

This entry was posted in . Bookmark the permalink.

Leave a reply