Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INSERT INTO OVERWRITING ROWS

Status
Not open for further replies.

lesleycampbell

Technical User
Jun 21, 2013
59
US
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!
 
Can you run this query a post the result here?

Code:
sp_helptrigger 'COMMISSION_REV_DET_LC'

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top