Monday 24 September 2012

Add SQL Azure as Linked Server

Just a quick note on how to set SQL Azure on your local SQL Server as Linked Server.

EXEC sp_addlinkedserver
@server='LinkServerName',
@srvproduct='',
@provider='sqlncli',
@datasrc='ServerName.database.windows.net',
@location='',
@provstr='',
@catalog='DatabaseName'

EXEC sp_addlinkedsrvlogin
@rmtsrvname='LinkServerName',
@useself='false',
@rmtuser='username@ServerName.database.windows.net',
@rmtpassword='Password'

EXEC sp_serveroption 'LinkServerName', 'rpc out', true;

I added user@ServerName because I kept on getting error from SQL Azure.

Server name cannot be determined.  It must appear as the first segment of the server's dns name (servername.database.windows.net).  Some libraries do not send the server name, in which case the server name must be included as part of the user name (username@servername).  In addition, if both formats are used, the server names must match.



9 comments:

  1. Thanks for this, it helped me out too.

    ReplyDelete
  2. Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here Thank you. Your blog was very helpful and efficient For Me,Thanks for Sharing the information Regards..!!..Azure Online Training Bangalore

    ReplyDelete
  3. Cryptocurrency App Development Company

    is a subset of digital currency designed
    to serve as an exchange mechanism for secure online transactions via cryptography. Bitcoin is the world's first decentralized record currency. It has been a huge success, with a good response from the global community. It has prepared the path for the emergence of new cryptocurrencies. These digital currencies are also known as Bitcoin forks.

    ReplyDelete
  4. With our easy-to-use and cleverpaxful clone script development, Omninos gives you the ability to trade from anywhere at any time. We've created a useful app for both Android and iOS that meets your requirements. Our talented programmers produce user-friendly apps that facilitate global commerce and attract a significant number of new traders.

    ReplyDelete