all groups > sql server (alternate) > december 2003 >
You're in the

sql server (alternate)

group:

Running a SQL file from OSQL command line utility


Running a SQL file from OSQL command line utility Murtix Van Basten
12/27/2003 9:40:17 PM
sql server (alternate):
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.

Re: Running a SQL file from OSQL command line utility Murtix Van Basten
12/27/2003 10:01:56 PM
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.

[quoted text, click to view]

Re: Running a SQL file from OSQL command line utility Hari Prasad
12/28/2003 8:28:01 AM
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






[quoted text, click to view]

AddThis Social Bookmark Button