Using SQL Server as resource locking mechanism
问题 Given a table of logical resource identifiers (one per row), what is the best way for an arbitrary number of database clients to perform the following operations: Claim access to a specific resource, if it is not already claimed SELECT the next available resource and claim it (similar to above) Release a previously-claimed resource (The table would have a "claimant" column, which would be NULL in unclaimed rows.) I'm stuck on the atomicity of these operations: would I need a whole-table lock