Problems with INSERT INTO OPENROWSET

  • Hello,

    I'm working in a data migration, I created a MS SQL procedure to insert data in PostgreSQL tables using OpenRowSet, but when the table have many records, the SQL Server service crash.

    This is the way that I'm using:

    INSERT INTO OPENROWSET('MSDASQL', 'Driver=PostgreSQL Unicode(x64);uid=postgres;Server=localhost;port=5435;database=nomebanco;pwd=senha', 'SELECT campo1, campo2 FROM schema.tabela' )

    SELECT campo1, campo2 FROM tabela;

    In tables with not too many records I get without problemas, but when the table is realy big, the SQL Server service crash and the follow error occurs:

    Mensagem 109, Nível 20, Estado 0, Linha 0

    Ocorreu um erro no nível de transporte durante o recebimento de resultados do servidor. (provider: Provedor de Memória Compartilhada, error: 0 - O pipe foi finalizado.)

    English:

    Post 109, Level 20, State 0, Line 0

    An error occurred at the transport level when receiving results from the server. (provider: Shared Memory Provider, error: 0 - The pipe has been finalized.)

    PS: A table with 32150 records works fine, another table with 46686 records doesn't work.

  • Would changing the process to SSIS be an option?

    That's exactly why you have it available.

    I hope that's not the real password. 😉

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Luis Cazares (11/10/2015)


    Would changing the process to SSIS be an option?

    That's exactly why you have it available.

    I hope that's not the real password. 😉

    Sorry, I don't want to use another method.

    I want to know what is the reason to this error and if there is a possible solution to It.

    And of course this is not my real password.

  • It seems that the PostgreSQL server is closing the connection or limiting the resources. You might need to change some settings. I'm sorry that I can't help you with much details.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply