Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

169
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda