Groups | Blog | Home
all groups > sql server (microsoft) > october 2004 >

sql server (microsoft) : Handling duplicates in linked server and dealing with raised error


NOOR.FAZLI NO[at]SPAM gmail.com
10/22/2004 8:45:50 AM
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.FAZLI NO[at]SPAM gmail.com
10/25/2004 8:43:27 AM
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

AddThis Social Bookmark Button