Solved

MS SQL - UPDATE STATEMENT - LOOK FOR ' AND REPLACE

Posted on 2008-06-13
3
4,212 Views
Last Modified: 2013-11-05
Been fighting with sql and continually get errors when running this statement.

UPDATE [FSSINC].[dbo].[Customer]
   SET [CustomerName] = CustomerName
 WHERE <,,> i add the criteria. What im trying to do is search for say instances where
firstname , lastname remove the , so i end up with just firstname lastname.
0
Comment
Question by:MarkMaloney
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
rickchild earned 500 total points
ID: 21781399
If you are looking to remove all commas then use REPLACE

UPDATE [FSSINC].[dbo].[Customer]
   SET [CustomerName] = REPLACE(CustomerName,  ','  ,  '' )  
0
 
LVL 13

Assisted Solution

by:rickchild
rickchild earned 500 total points
ID: 21781417
If you are looking to replace single quotes (As the question title)

UPDATE [FSSINC].[dbo].[Customer]
   SET [CustomerName] = REPLACE(CustomerName,  ''''  ,  '' )
0
 

Author Comment

by:MarkMaloney
ID: 21781475
thanks folks. worked perfectly
0

Featured Post

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
In this article I will describe the Detach & Attach 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.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

813 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

16 Experts available now in Live!

Get 1:1 Help Now