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.
| Author |
Topic |
|
CTG
Starting Member
1 Post |
Posted - 2008-11-24 : 18:28:23
|
| Hi I have a c# application using sql 2005.there are 2 methods associate with that table-Select-UpdateI d like to lock the records that are selected for others to update.I d like to be able to unlock the records when updates are done.I also like to know how I can figure out that using select can tell me if that particular record is clocked or not.CheersYohoo |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-11-25 : 04:21:12
|
| moved from article discusion forum.___________________________________________________________________________Causing trouble since 1980Blog: http://weblogs.sqlteam.com/mladenpSpeed up SSMS development: www.ssmstoolspack.com <- version 1.1 out! |
 |
|
|
darkdusky
Aged Yak Warrior
591 Posts |
|
|
LoztInSpace
Aged Yak Warrior
940 Posts |
Posted - 2008-11-25 : 07:56:13
|
| Yeah - what darkdusky said. DB locks are how the database implements concurrency and consistency. Usually just the fact you are in a transaction doing updates will lock the relevant things. What you are describing sounds like it is a requirement of your application and must be analysed and coded as per your requirements. Some applications take the view that mostly things don't change and just make sure the record they are updating is the same as that that they read, which is pretty easy (use a row timestamp). If you want a long-term lock-update-release across transactions then you'll need to design something (including tidy-up of abandoned updates etc). |
 |
|
|
|
|
|