Solved

MS SQL - UPDATE STATEMENT - LOOK FOR ' AND REPLACE

Posted on 2008-06-13
3
4,220 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
[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
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

I have written a PowerShell script to "walk" the security structure of each SQL instance to find:         Each Login (Windows or SQL)             * Its Server Roles             * Every database to which the login is mapped             * The associated "Database User" for this …
This is basically a blog post I wrote recently. I've found that SARGability is poorly understood, and since many people don't read blogs, I figured I'd post it here as an article. SARGable is an adjective in SQL that means that an item can be fou…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

726 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