Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7489911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:24:01+00:00 2026-05-29T15:24:01+00:00

i was wondering how to use IsNumeric in SQL, it’s a bit different from

  • 0

i was wondering how to use IsNumeric in SQL, it’s a bit different from VBScript, but i think i was able to get around it, ie:

 IF 1 = ISNUMERIC('5675754674') 
 BEGIN 
 ...
 END

Would this be a way around it? What I really want to do is:

IF ISNUMERIC('5675754674')
BEGIN 
... 
END

but that gives an error. Example 1 seems to work, but just making sure i’m doing this right, wasn’t able to find any good resources online about it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T15:24:03+00:00Added an answer on May 29, 2026 at 3:24 pm

    There is no boolean in SQL Server. This means you can’t just say IF (expression); you must compare it to something, because it does return true or false in the same sense as you’re probably used to in other languages.

    Just a preference, but I would prefer to write it this way:

    IF ISNUMERIC('5675754674') = 1
    BEGIN
    ...
    END
    

    There is no way in SQL Server to avoid the comparison to 1, as in your second example.

    Also as an aside you should be aware of the weaknesses of ISNUMERIC() – it can give false positives for “numeric” values such as ., CHAR(9), e, $ and a host of other non-numeric strings. If you want to know if something is an integer, for example, better to say:

    IF '5675754674' NOT LIKE '%[^0-9]%'
    BEGIN
    ...
    END
    

    But even that is not a complete and valid test because it will return true for values > (2^32)-1 and it will return false for negative values.

    Another downside to ISNUMERIC() is that it will return true if the value can be converted to any of the numeric types, which is not the same as all numeric types. Often people test for ISNUMERIC() and then try to cast a FLOAT to a SMALLINT and the conversion fails.

    In SQL Server 2012 you will have a new method called TRY_CONVERT() which returns NULL if the conversion to the specified data type is not valid.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wondering how to use functions from another script in Lua. For example, say
Sorry if this has been asked before, but I am wondering what the use
Strange question, but someone showed me this, I was wondering can you use the
Studying compilers course, I am left wondering why use registers at all. It is
I'm wondering how to use a VideoDisplay object (defined in MXML) to display video
I was wondering how to use cin so that if the user does not
I am wondering how to use NUnit correctly. First, I created a separate test
I was wondering why we use the terms push and pop for adding/removing items
I am wondering how to use Model Binding in a scenario where I am
I was wondering if I use PHP's hash() function to generate sha512 hashes how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.