Connecting Tech Pros Worldwide Forums | Help | Site Map

Running a SQL file from OSQL command line utility

Murtix Van Basten
Guest
 
Posts: n/a
#1: Jul 20 '05
Hi,

I have dumped a very large database from mysql (using mysqldump program)
as a raw sql file. The reason was, convert this database to a MSSQL
database. Since mysqldump creates the file as raw sql file with the
database-table structures and the data in it, I thought using OSQL command
line utilities should work to out this whole database in MSSQL server.

I have run this command from command line:

osql -u sa -i mysqldump.sql

It is going since yesterday. It has been almost 36 hours that it's
started. And in the mssql server, I see no database created yet. On the
screen of the command line, I see bunch of numbers are going in order. I
assume they are row numbers of the tables processed. But, if it is doing it,
then where is it saving all this data ? I have checked the tempdb, pub db,
other dbs, and I see no tables related to the database I am inserting. Will
it populate it at the and of the job ? Or, am I doing something wrong here
?

Regards.

Murtix.



Hari Prasad
Guest
 
Posts: n/a
#2: Jul 20 '05

re: Running a SQL file from OSQL command line utility


Hi ,

You cant use that file (generated using MYSQLDUMP) directly in MSSQL using
OSQL. This raw file can be used only in MYSQL incase you need a recovary.
OSQL program can take only TSQL commands.

The solution for you is:

1. Create a database in MSSQL server Manually
2. Use DTS to transfer Tables to MSSQL Server

If your table size is very huge , generate a text file in MYSQL for each
tables and use BCP IN to load inside MSSQL.

Thanks
Hari
MCDBA






"Murtix Van Basten" <nospam@nospam.org> wrote in message
news:3fee42a7$1_3@athenanews.com...[color=blue]
> Hi,
>
> I have dumped a very large database from mysql (using mysqldump[/color]
program)[color=blue]
> as a raw sql file. The reason was, convert this database to a MSSQL
> database. Since mysqldump creates the file as raw sql file with the
> database-table structures and the data in it, I thought using OSQL command
> line utilities should work to out this whole database in MSSQL server.
>
> I have run this command from command line:
>
> osql -u sa -i mysqldump.sql
>
> It is going since yesterday. It has been almost 36 hours that it's
> started. And in the mssql server, I see no database created yet. On the
> screen of the command line, I see bunch of numbers are going in order. I
> assume they are row numbers of the tables processed. But, if it is doing[/color]
it,[color=blue]
> then where is it saving all this data ? I have checked the tempdb, pub db,
> other dbs, and I see no tables related to the database I am inserting.[/color]
Will[color=blue]
> it populate it at the and of the job ? Or, am I doing something wrong[/color]
here[color=blue]
> ?
>
> Regards.
>
> Murtix.
>
>[/color]


Murtix Van Basten
Guest
 
Posts: n/a
#3: Jul 20 '05

re: Running a SQL file from OSQL command line utility


Hi Hari,

all the pain I suffered to do this, was because of not to use BCP method.
I guess I will have to use it after finding out osql methid would not work.

Thank you clearifying this issue for me.

Best Regards.

Murtix.

"Hari Prasad" <hari_prasad_k@hotmail.com> wrote in message
news:Oaj1x2OzDHA.1412@TK2MSFTNGP11.phx.gbl...[color=blue]
> Hi ,
>
> You cant use that file (generated using MYSQLDUMP) directly in MSSQL using
> OSQL. This raw file can be used only in MYSQL incase you need a recovary.
> OSQL program can take only TSQL commands.
>
> The solution for you is:
>
> 1. Create a database in MSSQL server Manually
> 2. Use DTS to transfer Tables to MSSQL Server
>
> If your table size is very huge , generate a text file in MYSQL for each
> tables and use BCP IN to load inside MSSQL.
>
> Thanks
> Hari
> MCDBA
>
>
>
>
>
>
> "Murtix Van Basten" <nospam@nospam.org> wrote in message
> news:3fee42a7$1_3@athenanews.com...[color=green]
> > Hi,
> >
> > I have dumped a very large database from mysql (using mysqldump[/color]
> program)[color=green]
> > as a raw sql file. The reason was, convert this database to a MSSQL
> > database. Since mysqldump creates the file as raw sql file with the
> > database-table structures and the data in it, I thought using OSQL[/color][/color]
command[color=blue][color=green]
> > line utilities should work to out this whole database in MSSQL server.
> >
> > I have run this command from command line:
> >
> > osql -u sa -i mysqldump.sql
> >
> > It is going since yesterday. It has been almost 36 hours that it's
> > started. And in the mssql server, I see no database created yet. On the
> > screen of the command line, I see bunch of numbers are going in order. I
> > assume they are row numbers of the tables processed. But, if it is doing[/color]
> it,[color=green]
> > then where is it saving all this data ? I have checked the tempdb, pub[/color][/color]
db,[color=blue][color=green]
> > other dbs, and I see no tables related to the database I am inserting.[/color]
> Will[color=green]
> > it populate it at the and of the job ? Or, am I doing something wrong[/color]
> here[color=green]
> > ?
> >
> > Regards.
> >
> > Murtix.
> >
> >[/color]
>
>[/color]


Closed Thread


Similar Microsoft SQL Server bytes