Skip site navigation (1) Skip section navigation (2)

Re: Data migration to sql server 2008

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: karthi keyan <karthi2itnet(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Data migration to sql server 2008
Date: 2012-08-08 06:57:05
Message-ID: 50220DC1.8030007@ringerc.id.au (view raw or flat)
Thread:
Lists: pgsql-admin
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

Responses

pgsql-admin by date

Next:From: Stuart BishopDate: 2012-08-08 15:51:15
Subject: Streaming replication failover with 3 servers
Previous:From: Craig RingerDate: 2012-08-08 02:38:52
Subject: Re: Data corruption after SAN snapshot

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group