dbTalk Databases Forums  

DTS Package and Delete

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss DTS Package and Delete in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
dm4714
 
Posts: n/a

Default DTS Package and Delete - 03-25-2005 , 08:29 AM






I have a DTS package the does an FTP --> Text File Data Source -->>>
Multiple Tasks -->>> SQL Server database.

The input source file has one row that has12 fields.

The multiple tasks basically read 3 columns from the source record and
insert a new row in the destination table until all 12 fields have been
read.

I.E., field1, field2, field3, field4, field5, field5, field6, field7,
field8, field9, field10, field11, field12.

The first task will read fields1-3 and output a row to destination.

The second task will read feidls 4-6 and output a row to destination.

The next task and subsequent will read 3 fields and output to destination.

My question is this: one of the fields has a datetime field. I'm outputting
the datetime field to the desttination. The problem is, if I rerun the DTS
tasks, I will have duplicate rows. I want the ability to delete any rows in
the destination that have a date equal to the date that is in the source
file.

Is there an easy way to accomplish this?

I suppose I could add a Lookup on each task and delete any rows that match
field1, field2, and field3 or whatever field is relevent to that tasks. But
I wanted a way to mass delete anything with the same date in one shot before
the tasks run.

Any ideas or comments would be appreciated.



Reply With Quote
  #2  
Old   
Axel Dahmen
 
Posts: n/a

Default Re: DTS Package and Delete - 03-26-2005 , 09:52 PM






Quote:
tasks, I will have duplicate rows. I want the ability to delete any rows
in
the destination that have a date equal to the date that is in the source
file.

Is there an easy way to accomplish this?
Yes, you might like to use the Data Driven Query task. You can just update
rows with existing DATETIME values and insert rows with non-existing
DATETIME values.

HTH,
Axel Dahmen
www.sportbootcharter.com


-------------------
"dm4714" <spam (AT) spam (DOT) net> schrieb im Newsbeitrag
news:OAaikdUMFHA.508 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
Quote:
I have a DTS package the does an FTP --> Text File Data Source --
Multiple Tasks -->>> SQL Server database.

The input source file has one row that has12 fields.

The multiple tasks basically read 3 columns from the source record and
insert a new row in the destination table until all 12 fields have been
read.

I.E., field1, field2, field3, field4, field5, field5, field6, field7,
field8, field9, field10, field11, field12.

The first task will read fields1-3 and output a row to destination.

The second task will read feidls 4-6 and output a row to destination.

The next task and subsequent will read 3 fields and output to destination.

My question is this: one of the fields has a datetime field. I'm
outputting
the datetime field to the desttination. The problem is, if I rerun the
DTS
tasks, I will have duplicate rows. I want the ability to delete any rows
in
the destination that have a date equal to the date that is in the source
file.

Is there an easy way to accomplish this?

I suppose I could add a Lookup on each task and delete any rows that match
field1, field2, and field3 or whatever field is relevent to that tasks.
But
I wanted a way to mass delete anything with the same date in one shot
before
the tasks run.

Any ideas or comments would be appreciated.





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.