creating linked server in sql server 2008R2 from on-prem to Azure

Newtojob 66 Reputation points
2023-09-27T00:11:47.4833333+00:00

Hi,

I am trying to create a linked server in sql server 2008R2 from on-prem to Azure but it is giving me an error. when i try to create in sql server 2012 it is working.

Please suggest.

Thank you for the help

SQL Server Other
{count} vote

1 answer

Sort by: Most helpful
  1. Erland Sommarskog 121.4K Reputation points MVP Volunteer Moderator
    2023-09-27T21:54:35.7366667+00:00

    It seems like an uphill battle to do it the right way from SQL Server 2008, that is using an SQL Server OLE DB provider. I got the same error message as you. I also tried SQLNCLI11, which took me a little longer, but, no, it did not work.

    Mysteriously enough, I got it working with MSDASQL+ODBC:

    EXEC sp_addlinkedserver AzureSQLDB, '', 'MSDASQL', @provstr = 'Driver={SQL Server};Server=xxxxxx.database.windows.net;Database=xxxxx'
    EXEC sp_addlinkedsrvlogin AzureSQLDB, 'false', NULL, 'xxxxxx', 'cccccccc'
    

    But you should install a new ODBC Driver; "SQL Server" is a 20 year old driver which lacks support for many newer functions.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.