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
 General SQL Server Forums
 New to SQL Server Programming
 pull numbers from column

Author  Topic 

WJHamel
Aged Yak Warrior

651 Posts

Posted - 2012-02-10 : 10:48:06
Doing a data conversion.

Customer has a column - Varchar(max), which contains a mix of text and number values in most, if not each, row.
I need to pull the text from that column and leave only the number values. For instance, an entry might state "Bond amount was $650 and custody remanded to sheriff's department". i need such cells to only say "650".
is this possible?

thanks

ps: the extracted text should be dumped into a new column for each row.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-02-10 : 10:57:05
see

http://beyondrelational.com/blogs/madhivanan/archive/2011/02/28/extract-only-numbers-from-a-string-part-3.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

WJHamel
Aged Yak Warrior

651 Posts

Posted - 2012-02-10 : 11:07:10
Well done. thanks.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-02-10 : 11:09:44
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -