Re: solved mySQL to MSSQL partially now i need a quick TSQL solution to solve the end part ( is there a Kalen Delany over here :-)
From: John Bell (jbellnewsposts_at_hotmail.com)
Date: 02/05/05
- Next message: Roji. P. Thomas: "Re: automaticly create a record's field"
- Previous message: authorking: "automaticly create a record's field"
- In reply to: M. Posseth: "solved mySQL to MSSQL partially now i need a quick TSQL solution to solve the end part ( is there a Kalen Delany over here :-)"
- Next in thread: M. Posseth: "Re: solved mySQL to MSSQL partially now i need a quick TSQL solution to solve the end part ( is there a Kalen Delany over here :-)"
- Reply: M. Posseth: "Re: solved mySQL to MSSQL partially now i need a quick TSQL solution to solve the end part ( is there a Kalen Delany over here :-)"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 5 Feb 2005 10:22:15 -0000
Hi
If this is a one off you may want to try something like:
For an output file per input file (should be zero length if worked!):
FOR %f IN ("*.sql") DO osql -U <UserName> -P <password> -S <Server> -d
<Database> -n -i %f -o %~nf.txt
For a single output file (using a trusted connection on the default
instance):
for %i in (*.sql) do osql -E -d <database> -n -i%i >> outputfile.txt
or a quicker method as it does not create a new connection for each file is
to list the files in a script using the :r option
for %i in (*.sql) do echo :r %i >> Myfiles.sql
osql -E -d <database> -n -i MyFiles.sql -o outputfile.txt
John
"M. Posseth" <michelp@nohausystems.nl> wrote in message
news:cu26an$2sr$1@reader11.wxs.nl...
> Hi ,,,
>
>
> It is me again the guy that wanted to import a MYSQL dump file into MSSQL
> server
>
> The problem was that this file is 7 GB big and i could not even open it in
> the query analyzer ( or even in notepad :-) ) also the SQL syntax of
> MYSQL
> is different as MSSQL
>
>
> However that part is now solved as i am also a Visual studio Programmer i
> wrote a program that can open the 7 GB dump file and that will make a
> syntax
> change from MYSQL to SQL wich Microsoft`s SQL server seems to understand
> :-)
>
>
> well what the heck is now my problem ???
>
>
> Well that 7 GB file is now chopped in a few hundred small SQL files (
> wich
> i tested a few in SQL server query analyzer and do work in MSSQL server )
> i would like to know the folowing
>
> 1. is it possible to write a stored procedure that can execute these IO
> based SQL scripts , and how ?
>
> 2. or can i use OSQL to load these scripts to my sql server ??
>
> and then the most important question how big can i make these files ,,, at
> this moment i limited them to 10.000 records but there are millions in
> the
> original MYSQL file ( 28 million i believe )
>
>
> maybe it is possible to skip the hole IO thingy and execute the SQL direct
> through a SQL connection however then again the question is how big can i
> make the string to send through the wire
>
> Hope that a Pseudo Kalen will stand up and can answer this for me
>
>
> after i finished this project i will write a nice GUI wrapper around it
> and
> publish the source and exe for who might be interested in this solution (
> import a MYSQL dump to MSSQL )
>
>
> Michel Posseth [MCP]
>
>
>
- Next message: Roji. P. Thomas: "Re: automaticly create a record's field"
- Previous message: authorking: "automaticly create a record's field"
- In reply to: M. Posseth: "solved mySQL to MSSQL partially now i need a quick TSQL solution to solve the end part ( is there a Kalen Delany over here :-)"
- Next in thread: M. Posseth: "Re: solved mySQL to MSSQL partially now i need a quick TSQL solution to solve the end part ( is there a Kalen Delany over here :-)"
- Reply: M. Posseth: "Re: solved mySQL to MSSQL partially now i need a quick TSQL solution to solve the end part ( is there a Kalen Delany over here :-)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|