How display code or Text of Stored Procedure using Sql query in Sql Server ?
Satyaprakash Samantaray
sp_helptext 'Name Of Stored_Procedure'e.g. sp_helptext SP_EmailDeatails
sp_helptext StoredProcedure Name Ex:sp_helptext GetClientdetails
sp_helptext sroredprocedurename ex: sp_helptext sp_GetDetails
sp_helptext Ex:sp_helptext GetEmployeeDetails
sp_helptext
sp_helptext "your stored procedure name"eg:sp_helptext usp_getstudentdetails
sp_helptext NameofProcedure
So_helptext
By using system stored procedureSp_helptext
sp_help text process_name
by the use ofhelp_text proc_name
The following query can also be used: SELECT r.ROUTINE_DEFINITION from information_schema.routines r where r.ROUTINE_NAME='uspGetEmployeeManagers' and r.ROUTINE_TYPE='PROCEDURE' Here 'uspGetEmployeeManagers' is the name of the procedure
EXEC [ServerName].[DatabaseName].dbo.sp_HelpText 'storedProcName'