February 28, 2014 at 11:44 am
I have Input Table and Output table. I need to add or update records in my Output table.
Here is my input table. Output table is the same. Item and Code are the primary key.
Item Code Price
01753r28.8
01709us8
01709ud4.8
01709bu4.4
01709r4.8
01709b4.8
01709p4.8
01753cd123.24
01753k6123.24
01753k5132.72
01753k4143.78
07530k3164.32
01753c104.28
01753k2160.21
01753k1164.32
01753t1166.37
01753t2184.86
01753t3205.4
February 28, 2014 at 12:00 pm
Hi and welcome to the forums. It is difficult to know what you are trying to do. I suspect you might want to look at MERGE.
If that doesn't do it and you need some more help we will need a few things:
1. Sample DDL in the form of CREATE TABLE statements
2. Sample data in the form of INSERT INTO statements
3. Expected results based on the sample data
Please take a few minutes and read the first article in my signature for best practices when posting questions.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply