Unix Technical Forum

Re: How to reset auto generated id in a DB2 table

This is a discussion on Re: How to reset auto generated id in a DB2 table within the DB2 forums, part of the Database Server Software category; --> >>> On 6/10/2008 at 4:30 PM, in message <ebf88f96-d8b0-4dfc-85ed-a3a5c44ae4dd@i18g2000prn.googlegroups.com>, <anuritab@gmail.com> wrote: > Hi > Is there a way to ...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-13-2008, 02:58 PM
Frank Swarbrick
 
Posts: n/a
Default Re: How to reset auto generated id in a DB2 table

>>> On 6/10/2008 at 4:30 PM, in message
<ebf88f96-d8b0-4dfc-85ed-a3a5c44ae4dd@i18g2000prn.googlegroups.com>,
<anuritab@gmail.com> wrote:
> Hi
> Is there a way to reset the auto generated id for this table. Drop
> table and recreating does not work.


Seems like that would work, unless you are actually using a SEQUENCE and not
an IDENTITY column.

There is also this option, if it's an IDENTITY column:
ALTER TABLE my_table ALTER COLUMN my_id RESTART WITH 12345;

I would love to see this done automatically if restoring a table (with
replace) using the LOAD utility.
But that's a matter for another day...


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:24 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com