2

I'm currently trying to delete data held in a table on IBM i, via an openquery using a linked server, with the following command in SSMS;

DELETE FROM OpenQuery(LnkSrv,'SELECT * FROM LibA.Table1') 

When running the above, I get an error message.

OLE DB provider "IBMDASQL" for linked server "LnkSrv" returned message "Key column information is insufficient or incorrect. Too many rows were affected by update.". Msg 7345, Level 16, State 1, Line 3 The OLE DB provider "IBMDASQL" for linked server "LnkSrv" could not delete from table "SELECT * FROM LibA.Table1". Updating did not meet the schema requirements.

mao
  • 11,321
  • 2
  • 13
  • 29
nowYouSeeMe
  • 935
  • 6
  • 11
  • 21

1 Answers1

0

My feeling is that this is not an OpenQuery problem specifically.

I suspect that the combination of a DB2 on i 'CLRPFM' situation and the use of OLE DB to drive it is causing some sort of tangle.

Does your target table have a primary key? If not, I'd try adding one.

If you just want to clear the table on a one-off basis, you should be able to run the delete natively on IBM i.

MandyShaw
  • 1,088
  • 3
  • 14
  • 22