lesleycampbell
Technical User
I'm on SQL 2008. I'm trying to insert rows into a table from a temp table. Instead of adding new rows it is overwriting the existing rows.
Below is what I'm using. The COMMISSION_REV_DET_LC table does have an identity column as the primary key. I have no idea what I'm doing wrong.
INSERT INTO COMMISSION_REV_DET_LC
(BPKEY, PERBEGIN, PEREND, WGSREV, COST, MARGIN, BALANCE)
SELECT BPKEY, PERBEG, PEREND, REV, COST, MARGIN, BALANCE
FROM #RESULTS
thank you!
Below is what I'm using. The COMMISSION_REV_DET_LC table does have an identity column as the primary key. I have no idea what I'm doing wrong.
INSERT INTO COMMISSION_REV_DET_LC
(BPKEY, PERBEGIN, PEREND, WGSREV, COST, MARGIN, BALANCE)
SELECT BPKEY, PERBEG, PEREND, REV, COST, MARGIN, BALANCE
FROM #RESULTS
thank you!