Rana
Rana

Reputation: 178

I have a *.sql file from MSSQL I am need To import it to MySQL

I have a .sql file from MS-SQL i am trying to import it into MySQL from PHP-My-admin but there showing error for max size i've also change it form php.ini but showing same error. I also tried from command prompt but there also showing error in 21 Line. I pasting here 21 line to 32. how can i do it.

DROP TABLE [dbo].[ACDProcessGradeSheet]
GO
CREATE TABLE [dbo].[ACDProcessGradeSheet] (
[ProcessID] int NOT NULL IDENTITY(1,1) ,
[SessionID] int NULL ,
[ExaminationID] int NULL ,
[IsComplete] bit NULL ,
[CreatedBy] uniqueidentifier NULL ,
[CreatedDate] datetime NULL ,
[ModifiedBy] uniqueidentifier NULL ,
[ModifiedDate] datetime NULL 
)

Upvotes: 0

Views: 58

Answers (1)

Sjoerd
Sjoerd

Reputation: 1754

IDENTITY is not a MySQL command. You have to do like this:

CREATE TABLE [dbo].[ACDProcessGradeSheet] (
[ProcessID] int NOT NULL auto_increment ,
... //rest of the fields here
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

I have used InnoDB as engine adn latin as default charset, but you should use the engine and charset that suites your needs.

Also I'm not sure about the brackets. Use none or ` if needed. And uniqueidentifier does not exists in mysql. See this website for a mapping of the MSSQL data types to the MySQL data types: http://dev.mysql.com/doc/workbench/en/wb-migration-database-mssql-typemapping.html

Upvotes: 1

Related Questions