title: How to parse stored procedure into separate executable statements?
body: <pre><code>ALTER PROCEDURE Masterinsertupdatedelete 
      (@id            INTEGER,
       @first_name    VARCHAR(10),
       @last_name     VARCHAR(10),
       @salary        DECIMAL(10, 2),
       @city          VARCHAR(20),
       @StatementType NVARCHAR(20) = '')
  AS
  BEGIN
      IF @StatementType = 'Insert'
      BEGIN
          INSERT INTO employee (id, first_name, last_name, salary, city)
          VALUES (@id, @first_name, @last_name, @salary, @city)
      END
  
      IF @StatementType = 'Select'
      BEGIN
          SELECT *
          FROM employee
      END
  
      IF @StatementType = 'Update'
      BEGIN
          UPDATE employee
          SET first_name = @first_name,
              last_name = @last_name,
              salary = @salary,
              city = @city
          WHERE id = @id
      END
      ELSE IF @StatementType = 'Delete'
      BEGIN
          DELETE FROM employee
          WHERE id = @id
      END
  END
  </code></pre>
  <p>I should be able to extract individual if/select/insert statements from the stored procedure</p>