Solved

Function to remove apostrophes ( ' ) from a string

Posted on 2007-12-03
2
1,551 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
2 Comments
 
LVL 7

Accepted Solution

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

should do it.  
0
 
LVL 65

Author Comment

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

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

806 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