You can see the text of a stored procrdure using the sp_helptext stored procedure.use Northwindexec sp_helptext '[dbo].[CustOrderHist]'
Results:Text--------------------------------------------------------------------------------------------CREATE PROCEDURE CustOrderHist @CustomerID nchar(5)ASSELECT ProductName, Total=SUM(Quantity)FROM Products P, [Order Details] OD, Orders O, Customers CWHERE C.CustomerID = @CustomerIDAND C.CustomerID = O.CustomerID AND O.OrderID = OD.OrderID AND OD.ProductID = P.ProductIDGROUP BY ProductName
CODO ERGO SUM