SqlServer 打开或关闭自增列插入
1 SET IDENTITY_INSERT table1 ON
2 INSERT INTO table1 (a1,a2,a3,a4)
3 SELECT * FROM table
4 SET IDENTITY_INSERT table1 OFF
2 INSERT INTO table1 (a1,a2,a3,a4)
3 SELECT * FROM table
4 SET IDENTITY_INSERT table1 OFF
注:通过SELECT * FROM [table] 插入数据时 必须在INSERT INTO语句中指定插入的列