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 2000 Forums
 Transact-SQL (2000)
 Space Problem - Urgent

Author  Topic 

real_pearl
Posting Yak Master

106 Posts

Posted - 2004-08-09 : 06:52:51
RTRIM is not removing the speaces. And when I used

STUFF(field, LEN(field), 1, '') it worked fine. But the values which does not have space it removes the last character. How I may overcome this problem please tell me.

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2004-08-09 : 07:05:00
select rtrim('andrew '), len(rtrim('andrew '))
select rtrim('andrew'), len(rtrim('andrew'))

what do you get when you execute the two above?
are you putting the result from your queries into another table????...another table defined as CHAR?
Go to Top of Page

real_pearl
Posting Yak Master

106 Posts

Posted - 2004-08-09 : 07:14:58
i am pick table_name from a field that stores table_name, and dynamically generates the SQL statement. but when I pick the table_name and concatenate it with a field_name like this

table_name.field_name it does not do this while it make it something like this

select * from table where table .field_name = 'ABC'

i want to remove these spaces.
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2004-08-09 : 08:27:04
maybe you have an extra space in the dynamic sql before a . like table_name + ' .' + filed_name???


Go with the flow & have fun! Else fight the flow :)
Go to Top of Page
   

- Advertisement -