當 IDENTITY_INSERT 設置為 OFF 時,不能向表"A" 中的標識列插入顯示值。
一般來說是自增ID造成的。
因此可以在數據庫insert語句前加上 SET identity_insert tiexie_config on
查詢語句之后加上 SET identity_insert tiexie_config off
即可。
例如:
SET identity_insert tiexie_config ON INSERT INTO [GMIS2000S].[dbo].[tiexie_config] ( [Id], [Info_Car_Id], [Tiexie_Num], [Tiexie_RFID], [Modify_User_Id], [Create_User_Id], [Create_Date], [Modify_Date], [Sts] ) VALUES ( '90', '153', 'HG-004', '17194004', NULL, '368', '2017-08-25 16:30:02.557', NULL, 'Y' ); SET identity_insert tiexie_config off
