Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

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

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

PGG_CA
Starting Member

24 Posts

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

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.

A B
123 abc

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

Thanks.

ditch
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.

Duane.
http://ditchiecubeblog.wordpress.com/
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52326 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
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next 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.08 seconds. Powered By: Snitz Forums 2000