Updating multiple rows.

  • OK, still no luck but am looking into looping through each record using cursors.

    Antares686 et al who suggested the same, I have tried joining to the inserted table but to no avail (and the MobID field will never be null.)

    J Houston, the temp table solution you offered only seems to add an extra step before hitting the problem. retrieving the values is no bother, it's the fact that the update query won't run on anything apart from a single row. As soon as there are two or more records that need to be rectified SQL has a little cry.

    Am thinking the only way forward is to code an SP that'll rectify the records one by one. Thanks for your help everyone, keep sending solutions if you have them and i'll post when I've succeeded in my efforts to teach this piece of software that it will do as it's told...

     

    Cheers, Paul

  • Ok I did a test and had no issues. Do you still get the error with the CREATE TRIGGER I suggested or is it something else wrong. What is happening or not happening that you are expecting as I seem to have lost why you are having an issue with my Trigger spec and I cannot duplicate. Do you happen to have more than  one INSERT triggered trigger or an UPDATE Trigger on the table as well?

  • Have written an SP that does what I need, thanks to people for suggesting cursors. Antares, I don't know why your trigger didn't work on my table as it all seemed logical and I could see no reason for it not to work. I have an update trigger but all it does is check if a few bit fields have changed from 0 to 1 and if so fill in a date time stamp, and when something is changed it fills in a text field with the local user name. Thanks for your help tho, i'll try to keep any further problems clearer.

    Cheers Paul

Viewing 3 posts - 16 through 17 (of 17 total)

You must be logged in to reply to this topic. Login to reply