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.
| Author |
Topic |
|
amurark
Yak Posting Veteran
55 Posts |
Posted - 2012-01-20 : 15:14:18
|
| pls tell me how to trim trailing spaces as lrtrim ,rtrim is not working in slq server 2005.Ankita |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-01-20 : 15:20:45
|
They ARE working!Maybe your spaces are no spaces? No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-01-20 : 15:24:09
|
LTRIM and RTRIM do work in SQL 2005 - if it looks like it is not working, it may be that they are not spaces, but other characters such as tab etc.? You can cast to varbinary and see what the trailing/leading characters are, for example:DECLARE @x1 VARCHAR(32), @x2 VARCHAR(32);SET @x1 = 'abcd '; -- trailing spaceSET @x2 = 'abcd '; -- trailing tabSELECT CAST(@x1 AS VARBINARY),CAST(@x2 AS VARBINARY);-- 0x6162636420 0x6162636409-- Hex 20 is space and hex 09 is tab |
 |
|
|
amurark
Yak Posting Veteran
55 Posts |
Posted - 2012-01-21 : 08:19:28
|
| thnks for repliesbut it is not working i want to remove spaces or tabs plssss help meAnkita |
 |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-01-21 : 09:03:40
|
| Can you post the query you are using, along with some sample data? Take a look at Brett's blog here for some guidance on how to post it. |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2012-01-21 : 09:28:59
|
| " i want to remove spaces or tabs "RTrim doesn't remove TABs. |
 |
|
|
|
|
|