BREZ Posted July 31, 2009 Share Posted July 31, 2009 :facewall:Me old head is sore! My .sql file is 20Mb in size and keeps timing out on import. I tried uploading the first table on its own with this error as a result. Error SQL query: Documentation -------------------------------------------------------- -- -- Program Version 3.0.117 IF NOT EXISTS ( SELECT * FROM master.dbo.sysdatabases WHERE name = N 'irishavs_list01' ) CREATE DATABASE [irishavs_list01] USE [irishavs_list01] MySQL said: Documentation #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 '---------------------------------------------------------- -- Program Version 3' at line 1 Quote Link to comment https://forums.phpfreaks.com/topic/168326-1024-syntax-error/ Share on other sites More sharing options...
bundyxc Posted July 31, 2009 Share Posted July 31, 2009 Try this: IF NOT EXISTS ( SELECT * FROM master.dbo.sysdatabases WHERE name = N 'irishavs_list01' ) CREATE DATABASE [irishavs_list01] USE [irishavs_list01] Quote Link to comment https://forums.phpfreaks.com/topic/168326-1024-syntax-error/#findComment-887986 Share on other sites More sharing options...
BREZ Posted August 1, 2009 Author Share Posted August 1, 2009 Pardon my old eyes but.... Is that not exactly the same? Without the CREATE and USE i get an 1064 SQL query: Documentation -------------------------------------------------------- -- -- Program Version 3.0.117 IF NOT EXISTS ( SELECT * FROM master.dbo.sysdatabases WHERE name = N 'irishavs_list01' ) MySQL said: Documentation #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 '---------------------------------------------------------- -- Program Version 3' at line 1 Quote Link to comment https://forums.phpfreaks.com/topic/168326-1024-syntax-error/#findComment-888029 Share on other sites More sharing options...
Philip Posted August 1, 2009 Share Posted August 1, 2009 A comment (--) needs to have a space after the first 2 hyphens. -- -------------------------------------------------------- -- Program Version 3.0.117 IF NOT EXISTS ( SELECT * FROM master.dbo.sysdatabases WHERE name = N 'irishavs_list01' ) CREATE DATABASE [irishavs_list01] USE [irishavs_list01] Quote Link to comment https://forums.phpfreaks.com/topic/168326-1024-syntax-error/#findComment-888080 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.