Re: Reset Auto-Incriment?

2004-01-26 Thread Chris Elsworth
On Mon, Jan 26, 2004 at 10:40:02AM -0600, Paul Fine wrote:
> I realize that this might be problematic/devastating if you had an AI PK and
> did this, however in my case there is no problem as there is no related data
> in the database yet lol.
> 
> My question is, how can I reset AI? For example I deleted several rows and
> now my AI starts with the AI number after the last row that was deleted. Ie.
> 1,2,3,4,9,10,11 when I want to start numbering at 5 not 9!

Use:
ALTER TABLE foo AUTO_INCREMENT = $x

Doesn't seem to be documented here, but it's in a comment at the
bottom:
http://www.mysql.com/doc/en/ALTER_TABLE.html

-- 
Chris

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Reset Auto-Incriment?

2004-01-26 Thread Paul Fine
I realize that this might be problematic/devastating if you had an AI PK and
did this, however in my case there is no problem as there is no related data
in the database yet lol.

My question is, how can I reset AI? For example I deleted several rows and
now my AI starts with the AI number after the last row that was deleted. Ie.
1,2,3,4,9,10,11 when I want to start numbering at 5 not 9!

Even if I insert/update with non-nulls then the sequence is still pushed
ahead. 

Is there a way to reset this?



Thanks!


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]