快速生成扩展表默认数据的脚本
分类:巴黎人-数据库

declare @total int;
declare @count int;
set @count=0;
SELECT @total=COUNT(1) FROM TB_JJ;

create table #T
(
  rid int PRIMARY KEY,
  sys_guid NVARCHAR(40)
);

INSERT INTO #T SELECT ROW_NUMBER() over (order by sys_guid) as rid,sys_guid FROM TB_JJ;

WHILE @count<@total
BEGIN
    set @count=@count+10000;
    INSERT INTO TB_JJ_Info(sys_guid) SELECT sys_guid FROM #T where rid<=@count;    
    DELETE FROM #T where rid<=@count;
END
DROP TABLE #T;

本文由巴黎人手机版发布于巴黎人-数据库,转载请注明出处:快速生成扩展表默认数据的脚本

上一篇:没有了 下一篇:做如下修改,先简单介绍一下这个新手卡录入后
猜你喜欢
热门排行
精彩图文