马上生成扩展表暗中认可数据的本子

2019-12-29 作者:数据库资讯   |   浏览(130)
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;

本文由yzc216亚洲城发布于数据库资讯,转载请注明出处:马上生成扩展表暗中认可数据的本子

关键词: yzc216亚洲城 www.yzc216.c

  • 上一篇:没有了
  • 下一篇:没有了