Apologies if this has been asked before, the suggested 'related' questions weren't relevant and my own search turned up very little.
I need to list the definitions (code) of all my stored procedures, so that I can start working through all 450 of them and adding in semi-colons to work toward v2014 standards.
I found the following code here and adapted it slightly:
SELECT
obj.Name AS SPName,
REPLACE(modu.definition, 'CREATE PROC', 'ALTER PROC') + 'GO' AS SPDefinition
FROM
sys.sql_modules modu INNER JOIN
sys.objects obj ON modu.object_id = obj.object_id
WHERE
(obj.type = 'P')
ORDER BY
obj.name;
The code above is run using the SA account.
I assumed that this provided exactly what I needed, but, I've just noticed that somebody on MSDN is claiming it doesn't show the full text as expected.
When pasting the results into the SSMS editor, I have 46,000 lines of code to work through, so its not apparent to me if anything is missing. I'd like to be sure I've started this process correctly before wasting a day in the editor.
Therefore, I am reaching out to you pro's to ask if this is a genuine shortcoming of this approach, or is there an alternative method rather than one-by-one?