Sunday, February 19, 2012

Insert or Update using DTS SERVER 2005

I am new to using DTS so forgive the newbie post.
I have CSV file that has records that lookup a value from a table in a
database and then write the record to the table with the lookup value.
This works for insert.
What I need is a way to check and see if the record already exists and
if so update.
It looks like a EXECUTE SQL transaction will do this but then how do
intercede the write to the actual table? I would like to use DTS.Hi
If you are using SQL 2005 you should be writing new packages in SSIS
(Integration Services). DTS was with SQL 2000. One way of doing this which
can be implemented in DTS and SSIS is to load the file into a staging table
and then update the existing data using the values in the staging table
(using a SQL Command Task) and then inserting rows from the staging table
into the live table that don't currently exist in the live table (using a SQL
Command Task).
This may give you some idea! http://www.sqlis.com/311.aspx
John
"axwack" wrote:
> I am new to using DTS so forgive the newbie post.
> I have CSV file that has records that lookup a value from a table in a
> database and then write the record to the table with the lookup value.
> This works for insert.
> What I need is a way to check and see if the record already exists and
> if so update.
> It looks like a EXECUTE SQL transaction will do this but then how do
> intercede the write to the actual table? I would like to use DTS.
>

No comments:

Post a Comment