您能否請幫助。SQL IDENTITY INSERT問題
我運行下面的查詢:
set identity_insert sites_dynamic ON
insert into sites_dynamic
select *
from gpbatt_archive.dbo.sites_dynamic
where site_serial_number = 49955
set identity_insert sites_dynamic OFF
set identity_insert sites_static ON
insert into sites_static
select *
from gpbatt_archive.dbo.sites_static
where static_site_id in (select static_site_id
from gpbatt_archive.dbo.sites_dynamic
where site_serial_number = 49955)
set identity_insert sites_static OFF
返回錯誤是:
消息8101,級別16,狀態1,行3
在表中標識列的顯式值'sites_dynamic'只能在使用列列表且IDENTITY_INSERT爲ON時指定。
任何人都可以幫助我嗎?我是新手
可能的重複[只有在使用列列表且IDENTITY \ _INSERT爲ON SQL Server時,才能指定表中標識列的顯式值(https://stackoverflow.com/questions/2005437/an-顯式值爲標識列在表中只能指定-a) –