This is a discussion on trying to insert data to an AS/400 linked server within the SQL Server Data Warehousing forums, part of the Microsoft SQL Server category; --> Hi! I'm trying to insert data to an AS/400 linked server... Presently I'm able to get data from the ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi! I'm trying to insert data to an AS/400 linked server... Presently I'm able to get data from the AS/400 but unable to insert, update. There is some T-SQL that I already try: INSERT INTO AS400.S7828389.SYSCOSDTA.CPDBREP VALUES('03','MF','Mec Fil.','Mécanique Filliale','TEST',1031020,' ',' ',' '); Server: Msg 7399, Level 16, State 1, Line 1 OLE DB provider 'MSDASQL' reported an error. [OLE/DB provider returned message: Query cannot be updated because it contains no searchable columns to use as a key.] SELECT * FROM OPENQUERY(AS400,'UPDATE GLMEREP SET MEEMMB = ''A'' WHERE MEAAGL = ''03'' AND MESBMB = ''120''') Server: Msg 7357, Level 16, State 2, Line 3 Could not process object 'UPDATE GLMEREP SET MEEMMB = 'A' WHERE MEAAGL = '03' AND MESBMB = '120''. The OLE DB provider 'MSDASQL' indicates that the object has no columns. UPDATE AS400.S7828389.SYSCOSDTA.GLMEREP SET AS400.S7828389.SYSCOSDTA.GLMEREP.MEEMMB = 'A' WHERE MEAAGL = '03' AND MESBMB = '120'; Server: Msg 7344, Level 16, State 2, Line 4 OLE DB provider 'MSDASQL' could not UPDATE table '[AS400].[S7828389].[SYSCOSDTA].[GLMEREP]' because of column 'MEEMMB'. The data value violated the schema for the column. [OLE/DB provider returned message: Multiple-step operation generated errors. Check each status value.] UPDATE openquery(AS400, 'select * FROM GLMEREP WHERE MEAAGL = ''03'' AND MESBMB = ''120''') SET MEEMMB = 'A'; Server: Msg 7344, Level 16, State 2, Line 5 OLE DB provider 'MSDASQL' could not UPDATE table '[MSDASQL]' because of column 'MEEMMB'. The data value violated the schema for the column. [OLE/DB provider returned message: Multiple-step operation generated errors. Check each status value.] (MEEMMB is a 1character long field) As you can see I tried almost any combination of UPDATE statement for a linked server. Thanks in advance! Jeff |