mysql - Setting Auto_Increment to start from 1000 when creating table -
i want table's primary key start number 1000 instead of default. read around here , answer declare increment value when creating table follows:
auto_increment = 1000;
i tried when create
table returns syntax error. of course make changes on phpmyadmin
want on create
instead. please advice wrong. thanks.
create table if not exists departments ( dept_id int auto_increment=1000, -- equals sign returns syntax error. dept_name varchar(255), dept_address varchar(255), dept_tel int, primary key (dept_id) );
the starting point must specified table option:
create table if not exists departments ( dept_id int auto_increment, dept_name varchar(255), dept_address varchar(255), dept_tel int, primary key (dept_id) ) auto_increment=1000;
you can see full syntax creating table here
Comments
Post a Comment