Solved

How Do I Update Records with SSIS and NOT INSERT new rows!?

Posted on 2009-04-06
3
1,628 Views
Last Modified: 2013-11-10
Here is my dilema:

I need to pull information from one database (we'll say database A) and update records in another database (database B) based on common information in both databases.

I already have an SSIS package that can essentially get the correct information I need (using the Lookup Dataflow), but the problem I am having is that it seems that all I can do is "insert" new rows into database B.  If I export the data to a flatfile, all is well, but that's not what I want.  My goal is to use SSIS to update records in database B to have information from database A, but if it doesn't exists in database B, then we cannot add it.

Any ideas?  From what I can see and read, all of the dataflow destinations do INSERTS only, but I want simply to update records.  (The only reason I haven't done this with T-SQL scripting is because I felt that SSIS would be a better tool given that there are some data conversions that must take place since the comparing columns in database A and database B are of different types, but essentially the same data.)
0
Comment
Question by:VFCC
  • 2
3 Comments
 
LVL 29

Expert Comment

by:QPR
ID: 24084603
Why not use an execute sql task rather than a data flow
0
 
LVL 29

Expert Comment

by:QPR
ID: 24084616
oops just re-read... what you are trying to do sounds like a data pump task to use a DTS term. Copy column etc. To my knowledge this is importing data into table B from table A (in other words an insert)

A sql task within your package can work fine. Google "update based on a join"
0
 
LVL 2

Accepted Solution

by:
VFCC earned 0 total points
ID: 24100555
Well, the purpose was to make this so it only updates information and never adds any new or unique information.  I know that it doesn't fall under a lot of typical ETL situations, but doing any inserting of newer data in this case would cause more damage than good.  That being said, there is also the fact that the tables are in completely different databases for different 3rd party applications.

What I found is that I could use the OLD DB Command Data Flow Transformation Object and use it to run a parameratized update query.  While this probably isn't the best way, our institution is rather small and the approximately 5 second processing time of the package is acceptable.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question