Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Weird SQL Server 2005 Sybase interaction [modified]

Weird SQL Server 2005 Sybase interaction [modified]

Scheduled Pinned Locked Moved Database
databasehelpsql-serversysadmindebugging
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jchalfant
    wrote on last edited by
    #1

    How's this for weird? One of my co-workers was attempting to develop an update trigger for an application that is developed using power-builder and (as far as I can tell) communicates to the database through a Sybase layer. The application is talking to a SQL Server 2005 server with a database set to SQL Server 2000 compatibility level. In the trigger, he is inserting into a table variable and running some logic based on that. The entire trigger runs just fine through all test cases in the DB; however it fails when the update is called from the application. With the error: Row changed between retrieve and update. Not having access to the application source, we couldn't debug very much through the app and Google was not our friend. Through debugging the trigger, we found the insert statement to be the culprit, but only when it insert 0 records into the table variable(we knew the logic below the trigger to be irrelevant as it was commented out). Being curious about the error message, I went ahead and printed @@error before and after the insert; then tested through Management Studio. I received no errors. Still curious, we ran the update through the app. We encountered no errors here either. Eventually we found that printing anything before the insert resolved the issue. In an attempt to figure out the problem, I even tried PRINT char(13)+'(0 row(s) affected)'. It ran with no problem through the app. Happy to be rid of the error, my colleague continued his development; but we're still wondering: "WTF?" What do you guys think? Shall we chalk it up to Sybase oddities or is there a reasonable explanation for this?

    modified on Friday, August 27, 2010 9:47 PM

    M 1 Reply Last reply
    0
    • J jchalfant

      How's this for weird? One of my co-workers was attempting to develop an update trigger for an application that is developed using power-builder and (as far as I can tell) communicates to the database through a Sybase layer. The application is talking to a SQL Server 2005 server with a database set to SQL Server 2000 compatibility level. In the trigger, he is inserting into a table variable and running some logic based on that. The entire trigger runs just fine through all test cases in the DB; however it fails when the update is called from the application. With the error: Row changed between retrieve and update. Not having access to the application source, we couldn't debug very much through the app and Google was not our friend. Through debugging the trigger, we found the insert statement to be the culprit, but only when it insert 0 records into the table variable(we knew the logic below the trigger to be irrelevant as it was commented out). Being curious about the error message, I went ahead and printed @@error before and after the insert; then tested through Management Studio. I received no errors. Still curious, we ran the update through the app. We encountered no errors here either. Eventually we found that printing anything before the insert resolved the issue. In an attempt to figure out the problem, I even tried PRINT char(13)+'(0 row(s) affected)'. It ran with no problem through the app. Happy to be rid of the error, my colleague continued his development; but we're still wondering: "WTF?" What do you guys think? Shall we chalk it up to Sybase oddities or is there a reasonable explanation for this?

      modified on Friday, August 27, 2010 9:47 PM

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      WTF, who was the evil bastard who architected this abomination. With so many competing and disparate layers you are going to get insane problems like this one! When it come down to the point where the solution is based on a print statement I would want nothing to do with it. run away, run away very fast

      Never underestimate the power of human stupidity RAH

      J 1 Reply Last reply
      0
      • M Mycroft Holmes

        WTF, who was the evil bastard who architected this abomination. With so many competing and disparate layers you are going to get insane problems like this one! When it come down to the point where the solution is based on a print statement I would want nothing to do with it. run away, run away very fast

        Never underestimate the power of human stupidity RAH

        J Offline
        J Offline
        jchalfant
        wrote on last edited by
        #3

        LOL! I've been saying the same thing for three years. Either I'll convince someone that we need to write our own application to replace this one, or hope the vendor moves away from this model.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups