Added Step 5c in SQL stored procedure