How To Save Stored Procedure In SQL Server

As a database developer, it is essential to know how to save and mange the stored procedure. In this article, I will guide you through the steps to save stored procedure in SQL server.

How To Save Stored Procedure In SQL Server

To save stored procedure in SQL Server, follow the below steps.

1. Log in to SQL Server Management Studio (SSMS) and connect to your SQL server instance.

2. Expand the Databases folder under Object Explorer and select your target database.

how to save changes to stored procedure in sql server

3. Expand the Programability folder then Right-click on the Stored procedure folder and select New, and then choose the stored procedure option, as shown in the screenshot below.

How To Save Stored Procedure In SQL Server

4. Modify the stored procedure based on your requirement and then press the F5 key or Execute button to execute and save the stored procedure.

save stored procedure sql server

Now you can see the command executed successfully.

how to save modified stored procedure in sql server

5. Now, Right click on the database node and select the Refresh option as shown below.

how to modify, and save a stored procedure in sql server 2012

6. Now again expand the Programmability folder and then expand the Stored Procedures folder and you will see the stored procedure is saved there as shown in the screenshot below.

how to modify and save a stored procedure in sql server 2019

Video Tutorial

Conclusion

Saving the stored procedure in SQL server means just to execute or run the stored procedure and once done, the stored procedure will automatically save in the Stored Procedures folder as explained in this article.

You may also like following the articles below.

Top 200 SQL Server Interview Questions and Answers

Free PDF On Top 200 SQL Server Interview Questions And Answers

Download A 40 pages PDF And Learn Now.