dbTalk Databases Forums  

Database Table Maintanance by Text File

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


Discuss Database Table Maintanance by Text File in the microsoft.public.sqlserver.dts forum.



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

Default Database Table Maintanance by Text File - 12-13-2004 , 07:31 AM






Hello,

I want to update a database table by a text file.

If the primary key in the text file also exists in the table, I want to update
all no primary key fields in the database with the corresponding fields of the text file.

If the primary key column in the text file ist empty, I want to have the line of the text file
being inserted into the table.

I tried several ways, but I dont know how to do this, I think this kind of task is confusing.

- Is this in general possible without using a temporary database table being filled first?

- What tasks are meaningful to do this? A normal data pump task; maybe with a lookup?
Or, do I need to use a data driven query, maybe with a lookup?

- Can somebody tell me a rough procedue to build this kind of task?


Thank You very much

Joachim

Reply With Quote
  #2  
Old   
Francesco Anti
 
Posts: n/a

Default Re: Database Table Maintanance by Text File - 12-13-2004 , 12:35 PM






Hi Joachim,
you can use a Data Driven Query Task. First you have to import the text file
into a SQL server table to use as the source rowset and then....you can find
a sample on BOL "Data Driven Query Example: File Maintenance".

Francesco Anti

"Joachim Hofmann" <speicher (AT) freenet (DOT) de> ha scritto nel messaggio
news:41BD99CE.45E7133 (AT) freenet (DOT) de...
Quote:
Hello,

I want to update a database table by a text file.

If the primary key in the text file also exists in the table, I want to
update
all no primary key fields in the database with the corresponding fields of
the text file.

If the primary key column in the text file ist empty, I want to have the
line of the text file
being inserted into the table.

I tried several ways, but I dont know how to do this, I think this kind of
task is confusing.

- Is this in general possible without using a temporary database table
being filled first?

- What tasks are meaningful to do this? A normal data pump task; maybe
with a lookup?
Or, do I need to use a data driven query, maybe with a lookup?

- Can somebody tell me a rough procedue to build this kind of task?


Thank You very much

Joachim



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.