Hello
I am trying to use the IDENTITY function like....
insert into USR_COMPANY_HISTORY
select
DCT.CUSTOMER_ID as 'master_customer_id',
'0' as 'sub_customer_id',
identity(int,2464262,1) as sequence_no,
DCT.USR_DATASOURCE,
DCT.USR_USERID,
0 as concurrency_id,
null as prospect_id
from DCT_CUS_COMPANY_HISTORY DCT
But I receive an error?
"The IDENTITY function can only be used when the SELECT statement has an INTO clause."
Is there a way to use the IDENTITY function (or something equivalent) with a INSERT statement? I don't want to use "SELECT INTO" and recreate the table.
Thanks in advance
Dave
I am trying to use the IDENTITY function like....
insert into USR_COMPANY_HISTORY
select
DCT.CUSTOMER_ID as 'master_customer_id',
'0' as 'sub_customer_id',
identity(int,2464262,1) as sequence_no,
DCT.USR_DATASOURCE,
DCT.USR_USERID,
0 as concurrency_id,
null as prospect_id
from DCT_CUS_COMPANY_HISTORY DCT
But I receive an error?
"The IDENTITY function can only be used when the SELECT statement has an INTO clause."
Is there a way to use the IDENTITY function (or something equivalent) with a INSERT statement? I don't want to use "SELECT INTO" and recreate the table.
Thanks in advance
Dave