dbTalk Databases Forums  

importing flat file into two tables based on attribute in row

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


Discuss importing flat file into two tables based on attribute in row in the microsoft.public.sqlserver.dts forum.



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

Default importing flat file into two tables based on attribute in row - 03-02-2006 , 08:24 PM






How would anyone go about importing rows into two tables from one flat file. One row contains an attribute for an insert - "I"; one row contains an attribute for an update - "U". I would like the updates to go to one table and the inserts to go to another. How can I accomplish this with a text source and a transform. If it can't be done this simply would you place an instead of trigger on the one table and dump all the records into it. When it finds one with an I or U have it inserted into the other table ?



Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: importing flat file into two tables based on attribute in row - 03-03-2006 , 03:54 PM






Hello joelhelms,

This is so much easier in SSIS

http://www.sqlis.com/default.aspx?54

but you are i presume you are using 2K. You can use Lookups to achieve what
you want. You can also use the Data Drivern Query Task.

Allan Mitchell
www.SQLDTS.com
www.SQLIS.com
www.Konesans.com

Quote:
How would anyone go about importing rows into two tables from one flat
file. One row contains an attribute for an insert - "I"; one row
contains an attribute for an update - "U". I would like the updates
to go to one table and the inserts to go to another. How can I
accomplish this with a text source and a transform. If it can't be
done this simply would you place an instead of trigger on the one
table and dump all the records into it. When it finds one with an I or
U have it inserted into the other table ?




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.