Is it possible to output the text (contents) in a stored procedure using a query? I want to have a query that I can run and just input the name of the stored proc instead of navigating to it.
There are literally hundreds of stored procs I have to navigate to, right click and select Modify and I would like an easier way to see the contents of the stored proc.
I am using SQL Server 2005.
Maybe something similar to:
SELECT *
FROM sys.procedures
WHERE name = 'stored_procedure_name'
There are many ways to do that, You can try one of the following:
Which gives you the one row per line of the stored procedure, Or
Which gives you a single row with all of the stored procedure definition.