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)
 how to remove spaces from string

Author  Topic 

shubhada
Posting Yak Master

117 Posts

Posted - 2006-04-10 : 07:38:03
i am doing a concatenation of string of column col2 as follow

col1 col2
1 #abcdef#
2 #123455#
3 #mmmmmm#

after concatenation my string will be
#abcdef##123455##mmmmmm#

then i remove all # with '' after this string will be
abcdef 123455 mmmmmm

how i can remove the spaces between f & 1 and 5 & m

shubhada

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-04-10 : 08:16:36
If u want that to be done in the way u want
Print replace('abcdef 123455 mmmmmm',' ','')

or u should have done it at an earlier stage as
Print replace('#abcdef##123455##mmmmmm#','#','')


Srinika
Go to Top of Page

snktheone
Starting Member

20 Posts

Posted - 2006-04-10 : 08:20:37
use replace function
Replace ( field, ' ', '')
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-04-10 : 08:59:37
>>then i remove all # with '' after this string will be
abcdef 123455 mmmmmm

How did you remove #?
Use the same logic

Madhivanan

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

shubhada
Posting Yak Master

117 Posts

Posted - 2006-04-10 : 09:29:06
ok...my problem has been resolved....
Thanks a lot......



shubhada
Go to Top of Page
   

- Advertisement -