?
Solved

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

Posted on 2007-03-26
1
Medium Priority
?
511 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 2000 total points
ID: 18796543
UPDATE    listings
  SET   [virtualtours] = replace([virtualtours], '''', '')
0

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

Question has a verified solution.

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

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 SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

850 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