2

I have an SQL file generated from a Postgres database that I want to run on SQL Server 2008. The SQL file creates, drops and inserts data into tables. SQL Server returns a number of errors in the syntax.

Is there a way to make the file compatible?

If not, what is the best way to export data from Postgres to SQL Server?

1

1 Answer 1

2

The best approach is usually to restore the dump to a PostgreSQL server, then copy the data out of the live server using:

  • A schema-only dump you hand-convert, followed by a pg_dump --data-only --inserts dump that might load as-is if you're lucky, and otherwise can be machine converted with text processing tools; or

  • A dedicated conversion tool if you can find one for Pg -> MS SQL. Maybe the MS SQL ODBC dump/export tool referred to in the linked post is a special case of an ETL tool.

  • Usually better, use ETL tools like Talend or Pentaho to aid in the conversion.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.