title: Export the "functionality" of many stored procedures to script
body: <p>I have a large number of stored procedures (200+) that all collect clinical data and insert the result into a common table. Each stored procedure accepts the same single parameter, <code>ClientID</code>, and then compiles a list of diagnostic results and inserts them into a master table. </p>
  
  <p>I have each clinical test separated into individual stored procedures however as I described in a <a href="https://stackoverflow.com/questions/23062561/sql-server-stored-procedures-slow-vs-giant-script">previous SO question</a>, the execution of the batch of these stored procedures pegs the CPU at 100% and continues on for hours before eventually failing. This leads me to want to create a single script that contains all the functionality of the stored procedures. Why you ask? Well, because it works. I would prefer to keep the logic in the stored procedure but until I can figure out why the stored procedures are so slow, and failing, I need to proceed with the "script" method.</p>
  
  <p>So, what I am looking to do is to take all the stored procedures and find a way to "script" their functionality out to a single SQL script. I can use the "Tasks => Generate Scripts" wizard but the result contains all the <code>Create Procedure</code> and <code>Begin</code> and <code>End</code> functionality that I don't need.</p>