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?
I am Bijay having more than 15 years of experience in the Software Industry. During this time, I have worked on MariaDB and used it in a lot of projects. Most of our readers are from the United States, Canada, United Kingdom, Australia, New Zealand, etc.
Want to learn MariaDB? Check out all the articles and tutorials that I wrote on MariaDB. Also, I am a Microsoft MVP.