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.

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.

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.

Now you can see the command executed successfully.

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

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.

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.
- How to Find Stored Procedure in SQL Server
- How to Use If Else in SQL Server Stored Procedure
- Find Stored Procedure by Name in SQL Server
- How to Execute the Stored Procedure for Updating the SQL Server?

Rajkishore Sahoo is a Microsoft Azure consultant with more than 14 years of hands-on experience building cloud-native data solutions across Azure and AWS, focused on Azure SQL Database, Azure SQL Managed Instance, and the pipelines that connect them to production apps. Day to day, he provisions Azure SQL instances, configures firewalls and connection strings, tunes queries for cloud workloads, and wires databases into Azure Functions and Logic Apps. Read more