[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: mssql database to free database



* Matt Fair (matt@netasol.com) spake thusly:
> Hello,
> I am converting an ASP Visual Basic application to run on a linux machine.  I 
> downloaded the trial version of Chilisoft and got the ASP working, now I want 
> to have the database be mysql or postgresql.  Does anyone know of a 
> conversion utility for mssql database to either mysql or postgresql?  Or 
> would I just have to setup a database and just use mysql or postgresql?  What 
> are the sql syntax between Microsoft's and other?  Are there?  I know mysql 
> doesn't support transactions, so maybe postgresql is the only option that I 
> have since it is a standard sql database, is mssql one?
> Any help would be greatly appreciated.
> Thanks
> Matt

Most SQL servers have ways of loading data from file. RTFM to find out
how postgresql does it. If all else fails, you can always dump your 
tables into text files and run them through a little awk/perl/whatever
script to turn the rows into INSERT statements.

Off the top of my head:
#!/usr/bin/perl -w
while( $line = <> ) {
  chomp $line;
  @fields = split /\s+/, $line;
  print "INSERT INTO newtable VALUES (\'$fields[0]\', $fields[1], ... );";
}

Dima
-- 
E-mail dmaziuk at bmrb dot wisc dot edu (@work) or at crosswinds dot net (@home)
http://www.bmrb.wisc.edu/descript/gpgkey.dmaziuk.ascii -- GnuPG 1.0.4 public key
One distinguishing characteristic of BOFHen is attention deficit disorder.  
Put me in front of something boring and I can find a near-infinite number 
of really creative ways to bugger off.                  -- Antony De Boer in asr



Reply to: