Using SQL Server 2019 Enterprise Edition (CU14)
I am attempting to use Polybase for reading data from a simple CSV text file.
When executing the create external data source
I get the error " Msg 46721, Level 20, State 1 Login failed. The login is from an untrusted domain and cannot be used with Integrated authentication ."
The statement I'm using is:
create external data source datasourcename
with (
location = 'odbc:\\localhost',
connection_options='Driver=Microsoft Access Text Driver (*.txt, *.csv); Dbq=d:\data\; ApplicationIntent=ReadOnly;',
pushdown=off,
credential = <credential name> -- < On DEV server it works both with/without this
);
This actually works on my development server, however on the production server it is throwing this error and I can't find a solution. Not really sure what is trying to be logged in to!
On the Dev server (also SQL server 2019/CU14) I can even leave off the credential option and it still works.
Both servers are using the same domain account for the SQL Server service and Polybase services, I have defined the credential identically as:
create database scoped credential <credential name> with identity = 'Sql Server service domain account', secret = 'domain account password';
I don't think it's relevant but the production server is an Availability-Group secondary replica where I'm trying a simple proof-of-concept to test reading a CSV file and inserting data into TempDB.
On both my Dev server and Production server the file I'm trying to read is located in a folder on a local drive. The drive & folder has full control permissions for the SQL Server Service account.
Both servers have the same odbc driver installed, version 16.00.4999.1000
I have tried adding "trusted_connection=Yes and No" to the connection_options.
Connecting with SSMS I have tried using my own domain account and the SQL Server sa account.
I have installing the "Kerberos Configuration Manager" and connecting to the production server to check the SPNs and it reports "status good".
I have tried adding "DisableLoopbackCheck" registry key on the server.
So far nothing has worked and I'm at a loss as to what else to try.
The external data source definition is wrong: use forward slashes, don't use localhost, the odbc string is missing the curly braces, application intent is not a property of the odbc, and you don't need a credential. See this link for an example: https://36chambers.wordpress.com/2022/02/21/polybase-versus-flat-files/
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.