I have been attempting to connect the databases of a MSSQL server to a Google Cloud MySQL server so I can do joins between them. I've set up the correct ODBC on my machine and tested the connection, which works fine. But when I go to set up the linked server in the MS Server Management Studio, I get error 7303
The linked server has been created but failed a connection test. Do you want to keep the linked server?
Additional information: An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "MYSQL". OLE DB provider "MSDASQL" for linked server "MYSQL" returned message "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified". (Microsoft SQL Server, Error: 7303
What might I be missing here? I ensured the ODBC driver I have is 64 bits (same as the MS Sever Management I have) but configured the System DSN for 32 bits as well. Is there something I must configure on the Google Cloud Server to make this link work? Since the DSN connection test passes, I assume it must be some failure within the Server Management Studio itself. Thank you!
EDIT: Here is the script used to create the linked server:
USE [master]
GO
EXEC master.dbo.sp_addlinkedserver @server = N'SERVERNAME', @srvproduct=N'MSDASQL', @provider=N'MSDASQL', @datasrc=N'server-name'
GO
EXEC master.dbo.sp_serveroption @server=N'SERVERNAME', @optname=N'collation compatible', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'SERVERNAME', @optname=N'data access', @optvalue=N'true'
GO
EXEC master.dbo.sp_serveroption @server=N'SERVERNAME', @optname=N'dist', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'SERVERNAME', @optname=N'pub', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'SERVERNAME', @optname=N'rpc', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'SERVERNAME', @optname=N'rpc out', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'SERVERNAME', @optname=N'sub', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'SERVERNAME', @optname=N'connect timeout', @optvalue=N'0'
GO
EXEC master.dbo.sp_serveroption @server=N'SERVERNAME', @optname=N'collation name', @optvalue=null
GO
EXEC master.dbo.sp_serveroption @server=N'SERVERNAME', @optname=N'lazy schema validation', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'SERVERNAME', @optname=N'query timeout', @optvalue=N'0'
GO
EXEC master.dbo.sp_serveroption @server=N'SERVERNAME', @optname=N'use remote collation', @optvalue=N'true'
GO
EXEC master.dbo.sp_serveroption @server=N'SERVERNAME', @optname=N'remote proc transaction promotion', @optvalue=N'true'
GO
USE [master]
GO
EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname = N'SERVERNAME', @locallogin = NULL , @useself = N'False'
GO
script
button at the top – Panagiotis Kanavos