T-SQL Query running on Linked Servers Fail

  • Hi All,

    Whenever I run the following query...it just goes on and on and the expected output does not happen

    /*This table is on SERVER 1*/

    CREATE TABLE temp_history (baan_project_number char(6),ledger_account char(12),[year] INT,[month] TINYINT, PTD_Amount float)

    INSERT INTO temp_history(baan_project_number,ledger_account,[year],[month],PTD_Amount)

    /*THIS SP IS ON SERVER 2*/

    EXEC HQBAANSQL.vbaandb.dbo.usp_RR_BaaN_PTD_GL_Figures 2005,2,'600030'

    Any ideas why this is happening or hwo the same effect can be achieved using some better technques. I am using SQL SERVER 2000 SP3.

    Thankx in advance...

  • How many records are you expecting from the stored procedure?  I also encountered problems doing it this way, meaning getting data from one server and writing it to another and I found out that somehow it transfers the data one row at a time using cursors.

    As a work around, why not create the temp_history table in the second server where the data is coming from and then export it to the first server.  This is what I did in my case and it is much faster this way, unless you are not allowed to create a new table in the second server.

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

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