Data Encryption with Linked Servers In SQL Servers - sql-server

We have MS Access Databases and they are linked to SQL servers via linked servers.
We would like to enable the data encryption when data transit between SQL server and linked servers.
In this process, We added Encrypt=Yes option in linked server definition while creating.
```
EXEC master.dbo.sp_addlinkedserver
#server = N'REGISTRATION_NAME',
#srvproduct=N'',
#provider=N'SQLNCLI',
#datasrc=N'SERVER\INSTANCE',
#provstr=N'Encrypt=yes;',
#catalog = 'DATABASE_NAME'
```
After this, We get different errors when I try to query from linked servers.
Here are the some of the errors.
SSMS throws error
"Cannot initialize the data source object of OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server"
If the security option is "Not be made" then below error is throwing.
"Access to the remote server is denied because no login-mapping exists. (.Net SqlClient Data Provider) *
Please help me to understand and resolve these errors.

Related

SQL Server -- CREATE EXTERNAL FILE FORMAT to query Parquet files via Polybase -- failing due to TCP error

Context: I'm trying to use SQL Server's Polybase to query data in parquet files. One of the steps required to do so is to create an external file format that maps to parquet. MSDN provides SQL sample below.
CREATE EXTERNAL FILE FORMAT parquet_file_format
WITH (
FORMAT_TYPE = PARQUET,
--DATA_COMPRESSION = 'org.apache.hadoop.io.compress.SnappyCodec'
DATA_COMPRESSION = 'org.apache.hadoop.io.compress.GzipCodec'
);
When I execute it I get the following error.
OLE DB provider "MSOLEDBSQL" for linked server "(null)" returned message "Login timeout expired".
OLE DB provider "MSOLEDBSQL" for linked server "(null)" returned message "A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.".
Msg 10061, Level 16, State 1, Line 40
TCP Provider: No connection could be made because the target machine actively refused it.
I've tried enabling TCP network protocol
and also tried configuring the remote access server configuration option neither of which resolve the error.
EXEC sp_configure 'remote access', 0 ;
GO
RECONFIGURE ;
GO
Question: Can someone please point me in the right direction, or tell me what I'm doing wrong?
Turns out issue was Polybase services weren't running. I was able to run them in the sql server configuraion manager under sql server network configuration. This was helpful: https://www.sqlservercentral.com/forums/topic/polybase-syntax-error

Issues connecting from SQL Server to MS Access database

Environment: Windows Server 2016, SQL Server 2016; MS Access .accdb files (various versions)
Attempting to establish a linked server via oledb to an .accdb file content like this:
EXEC master.dbo.sp_addlinkedserver
#server = N'redacted',
#srvproduct = N'',
#provider = N'Microsoft.ACE.OLEDB.16.0',
#datasrc = N'D:\AccessTest\redacted.accdb',
#provstr = N'Jet OLEDB:Database Password=redacted;'
This causes an error:
The OLE DB provider "Microsoft.ACE.OLEDB.16.0" for linked server "redacted" reported an error. The provider reported an unexpected catastrophic failure. (Microsoft SQL Server, Error: 7399)
Attempted fixes:
Varying provider strings, like 'Uid=;Pwd='
Check AccessDB engine is installed (64bit)
Moved db to local drive (from network)
OLE provider set 'Allow Inprocess' to true
The database appears to be accessible through MS Access front end. No signs of corruption.
Any ideas?

SELECT Query between two different servers

I want to pull out data from different tables from different servers. I took a query at V5\SQL2014 Server and run these following to connect to V5_27\SQL2005 Server
EXEC sp_addlinkedserver
#server= 'V5_27\SQL2005',
#srvproduct='V5_27\SQL2005',
#provider='SQLNCLI',
#datasrc='tcp:0.0.0.0'
EXEC sp_addlinkedsrvlogin
#useself='FALSE',
#rmtsrvname='V5_27\SQL2005',
#rmtuser='sa',
#rmtpassword='123'
SELECT * FROM Stk006,[V5_27\SQL2005]..[TESTACC].Stk006
It shows me following errors.
OLE DB provider "SQLNCLI11" for linked server "V5_27\SQL2005" returned message "Login timeout expired".
OLE DB provider "SQLNCLI11" for linked server "V5_27\SQL2005" returned message "A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online.".
Msg 10049, Level 16, State 1, Line 22
TCP Provider: The requested address is not valid in its context.
User and Password are not wrong.
Allow remote is enabled in both servers.
TCP/IP and Named Pipes are enabled in both servers.
Please help me, thanks!
Thanks everyone, I found a solution for my problem.
You can check the solution link here or do below steps.
Try to create a linkServer , Object Explorer -> Server Objects -> Linked Servers (Right click and create new)
Configure Settings
Enter your Server Name
Login with sa and password
Then Test Connection of it.
Enjoy your query.
select
lc.t2 as 'Local Stock Code',
ext.t2 as 'External Stock Code'
from
Stk001 lc,
[V5_27\SQL2005].[TESTACC].[dbo].[STK001] ext

Error while calling stored procedure on linked server

I had configured a linked server to enable the SQL Server Database Engine to execute commands against OLE DB data sources outside of the instance of SQL server by executing sp_addlinkedserver procedure. After doing that I was trying to execute a procedure on a linked server using the following statement
EXEC [LinkedServer].[DatabaseName].[DatabaseOwner].[StoredProcedure] param1, param2
When I tried to execute the statement mentioned above it threw me the following error
OLE DB provider "SQLNCLI10" for linked server "server name" returned message "Unable to complete login process due to delay in opening server connection".
Msg 7303, Level 16, State 1, Line 1
Cannot initialize the data source object of OLE DB provider "SQLNCLI10" for linked server "server name".
I tried the following
Check if a linked server has remote access enabled
Increase remote query timeout
Check firewall to see if port was enabled.
What am I missing here? I appreciate your help.

When Executing proc: Cannot fetch a row from OLE DB provider "OraOLEDB.Oracle" for linked server

I have an Oracle linked server in my SQL Server database.
I log into SQL Server using local and then Windows authentication.
As the Administrator (which is the account that set up the linked server) I can query directly or embed in a stored proc and then execute the proc without a problem.
As my named user, which has full administrator rights and also has had all SQL Server Groups on the Windows security settings added, I can query my linked server just fine using either synonyms or the OpenQuery syntax. But if I try to execute one of the stored procedures, it will give me the error messages
Message 1:
The OLE DB provider "OraOLEDB.Oracle" for linked server "<server name>" reported an error. The provider did not give any information about the error.
Message 2:
Cannot execute the query "<query string>" against OLE DB provider "OraOLEDB.Oracle" for linked server "<server name>".
I have searched online and typically people see this emssage when trying to run an ad hoc query. My ad hoc query runs just fine. Still, I applied the solution selected, which was to check the "Allow inprocess" option on the OLEDB Provider. Doing that did not help.
any ideas?
Please enable "Allow in Process" option for the provider by opening up Linked Server > Providers and checking on "Allow in Process". For more detail information, please refer to the following link:
Demystifying SQL-Oracle Distributed Query Issues
http://blogs.msdn.com/b/bindeshv/archive/2008/05/21/demystifying-sql-oracle-distributed-query-issues.aspx
source:
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/902f5edf-e357-4ee7-82e8-ea5760882985/cannot-fetch-a-row-from-ole-db-provider-oraoledboracle-for-linked-server-linkedservername?forum=sqldataaccess

Resources