Quantcast
Channel: MySQL Forums - MySQL Workbench
Viewing all articles
Browse latest Browse all 3737

Error Code: 1064 You have an error in your SQL syntax (no replies)

$
0
0
Message output: "Error Code: 1064 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 'IF NOT EXISTS (SELECT * FROM SYSOBJECTS WHERE NAME='$tablename' and TYPE='U') BE' at line 1"

My script: "IF NOT EXISTS (SELECT * FROM SYSOBJECTS WHERE NAME='$tablename' and TYPE='U') BEGIN CREATE TABLE $tablename (messageid VARCHAR(60) PRIMARY KEY,createdate DATETIME DEFAULT getdate(),serializedmessage TEXT) CREATE INDEX $tablename_index ON $tablename(messageid) END"

I am using MySQL Server 8.0.29

Please help me to write the good syntax.

Viewing all articles
Browse latest Browse all 3737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>