简体   繁体   中英

Could not UPDATE table on a Linked Server OLE DB provider “MSDASQL”

Im trying to execute the following simple statement on my Linked Server(HANA Based) in SQL Server:

UPDATE HANASERVER.."SAP_WORKSHOP"."CUSTOMER"
 SET "CUSTOMER_ID"='3' 
WHERE "CUSTOMER_NAME"='John'

Unfortunately the server retrieve the following error message, denying the transaction:

 The OLE DB provider "MSDASQL" for linked server "HANASERVER" could not UPDATE table "[HANASERVER]..[SAP_WORKSHOP].[CUSTOMER]" 

The SELECT * is doable, so the connection is tested and working.

Anyone knows any workaroud for this issues?

Thank you, Luigi

EDIT : I forgot to tell that im using the server as SYSTEM User, so I literally have the permission for doing everything on it, but unfortunately still not working.

EDIT : I defined the Linked Server following the procedure below :

EXEC sp_addlinkedserver 
@server = 'HANASERVER', --description
@srvproduct = 'HANA_TEST',  --description
@provider = 'MSDASQL',  --Microsoft's OLE DB provider (FIXED NAME)
@datasrc = 'HANA_TEST'  --ODBC System DSN (OUR CONFIGURED SYSTEM DSN)

EXEC sp_addlinkedsrvlogin   
@useself= 'FALSE',  
@rmtsrvname = 'HANASERVER', --description
@locallogin = NULL, 
@rmtuser = 'SYSTEM',    --HANA User
@rmtpassword = 'XXXXXXXX'   --HANA Pswd

EDIT: I'm currently using SSMS on the remote server where the system and the linked server are on. But still can't resolve the issue. I'm trying to exec the query from the query window. :)

Try using this syntax if you verified that the user specified for the linked server definition has appropriate permissions to UPDATE the table:

update [linked-server].dbname.dbo.tablename
...
where
...

Also try updating as below, specifically the @provider option:

EXEC sp_addlinkedserver     
   @server=N'S1_instance1',   
   @srvproduct=N'',  
   @provider=N'SQLNCLI',   
   @datasrc=N'S1\instance1'; 

MSDN LINKED SERVER SPEC

UPDATED

Check for TCP/IP and Named Pipes protocols and port. Open SQL Server Configuration Manager and check the SQL Server Network Configuration protocols. You should enable Named Pipes and TCP/IP protocol.

I think I forgot the login piece:

EXEC master.dbo.sp_addlinkedserver @server = N'SQL1', @srvproduct=N'SQL Server'

EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'SQL1',@useself=N'False',@locallogin=NULL,@rmtuser=N'linkeduser',@rmtpassword='########'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM