复制表时自动生成标识列
row_number() over(order by rec_no)+@rec_no1
declare @rec_no1 int
select @rec_no1=ISNULL(MAX(rec_no)+1,1) from [dbo].[tb_Base_EngineeringParts_AuxDetail1Ex]
print @rec_no1;
INSERT INTO [dbo].[tb_Base_EngineeringParts_AuxDetail1Ex]
(rec_no
,[base_rec_no]
,tb_Base_ArtificialCost_rec_no
,tb_Base_Material_rec_no
,materials_name
,specifications
,unit
,dosage_remark
,unit_dosage
,price
,amount
,memo)
select row_number() over(order by rec_no)+@rec_no1
,208
,tb_Base_ArtificialCost_rec_no
,tb_Base_Material_rec_no
,materials_name
,specifications
,unit
,dosage_remark
,unit_dosage
,price
,amount
,memo from [dbo].[tb_Base_EngineeringParts_AuxDetail1] where [dbo].[tb_Base_EngineeringParts_AuxDetail1].rec_no=14 or [dbo].[tb_Base_EngineeringParts_AuxDetail1].rec_no=19