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 -- 删掉临时表