Solved

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

Posted on 2009-04-06
3
1,627 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

777 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