How to Generate Stored Procedures Automatically Using Visual Studio

You don’t have to spend your time writing stored procedures. You simply generate them. By the way writing stored procedures have always be a pain for developers and DBAs.

So as a genius, I found an easy way you can do it!

Step by Step Video explanation

Prerequisite
You must have an existing table in MS SQL Server

 

Step 1: Create a Project in Visual Studio

Step 2: Right-click on the project in Solution explorer and choose Add > New Item

Step 3: Choose Data in the left sided under C# and then Choose DataSet from the right

 

 

 

Step 4: Give the DataSet a name and Click on Add (The DataSet Designer windows opens up as shown)

Step 5: Right-click and the design surface and choose Add > TableAdapter

 

Step 6: Create a New Connection or Select an existing one an click Next



Step 7: Click Next again to display Choose Command Type window

Step 8: Choose Create New Stored Procedure and Click on Next

 

 

Step 9: Click on Query Builder, Select the table and the close Query Builder ( you can also write the select statement yourself)

Step 10: Click on Next

Step 11: Give the stored procedure names and Click Finish.

You’re done!.

By now, your stored procedures are beautifully created in SQL Server. You can now open SQL Server Management Studio to verify that your stored procedures have been created.

 

So by now you have learnt how to generate stored procedure in SQL Server using Visual studio.
Watch the video explanation and subscribe to the free lessons.