all groups > sql server (alternate) > august 2006 >
You're in the

sql server (alternate)

group:

Using SQL to append records to a table from a flat file using DTS


Using SQL to append records to a table from a flat file using DTS blackd77 NO[at]SPAM hotmail.com
8/4/2006 1:02:53 PM
sql server (alternate):
What I would LIKE to do is noted in the subject line. What I'm finding
is that "edit SQL" appears to only be an option if I am creating a
table. If I select "append to" the option to edit SQL shades itself as
unavailable.

The reason I'd like this is that there is a datum in the flat file that
indicates whether that record should be appended to that table noted
above. There are other ways of dealing with this "problem" but it would
be nice to be able to control it using SQL, in the DTS import/export
wizard.

If the source of my data is an SQL table, I can generate an SQL query
to specify what fields to import in an append, to check for existing
values, etc...

Is there a way around this? I can reserve a table for data transfers,
regularly overwrite it with new data from text file inputs, and use SQL
to insert select fields from that transfer table to other database
tables. (From this "transfer" table, data needs to be inserted into
four separate tables in our database).

I hope this is clear. If it CAN'T be done this way, it's okay...just a
little ugly with the need to re-create the transfer table.
Re: Using SQL to append records to a table from a flat file using DTS blackd77 NO[at]SPAM hotmail.com
8/4/2006 1:04:52 PM
This system is running MS SQL server 2000.


[quoted text, click to view]
Re: Using SQL to append records to a table from a flat file using DTS John Bell
8/6/2006 12:00:00 AM
Hi

I suggest that you use the wizard to create the DTS package initially and
then add workflow that will optionally truncate the destination table
depending on the values initially read from the file and then re-read the
file to insert the data. To read the same row multiple times see
http://www.sqldts.com/default.aspx?266 and to skip a task see
http://www.sqldts.com/default.aspx?214

John



[quoted text, click to view]

Re: Using SQL to append records to a table from a flat file using DTS blackd77 NO[at]SPAM hotmail.com
8/7/2006 1:48:44 PM
Thanks! I haven't a chance to try this yet, but I will soon.


[quoted text, click to view]
AddThis Social Bookmark Button