MySQL Forums
Forum List  »  Microsoft SQL Server

Export from MySQL then Import to MSSQL
Posted by: Henry Veldman
Date: August 27, 2008 12:37PM

I need to copyt many tables from MySQL V5.0 on the server to my PC which has MSSQL
I specify MSSQL compatibility.

When I test in SQL Query Analyser it has several problems:

1) The statement "CREATE TABLE IF NOT EXISTS" has to change to "CREATE TABLE"
2) The tick symbol ` has to changed to a single quote '
3) The table name needs to have the ' removed
4) Then on line 15 I have another (fatal) error.

Here is the code with some comments

-------------------------------

-- Table structure for table 'timeregion'

-- CREATE TABLE IF NOT EXISTS "timeregion" ( -- Error : Original--- IF NOT EXISTS
CREATE TABLE "timeregion" (
"ID" int(11) NOT NULL,
"RegionID" int(11) NOT NULL,
"RegionName" varchar(50) NOT NULL,
--UNIQUE KEY "ID" ("ID","RegionID") ------ Error : Original------- KEY
)
-- AUTO_INCREMENT=8 ; ------ Error : Original------- Auto_Increment

-- Dumping data for table 'timeregion'
--INSERT INTO `timeregion` (`ID`, `RegionID`, `RegionName`) VALUES -- Error : Original-- ` to '
INSERT INTO timeregion ('ID', 'RegionID', 'RegionName') VALUES
(1, 1, 'MI - Bernie'), -- Fatal Error : Line 15: Incorrect syntax near ','.
(2, 2, 'In - Day');

----------------------------------

Advice appriciated

Options: ReplyQuote


Subject
Written By
Posted
Export from MySQL then Import to MSSQL
August 27, 2008 12:37PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.