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

推荐订阅源

Last Week in AI
Last Week in AI
Project Zero
Project Zero
L
LINUX DO - 最新话题
C
Cisco Blogs
P
Privacy International News Feed
S
Schneier on Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
S
Security @ Cisco Blogs
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
H
Hacker News: Front Page
V
Vulnerabilities – Threatpost
W
WeLiveSecurity
Webroot Blog
Webroot Blog
K
Kaspersky official blog
Help Net Security
Help Net Security
博客园_首页
Security Archives - TechRepublic
Security Archives - TechRepublic
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
雷峰网
雷峰网
The Last Watchdog
The Last Watchdog
WordPress大学
WordPress大学
IT之家
IT之家
Hugging Face - Blog
Hugging Face - Blog
A
Arctic Wolf
I
Intezer
V
V2EX
博客园 - 【当耐特】
Latest news
Latest news
T
Tenable Blog
Google Online Security Blog
Google Online Security Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
Cyberwarzone
Cyberwarzone
量子位
G
GRAHAM CLULEY
T
Troy Hunt's Blog
博客园 - Franky
Simon Willison's Weblog
Simon Willison's Weblog
博客园 - 三生石上(FineUI控件)
TaoSecurity Blog
TaoSecurity Blog
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Visual Studio Blog
Jina AI
Jina AI
T
The Exploit Database - CXSecurity.com
NISL@THU
NISL@THU
Scott Helme
Scott Helme

博客园 - Jackie Yao

美国vps哪个比较好,vps国内访问速度最快! http://t.sohu.com/u/416461865 吃什么水果减肥? GPS导航仪准确度遭质疑-www.daohang2012.com GPS导航仪把车“导”进海-www.daohang2012.com 广州虚拟主机 www.48wo.com sql05 变量小技巧 boxy 你用了吗?? js 繁体转简体 The Digital Lifestyle Developer Blog[推荐] [转]escape,encodeURI,encodeURIComponent函数比较 正则表达式大全. YAHOO工具库提供的方法[转贴] {转}sql日期格式转换 [转]html控件、html服务器控件和web服务器控件的区别 [收藏]ASP.NET的底层的工作机制介绍 [转]asp.net2.0实现treeview无限级菜单树 [转]asp.net 2.0 TreeView客户端个性化控制 Build Google IG like Ajax Start Page in 7 days using ASP.NET Ajax and .NET 3.0 ASP.NET Application Life Cycle Overview for IIS 5.0 and 6.0
赞一个 mssql2005 的并发处理.
Jackie Yao · 2008-03-26 · via 博客园 - Jackie Yao

网上有位朋友这样测试:
declare @id int
set @id = ( select max(id) from table1 )
while @id < 20000
begin
set @id = @id + 1
insert into table1 ( id ) select @id
set @id = ( select max(id) from table1 ) 
end
具他的测试(sql2000): 有 21868条数据,其中1868条重复.
但我在sql2005,一条重复也没有.牛~~

加了事件 跟 锁跟不用说了.安全性更高:

begin tran
declare @id int

set @id = ( select max(id) from table1 )
while @id < 40000
 begin
 set @id = @id + 1
 insert into table1 with (tablock) ( id )  select @id
 set @id = ( select max(id) from table1 ) 
 end
commit tran

posted on 2008-03-26 11:45  Jackie Yao  阅读(398)  评论()    收藏  举报