Powered by Blogger.

Saturday, February 15, 2014

stored procedure to update record in sql server 2008

In this post we will discuss about how to write a stored procedure that will update a record in the table. Also you can check out my previous posts on:

- Serialization and Deserialization in Remoting in C#.Net

- What is ContentPlaceHolder in Masterpage in asp.net?

- Special Operators in C#

Below are the steps for performing update operation in sql server. This procedure will take 4 input parameters.

Right click on stored procedure, then add new stored procedure

Create procedure sp_Update
@id integer,
@name varchar(20),
@add varchar(20),
@img varchar(20)
     Update Emp_master set  emp_name=@name,emp_address=@add,emp_image=@img where emp_id=@id

Here Table Name is Emp_master and Procedure name is sp_Update.

Then Save the stored procedure.