Linked Server Insert error

  • Hello

    i have linked server

    one server in cloud one is local

    from local my select query in linked server success working

    but insert give me this error

    OLE DB provider "MSOLEDBSQL" for linked server "LINKEDSERVERNAME" returned message "Cursor operation conflict".

    Msg 7343, Level 16, State 2, Line 7

    The OLE DB provider "MSOLEDBSQL" for linked server "LINKEDSERVERNAME" could not INSERT INTO table "[MSOLEDBSQL]".


    query is that

    FROM [SunFinanceIntegration].[dbo].[NOC_A_SALFLDG]

    values (58009,2020012,'2002-02-02',12,1,-372.00,'D','a','sql','sql','payroll','a','2020-02-02',2021001,'2020-02-02',0,null,0,'','','','azn',1.70,-219.00,3,

  • What happens if you do that insert on the other server without using the linked server?

    The error "Cursor operation conflict" makes me think that there MIGHT be a trigger on the remote table and it is causing the failure.

    I would test the insert with the exact same parameters on the remote server and see what happens.

    ALTERNATELY, a quick google makes it look like you need to SET NOCOUNT ON -

  • and be careful with inserting data onto remote server through a linked server . it is EXTREMELLY slow as it does it a record at the time.

    if there is any type of volume it is better to use SSIS/C# to do the data transfer or to execute a SP on the REMOTE server to retrieve the data from the local server and insert it there.

  • Is the linked server also SQL Server? If it is, you can do it without OPENQUERY(). You just need to  use the full name of the table "LINKED_SERVER"."DATABASE"."schema"."TABLE".

    And why don't you drop the empty columns and null columns from your query? Is there any constraint?

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

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