DTS Lookup % | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

DTS Lookup %

Hi, In DTS Lookup, I want to write a query as SELECT col1
FROM Table1
WHERE col2 like ‘%0001’ ( this would be parameter) col2 is varchar column I wrote it as SELECT col1
FROM Table1
WHERE col2 like ? But it doesnt seems to work. Any idea what should be the value of parameter. I tried passing value as ‘%0001’, ‘0001’, %0001, but no luck… Any help would be appreciated.. Regards,
Nilay.

What error are you receiving??
No error but it is not always giving blank results (i.e. no record) … I tried passing parameter as
– %0001
– ‘%0001’
– ‘00001’ but no luck with any? With normal query it returns one row but with this it returns zero row..
I tried doing the same in the test environment and it worked successfully. Make sure that the following items has been considered. 1. Global variable data type is selected as string
2. Make sure that the value is typed in Global variable. Raj
Hi, I got answer to my question: If column (col2) is char then in Lookup in Data Transformation , you have to specify SELECT col1
FROM table1
WHERE (col2 LIKE ‘%’ + RTRIM(?))
If column (col2) is varchar then in DTS Lookup, you have to specify SELECT col1
FROM table1
WHERE (col2 LIKE ‘%’ + ?) Then it works.. Regards,
Nilay.
]]>