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

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Removing 32 Ascii Space Character

Author  Topic 

Muj9
Yak Posting Veteran

75 Posts

Posted - 2013-11-01 : 07:14:40
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

22864 Posts

Posted - 2013-11-01 : 07:37:43
select replace(col,char(32),'') from table

Madhivanan

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

Muj9
Yak Posting Veteran

75 Posts

Posted - 2013-11-01 : 07:57:42
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
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2013-11-01 : 08:11:37
quote:
and checked the new table it still had space in the field.

is it really SPACE or empty string ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

Muj9
Yak Posting Veteran

75 Posts

Posted - 2013-11-01 : 09:16:03
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
   

- Advertisement -