Solved

Function to remove apostrophes ( ' ) from a string

Posted on 2007-12-03
2
1,556 Views
Last Modified: 2008-02-01
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
0
Comment
Question by:Jim Horn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
wittyslogan earned 500 total points
ID: 20397665
replace(PERS_LAST_NAME,'''','')

should do it.  
0
 
LVL 66

Author Comment

by:Jim Horn
ID: 20398067
Doh.  Thanks.  -Jim
0

Featured Post

Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
I have a large data set and a SSIS package. How can I load this file in multi threading?
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how the fundamental information of how to create a table.

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question