锁定SQL Server 2008中的特定ID [英] Locking particular ID in sql server 2008

查看:127
本文介绍了锁定SQL Server 2008中的特定ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我的问题是,在我的应用程序中,有100个用户可以访问表中的记录,但是我的要求是,如果假设有任何一个拥有特定记录的用户,那么任何用户(即,其余99个用户都无法访问)直到该记录为止.的锁已释放.

所以请帮忙

OP的其他信息已从下面的评论中移出
先生,我想在Sql Server或C#中锁定特定的整数值

我有RadioButtonList,因此,如果某个人检查了特定的单选按钮列表,并且同时又有另一个用户尝试检查此单选按钮,则他将收到消息(该单选按钮被其他用户持有).

使用表提示来锁定特定的行,页面或表.请参考以下链接:
http://msdn.microsoft.com/en-us/library/ms187373.aspx [ ^ ]


Hey everyone,
My question is that, In my app there are 100 of user to access the record from table but my requirement is that if suppose, any one hold particular record none of user(ie remaining 99 user can''t) access this record until it''s lock is release.

so pls help me

OP''s additional information moved from comment below
Sir, I wanted to lock particular integer value either in Sql server or C#

I have RadioButtonList, so if some one checked particular radiobuttonlist and also at the same time another user trying to check this radiobutton then he will get the messages(this radio button hold by other user).

解决方案

Use table hints to lock the particular row, page or table. Please refer the following link:
http://msdn.microsoft.com/en-us/library/ms187373.aspx[^]


这篇关于锁定SQL Server 2008中的特定ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆