Restart Identity Column Dynamically

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gags
    New Member
    • Nov 2011
    • 1

    #1

    Restart Identity Column Dynamically

    DB2 LUW 9.5
    Context : Loaded the data for over 100 tables and all with the identity columns. I can go over all the tables manually and find max and can use the alter table alter column restart command but wondering if there's a possibility to just write a stored proc that will take the input as SCHEMA name and will find the tables with identity columns and alter them and restart the identifier.

    Looking for a very similar solution to what Serge Rielau has provided in this post:http://bytes.com/topic/db2/answers/1...entity-counter,but with an extension to it for multiple tables and with just one input of SCHEMA name.
    Last edited by Gags; Nov 14 '11, 04:56 PM. Reason: Added more info
Working...