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 the 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 least) 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 ways 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 duplicate 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
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment