Here is my create table and this is the error I am getting
DROP TABLE IF EXISTS `teamfocus_dbo`.`sysdiagrams`;
CREATE TABLE `teamfocus_dbo`.`sysdiagrams` (
`name` VARCHAR(128) NOT NULL,
`principal_id` INT(10) NOT NULL,
`diagram_id` INT(10) NOT NULL AUTO_INCREMENT,
`version` INT(10) NULL,
`definition` VARBINARY(-1) NULL,
PRIMARY KEY (`diagram_id`),
UNIQUE INDEX `UK_principal_name` (`principal_id`, `name`)
)
ENGINE = INNODB;
ERROR
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1) NULL,
PRIMARY KEY (`diagram_id`),
UNIQUE INDEX `UK_principal_name` (`pri' at line 6
I even tried to take out the UNIQUE line and still erroring…any ideas
-1isn’t a valid length forVARBINARYfor most databases:SQL Server:
http://msdn.microsoft.com/en-us/library/ms188362.aspx
MySQL: http://dev.mysql.com/doc/refman/5.0/en/binary-varbinary.html
Refers to
VARCHARwhich provides the following limits:http://dev.mysql.com/doc/refman/5.0/en/char.html