Sometimes upstream (place to collect data) or your vendor may give you the permission on some Stored Procedure. Or you may have restricted SQL management Studio installed in your PC. Or you may can not view those in 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 Stored Procedure Code:
sp_helptext 'your sp name'
Lets say I have a stored procedure named TestProcedure then the TSQL will be: