Azure SQL get data from another non-Azure sql server using Linked Server

We have two SQL Server Database (EG: DB1 & DB2) that are hosted in NON-Azure environment (dedicated server). We are planning to migrate DB1 to Azure SQL.

Is there way the Azure SQL DB1 can talk to non-azure DB2 using Linked Server approach? I want to query in my Azure SQL (DB1) and get the data of DB2.

Upvotes: 0

Views: 633

Answers (2)

Aram
Aram

Reputation: 5705

Yes you can certainly do that.

This atricle explains all the details that you need to do to accomplish that:

https://www.mssqltips.com/sqlservertip/3630/connect-an-azure-sql-database-to-an-onpremises-sql-server/

Note that your SQL Azure instance needs to be in "Standard" service tier to be able to do that.

If you want to add your SQL Azure server as a linked server to your on-prem SQL you can use ODBC connection. Bellow MSDN article will help you with that:

https://blogs.msdn.microsoft.com/sqlcat/2011/03/07/linked-servers-to-sql-azure/

Upvotes: 1

Abhishek
Abhishek

Reputation: 2490

If I understand correctly you are trying to connect your Azure-db (DB1) from an on-premise db (DB2). From on-premises SQL Server, you can use linked servers and 4-part names to point to a database in Azure SQL DB using a datasource which would look like this - [[email protected]].[YourDatabaseName].[YourSchemaName].[YourTableName]

For more details please check this link.

Upvotes: 1

Related Questions