Please start any new threads on our new site at http://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Removing 32 Ascii Space Character
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Muj9
Yak Posting Veteran

United Kingdom
75 Posts

Posted - 11/01/2013 :  07:14:40  Show Profile  Reply with Quote
Hi all,

I am having a problem with this column it has a space character in it at the bottom i ran this query to find out i had ascii 32. i would like to remove the space with an empty string.Can somebody please help me with this.


select REPLACE(REPLACE(REPLACE([Time verified], ' ', ''), CHAR(13), '~'), CHAR(10), '~')
from dbo.Imaging_BluePrint

Time verified
126~
124~
349~
320~
1654~
1654~
759~
807~
807~


Thank you

madhivanan
Premature Yak Congratulator

India
22864 Posts

Posted - 11/01/2013 :  07:37:43  Show Profile  Send madhivanan a Yahoo! Message  Reply with Quote
select replace(col,char(32),'') from table

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Muj9
Yak Posting Veteran

United Kingdom
75 Posts

Posted - 11/01/2013 :  07:57:42  Show Profile  Reply with Quote
Hi madhivana

thanks for your help but i did the folowing and it did not work


SELECT
REPLACE([Timeverified], CHAR(32),'')[Timeverified]
into dbo.table1
FROM table

and checked the new table it still had space in the field.

Thanks

Edited by - Muj9 on 11/01/2013 08:00:51
Go to Top of Page

khtan
In (Som, Ni, Yak)

Singapore
17689 Posts

Posted - 11/01/2013 :  08:11:37  Show Profile  Reply with Quote
quote:
and checked the new table it still had space in the field.

is it really SPACE or empty string ?


KH
Time is always against us

Go to Top of Page

Muj9
Yak Posting Veteran

United Kingdom
75 Posts

Posted - 11/01/2013 :  09:16:03  Show Profile  Reply with Quote
sorry the space has been removed but there are others, i used dynamic sql to find out i have 178,179 and 185 from the Ascii table.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000