惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
Spread Privacy
Spread Privacy
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Apple Machine Learning Research
Apple Machine Learning Research
SecWiki News
SecWiki News
腾讯CDC
P
Privacy International News Feed
Webroot Blog
Webroot Blog
J
Java Code Geeks
爱范儿
爱范儿
A
About on SuperTechFans
S
Secure Thoughts
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
D
DataBreaches.Net
Cloudbric
Cloudbric
Security Archives - TechRepublic
Security Archives - TechRepublic
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Security Latest
Security Latest
Forbes - Security
Forbes - Security
小众软件
小众软件
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cybersecurity and Infrastructure Security Agency CISA
T
Threatpost
量子位
MongoDB | Blog
MongoDB | Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
W
WeLiveSecurity
P
Privacy & Cybersecurity Law Blog
Vercel News
Vercel News
Google Online Security Blog
Google Online Security Blog
云风的 BLOG
云风的 BLOG
GbyAI
GbyAI
S
Security @ Cisco Blogs
T
The Exploit Database - CXSecurity.com
Help Net Security
Help Net Security
V
Visual Studio Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - 聂微东
P
Proofpoint News Feed
C
CERT Recently Published Vulnerability Notes
Attack and Defense Labs
Attack and Defense Labs

博客园 - 笑萧亦然

KingdeeK3-修改单据邮件发送的自定义字段 微软在GitHub上开放源代码 【转】GitHub入门详细讲解 asp.net 导出excel 中文乱码解决方法 (转) C#自动切换Windows窗口程序,如何才能调出主窗口? 系统颜色对照表 showModalDialog后如何刷新父页面 delegate Demo (一个关于System.Timers.Timer的Demo) 常用SQL关于表的操作 System.Web.HttpException 与 HTTP Error 404.13 - Not Found问题解决说明 SQL 数据库常用的系统存储过程解析 JAVA md5把我气到疯的代码,天哪,神呀,我的C# 啊。 根据经纬度坐标计算两点间几何距离 - 椰子树下 - CSDN博客 获取库中的所有字段的描述/获取某个表中所有字段方法 多个CSS风格共用同一(背景)图片_那一片天_百度空间 学习总结之三(SQL SERVER游标CURSOR的使用) SQL中的系统变量一览 简单的弹出层窗口应用(DIV+JS) - 笑萧亦然 - 博客园 sql中左侧不够自动补0的写法,优!
SQL Server 如何锁一个表的某一行 - MS-SQL Server / 基础类
笑萧亦然 · 2011-03-21 · via 博客园 - 笑萧亦然

1 如何锁一个表的某一行
A 连接中执行
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ
begin tran
select * from tablename with (rowlock) where id=3
waitfor delay '00:00:05'
commit tran
B连接中如果执行
update tablename set colname='10' where id=3 --则要等待5秒
update tablename set colname='10' where id<>3 --可立即执行
2 锁定数据库的一个表
SELECT * FROM table WITH (HOLDLOCK) 
注意: 锁定数据库的一个表的区别
SELECT * FROM table WITH (HOLDLOCK) 
其他事务可以读取表,但不能更新删除
SELECT * FROM table WITH (TABLOCKX) 
其他事务不能读取表,更新和删除

posted @ 2011-03-21 17:43  笑萧亦然  阅读(592)  评论()    收藏  举报