Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 9020E7ACC82 for ; Wed, 8 Aug 2012 03:57:29 -0300 (ADT) Received: from mail-yw0-f46.google.com ([209.85.213.46]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Sz0Cs-0007t7-6R for pgsql-admin@postgresql.org; Wed, 08 Aug 2012 06:57:28 +0000 Received: by yhmm54 with SMTP id m54so431312yhm.19 for ; Tue, 07 Aug 2012 23:57:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:x-gm-message-state; bh=CceBlNQiPyYdLj1nxDQofWEkBnFCMjJmPp/DGiSvu9E=; b=iUZLZ8GYaDIS/b3Duy082vikRSFRTtDZFTGjYq4WpdARONNWvkp4DXTbNTpH4H27y2 64JYRu6oaMvlAZrzfqiPV6ZAUzmJ5xxwmo3Q21fl0mUfvGCFns58UfvW5YHvj/wh+EZQ qaR53jj6qUeWP0RfUgWF3HM5qfb7Dz0Rrcw4VyKbNf9De9PGfuvBB6BUWPHSMHOifFoz SD5N/rl2KeUwCaoWjEbaLn1ca+UgdYX3vNwqEagF5IpTxEQZCfcwCARA3JiJAegNRbpB qn14oKjKMe6w/ocREWhr3y84mumqlPGmkSjFl+q2lhbcaTAYht6LhtdgmLA6oUbeyk4P ahKw== Received: by 10.66.83.161 with SMTP id r1mr31599659pay.69.1344409030649; Tue, 07 Aug 2012 23:57:10 -0700 (PDT) Received: from ayaki.localdomain (office1.postnewspapers.com.au. [150.101.171.128]) by mx.google.com with ESMTPS id qt6sm5855469pbb.9.2012.08.07.23.57.08 (version=SSLv3 cipher=OTHER); Tue, 07 Aug 2012 23:57:09 -0700 (PDT) Message-ID: <50220DC1.8030007@ringerc.id.au> Date: Wed, 08 Aug 2012 14:57:05 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: karthi keyan CC: pgsql-admin@postgresql.org Subject: Re: Data migration to sql server 2008 References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------060707070002080307020203" X-Gm-Message-State: ALoCoQmk5mwAsJummgEo2K95Upuq9lOPNRw03wE1ZQSmDtosJG5bXJoFJmEBQByovVaF6Id28V4j X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201208/53 X-Sequence-Number: 39874 This is a multi-part message in MIME format. --------------060707070002080307020203 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------060707070002080307020203 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
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
--------------060707070002080307020203--