What is wrong with this?
CREATE TABLE IF NOT EXISTS `Service Manager`.`Company` (
`Company_ID` INT(6) UNSIGNED NOT NULL AUTO_INCREMENT ,
`GUID` CHAR(32) UNSIGNED NOT NULL ,
`Region_ID` INT(6) UNSIGNED NOT NULL ,
`name` VARCHAR(45) NOT NULL ,
`inactive` TINYINT NOT NULL ,
PRIMARY KEY (`Company_ID`) ,
UNIQUE INDEX `name` (`name` ASC) ,
UNIQUE INDEX `GUID` (`GUID` ASC) )
ENGINE = InnoDB;
ERROR 1064 (42000): 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 ‘UNSIGNED NOT NULL ,
Region_IDINT(6) UNSIGNED NOT NULL ,
nameVARCHAR(45′ at line 3
I think you probably don’t want the
UNSIGNEDqualifier on theCHARcolumn.See MySQL 5.0 Reference Manual :: 11 Data Types :: 11.1 Data Type Overview :: 11.1.6 String Types :: 11.1.6.1 The CHAR and VARCHAR Types for more.