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)
 Removing characters and spaces from a field

Author  Topic 

waxdart23
Starting Member

33 Posts

Posted - 2005-06-08 : 04:14:36
I am currently trying to convert some phone number data which has been entered with spaces for formatting and in some cases with text. Is there a way of removing all spaces and text from this field leaving just the numbers?

Thanks

Thanks
P

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-06-08 : 04:19:43
without sample data and ddl, you can use replace (search and read bol)

--------------------
keeping it simple...
Go to Top of Page

waxdart23
Starting Member

33 Posts

Posted - 2005-06-08 : 04:35:01
Thanks

Thanks
P
Go to Top of Page

vivek.kumargupta
Starting Member

45 Posts

Posted - 2005-06-08 : 04:41:34
U can also use rtrim and ltrim functions to cut the spaces u do not require.

Thanks,
Vivek
Go to Top of Page
   

- Advertisement -