Solved

MS SQL - UPDATE STATEMENT - LOOK FOR ' AND REPLACE

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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

Audit has been really one of the more interesting, most useful, yet difficult to maintain topics in the history of SQL Server. In earlier versions of SQL people had very few options for auditing in SQL Server. It typically meant using SQL Trace …
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 …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

856 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