Solved

How do I use replace to remove single quotes and commas?

Posted on 2007-03-26
1
499 Views
Last Modified: 2012-06-21
I have a column called VirtualTours in which I want to remove single quotes and commas. I am trying to use the replace function. See below (incorrect) example.

BEGIN TRAN; UPDATE    listings
                              SET              [virtualtours] = replace('''', '', [virtualtours]);
                                                         SELECT     VirtualTours
                                                          FROM         listings
                                                          WHERE     LEN(VirtualTours) > 1; ROLLBACK;

For example, I have 'vt',   and I want it to return vt.
0
Comment
Question by:Promethyl
1 Comment
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 500 total points
ID: 18796543
UPDATE    listings
  SET   [virtualtours] = replace([virtualtours], '''', '')
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

759 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now