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 |
|
tech1
Starting Member
49 Posts |
Posted - 2011-07-18 : 18:08:22
|
| Just a quick one.lets say I have a table with records. We are searching on a field which is of nvarchar.we are doing a LIKE search.SELECT * FROM MyTable WHERE Field LIKE '%Shes the one%'Problem: What if the "Field" contains "She's the one" - notice the apostrophe. is there a way to query it and say to ignore the punctuation, rather than modifying the underlaying data?Thanks! |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
tech1
Starting Member
49 Posts |
Posted - 2011-07-18 : 18:58:57
|
| thanks. well its ok as the table is very very small. we are talking <1000 records. The problem with escaping is that this will be coming from a web application and using SPROCS to pass in params from which the query will be using to query against in the WHERE Clause.so really I want to "escape" the keyword AND the field without modifying the underlaying data. UDF? |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2011-07-19 : 04:08:31
|
| You can escape the character in the web application and send the data as parameterMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|