Stored Procedure SQL Server 2014 Tutorial

13
0

hello, Every Body Today I have shared Stored Procedure (SP) usage with step by step. First of All, you have good knowledge about SQL Server after that, you will understand as well.

Basically, SP which is used in SQL Server, SQL Server is the product of Microsoft. Stored Procedure is mostly used with Insert, Update and Delete Data in Your Tables.

If you make a table and insert update and delete record a records you have used insert update and delete query simply again and again but SP different.

Stored Procedure you make one time simply after that you don’t use long insert update and delete query. SP is very helpful to make a Web Application or Desktop Application with the help of ASP.NET.

Stored Procedure

How to Make a Stored Procedure

First of All, you make a table, for example, I have made a Table namely Employee and I have inserted five columns ID_Number, Name_in_Full, Designation and Salary in my table you are see below with query and screenshot. 

Make a Table in SQL Server 

I have made a table with you can see table query and display screen shot, after that I have inserted data into a table. I have shared with insert data in table with query and screen shot as below

Insert Data Table in SQL Server 

 

I have made the table and insert a record in the table, after that I have made a Procedure with Query and Screenshot as below.

Create Stored Procedure in SQL Server

I have made a SP namely CreateProc and I have used same column name with I have already used in a table below you can see complete query and screenshot. 


After that, I have made complete Stored Procedure after that I have inserted a data in Table via SP, complete query and screen shot as below.

Afer Run above query my data is inserted in my table with the help of SP, 

Alter Stored Procedure in SQL Server

After that I have changed with column data type I have used with Alter Query and change my column DataType, the complete query, and screen shot as below.


After that, I have made UpdateProcedure which is used with an update a record with your table with the help of SP, the query and screenshot as below.

Update Stored Procedure in SQL Server


After that, I have updated a Record with Table with the help of SP, the complete query, and screenshot as below.

Second Last I have made delete a record with a table with the help of SP the complete query and screenshot as below.

Delete Record with ID Stored Procedure in SQL Server


I have made delete SP I have run a query and delete record table with the help of SP, the complete query and screenshot as below.


Stored Procedure SQL Server 2014 Tutorial
Final if you want to delete SP in SQL Server you are run the query “Drop Procedure Name” after running this query your SP complete deleted.

Stored Procedure in SQL Server Tutorial

However, If hope it most beneficial and helpful knowledge if you like this tutorial to share with personal friends on social media networks and follow on my website Facebook, Google+ and Twitter pages for post updates. If you have any question/suggestion about this topic to comment me on below section I will reply with your answer about 24 hours.