SQL Server Excel Linked Server Remote Server Execution Issues - sql-server

This is the first time I've had to work with an Excel sheet as a linked server, and after a whole ton of struggling with it and solving one issue only to hit another I've decided to reach out. Long story short I have a SP that pulls data from an Excel linked server(this was originally just an open datasource rather than a linked server but I had issues there too) the SP works fine locally, however when I run it remotely, I was just getting error 7302 "can not create instance of provider" then after doing some searching I enabled "allow in process" and "Dynamic Parameter" in the provider settings, and now I'm getting:
Msg 7399...
The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked
server "JOBDETAILS" reported an error. The provider did not give any
information about the error.
Msg 7303...
Cannot initialize the data
source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked
server "JOBDETAILS".
I looked through event viewer on both the local and remote servers and the local was logging a Com applications permissions issue when I tried to execute from remote using Windows Credentials(the end result will be running with SQL creds but I also tried Windows for troubleshooting purposes) so I corrected the permissions issue but that had no effect.

Solved my own stupidity, went back through everything this morning, and realized I had pointed the linked server to a mapped drive.

Related

Sporandic OLE DB provider "SQLNCLI11" for linked server "Servername" returned message "No transaction is active." and Linked Servers

The Configuration
We have two servers.
An accounts server called MSSQL-Accounts (SQL 2012 SP1) on premise.
An Azure cloud server called MSSQL-CRM (SQL 2019).
There is a bidirectional, all port, VPN between the two servers. Each is on a different network, there is no DNS between them. To allow name resolution we have added each to the others hosts and lmhosts files.
Both have DTC enabled and configured as below:
Both have a remote security context set that is a sys admin role:
We have tried it with "Enable Promotion of Distributed Transactions for RPC" both on, and off:
The Scenario and Error
MSSQL-CRM will run a stored procedure that will update records on itself and also update some records on the accounts server, MSSQL-Accounts, which will then return a billing ID back to MSSQL-CRM. All the procedures run from MSSQL-CRM, with some inserts and updates to both servers.
Most of the time this works! And it flew through testing. However, now and again, it fails. This morning it would not work at all. When the procedure was fired, the error it gave was:
OLE DB provider "MSOLEDBSQL" for linked server "MSSQL-Accounts"
returned message "No transaction is active."
On MSSQL-CRM we could still expand our linked server section in SQL Server Management Studio, however, on MSSQL-Accounts server we could not expand the catalogues,
On testing the linked server from MSSQL-Accounts to MSSQL-CRM we got.
We even went to the lengths of rebooting MSSQL-Accounts, however, the error remained.
We tested the link (right click on the linked server then click "Test Connection"), from the other end (from MSSQL-CRM to MSSQL-Accounts), and it worked just fine. And then magically, at 3pm, it all started working again!
I can see nothing in the event log, I can see nothing in the SQL logs here (C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER2\MSSQL\Log).
Infrastructure confirm the VPN is healthy, and there are no network issues.
In addition to the Local DTC settings, I have sometimes had to enable three Inbound rules in the Windows Firewall to get everything to work correctly.

SQL-Server - Access Linked Server (Cannot initialize the data source object)

I am currently configuring a linked server connection between Microsoft SQL-Server and a Microsoft Access database in our network. To make things easy, I saved the Access db locally and tried to configure the linked server.
First I created a system-DSN named "BADEN32" (32 bit)
This DSN refers to my Access database (located C:\Users\xxx\Desktop\Baden.accdb)
For this DSN, I used the Microsoft Access Driver (.mdb .accdb)
When I try to create a new linked server, I keep getting the following error: Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "BADEN32"
I have already checked the MSDASQL provider if allow inprocess was true, but it was.
What am I doing wrong here?
You're linking to the SQL server from the Access Database? You would need to set up an ODBC connection to the SQL server and test it. Once it is working, go to the Access Database, External Data Tab, then ODBC Database to set up.
If this isn't what you mean, could I get more information?

SQL Server openrowset from csv on shared drive works from server not from desktop or app

I set up a stored procedure to import data from a csv file on a network drive. I trouble shoot all the previous errors and setting that are the usual requirements to make this work. I'll put that T/S info below with the boiled down code. I am at the point where this works perfectly when I run it from SSMS 2016, which is running on the windows 2012r2 server, which is running the sql server 2016, and I am logged in via Remote desktop as my network admin id. But does not work when I run it from SSMS 2016, which is running on windows 10 desktop, and I am logged it as the same admin id.
It also failed when I call the sp from the app on my desktop, which will be the actual place I want to call it from.
Code:
select *
from openrowset('MSDASQL'
,'Driver={Microsoft Access Text Driver (*.txt, *.csv)}'
,'select * from \\servername\public\Utilities\SWUMOps\BackEnd\saws\accts.csv')
Error from ssms on desktop:
OLE DB provider "MSDASQL" for linked server "(null)" returned message "[Microsoft][ODBC Text Driver] '\servername\public\Utilities\SWUMOps\BackEnd\saws' is not a valid path. Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.".
Msg 7320, Level 16, State 2, Line 1
Cannot execute the query "select * from \servername\public\Utilities\SWUMOps\BackEnd\saws\accts.csv" against OLE DB provider "MSDASQL" for linked server "(null)".
.............
I've set the temp folder in the profile of the service id to everyone and domain users to modify
I have the 64bit driver loaded on the 64bit sql server
I have set 'Ad Hoc Distributed Queries', 1;
I verified the SQL Server service ID is in the Global group that has permissions to the folders and file on the remote share.
All the research I've done keep pointing me back the these steps above.
I also saw something about forcing tcp/ip instead of named pipes, but named pipes wasn't enabled, which it is now.
It seems to be related to how the permissions are used differently from when you run the tsql from on or off server , so I was hoping that would ring a bell for one of you fine folks.
Thanks
edit:
I also tested the sql svr service id by logging on to my desktop with it and opening the file on the unc path with no problems.

Cannot create an instance of OLE DB Provider 'OraOLEDB.Oracle' error when creating linked servers from SQL Server to Oracle

Aware that this topic has been raised many times here (I have gone through the posts), but none of the suggestion on the posts has resolved my issue.
When I attempt to create a linked server to the oracle database from SQL Server Management Studio, I get the error:
Cannot create an instance of OLE DB Provider 'OraOLEDB.Oracle' for
linker server ''. (Microsoft SQL Server, Error: 7302)
My understanding of this error is that the Oracle provider is not installed correctly or not at all.
To check this I ran 'ODBC Data Source Administrator (64-bit) and attempted to add the provider (which was not available).
To resolve this I fully installed Oracle 10g Client as an admin and restarted the server. I added the new oracle bin folder to the environment %PATH% as well as %TNS_ADMIN% to point to the tnsnames.ora file.
I have run 'tnsping' using the value specified in the tnsname.ora file and it is able to connect.
I have exhausted my ideas to get the oracle provider recognised by the ODBC 64 bit connector.
Does anyone have any idea that could resolve this issue?
Thank you for any help.
The solution was to follow the steps suggested by Dmitry. However, make sure you carry out the following step:
C:\Users\dbrowne\Downloads\ODAC121010Xcopy_x64>.\install.bat oledb
c:\oracle\odac64 odac64 true
as an admin!

SQL Server and Sybase Linked Server Issue

In SQL Server 2008 using the Sybase 12.5 driver everything works fine but now we had migrated to SQL Server 2012 and Sybase 15 using the 64bit driver it seems that things are broken.
If I test linked server connection it gives me linked server succeeded message but as I visually drill down the catalogs though it lists all of them they show as blank like such
but the item count is correct as we have that many catalogs in our Sybase.
Another funny thing that I recognized is that when I perform and OPENQUERY it gives me the correct amount of rows and still it is showing empty strings, like such
I dont have any idea what is happening here and my only clue is this error message when I drill down inside those blank databases. This exception prompts.
Failed to retrieve data for this request. (Microsoft.SqlServer.Management.Sdk.Sfc)
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Cannot obtain the schema rowset "DBSCHEMA_TABLES" for OLE DB provider "MSDASQL" for linked server "TEST". The provider supports the interface, but returns a failure code when it is used. (Microsoft SQL Server, Error: 7311)
Any ideas why this might be happening? does anyone know a solution to this?
I solved this by restarting my Server, it looks like the Sybase drivers was not fully registered on install.

Resources