Solved

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

Posted on 2007-03-26
1
502 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

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…
Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

832 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