0

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.

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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/

3 Comments

This one connects a Azure SQL to an on premise db. I need the exact opposite, connect on premise to Azure SQL.
@SureshKumarNarayanasamy you can use ODBC for adding SQL Azure as linked server. look at this article: blogs.msdn.microsoft.com/sqlcat/2011/03/07/…
Since I wrote that article, I am up ticking the response. Linked servers have to be created on virtual machine or physical machine or Infrastructure as a service (IAAS). This is because they are built on top of OLEDB. Azure SQL database is a platform as a service (PAAS) offering. Therefore, you can only pull/pull data from the first configuration. The later does not work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.