Results 1 to 8 of 8

Thread: Error

  1. #1
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Unanswered: Error

    I get this error message when I alter my stored procedure. Can someone help me out pls
    Last edited by desireemm; 09-15-04 at 16:59.

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Add parentheses around the string.

    -PatP

  3. #3
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Why aren't you using the templates I showed you?

    In any event, post the code not a picture...

    But switch to

    IF @@ERROR <> 0

    But my guess is it's before that
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I'm 99% sure that the problem is just needing parentheses around the string after RAISERROR.

    She probably got the 0 <> @@error from some of my code. Is there anybody that can guess why I almost always put constants on the left?

    -PatP

  5. #5
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    No clue...I thought that wasn't a good thing.....
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  6. #6
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    The problem goes back to the days of cruddy compilers, and poor language syntax. This is just an example, but you can interpret the construct:
    Code:
    SELECT @a = 0
    to mean two very different things. You can only interpret the construct:
    Code:
    SELECT 0 = @a
    one way. Once upon a time, Transact-SQL could get confused, and many other tools still have the same problem. By always using an expression that can't be an l-value on the left side of a comparison, there is almost no chance that the code can be mis-interpreted.

    There was actually one mainframe language that would let you assign new values to constants. That one confounded even me, but it was such a weird thing that I'm not too defensive about it! I doubt that it will happen again, but it was weird being allowed to redefine the value of zero!

    -PatP

  7. #7
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Yes

    I did get the @@Error from pats coding and I looked it up on the internet after I did a post here and that helped me to determine how to better use it and troubleshoot. I do love Google..sometime Books online does not give you enough information. Also you guys those Transact SQL books youi refered me to are awesome. they answer alot of question and are a wonderful source of info on programming (for those of us new to the programming concept)

  8. #8
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Talking Error Success

    works great guys thanks again

Posting Permissions

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