IDENTITY属性のある列を保有するテーブルに対して以下のSQLを実行しましたが、
エラーが発生して実行できません。
Delete testDB.TestTable;
SET IDENTITY_INSERT testDB.TestTable ON;
INSERT INTO testDB.TestTable select * from testDB.TestTable2;
SET IDENTITY_INSERT testDB.TestTable OFF;
【エラー内容】
列リストが使用されていて、IDENTITY_INSERT が ON のときに限り、
テーブル 'testDB.TestTable' の ID 列に明示的な値を指定できます。
下記のようなSQLは実行できます。
SET IDENTITY_INSERT testDB.TestTable ON;
insert into testDB.TestTable (ID) values (999);
解決方法はありますでしょうか?
環境はSQLServer2005 SP3 Enterpriseです。