34,588
社区成员
发帖
与我相关
我的任务
分享
-- 代码我还真留了一份,数据我就不贴了,你自己跑跑看
create table test(id int, md5 varchar(32))
create table temp(id int primary key not null)
go
declare @c int =0 ;
insert into temp
select top 100000
row_number() over(order by (select 1)) id
from sys.columns a, sys.columns b,sys.columns c
while @c < 1000
begin
begin transaction
insert into test
select
@c * 100000 + id,
convert(varchar(32),hashbytes('MD5',ltrim(id)),2) from temp
set @c = @c + 1
commit
end
go
select count(*) rscount from test
go
drop table test, temp
go