MS SQL - > MySQL Question

Jeff Mings jeffm at lava.net
Sun Apr 1 20:01:02 PDT 2001


Warren, I haven't used phpmyadmin much, since I prefer doing things w/ 
MySQL at the prompt, but it looks like he's either using M$ SQL syntax, 
or SQL proper.  MySQL uses a rigidly defined implementation of SQL, and 
I think that there are still a few tiny bits of SQL that it doesn't 
understand.  As an example, here's a batch file that I piped into 
mysqladmin to create a table:

USE ClientsTable;
Create Table Users (HRAID INT, FirstName VARCHAR(25), LastName VARCHAR(25),
Password VARCHAR(20), PassHint VARCHAR(100), SendInfo TINYINT UNSIGNED, AccessLevel VARCHAR(15),
ZipCode MEDIUMINT, Plus4 SMALLINT, Email VARCHAR(80), LastLogin Date, Logins INT ,
 PlacedBy VARCHAR(50) , UserNum INT UNSIGNED NOT NULL AUTO_INCREMENT, PRIMARY KEY(UserNum));

You can see that the use of parentheses, "GO" and a few other things are 
different.  I think he'll just need to download the manual and convert 
the SQL script by hand.

-Jeff


Warren Togami wrote:

> Can anyone help this guy out?
> (Post from MPLUG)
> ----------------
> 
> MS SQL - > MySQL Question
> 
> I am trying to convert a MS SQL 7 database into a mySQL database. The first
> thing I need to do, I think, is get the table structure .sql script from MS
> SQL, which I have include a portion of below:
> 
> 
> CREATE TABLE [dbo].[FAQTopics]
> 
> [FAQID] [int] IDENTITY (1, 1) NOT NULL ,
> [FAQDescription] [char] (100) NOT NULL
> ) ON [PRIMARY]
> GO
> 
> CREATE TABLE [dbo].[Files]
> 
> [FileID] [int] IDENTITY (1, 1) NOT NULL ,
> [ManuID] [int] NULL ,
> [ModelID] [int] NULL ,
> [FileStatusID] [int] NULL ,
> [FileURL] [text] NULL ,
> [FileTitle] [text] NULL ,
> [FileDescription] [text] NULL ,
> [Date] [datetime] NULL
> ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
> GO
> 
> When I use phpMyAdmin to execute this part of the script, or the entire
> script, I get the error: MySQL said: You have an error in your SQL syntax
> near '[dbo].[FAQTopics] ( [FAQID] [int] IDENTITY (1, 1) NOT NULL ,
> [FAQDescription' at line 1
> 
> 
> So, I assume its a format error. What is/are the problem(s) and how can I
> fix them? Is there a way to have MS SQL output the correct sql script?



More information about the LUAU mailing list