• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 268
  • Last Modified:

Stored Proc Error with Isnumeric

IF (    (NOT ISNUMERIC(LEFT(@newExceptionLbl, 1))) AND (NOT ISNUMERIC(RIGHT(@newExceptionLbl, 1)))      )

I get this error:
Server: Msg 170, Level 15, State 1, Procedure test_put, Line 100 Line 100: Incorrect syntax near ')'.

Anything wrong with this statement?
0
phunchak
Asked:
phunchak
  • 2
1 Solution
 
Brendt HessSenior DBACommented:
IsNumeric returns 1 or 0.  Try this, instead of using NOT:

 IF (ISNUMERIC(LEFT(@newExceptionLbl, 1))=0)
     AND (ISNUMERIC(RIGHT(@newExceptionLbl, 1))=0)
0
 
Brendt HessSenior DBACommented:
The NOT syntax you are using is from languages like VB, where NOT TRUE = FALSE, and only works on Boolean operations.  IsNumeric does not return a Boolean, but an INT.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now