Reputation: 1
This is what I have now. This gets me a list of the stored procedures, but I need an additional column with their respective definition.
SELECT
name
FROM sys.objects
WHERE type = 'P'
order by name
I've also tried adding another line below the SELECT (definition as OBJECT_DEFINITION).
Upvotes: 0
Views: 203
Reputation: 2171
Here is how to get the definition and stored procedure name in Sql Server
SELECT o.name, m.definition
FROM sys.objects o
INNER JOIN sys.sql_modules m
ON o.object_id = m.object_id
WHERE o.type = 'P';
Upvotes: 2