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 |
|
SamC
White Water Yakist
3467 Posts |
Posted - 2007-02-21 : 09:11:29
|
| I'm sure this can't be done, please prove me wrong...I've got a select ... WHERE column LIKE @parameteris there a value of @parameter that would find all columns NOT ending with, or containing, a specific string, e.g. %abc% ?We would like to not rewrite the LIKE condition to be NOT LIKE.Sam |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-02-21 : 09:16:37
|
| LIKE '%[^a-z]'is the same asnot like '%[a-z]'Peter LarssonHelsingborg, Sweden |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-02-21 : 11:00:46
|
"Ending with" you could doselect ... WHERE column LIKE '%[^a][^b][^c]'but it won't match rows with [column] length < 3No way to do it for a "containing", unless its a Single Character, or RegEx in SQL 2005 is beefier than SQL 2000 Kristen |
 |
|
|
SamC
White Water Yakist
3467 Posts |
Posted - 2007-02-22 : 08:50:50
|
quote: Originally posted by Kristen No way to do it for a "containing", unless its a Single Character, or RegEx in SQL 2005 is beefier than SQL 2000 
This is 2005. Is RegEx part of the LIKE comparison? |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-02-22 : 09:10:30
|
| Sorry, I don't know for SQL 2005.I would be very interested to know if BoL suggest that LIKE is "beefier" than in SQL 2000 ?Kristen |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-02-22 : 10:51:08
|
| no it's not.you can use CLR for regex.Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
|
|
|
|