February 27, 2012 at 12:38 pm
Well I am stuck at this current scenerio :
My excel source has :
FirstName
LastName
Age
Address
Phonenumber
Zipcode
Destination Table:
ID---------------Primary
FirstName
LastName
Age
Address
Phonenumber
Zipcode
Two Things :
1. Insert new rows
2. how do I update the destination file if the excel source has changed on multiple columns ( for ex : age,Address,Phonenumber,Zipcode) and exist in the database .
The problem is my excel source doesn't have a Unique Identifier to look up between source and destination and update the records...
Please Help me I need it for my project...for work :((
February 27, 2012 at 1:41 pm
Take a look at using MERGE. From you description it sounds like what you need.
http://technet.microsoft.com/en-us/library/bb510625.aspx
_______________________________________________________________
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/
February 27, 2012 at 2:17 pm
duplicate post. Please direct all replies here. http://qa.sqlservercentral.com/Forums/Topic1257891-147-1.aspx
_______________________________________________________________
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 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply