Function to remove apostrophes ( ' ) from a string

Does anyone have a handy-dandy SQL2K User-defined function to remove any apostrophe's from a string?

SELECT @INSD_LAST_NAME = dbo.SomeFunction(pers.PERS_LAST_NAME)
FROM PERS_PERSON pers
WHERE blah blah blah

If pers.PERS_LAST_NAME is O'Malley, then @INSD_LAST_NAME would be assigned the value of OMalley.

TIA
Jim
LVL 66
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
wittysloganConnect With a Mentor Commented:
replace(PERS_LAST_NAME,'''','')

should do it.  
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorAuthor Commented:
Doh.  Thanks.  -Jim
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.