Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Updating multiple rows using single stored proc

By Subodh-Rx, 2004/11/04

The situation arises when we are displaying data in a grid or some other control at front end level, where the user is making corresponding changes in the grid and at last when the user click for update button, the whole changes should be posted back to the database. This can be achieved by two ways
• For each and every updation into the table we have to call a stored procedure.
• To call a stored procedure which can handle every updation to a table
Well if we are going for the first method, for each update we have to call the stored procedure. For example if we have 100 rows to update 100 times we have to call the stored procedure. In the second case, only once we will be calling the stored procedure, which will update all the rows.
Please follow the inline documentation provided inbetween the sql statements

Total article views: 360 | Views in the last 30 days: 1
 
Related Articles
FORUM

Store Procedure to update

Store Procedure to update

FORUM

Insert Update Stored Procedure - HELP

Problem with insert update stored procedure

SCRIPT

Insert Update Stored Procedure for a table

Generic Script for Insert Update Stored Procedures

ARTICLE

Dynamic creation of Insert, Update, Delete Stored procedures

Automates the creation of INSERT, UPDATE & DELETE stored procedure of a table

FORUM

Mirroring Failover - Updating Stored Procedures

How to update sql instance names in stored procedures during a failover

Tags
t-sql    
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones