What are you using for your repository? I don't understand why you have to pull it out of the db directly when you begin your change. If your release management is such that you have them in your repository you should just be able to pull the file out of your repository, fire up a connection in Management Studio and run the ALTER PROCEDURE.
That said, you can extract the code of an object using the INFORMATION_SCHEMA.ROUTINES
system view or the syscomments
view.
Using INFORMATION_SCHEMA.ROUTINES
it's something like this:
SELECT Routine_Definition
FROM INFORMATION_SCHEMA.ROUTINES
WHERE Routine_Type='Procedure'
Using syscomments
it's something like this:
SELECT OBJECT_NAME(id),text
FROM syscomments
WHERE OBJECTPROPERTY(id, 'IsProcedure') = 1