t-sqlnumerical-methods

Check if a varchar is a number


Is there an easy way to figure out if a varchar is a number?

Examples:

abc123 --> no number

123 --> yes, its a number


Solution

  • ISNUMERIC will do

    Check the NOTES section too in the article.