: 高手请进....有关LOCK 和unlock的问题。。。。

jingqiu5 2005-05-09 12:17:30
@uid nvarchar(50),

@pid int,

@nums int

AS
select * from cart where pid=@pid and uid=@uid
if @@RowCount>0


update cart set nums=(nums+1) where pid=@pid and uid=@uid
如何在SQL语句中加上LOCK和UNLOCK
请高手指教。。。。。。。
...全文
195 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
xspf 2005-05-09
  • 打赏
  • 举报
回复
可以参考一下连机丛书的"表级索引提示"
xspf 2005-05-09
  • 打赏
  • 举报
回复
select * from cart with(holdlock) where pid=@pid and uid=@uid

select * from cart with(nolock) where pid=@pid and uid=@uid

lys1706228 2005-05-09
  • 打赏
  • 举报
回复
关注,学习

27,579

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 应用实例
社区管理员
  • 应用实例社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧