Skip to content

Instantly share code, notes, and snippets.

@grishin
Created February 18, 2014 10:23
Show Gist options
  • Select an option

  • Save grishin/9068223 to your computer and use it in GitHub Desktop.

Select an option

Save grishin/9068223 to your computer and use it in GitHub Desktop.
How to create linked server to Azure SQL.sql
-- replace MYSERVER, MYDB, MYUSER, MYPASSWORD with real values
EXEC sp_addlinkedserver
@server='azure',
@srvproduct='',
@provider='sqlncli',
@datasrc='MYSERVER.database.windows.net',
@location='',
@provstr='',
@catalog='MYDB'
-- Add credentials and options to this linked server
EXEC sp_addlinkedsrvlogin
@rmtsrvname = 'azure',
@useself = 'false',
@rmtuser = 'MYUSER@MYSERVER',
@rmtpassword = 'MYPASSWORD'
EXEC sp_serveroption 'azure', 'rpc out', true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment