Hello
I am trying to insert a record that contains an incrementing #. The # to start with comes from another table (APP_NEXT_NUMBER in the example below).
Current way that works but is ugly...
select
DCT.CUSTOMER_ID as 'master_customer_id',
identity(int,2464262,1) as sequence_no
into USR_COMPANY_HISTORY_TEMP
from DCT_CUS_COMPANY_HISTORY DCT
Incorrect syntax but shows what I am trying to do
select
DCT.CUSTOMER_ID as 'master_customer_id',
identity(int,(select max(SEQUENCE_NO) from usr_company_history),1) as sequence_no
into USR_COMPANY_HISTORY_TEMP
from DCT_CUS_COMPANY_HISTORY DCT
Can someone help with the syntax?
Thanks in advance
Dave
I am trying to insert a record that contains an incrementing #. The # to start with comes from another table (APP_NEXT_NUMBER in the example below).
Current way that works but is ugly...
select
DCT.CUSTOMER_ID as 'master_customer_id',
identity(int,2464262,1) as sequence_no
into USR_COMPANY_HISTORY_TEMP
from DCT_CUS_COMPANY_HISTORY DCT
Incorrect syntax but shows what I am trying to do
select
DCT.CUSTOMER_ID as 'master_customer_id',
identity(int,(select max(SEQUENCE_NO) from usr_company_history),1) as sequence_no
into USR_COMPANY_HISTORY_TEMP
from DCT_CUS_COMPANY_HISTORY DCT
Can someone help with the syntax?
Thanks in advance
Dave