Solved

Is it possible to alter varchar  data in a SQL database?

Posted on 2009-07-06
3
270 Views
Last Modified: 2012-05-07
Hi I have a database to is storing names in a table I.e customer table with the field both the first and lastnames are stored in this like peter pan. I have recently added a form that captures the username I.e as peter.pan is there a way to run a SQL statment that will alter only peter.pan like data and reformat to peter pan? Let me know if you require any additonal info. Thanks Adrian
0
Comment
Question by:adypips
3 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 125 total points
ID: 24784168
you mean
UPDATE yourtable
   SET yournamefield = REPLACE(yournamefield, '.', ' ')
 WHERE yournamefield LIKE '%.%'

Open in new window

0
 
LVL 57

Expert Comment

by:Raja Jegan R
ID: 24784178
Hope this is what you meant:

update ur_table
set name =  replace(name, '.', ' ')

Kindly tell me if this doesn't helped you out with examples so that I can help further
0
 

Author Closing Comment

by:adypips
ID: 31600111
Many thanks spot on, this exactly what I am after. Many thanks
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

809 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