modify a stored procedure

Hi all,

We need to modify a stored procedure. Once we've made the change that we want, how do we "save" that change? Execute? Or some other option?

(I feel execute is the right answer, but asking for a colleague, as I personally have NO business modifying procedures!)

Thanks smart friends!

Parents
  • Hi,
     
    Assuming you’ve got the Stored Procedure script in SQL Server Management Studio as a MODIFY or DROP/CREATE, all you have to do is Execute the script to replace the procedure. You probably want to save a copy of the unaltered script.
     
    If you’ve already modified the script, no worries. Just right-click on the script in the Object Browser and select:
                    Script Stored Procedure as à ALTER To à New Query Editor Window
     
     
    That will get you the script before it was modified. Save that script somewhere so you can roll back if your changes have an error.
     
    Now set focus to the Script that was modified and you should be able to Execute (F5 on the keyboard) to ALTER (or DROP/CREATE) the modified script.
     
    Hope this helps.
     
    Jerry Boutot | Manager, Information Technology - Data
    O: 813.222.1097 C: 352-428-4199
     
Reply
  • Hi,
     
    Assuming you’ve got the Stored Procedure script in SQL Server Management Studio as a MODIFY or DROP/CREATE, all you have to do is Execute the script to replace the procedure. You probably want to save a copy of the unaltered script.
     
    If you’ve already modified the script, no worries. Just right-click on the script in the Object Browser and select:
                    Script Stored Procedure as à ALTER To à New Query Editor Window
     
     
    That will get you the script before it was modified. Save that script somewhere so you can roll back if your changes have an error.
     
    Now set focus to the Script that was modified and you should be able to Execute (F5 on the keyboard) to ALTER (or DROP/CREATE) the modified script.
     
    Hope this helps.
     
    Jerry Boutot | Manager, Information Technology - Data
    O: 813.222.1097 C: 352-428-4199
     
Children
No Data