There are a number of syntax differences between MSSQL and MySQL ... if you
are going to be doing a lot of conversion work, grab a copy of MS's help
file so you can compare it to the functions in the MySQL manual.
To answer you question more directly, MySQL doesn't need the dbo (database
object) prefix, and treats autoincrementing and setting the primary key
differently.
This script creates your tables in MySQL:
CREATE TABLE Articles (
ArticleID int (1) NOT NULL auto_increment,
Title char (100) NOT NULL ,
AuthorID int NOT NULL ,
Date datetime NOT NULL ,
SubjectID int NOT NULL ,
Pages int NOT NULL ,
Image text NOT NULL ,
ManuID int NULL ,
Publish char (10) NULL ,
BuyText char (100) NULL ,
BuyLink text NULL,
PRIMARY KEY (ArticleID)
);
CREATE TABLE Authors (
AuthorID int (1) NOT NULL auto_increment,
AuthorName char (50) NOT NULL ,
AuthorEmail char (50) NOT NULL,
PRIMARY KEY (AuthorID)
);
G. Jensen
----- Original Message -----
From: "Ryan Shrout" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, April 01, 2001 2:28 AM
Subject: SQL Import on MySQL
I have a SQL file that I generated on MS SQL 7. The file looks like this (a
portion):
CREATE TABLE [dbo].[Articles] (
[ArticleID] [int] IDENTITY (1, 1) NOT NULL ,
[Title] [char] (100) NOT NULL ,
[AuthorID] [int] NOT NULL ,
[Date] [datetime] NOT NULL ,
[SubjectID] [int] NOT NULL ,
[Pages] [int] NOT NULL ,
[Image] [text] NOT NULL ,
[ManuID] [int] NULL ,
[Publish] [char] (10) NULL ,
[BuyText] [char] (100) NULL ,
[BuyLink] [text] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
CREATE TABLE [dbo].[Authors] (
[AuthorID] [int] IDENTITY (1, 1) NOT NULL ,
[AuthorName] [char] (50) NOT NULL ,
[AuthorEmail] [char] (50) NOT NULL
) ON [PRIMARY]
GO
I am using phpMyAdmin and attempting to run the SQL query on the database
that has already been created. I get the error: MySQL said: You have an
error in your SQL syntax near '[dbo].[Articles] ( [ArticleID] [int] IDENTITY
(1, 1) NOT NULL , [Title] [cha' at line 1
What is the syntax problem that I am missing? And can I make MS SQL output
the sql file in the correct way?
Ryan Shrout
Athlonmb.com
Production Manager
http://www.athlonmb.com/
[EMAIL PROTECTED]
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php