SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 SSIS and Import/Export (2012)
 updating field in DB with value in Excel
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

24 Posts

Posted - 06/18/2013 :  16:18:12  Show Profile  Reply with Quote

How would I do this in SSIS?
- I have an Excel file that has columns: A and B
- DB table has these columns too.
- The SSIS task is to update column B in the DB table with the value supplied by column B that matches column A in the spreadsheet.

123 abc

If 123 exists in the table then for that record, update column B with abc.


Flowing Fount of Yak Knowledge

South Africa
1466 Posts

Posted - 06/18/2013 :  16:22:28  Show Profile  Visit ditch's Homepage  Reply with Quote
Load the excel file in ssis into a "staging" table - just some other table with the same layout.
Next task in the SSIS package must be a sql task which will be a Merge statement or a update statement setting column B to the value of B from the staging table where there is a match on the values of column A of both tables.

Not too difficult really.

Go to Top of Page

Very Important crosS Applying yaK Herder

52325 Posts

Posted - 06/19/2013 :  01:11:25  Show Profile  Reply with Quote
if you dont want to use SSIS you could simply do it in T-SQL using OPENROWSET

SQL Server MVP
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000