Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Function to remove apostrophes ( ' ) from a string

Posted on 2007-12-03
2
Medium Priority
?
1,560 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 2000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

604 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