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 2005 Forums
 Transact-SQL (2005)
 replace or filter in sql

Author  Topic 

sqlhelp14
Yak Posting Veteran

55 Posts

Posted - 2008-01-22 : 16:46:47
i have one value
405 2055 42555 or 405-2055-42555

i have to replace or u can say filter blank spaces or '-' into ''

means i want result as: 405205542555

can u tell me how can i do in sql?

thanks.

jdaman
Constraint Violating Yak Guru

354 Posts

Posted - 2008-01-22 : 16:54:00
REPLACE(REPLACE([YourColumn],'-',''),' ','')
Go to Top of Page

sqlhelp14
Yak Posting Veteran

55 Posts

Posted - 2008-01-22 : 20:24:21
replace not working...

can u tell me another option..

thanks.
Go to Top of Page

sqlhelp14
Yak Posting Veteran

55 Posts

Posted - 2008-01-22 : 20:36:53
quote:
Originally posted by jdaman

REPLACE(REPLACE([YourColumn],'-',''),' ','')



actually, u have to add select in the begining of repalce stataement and now its working....

Thanks a lot!!! - jdaman
Go to Top of Page
   

- Advertisement -