Solved

Stored Proc Error with Isnumeric

Posted on 2004-09-30
2
259 Views
Last Modified: 2008-02-01
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
Comment
Question by:phunchak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 32

Expert Comment

by:bhess1
ID: 12192555
IsNumeric returns 1 or 0.  Try this, instead of using NOT:

 IF (ISNUMERIC(LEFT(@newExceptionLbl, 1))=0)
     AND (ISNUMERIC(RIGHT(@newExceptionLbl, 1))=0)
0
 
LVL 32

Accepted Solution

by:
bhess1 earned 250 total points
ID: 12192646
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

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question