Wednesday, March 7, 2012

DB move from MySQL to MSSQL 2000

Hey everyone!
FYI - I am not a DB admin or a developer but I am responsible for this...
Anyway, I have a 20MB SQL script from a mysql server that contains all of t
he table structures and data from a DB. I need to somehow import this into
a new SQL 2000 DB. I've al
ready modified the syntax of the script to fix what is obviously (to me at l
east) wrong - Comments from '#' to '--' things like that. When I put the .
SQL file into Query Analyzer it spits up all over me complaining about auto_
increment and also with TYP
E=MyISAM. I've realized that mysql is very different from MSSQL in some way
s but I'm not sure where to start. All I have (and will ever have) is the .
SQL file from MySQL. I'm in a situation where I don't have access to a lot
of outside help and I reall
y need to get this data into our MSSQL server. Here's a small chunk of the
MySQL code that I need to import. If this can be made to work I can duplica
te the changes to the rest of the script...
CREATE TABLE `SampleTable` (
`Field1` int(10) NOT NULL auto_increment,
`Field2` int(10) NOT NULL default '0',
`Field3` int(10) NOT NULL default '0',
`Field4` float(5,2) NOT NULL default '0.00',
PRIMARY KEY (`Field1`)
) TYPE=MyISAM AUTO_INCREMENT=11 ;> CREATE TABLE `SampleTable` (
> `Field1` int(10) NOT NULL auto_increment,
> `Field2` int(10) NOT NULL default '0',
> `Field3` int(10) NOT NULL default '0',
> `Field4` float(5,2) NOT NULL default '0.00',
> PRIMARY KEY (`Field1`)
> ) TYPE=MyISAM AUTO_INCREMENT=11 ;
Here is your sample
CREATE TABLE SampleTable (
Field1 int NOT NULL identity(1,1),
Field2 int NOT NULL default 0,
Field3 int NOT NULL default 0,
Field4 numeric(5,2) NOT NULL default 0.00,
PRIMARY KEY (Field1)
)
GO
drop table SampleTable
GO
Bojidar Alexandrov

No comments:

Post a Comment