If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back  dBforums > Database Server Software > Microsoft SQL Server > UPDATE Query

LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Registered User
Join Date: Dec 2012
Posts: 5

I have a field in SQL Server table that somehow got data altered. So the data reads like this Test ,Test Is there a way for me to run an update query which will modify the data back to the original formatting of Test, Test?

Last edited by IndigoMontoya; 12-21-12 at 17:26.
Reply With Quote
  #2 (permalink)  
Registered User
Join Date: Feb 2012
Posts: 126
Try this:
update mytable
set mycolumn = replace(mycolumn, ' ,', ',')

This will replace ' ,' with just a single comma. And of course mytable = your table name and mycolumn = your field name.
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On