Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

168
Vistas
Copy Data from PostgreSQL Direct to MSSQL Similar Table using Query

I have a table in PostgreSQL cpad.mst_Patient PatientID|FirstName|LastName|Gender|Dob|ClinicNumber|Facility|EntryPoint|RegistrationDate|Status|DeleteFlag

I have a similar table in MSSQL that i am doing data migration to. PostgreSQL is live database and i wanted to migrate the new registration from PostgreSQL to MSSQL using script. I am using MSSQL Cursor currently but its tedious because i have to transfer the database from PostgreSQL to Excel then import to MSSQL using integrated services which is time wasting. I need a code that can query data from PostgreSQL and paste it directly into MSSQL.

I am using PostgreSQL 9 and MSSQL 2016

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You have a couple of options:

first, you can use a programming language like PHP or python that simply selects * from the postgres table and inserts into the mssql.

Second, you could use a postgres "FDW" (Foreign data wrapper) to set up a database connection from the postgres db to the mysql db using ODBC. Once you get that set up, the FDW makes postgress just see the mysql table as if it were in the postgres db. Then, it's as simple as

insert into mssqltab select * from postgrestab;

Setting up the FDW connection isn't something I'll cover here as most of the config will be determined by how your db and tables are configured.

Of course the third option is not to migrate to mssql because postgresql is a better db, but that's just my opinion.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda