dbTalk Databases Forums  

Lookup multiple fields

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


Discuss Lookup multiple fields in the microsoft.public.sqlserver.dts forum.



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

Default Lookup multiple fields - 10-09-2003 , 01:52 AM






Hi

I am new to DTS. I have trying to use Lookup in the
Transform Data Task to retrieve 2 column from a table. The
look looks like this

select field_1, field_2 from test_table where field_3 = ?

Then in the ActiveX scripting windows, I have declared a
dim variable (called it arrFields).

dim arrFields

arrFields = DTSLookups("LKP_test").Execute(DTSSource
("Field_ID"))

Its seems to work initially, however, when one or both the
return data (field_1 or field_2) is NULL, it gives error.

How to overcome this. To continue testing, I have done a
lousy work around or splitting it into 2 looksups which is
making the system very slow.

Hope I can get some advise on this.

Thank you very much

Yew Loon


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

Default Re: Lookup multiple fields - 10-09-2003 , 10:53 AM






Have a look at this article and the ISEMPTY() function

How to Use Lookups in DTS
(http://www.sqldts.com/default.aspx?277,1)

--
--

Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org

"YewLoon" <yewloon_wong (AT) sg (DOT) firstapex.com> wrote

Quote:
Hi

I am new to DTS. I have trying to use Lookup in the
Transform Data Task to retrieve 2 column from a table. The
look looks like this

select field_1, field_2 from test_table where field_3 = ?

Then in the ActiveX scripting windows, I have declared a
dim variable (called it arrFields).

dim arrFields

arrFields = DTSLookups("LKP_test").Execute(DTSSource
("Field_ID"))

Its seems to work initially, however, when one or both the
return data (field_1 or field_2) is NULL, it gives error.

How to overcome this. To continue testing, I have done a
lousy work around or splitting it into 2 looksups which is
making the system very slow.

Hope I can get some advise on this.

Thank you very much

Yew Loon




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.