Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2009
    Posts
    16

    Unanswered: An error occured in SP

    select @isOK = convert(smallint,isnull(isSet,"0"))

    Hi...

    I have a NULL value there and i get this error.

    isSET is null by the way.
    Also isSET value is String in my Java class and it is assigned null at first.


    Syntax error during explicit conversion of VARCHAR value 'null' to a SMALLINT field.

    What may be the error?

    Does not it set the isSet value to "0" and then this varchar "0" value to a smallint?
    Last edited by xotesa; 06-15-09 at 05:43.

  2. #2
    Join Date
    Jan 2004
    Posts
    545
    Provided Answers: 4
    You are trying to convert the string zero to an integer. If you use select @isOK = convert(smallint,isnull(isSet,0)) it would be okay.
    I'm not crazy, I'm an aeroplane!

  3. #3
    Join Date
    Jun 2009
    Posts
    16
    Thanks. I changed "null" values to null.

  4. #4
    Join Date
    Jun 2009
    Posts
    2
    You were passing isSet as "NULL" not as NULL.That was the issue.Thanks,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •