Skip to content

Instantly share code, notes, and snippets.

@aveek22
Last active April 20, 2023 06:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aveek22/07458fc70237c08a6855d4f5f2a9e000 to your computer and use it in GitHub Desktop.
Save aveek22/07458fc70237c08a6855d4f5f2a9e000 to your computer and use it in GitHub Desktop.
EXEC master.dbo.sp_addlinkedserver
@server =N'AWS_ATHENA',
@srvproduct=N'',
@provider=N'MSDASQL',
@datasrc=N'AWS_ATHENA'
GO
EXEC master.dbo.sp_addlinkedsrvlogin
@rmtsrvname=N'AWS_ATHENA',
@useself=N'False',
@locallogin=NULL,
@rmtuser=N'',
@rmtpassword=''
GO
SELECT *
FROM AWS_ATHENA.AwsDataCatalog.sampledb.sampledata
GO
@AdmiralrRicha
Copy link

Getting this error:
Failed to retrieve data for this request. Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "AWS_ATHENA". Error: 7303.

@aveek22
Copy link
Author

aveek22 commented Apr 16, 2023

@AdmiralrRicha - Looks like a credential-related issue. I haven't been working on SQL Server actively these days, so won't be able to offer much help. Please check this forum, might be useful to debug => https://www.sqlservercentral.com/forums/topic/msg-7303-cannot-initialize-the-data-source-object-of-ole-db-provider-microsoft-jet-oledb-4-0-for-linked-server-null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment