dbTalk Databases Forums  

Using Lookup in data pump

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


Discuss Using Lookup in data pump in the microsoft.public.sqlserver.dts forum.



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

Default Using Lookup in data pump - 05-14-2004 , 08:40 AM






I am importing text files into SQl using the Transform Data Task. I need to
validate some information by checking if a value in the text file (i.e.
EmpID) exists in an existing table (Emp). I am trying to use a lookup in
the Transform Data Task (Lookups tab). What I can't figure out is how do I
reference the value from the text file in the SQL statement and how do I
know it the lookup is successful or not? Also, if the text file has multiple
fields to be validated, can I do this also? What I want to do is not import
the record if the lookup fails.

Thanks



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

Default Re: Using Lookup in data pump - 05-14-2004 , 08:48 AM






Because you are bringing in rows from a text file I would be inclined to
move the whole lot into a staging table and use TSQL from there. Using
Lokoups forces you into Row*Row processing and that won't be funny if you
have a lot of data

Allan

"Tim Kelley" <tim.kelley (AT) iddonline (DOT) com> wrote

Quote:
I am importing text files into SQl using the Transform Data Task. I need
to
validate some information by checking if a value in the text file (i.e.
EmpID) exists in an existing table (Emp). I am trying to use a lookup in
the Transform Data Task (Lookups tab). What I can't figure out is how do I
reference the value from the text file in the SQL statement and how do I
know it the lookup is successful or not? Also, if the text file has
multiple
fields to be validated, can I do this also? What I want to do is not
import
the record if the lookup fails.

Thanks





Reply With Quote
  #3  
Old   
John Miceli
 
Posts: n/a

Default RE: Using Lookup in data pump - 05-14-2004 , 01:16 PM



I agree with Allan on this one: staging tables make it much easier to do cross verification. TSQL is much easier to use that the lookups functionality in the Transform Data Task. This is how we do it as well (so I may be a little biased ;-)

Regards,
John Miceli

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.