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

  • initials_mi (9/18/2014)


    I came across the same situation and I found the working solution for it.

    Here is the link:

    http://www.ittutorials.in/source/sql/sql-function-to-extract-only-numbers-from-string.aspx

    A set-based solution that does not use a loop is the faster way to go. In addition to what Jeff posted you could use the function discussed here: http://www.sqlservercentral.com/Forums/Topic1585850-391-2.aspx

    or PatExclude8K (referenced in my signature)

    "I cant stress enough the importance of switching from a sequential files mindset to set-based thinking. After you make the switch, you can spend your time tuning and optimizing your queries instead of maintaining lengthy, poor-performing code."

    -- Itzik Ben-Gan 2001