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 |
|
HGClubTec
Starting Member
12 Posts |
Posted - 2010-04-23 : 09:48:16
|
| I need to search a character field (in this case - a name) for a " and if it contains a quote then I need to add quotes to the beginning and end of the field. Is this possible?As an example...If I have Jennifer "Jen" then I need it to return "Jennifer "Jen""TIA! |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-04-23 : 09:50:53
|
| SELECT CASE WHEN CHARINDEX('"',field) > 0 THEN '"' + field + '"' ELSE field END FROM Table------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
HGClubTec
Starting Member
12 Posts |
Posted - 2010-04-23 : 10:11:51
|
| Awesome!! THANKS!!!! |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-04-23 : 10:12:51
|
| welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|