Re: Handling duplicates in linked server and dealing with raised error

From: Noor (NOOR.FAZLI_at_gmail.com)
Date: 10/25/04

  • Next message: Jason Robertson: "SSL in won't work under Domain User account. MS Fix buletin does not help at all. Please Help!!"
    Date: 25 Oct 2004 08:43:27 -0700
    
    

    Hi
    I hope somebody has already dealt with this type of situation and will
    help me.

    We have Sql7sp4 and db2/AS400. By using openquery and linked
    server(for libraries in AS400) in sql server I'm able to insert,
    delete and update the data.
    But my problem is I need to write Stored procedure for insertions and
    in Query Analyzer when I run the insert openquery to send data to db2
    and if it is encountering duplicates it is giving me following error

    Server: Msg 7343, Level 16, State 2, Line 1
    OLE DB provider 'DB2OLEDB' could not INSERT INTO table '[DB2OLEDB]'.
    [OLE/DB provider returned message: A SQL error has occurred. Please
    consult the documentation for your specific DB2 version for a
    description of the associated Native Error and SQL State. SQLSTATE:
    23505, SQLCODE: -803]
    OLE DB error trace [OLE/DB Provider 'DB2OLEDB'
    IRowsetChange::InsertRow returned 0x80040e21: The provider return
    DB_E_ERRORSOCCURRED, but none of the columns is in error status. Data
    status sent to the provider: [COLUMN_NAME=IUCO STATUS=DBSTATUS_S_OK],
    [COLUMN_NAME=IUDOC# STATUS=DBSTATUS_S_OK], [COLUMN_NAME=IUIXID
    STATUS=DBSTATUS_S_OK], [COLUMN_NAME=IUSKU STATUS=DBSTATUS_S_OK],
    [COLUMN_NAME=I...

    Please any one can help me in handling errors for duplicate records. I
    need to catch the error because after catching error I have to write
    update code for that.

    Thanks in advance

    Noor


  • Next message: Jason Robertson: "SSL in won't work under Domain User account. MS Fix buletin does not help at all. Please Help!!"

    Relevant Pages


    Loading