dbTalk Databases Forums  

Lookup in Transform Data Task

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


Discuss Lookup in Transform Data Task in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
mj.redfox.mj@gmail.com
 
Posts: n/a

Default Lookup in Transform Data Task - 04-07-2006 , 07:46 AM






Hi,

Can anyone help me?

I have a DTS package, which basically consists of a data pump task. The
source for this is a CSV file with various fields, and the destination
is a table in a database (let's call it "Database A")

Now, I've designed this sort of package before and have no problem with
most of this (i.e. the straight Copy Column or Date Time Conversion
types of transformation)...where I'm getting stuck though, is that a
couple of the fields in the csv file require me to do a LookUp style
conversion before passing the resulting value into the destination
fields.

Now, the tables where the values for the lookup would be found, also
exist in Database A, so are readily available...I simply don't know how
to implement this (i.e. do I have to select 'ActiveX Script' in the New
Transformation window and somehow put the SQL into VBScript? I've had a
look at the Lookups tab, but when I try to select the csv file as the
source for that, it doesn't seem to like it ("The selected connection
does not provide SQL support").

Can anyone help?


Reply With Quote
  #2  
Old   
mj.redfox.mj@gmail.com
 
Posts: n/a

Default Re: Lookup in Transform Data Task - 04-07-2006 , 08:05 AM






Ah, I've just figured that I do need to use the Lookup and use the db
as the source (pretty obvious really)...all I need to know now, is how
to specify the csv field in the WHERE clause...?


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

Default Re: Lookup in Transform Data Task - 04-09-2006 , 03:37 PM



Hello mj.redfox.mj (AT) gmail (DOT) com,


You could actually do this a number of ways

1. Merge Join and then filter out the NULLs using a conditional split transform
2. Use the Lookup transform. This will have the DB table as the reference
table. You can then match the inputs to the lookup columns. The CSV will
not feature in the reference table but will be the input.

Make sense?


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

Quote:
Ah, I've just figured that I do need to use the Lookup and use the db
as the source (pretty obvious really)...all I need to know now, is how
to specify the csv field in the WHERE clause...?




Reply With Quote
  #4  
Old   
mj.redfox.mj@gmail.com
 
Posts: n/a

Default Re: Lookup in Transform Data Task - 04-10-2006 , 07:14 AM



Hello Allan,

Thanks for replying. I'd ideally like to use the Lookup transform,
however the only thing I don't know how to do is specify the CSV file
in the code. i.e. when modifying the lookup query, I don't know how to
specify a field in the CSV file - I've tried using something like:

SELECT (field1) from (table1) where (field2) =
<CSVFILENAME>.<CSVCOLUMNNAME>

but it just tells me there's no table in the query with that name. I
really have tried looking absolutely everywhere for an answer to this
but can't seem to find it. I'll keep looking though - thanks again!


Reply With Quote
  #5  
Old   
mj.redfox.mj@gmail.com
 
Posts: n/a

Default Re: Lookup in Transform Data Task - 04-10-2006 , 07:27 AM



Ah, just found it on BOL - I leave a question mark in place of the
input.


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.