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 |
|
PGG123
Yak Posting Veteran
55 Posts |
Posted - 2004-10-05 : 11:42:07
|
| How do I do this? I am building a search query that would allow * as a wildcard, so I am replacing * with % in the query. But if the user decides to use % instead, I don't need to replace . |
|
|
ditch
Master Smack Fu Yak Hacker
1466 Posts |
Posted - 2004-10-05 : 11:44:13
|
| USE Charindex - look it up in BOLDuane. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-10-05 : 12:10:27
|
| [code]USE NorthwindGOSET NOCOUNT ONGODECLARE @search varchar(255)SET @search = '*Ale*'SELECT * FROM Products WHERE ProductName LIKE REPLACE(@Search,'*','%')SET @search = '%Lager%'SELECT * FROM Products WHERE ProductName LIKE REPLACE(@Search,'*','%')GOSET NOCOUNT OFFGO[/code]Brett8-) |
 |
|
|
|
|
|