Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Multiple Row Updation

Author  Topic 

rajeev.dhawan
Starting Member

5 Posts

Posted - 2007-05-17 : 01:30:56
Hi!
I have a datagrid in asp.net bounded with single table of sql server. Suppose the user has changed 5 rows data in datagrid and if I press a single Update button then the data in sqlserver should be fetched by a single quert.
Now its taking 5 rounds (single round for single row). As i am running a loop and executing update query.

Plese Help

mahesh_bote
Constraint Violating Yak Guru

298 Posts

Posted - 2007-05-17 : 02:09:58
quote:
Originally posted by rajeev.dhawan

Hi!
I have a datagrid in asp.net bounded with single table of sql server. Suppose the user has changed 5 rows data in datagrid and if I press a single Update button then the data in sqlserver should be fetched by a single quert.
Now its taking 5 rounds (single round for single row). As i am running a loop and executing update query.

Plese Help




Why don't you use the updation from Dataset. Whatever Dataset u have opened for binding the grid, use this Dataset for updation. This dataset will update the modified records into concern table.

Thanks,

Mahesh
Go to Top of Page

rajeev.dhawan
Starting Member

5 Posts

Posted - 2007-05-17 : 02:17:27
I am focusing on performance issue.
Are u confident that 5 time updation in dataset would take equal or less time instead of a stored procedure which seperate queries from the given string and executes.
Go to Top of Page

mahesh_bote
Constraint Violating Yak Guru

298 Posts

Posted - 2007-05-17 : 04:54:20
quote:
Originally posted by rajeev.dhawan

I am focusing on performance issue.
Are u confident that 5 time updation in dataset would take equal or less time instead of a stored procedure which seperate queries from the given string and executes.



Obviously, its will increase the performance of ur application. Coz, u r calling SP 5 times in this case, and i m telling u to call it once. Here u will not need to run a loop for executing SP upto certain intervals. In my case, if u updates more than 5 records, dataset will update theese records in 1 attempt.

Hopes i have explained all,

Thanks,

Mahesh
Go to Top of Page
   

- Advertisement -