Neue Tabelle einfügen

irulfs

Grünschnabel
ANFÄNGER !
Hallo
Ich habe versucht eine neue Tabelle in SQL einzufügen.
Die Einträge sollen laut der Importierten Datei so aussehen.

CREATE TABLE tt_calender(
uid int( 11 ) unsigned DEFAULT '0' NOT NULL AUTO_INCREMENT ,
pid int( 11 ) unsigned DEFAULT '0' NOT NULL ,
tstamp int( 11 ) unsigned DEFAULT '0' NOT NULL ,
hidden tinyint( 4 ) unsigned DEFAULT '0' NOT NULL ,
starttime int( 11 ) unsigned DEFAULT '0' NOT NULL ,
endtime int( 11 ) unsigned DEFAULT '0' NOT NULL ,
TYPE tinyint( 4 ) unsigned DEFAULT '0' NOT NULL ,
title tinytext NOT NULL ,
note text NOT NULL ,
date int( 11 ) unsigned DEFAULT '0' NOT NULL ,
datetext varchar( 80 ) DEFAULT '' NOT NULL ,
week tinyint( 4 ) unsigned DEFAULT '0' NOT NULL ,
complete tinyint( 4 ) unsigned DEFAULT '0' NOT NULL ,
workgroup varchar( 80 ) DEFAULT '' NOT NULL ,
responsible varchar( 20 ) DEFAULT '' NOT NULL ,
category int( 11 ) unsigned DEFAULT '0' NOT NULL ,
priority tinyint( 4 ) unsigned DEFAULT '0' NOT NULL ,
link tinytext NOT NULL ,
deleted tinyint( 3 ) unsigned DEFAULT '0' NOT NULL ,
time int( 10 ) unsigned DEFAULT '0' NOT NULL ,
PRIMARY KEY ( uid ) ,
KEY parent( pid )

)

Als Fehler kommt die Meldung
MySQL meldet:
b_help.png


#1067 - Invalid default value for 'uid'

Wer ist so Freundlich und hilft mir ?

Gruß aus Bremen
Ingo
 
Wenn du "DEFAULT '0'" aus der Zeile weglässt, in der die Spalte uid definiert wird, sollte es funktionieren:
Code:
CREATE TABLE tt_calender(
uid int( 11 ) unsigned NOT NULL AUTO_INCREMENT ,
pid int( 11 ) unsigned DEFAULT '0' NOT NULL ,
tstamp int( 11 ) unsigned DEFAULT '0' NOT NULL ,
hidden tinyint( 4 ) unsigned DEFAULT '0' NOT NULL ,
starttime int( 11 ) unsigned DEFAULT '0' NOT NULL ,
endtime int( 11 ) unsigned DEFAULT '0' NOT NULL ,
TYPE tinyint( 4 ) unsigned DEFAULT '0' NOT NULL ,
title tinytext NOT NULL ,
note text NOT NULL ,
date int( 11 ) unsigned DEFAULT '0' NOT NULL ,
datetext varchar( 80 ) DEFAULT '' NOT NULL ,
week tinyint( 4 ) unsigned DEFAULT '0' NOT NULL ,
complete tinyint( 4 ) unsigned DEFAULT '0' NOT NULL ,
workgroup varchar( 80 ) DEFAULT '' NOT NULL ,
responsible varchar( 20 ) DEFAULT '' NOT NULL ,
category int( 11 ) unsigned DEFAULT '0' NOT NULL ,
priority tinyint( 4 ) unsigned DEFAULT '0' NOT NULL ,
link tinytext NOT NULL ,
deleted tinyint( 3 ) unsigned DEFAULT '0' NOT NULL ,
time int( 10 ) unsigned DEFAULT '0' NOT NULL ,
PRIMARY KEY ( uid ) ,
KEY parent( pid )
)
 
Zurück