+,-(Plus sign, minus sign) is a number type? (In SQL Server 2000)

Source: Internet
Author: User
Tags sql server query
After debugging the stored procedure today, we found a strange problem. We all know that the function isnumeric is used to determine whether the expression is a valid numeric type, but the result I got with isnumeric ('+') is 1, that is, + is a number type. Then I tried to subtract the number-it also got the same result, I was puzzled. Later I thought that if they were numbers, what would they be? I converted them to convert (INT, '+') and the result was 0, convert (INT, '-') returns zero. It's strange. Why is it like this? This is not described in the online help of SQL Server. Later I tried other operators. Except for the plus sign and minus sign, none of the other operators are numerical (or, I have not found). Is this a bug in SQL Server2000? (Maybe this is not a problem at all)
You can run the following in the SQL Server Query Analyzer:
Print (isnumeric ('+ '))
Print (isnumeric ('-'))
Print (convert (INT, '+ '))
Print (convert (INT ,'-'))
The result is:
1
1
0
0
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.