views:

361

answers:

1

the scenario:

Two databases(each has a database named, for example testdb):

  • MS Sql Server 2000
  • Postgresql 8.3

I need to synchronize these two testdbs, actually the direction is from SqlServer to Postgresql.

The structure of testdb on SqlServer may change occasionally. I only need tables and data of testdb synchronized, exclude indexes, views or other foos.

I've already read this article: Microsoft SQL Server to PostgreSQL Migration by Ian Harding, but it seems to be a one-off solution. And I found this procedures: Generate Scripts for SQL Server Objects automatically, but I think it's still hard to make the steps in the article automatically.

Is it possible to make the synchronization automatically in another way?(By batch/scripts or noncommercial tools)

A: 

You've probably already though of this but...you can create a DTS package to export the data from SQL Server and move it some intermediate location. Then a cron job would execute a script to import the data into Postgres.

Todd
I came across new problems when using DTS to export data to postgresql. It seems impossible to export the data to postgresql due to the sql generated by SqlServer. All the table names and the fields are quoted and this makes SqlServer itself cannot find the table and fields it just created.
James Ni
Forgot to say thank you! :-D
James Ni