Identical records

  • Hi, Can anyone tell me how to update one of the two identical records (dups). I'd appreciate any help.

  • hi,

    use set rowcount 1 before the update, and only one row will be updated. (remember to use set rowcount 0 to display both records afterwards !)

    Paul

  • You can use a cursor and the 'WHERE CURRENT OF' clause in your update.

  • Here's a bad answer... update it in enterprise manager or some other interface where you can selectively update the record.

    The real question is why do you have dup records? Are there no keys? In order to prevent an update statement from updating both/all records you will need one or more unique columns to distinguish the record from its twin.

  • Thank you all for such a quick response. I've used ripg1011 direction and it worked. I'm trying to assign PK's to a table that did not have one assigned and therefor had dup issues.

    Thanks again,

Viewing 5 posts - 1 through 4 (of 4 total)

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