Created
May 10, 2018 18:12
-
-
Save jonasraoni/7911ed0f5690c9e4ffd8d9a93c0a97bc to your computer and use it in GitHub Desktop.
Microsoft SQL Server Management Studio: Add external server and query against local databases.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EXEC sp_addlinkedserver @server='SERVER_ADDRESS'; | |
EXEC sp_addlinkedsrvlogin @rmtsrvname='SERVER_ADDRESS',@useself=false, @rmtuser='USER', @rmtpassword='PASSWORD'; | |
-------------- | |
INSERT INTO LOCAL_TABLE | |
SELECT * | |
FROM | |
[SERVER_ADDRESS].DATABASE.dbo.REMOTE_TABLE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment