DTS Lookup against 2 columns | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

DTS Lookup against 2 columns

Good morning- I am trying to accomplish the following. In my lookup,
I need to find a value in a column(Store) when either the Store_Code or Store_Code_Orig columns match the variable passed through the lookup. I have this and it works for one:
SELECT STORE
FROM K_Collect_Code
WHERE (Store_Code = ?) but I need to have it use the Store_Code_Orig as well. Here is the transform as well. Function Main()
dim CM_ID
dim Store_Code
Store_Code = (DTSLookups("Store_Code").Execute(DTSSource("Col018").Value))
CM_ID = Store_Code + DTSSource("Col009")
DTSDestination("CM_ID") = CM_ID
Main = DTSTransformStat_OK
End Function Thanks for any help!!
It is possible to use more than one arguments in a lookup query. Change your query like this…. SELECT STORE
FROM K_Collect_Code
WHERE Store_Code = ? OR Store_Code_Orig ? And here is a piece of the activex you will use…. DTSDestination(Store) = DTSLookups("StoreQuery").Execute (DTSSource("Store_Code"), DTSSource("Store_Code_Orig"))
Raulie- Thanks! I had tried the OR statement earlier, but failed to inluced the variable again in the ActiveX script. That was the missing piece. Thanks for the info.
]]>