Created
April 1, 2016 15:00
-
-
Save jacobhackl/e36d4982ef04b6297aa9589f3ab0bace to your computer and use it in GitHub Desktop.
Add linked server for sql server in aws rds
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=N'wradminlite', -- Linked Server Display Name | |
@srvproduct=N'SQL Server', -- Default to SQL Server | |
@provider=N'SQLNCLI', -- Use SQLNCLI | |
@datasrc=N''; -- VPC IP of remote server, force TCP mode | |
EXEC sp_addlinkedsrvlogin @rmtsrvname = 'wradminlite' -- Linked Server Display Name | |
, @useself = 'false' -- Do not masquerade | |
-- , @locallogin = '' -- Commented out to force all local users to use linked login | |
, @rmtuser = '' -- Remote user name | |
, @rmtpassword = ''; -- Remote password |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this.
I was getting a "You cannot specify a provider or any properties for product 'SQL Server'." error.
I had to leave @srvproduct=N'' instead of @srvproduct=N'SQL Server' as per example here: https://msdn.microsoft.com/en-us/library/ms190479.aspx