?
Solved

Stored Proc Error with Isnumeric

Posted on 2004-09-30
2
Medium Priority
?
260 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:Brendt Hess
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:
Brendt Hess earned 1000 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Suggested Courses

762 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