Sometimes upstream (place to collect data) or your vendor may give you the permission on some Stored Procedure or Trigger or View or even you may have not SQL management Studio 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.
Sample Output Screenshot:
sp_helptext 'your sp/view/trigger name'Example:
Lets say i have a stored procedure named TestProcedure then the TSQL will be:
sp_helptext 'TestProcedure'Hope it will helps.