Showing posts with label queryselect. Show all posts
Showing posts with label queryselect. Show all posts

Saturday, February 25, 2012

rtrim in sql server 2000

Hi,
What is wrong with the following query?
select a.name, rtrim(a.name) from (
select top 100 name from dbo.table1 )a
whre table1 has the following in name column
A.B.xyz<space>
AB.xyz<space>
and so on...
When i cut and paste the result set from query analyzer into Excel, i
still see the trailing space.
BTW, i am using sql server 2000
Thanks in advance,
TamasWhat data type is the name column? The char/nchar/binary datatypes are of
fixed length, while varchar/nvarchar/varbinary are variable.
"Trimming spaces from fixed length columns is futile. You will be overpadded
."
ML
http://milambda.blogspot.com/|||what is the a.name datatype ?
Jack Vamvas
___________________________________
Receive free SQL tips - www.ciquery.com/sqlserver.htm
<tamashee@.yahoo.com> wrote in message
news:1145399053.665196.72630@.e56g2000cwe.googlegroups.com...
> Hi,
> What is wrong with the following query?
> select a.name, rtrim(a.name) from (
> select top 100 name from dbo.table1 )a
> whre table1 has the following in name column
> A.B.xyz<space>
> AB.xyz<space>
> and so on...
> When i cut and paste the result set from query analyzer into Excel, i
> still see the trailing space.
> BTW, i am using sql server 2000
> Thanks in advance,
> Tamas
>