Re: Migrate from MS SQL 6.5 to postgres?? - Mailing list pgsql-general

From Gordon A. Runkle
Subject Re: Migrate from MS SQL 6.5 to postgres??
Date
Msg-id 97kpha$260r$1@news.tht.net
Whole thread Raw
In response to Re: Migrate from MS SQL 6.5 to postgres??  (martin.chantler@convergys.com)
List pgsql-general
In article <OFB13C2AF2.443BAB84-ON80256A00.003E8B1C@cbis.com>, "Unknown"
<martin.chantler@convergys.com> wrote:

> I have an idea that might help I found ODBC to be very slow for
> importing data So I wrote a program in C that reads in dump files of SQL
> text on the Linux server itself E.G. first line is a create table, next
> lines are all the insert's This is very fast, 80mb of data in about 15
> minutes Only problem is the text files need to be formatted a bit
> specially If you can write a program in say VB to create the text files
> (one per table) it could work. If you are interested I could forward my
> C program and Foxpro prg that creates the text files that you could
> convert to VB

Why make it so difficult?  SQL Server provides a perfectly
usable bulk copy utility (bcp.exe), which will haul the data
out ready-to-go.

H:\tmp> bcp dbname..tabname out filename.del -c -t "|" -r "\n" \
-S server -U user -P password

This will pull the data out, with '|' as the field delimiter
and a newline as a record separator.

Now you can COPY the data in using '|' as the delimiter.

If you have BLOB data types, those tables will have to
be handled in another way, of course.

Gordon.
--
It doesn't get any easier, you just go faster.
   -- Greg LeMond

pgsql-general by date:

Previous
From: "Steff"
Date:
Subject: trouble with some characters
Next
From: "Stephen Livesey"
Date:
Subject: RE: Slowdown problem when writing 1.7million records