Viewing Stored Procedure code

I have sample DB, pubs.

I want to view stored procedures in the pubs db.

(The stored procedure names I want to see are "GetEmployeeCount" and "GetEmployeeCountByLastInitial"

How could I see it in the SQL Server 2012?

February 15th, 2015 6:38pm

Hi,

Like so in the image below

You can also script them out by right clicking on the proc > Script stored procedure option.

Hope This helps

Thanks

Bhanu


Free Windows Admin Tool Kit Click here and download it now
February 15th, 2015 7:09pm

Alternatively you can see the content of the stored procedures by using sp_helptext (assuming you have sufficient permission),

sp_helptext GetEmployeeCount
sp_helptext GetEmployeeCountByLastInitial

in addition, to list all the stored procedures from your database you can get it as below,

Select * From Sys.Procedures;

February 15th, 2015 7:53pm

hi ,

You can also design your own shortcut key for getting code from stored procedure.
after that you can simply select your procedure name then press short key.

you can follow below post;
http://techequation.com/create-you-own-shortcut-using-sql-server-managment-studio/

as per above you can select Name of procedure and press CTRL+F1

Thanks
Free Windows Admin Tool Kit Click here and download it now
February 16th, 2015 12:43am

you can see it in Object Explorer details tab

see

http://visakhm.blogspot.in/2013/02/object-filtering-using-ssms-object.html

February 16th, 2015 2:58am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics