草稿箱二十篇随笔没有发布,零零散散记录着曾经以为还不错的知识点。稍作整理发布,方便以后查看。2015-11-26 18:04 整理,未发布
1、模拟死锁
首先创建测试数据,然后开启必要的跟踪,最后执行两个语句模拟死锁。
1.1、创建测试数据
创建测试数据表、创建索引
create table testklup ( clskey int not null, nlskey int not null, cont1 int not null, cont2 char(3000) ) create unique clustered index inx_cls on testklup(clskey) create unique nonclustered index inx_nlcs on testklup(nlskey) include(cont1) insert into testklup select 1,1,100,'aaa' insert into testklup select 2,2,200,'bbb' insert into testklup select 3,3,300,'ccc'