dbTalk Databases Forums  

DTS Lookup Query in DDQ Task Always Incorrectly Returns 0

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


Discuss DTS Lookup Query in DDQ Task Always Incorrectly Returns 0 in the microsoft.public.sqlserver.dts forum.



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

Default DTS Lookup Query in DDQ Task Always Incorrectly Returns 0 - 03-04-2004 , 05:20 PM






My lookup query looks like:

SELECT COUNT(*) AS Expr1
FROM dbo.DestinationTable
WHERE (KeyField1 = ?)
AND (KeyField2 = ?)
AND (KeyField3 = ?)
AND (KeyField4 = ?)


My Transformation ActiveX script snippit:

....
RecExists = Trim(DTSLookups("lkpPreExistingRecs").Execute(
DTSSource("KeyField1").Value,
DTSSource("KeyField2").Value,
DTSSource("KeyField3").Value,
DTSSource("KeyField4").Value))

SELECT CASE RecExists
CASE 0
DTSDestination("Version") = 1
Main = DTSTransformstat_InsertQuery
CASE Else
DTSDestination("Version") = RecExists + 1
Main = DTSTransformstat_UpdateQuery
End Select
....


The problem is that "RecExists" is always a 0. My message box debug
statements confirm the correct inputs into the lookup query, and I
have verified that there are multiple rows for many of these
transformations (lookup query returns >0 value). I've also tried
using the VB Conversion routines in the "Execute" call w/o luck.

Any iders?

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.