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

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Unable to delete space\Special char from Varchar
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

deepugun
Starting Member

11 Posts

Posted - 07/01/2013 :  16:06:59  Show Profile  Reply with Quote
Hello All,
I have few rows in the address table with spaces(Leading\trail) which is being interpreted as special characters by the application. I have tried to delete those spaces using the below statement but had no success
UPDATE Addr
SET ADDRESS1=Ltrim(rtrim(Address1))
Also if possible please let me know why the extra space is interpreted as '-' in sql server management studio.
Thanks,


James K
Flowing Fount of Yak Knowledge

3589 Posts

Posted - 07/01/2013 :  16:45:47  Show Profile  Reply with Quote
That update should work if in fact the leading/trailing characters were spaces. So that means they are something else - some other non-printable characters. There is no one easy way to remove such non-printable characters. See here for example. http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=98382

You can also cast the column to varbinary to see what the characters actually are:
select cast(Address1 as varbinary) from Addr
Go to Top of Page
  Previous Topic Topic Next Topic  
 New 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