Using SQL Server Management Studio
To view the definition using query a procedure in Object Explorer, connect to an  instance of Database Engine and then expand that Instance. Expand Databases, expand the database in which the procedure belongs, and then expand Programmability. Expand Stored Procedures, right-click the procedure and then click Script Stored Procedure as, and then click one of the following: Create To, Alter To, or Drop and Create To. Select New Query Editor Window. This will display the procedure definition .
Using Transact-SQL
To view the definition of a procedure in Query Editor System Stored Procedure: sp_helptext In Object Explorer, connect to an instance of the Database Engine. On the toolbar, click New Query. In the query window, enter the following statement that uses the sp_helptext system stored procedure. Change the database name and stored procedure name to reference the database and stored procedure that you want.
EXEC sp_helptext ‘NAME_OF_PROCEDURE’;
We’re honored to mention that our efforts have been recognized by renowned B2B review and research platforms such as GoodFirms,
Clutch, MirrorView, and many more