MSSQL 复制数据 并随机打乱写入

select * into temp from XX order by newid() -- 复制表结构

truncate table XX -- 清空表

SET IDENTITY_INSERT XX OFF

insert into XX(gameid) select gameid from temp order by newid() -- 随即写入

SET IDENTITY_INSERT XX ON

drop table temp -- 删掉临时表

  

posted @ 2017-06-06 11:36  懒人境界  阅读(296)  评论(0编辑  收藏  举报