--临时表
select top 20000 identity(int,0,1) as id into # from syscolumns a,syscolumns b , syscolumns cselect * from #drop table #
select top 20000 identity(int,0,1) as id into # from syscolumns a,syscolumns b , syscolumns cselect * from #drop table #
drop table [tb]
go
create table [tb]([id] int,[col] int)declare @i int
set @i=1
while @i<20000
begin
insert tb values(floor(11*rand()+10),@i)
set @i=@i+1
end
创建一个 uniqueidentifier 类型的唯一值。
/*
id
-----------
13
20
17
18
16
12
11
19
10
15
14(所影响的行数为 11 行)
-----------
15
14
18
12
20
13
10
16
17
11
19(11 行受影响)