List Info

Thread: Issue ID : how to start with a custom ID




Issue ID : how to start with a custom ID
user name
2006-10-02 08:19:52
Hello,

 

Is it possible to start issue ID from a specific number?

I suppose this ID is managed in the database and controlled
with an auto-increment.

So, how can I configure database to start auto-increment
from xxx?

 

Kd rgds,

 

J LAVIGNE

 

Issue ID : how to start with a custom ID
user name
2006-10-02 08:33:14
On Mon, 2 Oct 2006 10:19:52 +0200
Jérôme Lavigne <jerome.lavignestreamezzo.com> wrote:

> Hello,
> 
>  
> 
> Is it possible to start issue ID from a specific
number?
> 
> I suppose this ID is managed in the database and
controlled with an
> auto-increment.
> 
> So, how can I configure database to start
auto-increment from xxx?
> 


From the manual:
h
ttp://dev.mysql.com/doc/mysql/en/CREATE_TABLE.html
AUTO_INCREMENT
The initial AUTO_INCREMENT value for the table. This works
for MyISAM
only. To set the first auto-increment value for an InnoDB
table, insert
a dummy row with a value one less than the desired value
after creating
the table, and then delete the dummy row.


For MyISAM:
CREATE TABLE xxx (id int NOT NULL auto_increment, title
varchar(20), PRIMARY KEY(id)) AUTO_INCREMENT=1000
TYPE=MyISAM;


And for InnoDB:
CREATE TABLE xxx (id int NOT NULL auto_increment, title
varchar(20),
PRIMARY KEY(id)) TYPE=InnoDB; 

INSERT INTO xxx (999, 'dummy');
DELETE FROM xxx WHERE nyckel=999;




+-------------------------------------------------------+
  Jostein Martinsen
  System developer, Redpill AB
  Tel: 0734-241 475, 054-4005 142 
  E-mail: jostein.martinsenredpill.se
 

-- 
Eventum Users Mailing List
For list archives: http://lists.mys
ql.com/eventum-users
To unsubscribe:    http:
//lists.mysql.com/eventum-users?unsub=bondyahoo.com

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )