Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL error - Incorrect table definition; there can be only one auto column

Tags:

sql

mysql

What is wrong with this SQL, -> ); ERROR 1075 (42000): Incorrect table definition; there can be only one auto column

SQL

CREATE TABLE TABLENAME12
(
TAB_ID INT NOT NULL AUTO_INCREMENT,

NAME_FIRST NVARCHAR(200),
TYPE NVARCHAR(200)

);

I am using mysql, how can I solve this. I am trying to create a table. and I get this error

like image 383
Illep Avatar asked Jul 24 '12 12:07

Illep


1 Answers

You must specify AUTO_INCREMENT column as PRIMARY KEY try:

CREATE TABLE TABLENAME12
(
 TAB_ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
 NAME_FIRST NVARCHAR(200),
 TYPE NVARCHAR(200)
);
like image 142
Omesh Avatar answered Sep 24 '22 01:09

Omesh