December 31, 2010 at 12:47 pm
I don't know if this can be done or not, but is there a program, or anything I can do to import a CSV, and whatever quantities are in my CSV file, add them to the existing quantities in the database?
We were doing inventory, and someone commited all the inventory already, and there is still more that needs to be done... I have a CSV file now with updated quantities that I would just like to add to the existing quantities...
Please let me know what I can do to make this process easier...
Thanks in advance!
December 31, 2010 at 1:58 pm
olie480 (12/31/2010)
I don't know if this can be done or not, but is there a program, or anything I can do to import a CSV, and whatever quantities are in my CSV file, add them to the existing quantities in the database?We were doing inventory, and someone commited all the inventory already, and there is still more that needs to be done... I have a CSV file now with updated quantities that I would just like to add to the existing quantities...
Please let me know what I can do to make this process easier...
Thanks in advance!
What I would suggest is:
1. Create a #temporary table with the proper format for the columns in the CSV file.
2. Bulk insert the csv file into the #temporary table.
3. Update the real table by joining to the #temporary table.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
December 31, 2010 at 3:27 pm
Thanks Wayne, that is a great solution... I'm still a newbie at SQL, so that never dawned on me... I will definitely try it out.. Thanks for your help!
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply