Solved

SQL Server - How to remover white spaces from a column

Posted on 2013-11-06
3
282 Views
Last Modified: 2013-11-06
Hi Experts,
I have a column in my table where the last name and first name are separated by a comma,
e.g. Smith,  Joseph
The problem is that there are two spaces after the comma. I would like to have only one space following the comma. How can I achieve that? Thanks for your help.
0
Comment
Question by:romsom
  • 2
3 Comments
 
LVL 48

Accepted Solution

by:
PortletPaul earned 500 total points
ID: 39628809
REPLACE ( string_expression , string_pattern , string_replacement )

e.g.

replace(  full_name,   ',  '   ,   ', '  ) -- spread out to make it easier to read here

replace comma & two spaces with comma & one space
0
 

Author Closing Comment

by:romsom
ID: 39628820
It worked, thank you very much!
0
 
LVL 48

Expert Comment

by:PortletPaul
ID: 39628851
No problem - thank you. Cheers, Paul
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

757 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now