Création table MySQL

Résolu
Jkai -  
bissdebrazza Messages postés 2065 Date d'inscription   Statut Contributeur Dernière intervention   -
Bonjour,
je ne comprends pas pourquoi cette requête plante :
 CREATE TABLE `Personne_Fonct` (
`Seq` INTEGER NOT NULL AUTO_INCREMENT ,
`Code` INTEGER NOT NULL DEFAULT 0,
`Fonction` VARCHAR( 5 ) ,
`N_Etabli` VARCHAR( 5 ) ,
`N_Adherent` VARCHAR( 6 ) ,
`Dcre` DATETIME,
`User_Cre` VARCHAR( 50 ) ,
`Dmaj` DATETIME,
`User_Maj` VARCHAR( 50 ) ,
`Tel_Port` VARCHAR( 20 )
) TYPE = InnoDB

MySQL a répondu:Documentation
#1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key 

Quelqu'un aurait une solution ?

Merci
A voir également:

4 réponses

Jkai
 
merci bien
0
basshero816 Messages postés 115 Date d'inscription   Statut Membre Dernière intervention   6
 
Salut,
L'erreur est parlante, tu n'as pas attribué de clé primaire à cette table.
Ajoute un primary key pour le premier champ, et tout ira bien.

@+
-1
bissdebrazza Messages postés 2065 Date d'inscription   Statut Contributeur Dernière intervention   712
 
salut!

essai ça!!

CREATE TABLE Personne_Fonct (
Seq INTEGER NOT NULL AUTO_INCREMENT ,
Code INTEGER NOT NULL DEFAULT 0,
Fonction VARCHAR( 5 ) ,
N_Etabli VARCHAR( 5 ) ,
N_Adherent VARCHAR( 6 ) ,
Dcre DATETIME,
User_Cre VARCHAR( 50 ) ,
Dmaj DATETIME,
User_Maj VARCHAR( 50 ) ,
Tel_Port VARCHAR( 20 )
) TYPE = InnoDB

essai de definir une clé primaire!
-1
bissdebrazza Messages postés 2065 Date d'inscription   Statut Contributeur Dernière intervention   712
 
si ça marche,alors n'oubli pas de mettre résolu!!
-1