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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 .NET Inside SQL Server (2005)
 How to solve concurrency issues?
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

2 Posts

Posted - 12/03/2012 :  01:03:08  Show Profile  Reply with Quote
Hi All,

I have a log table which stores a single record and there are multiple application which accesss this table and write read/data to this. The log table basically generates sequential numbers to be used by different application.

As 2 or more application may concurrently access this table how do avoid the same sequential number is not sent to 2 or more client application? Could we row lock record? or what would be the most efficient approach?


Elizabeth B. Darcy
Starting Member

United Kingdom
39 Posts

Posted - 12/03/2012 :  07:15:00  Show Profile  Reply with Quote
One option you might consider is using the OUTPUT clause available in SQL 2005 and later. Of course, without knowing the details ofhow the sequential numbers are generated or stored, this is only a guess on my part.

Here is a simple example - you can capture the value that is output and send it to the client.


SET id = id+1


-- "If a book is well written, I always find it too short"
Go to Top of Page

Starting Member

2 Posts

Posted - 12/03/2012 :  23:49:28  Show Profile  Reply with Quote
Thank you Elizabeth.. The Sequential number is increnmented by 1 each time an application calls the webservice.. So the row will hold the previous generated number, and when an call is made value is incremented by 1 and sent to the calling application.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2019 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000