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)
 How to write a SP to update a row with Concurrency

Author  Topic 

petre
Starting Member

11 Posts

Posted - 2010-02-23 : 23:11:23
Hi friend,

I have a table that has the followng columns:

tblDesignations
DesigID - int (auto)
DesigCode - nvarchar(3) NOT NULL (UNIQUE)
DesigName - nvarchar(30) not null
EnteredDate datetime not null
UpdatedDate - datetime not null
RowVersion - TimeStamp

How do write a SP to update a row that also checks for concurrency violations?

PS:
Typically before updateing a search operation will take place (most of the time) i would prefer if you write me a sample search/update procedure with concurrency handling!

thanks

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2010-02-24 : 00:35:38
what kind of concurrenty are you trying to check?

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

petre
Starting Member

11 Posts

Posted - 2010-02-24 : 21:07:05
quote:
Originally posted by dinakar

what kind of concurrenty are you trying to check?

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/



hi friend,

okay, that a good question. my Application is multiuser i think choice is to have optimistic concurrency and also i want to know how to do it to handle pesimistic concurrency as well :)

Furthermore, in the industry what conccurrecy handling is used most?
thanks
Go to Top of Page

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2010-02-25 : 17:16:25
Check this article - http://msdn.microsoft.com/en-us/library/aa0416cz(VS.71).aspx

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page
   

- Advertisement -