?
Solved

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

Posted on 2009-07-06
3
Medium Priority
?
309 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
[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
3 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Suggested Courses

752 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