Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2007
    Posts
    50

    Question Unanswered: reset identity column count

    hello

    is there any other way of resetting the identity column count besides doing an alter column restart with ?
    Also, is it just me or if you do an alter table alter column restart, when doing so it drops all contraints on that table first, then performs the alter table and then recreates the constraints?

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    1) no
    2) I have not seen that happen

    Andy

  3. #3
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    1) What's wrong with the ALTER TABLE ... ALTER COLUMN ... RESTART?
    2) Could you explain to us how you deduced that this is happening?
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  4. #4
    Join Date
    Sep 2007
    Posts
    50
    well, there's nothing wrong with alter column restart, unless it requires special permissions on the executing user (to alter table). Would be nice if there was a way to do that without that sort of permissions.
    about point 2, I didn't deduce that is the case, I just assumed. I was running a stored proc that does:
    delete from table
    alter column restart id
    many inserts ...
    and the job was failing and on the extremely long log I could see attempts to drop all constraints, then beggining a rollback and then attempting to recreate all constraints. Then I removed the alter statements and the job worked fine. I assumed the alter table would cause the drop/recreate constraints and that my user wouldn't have the persmissions (which would trigger the rollback). Again, this was just a long shot trying to explain something I didn't understand and I couldn't find anything to support this theory on the net so I thought I'd ask here. Any help would be greatly appreciated.

  5. #5
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Sorry, I don't get this part: "and on the extremely long log I could see attempts to drop all constraints". How exactly did you see that constraints were dropped? What was the error message you got? And could you also give us a reproducable scenario? I'm just asking because I don't believe that any constraints were dropped at all and that you were seeing some symptoms and may not interpret them correctly.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

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