/*set identity_insert a on
insert b select * from a
set identity_insert a off
执行结果(还是出错):
服务器: 消息 8101,级别 16,状态 1,行 2
仅当使用了列的列表,并且 IDENTITY_INSERT 为 ON 时,才能在表 'b'中为标识列指定显式值。*/
/*set identity_insert a on
insert b select * from a
set identity_insert a off
执行结果(还是出错):
服务器: 消息 8101,级别 16,状态 1,行 2
仅当使用了列的列表,并且 IDENTITY_INSERT 为 ON 时,才能在表 'b'中为标识列指定显式值。*/
set identity_insert a on
insert b select * from a
set identity_insert a off
执行结果(还是出错):
服务器: 消息 8101,级别 16,状态 1,行 2
仅当使用了列的列表,并且 IDENTITY_INSERT 为 ON 时,才能在表 'b'中为标识列指定显式值。
set identity_insert a on //用这一句强制插入数据
insert b select * from a
set identity_insert a off
执行结果(出错):
服务器: 消息 8101,级别 16,状态 1,行 2
仅当使用了列的列表,并且 IDENTITY_INSERT 为 ON 时,才能在表 'Test2' 中为标识列指定显式值。
set identity_insert a on
insert b select * from a
set identity_insert a off
执行结果(出错):
服务器: 消息 8101,级别 16,状态 1,行 2
仅当使用了列的列表,并且 IDENTITY_INSERT 为 ON 时,才能在表 'Test2' 中为标识列指定显式值。