0

I am currently preparing a migration from MSSQL to MYSQL using MYSQL workbench.

The error I am receiving is as follows.

ERROR: Error executing 'CREATE TABLE IF NOT EXISTS `dbo`.`VendorGTG` (
  `VID` INT NOT NULL COMMENT '',
  `Attending` TINYINT(1) NULL DEFAULT 0 COMMENT '',
  `Name1` VARCHAR(50) NULL COMMENT '',
  `Name2` VARCHAR(50) NULL COMMENT '',
  `Inserted` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
  `NameTag` TINYINT(1) NULL DEFAULT 0 COMMENT '',
  PRIMARY KEY (`VID`)  COMMENT '')'
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 'COMMENT '')' at line 8.
SQL Error: 1064
5
  • @TTeeple Please read questions carefully before suggesting edits like that. This question DOES relate to SQL Server. Commented Aug 5, 2015 at 12:15
  • @DavidG I would argue that. OP is migrating from SQL Server but the error in question is MySQL related. Commented Aug 5, 2015 at 12:25
  • @TTeeple And yet the code posted is SQL Server syntax. Either way, it doesn't warrant an edit suggestion to remove the tag. Commented Aug 5, 2015 at 12:27
  • @DavidG COMMENT, TINYINT(1), encasing all the columns in quotes, that all screams MySQL syntax to me. Commented Aug 5, 2015 at 12:31
  • @TTeeple Because it's only partially converted from SQL Server syntax. Check my answer. Commented Aug 5, 2015 at 12:33

2 Answers 2

1

MySQL doesn't have schemas like SQL Server, so remove that from your code:

CREATE TABLE IF NOT EXISTS VendorGTG (
  `VID` INT NOT NULL COMMENT '',
  `Attending` TINYINT(1) NULL DEFAULT 0 COMMENT '',
  `Name1` VARCHAR(50) NULL COMMENT '',
  `Name2` VARCHAR(50) NULL COMMENT '',
  `Inserted` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
  `NameTag` TINYINT(1) NULL DEFAULT 0 COMMENT '',
  PRIMARY KEY (`VID`)  COMMENT '')
Sign up to request clarification or add additional context in comments.

Comments

0

Problem is with COMMENT '' - just remove all occurence of that. Feel free to leave a comment under this bug http://bugs.mysql.com/bug.php?id=77910 We're working on it to fix it.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.