getting error on foreign key

[expired user #7324]'s profile image [expired user #7324] posted 11 years ago in General Permalink
every time I try to add a foreign key get error
create table employee
(
employeeID int not null auto_increment primary key,
name varchar(80),
job varchar(15),
departmentID int not null references department(departmentID)
) type=InnoDB;

sql(1046) SYNTAX error,it does not like InnoDB
can anyone help please?
ansgar's profile image ansgar posted 11 years ago Permalink
What's the exact error message? There is surely more than "Syntax error".
[expired user #7324]'s profile image [expired user #7324] posted 11 years ago Permalink
you have an error in sql syntax check the manual that corresponds to your mysql server versiĆ³n for the right syntax to use near type=InnoDB at line 7
kalvaro's profile image kalvaro posted 11 years ago Permalink
The TYPE keyword was deprecated since MySQL/4.0.18 and was removed in MySQL/5.1.
kalvaro's profile image kalvaro posted 11 years ago Permalink
From 4.x manual:

The ENGINE and TYPE options specify the storage engine for the table. ENGINE was added in MySQL 4.0.18 (for 4.0) and 4.1.2 (for 4.1). It is the preferred option name as of those versions, and TYPE has become deprecated. TYPE is supported throughout the 4.x series, but likely will be removed in the future.

I suppose you're generating the code manually rather than reporting an issue with HeidiSQL table editor.

Please login to leave a reply, or register at first.