Home Forums SQL Server 7,2000 T-SQL Urgent! - How to extract number from a string RE: Urgent! - How to extract number from a string

  • Thats beautiful work guys!

    What if the record has the string '4-Stars out of 5'. Woud this return 45?

    I was thinking about creating a function which loops through the string one character at a time and does some math with the results.

    1. You would need a try catch block to error trap and then exit out.

    2. You would have to store the previous result to use when an error is found so you could roll back to it.

    3. You may have to check for sequences such as 10E which might get interpreted as Scientific Notation.