sql if else doesnt work...

Results 1 to 3 of 3
  1. #1
    Hardcore Member tairasan is offline
    MemberRank
    Mar 2018 Join Date
    104Posts

    sql if else doesnt work...

    hey guys i wanted to change an if else in an existing sql procedure (from a game) but i cant get it to work and i dont know why...

    this is the old code (works)



    ------------------

    this is the code when i made 1 change (doesnt work as you can see in the error)



    ------------------

    here i added begin and end into the if and else if + made all the changes that i want too. i can save the code but when i go into the game and create a char to execute the code, the spawnid, body, pants, hand and foot from the IF work but i get the wdir from the ELSE IF (845) but i need it from the IF (439)....
    i really dont know why the code is "mixing" things...



  2. #2
    Account Upgraded | Title Enabled! Wokki is offline
    True MemberRank
    Aug 2008 Join Date
    FinlandLocation
    723Posts

    Re: sql if else doesnt work...

    You could try using BEGIN TRY to catch any errors. See this for example.
    https://stackoverflow.com/a/6376908
    Last edited by Wokki; 14-05-18 at 09:19 PM.

  3. #3
    Hardcore Member tairasan is offline
    MemberRank
    Mar 2018 Join Date
    104Posts

    Re: sql if else doesnt work...

    ok nvm i found the problem after watching over the code again today for 10minutes xD



Advertisement