pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <ringerc@ringerc.id.au>
To: karthi keyan <karthi2itnet@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Data migration to sql server 2008
Date: Wed, 08 Aug 2012 14:57:05 +0800
Message-ID: <50220DC1.8030007@ringerc.id.au> (raw)
In-Reply-To: <CAM-vHq+wi0jckw+-mHFJeX98FGutkmSPcDnYR75yHinqtHixrg@mail.gmail.com>
References: <CAM-vHq+wi0jckw+-mHFJeX98FGutkmSPcDnYR75yHinqtHixrg@mail.gmail.com>

On 08/07/2012 07:06 PM, karthi keyan wrote:

> For some interlink application purpose , i need to *migrate data into 
> Sql server 2008*.

The simplest way is usually to connect with psql and export CSV data with:

     \copy (SELECT ....) to '/path/to/file.csv' csv

or for a whole table:

     \copy tablename to '/path/to/file.csv' csv

For usage of COPY see:

     \h COPY

and http://www.postgresql.org/docs/current/static/sql-copy.html


... then load that CSV into MS SQL Server 2008 like you would anything else.


A more complicated but more powerful way is to use an ETL tool like 
Pentaho or Talend to connect to both databases and merge/convert data.

--
Craig Ringer

view thread (3+ messages)  latest in thread

Message-ID: <50220DC1.8030007@ringerc.id.au>
Permalink:  ../50220DC1.8030007@ringerc.id.au/
Also on:    postgresql.org/message-id/50220DC1.8030007@ringerc.id.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: ringerc@ringerc.id.au, karthi2itnet@gmail.com
  Subject: Re: Data migration to sql server 2008
  In-Reply-To: <50220DC1.8030007@ringerc.id.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox