Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Access
Starting Member
44 Posts |
Posted - 2007-06-26 : 15:38:18
|
| I’m passing a comma separated parameter (home, world, child) into stored procedure.I have a Slitter function which is basically creates a table out of delimited list.My stored procedure needs to find matched records in one of the table based on delimited list.I have something like this:SELECT *FROM WordWHERE WordName IN (SELECT * FROM dbo.fxSplitter('home,world,child, ',')I would like to have my stored procedure be able to select rows, even if comma delimited parameter holds part of the name like this “hom, wor, chil” . Another words it will be SELECT * FROM Word WHERE WordName LIKE '%hom%' OR WordName LIKE '%wor%' OR WordName LIKE '%chil%' |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2007-06-26 : 15:51:39
|
| I don't know how your function works, but something like:SELECT Word.*FROM WordINNER JOIN dbo.fxSplitter('home,world,child', ',') xon Word.WordName like '%' + x.FunctionColumnName + '%'I put "FunctionColumnName" in there because I have no idea what column name is returned from your function, since you don't specify in your example.- Jeffhttp://weblogs.sqlteam.com/JeffS |
 |
|
|
Access
Starting Member
44 Posts |
Posted - 2007-06-26 : 16:00:01
|
quote: Originally posted by jsmith8858 I don't know how your function works, but something like:SELECT Word.*FROM WordINNER JOIN dbo.fxSplitter('home,world,child', ',') xon Word.WordName like '%' + x.FunctionColumnName + '%'I put "FunctionColumnName" in there because I have no idea what column name is returned from your function, since you don't specify in your example.- Jeffhttp://weblogs.sqlteam.com/JeffS
That did it, thanks a lot. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|
|
|