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 |
|
roger00713
Starting Member
11 Posts |
Posted - 2010-02-10 : 20:32:22
|
| Hi. I am wondering if someone can please point me in the right direction.I am wanting to search for any apostrophes that turns up in a certain field. It is a surname field. An example would be O'Reily.I am struggling with the fact that SQL recognizes the Apostrophe as the end of my statement.Any help would be much appreciated.Thanks. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-11 : 00:10:19
|
| [code]SELECT * FROM YourTable WHERE CHARINDEX('''',Youfield)>0[/code]will return you field values containing apostrophes------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
roger00713
Starting Member
11 Posts |
Posted - 2010-02-11 : 17:33:44
|
| Thanks for your help with this.Your suggestion worked perfectly. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-12 : 01:11:41
|
welcome ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-02-12 : 01:33:14
|
| orSELECT * FROM YourTable WHERE Youfield like '%''%'MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|