![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, In DTS Lookup, I want to write a query as SELECT col1 FROM Table1 WHERE col2 like '%0001' ( this would be parameter) this returns one row. 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... i.e. it doesnt return any row. Any help would be appreciated.. Regards, Nilay. |
#3
| |||
| |||
|
|
You can adapt this example from QA declare @au_fname varchar(30) set @au_fname = 'ean' select * from Authors where au_fname like '%' + @au_fname I just plugged this into an ExecuteSQL task and it works select * from authors where au_fname like '%' + ? -- ---------------------------- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Nilay Shah" <Nilay Shah (AT) discussions (DOT) microsoft.com> wrote in message news:52FF5319-A061-4A77-8BD4-E9A6623B9296 (AT) microsoft (DOT) com... Hi, In DTS Lookup, I want to write a query as SELECT col1 FROM Table1 WHERE col2 like '%0001' ( this would be parameter) this returns one row. 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... i.e. it doesnt return any row. Any help would be appreciated.. Regards, Nilay. |
#4
| |||
| |||
|
|
It works in ExecuteSQL task but it doesnt work in Data Transformation Lookup.. I need specifically in lookup because while transformation I have |
|
"Allan Mitchell" wrote: You can adapt this example from QA declare @au_fname varchar(30) set @au_fname = 'ean' select * from Authors where au_fname like '%' + @au_fname I just plugged this into an ExecuteSQL task and it works select * from authors where au_fname like '%' + ? -- ---------------------------- Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Nilay Shah" <Nilay Shah (AT) discussions (DOT) microsoft.com> wrote in message news:52FF5319-A061-4A77-8BD4-E9A6623B9296 (AT) microsoft (DOT) com... Hi, In DTS Lookup, I want to write a query as SELECT col1 FROM Table1 WHERE col2 like '%0001' ( this would be parameter) this returns one row. 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... i.e. it doesnt return any row. Any help would be appreciated.. Regards, Nilay. |
![]() |
| Thread Tools | |
| Display Modes | |
| |