Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 5123

dbo.sp_addlinkedserver, how to point the linked server to a specific database? How to rename the Linked Server?

$
0
0

Hi group,

I am useing Linked Server in SQL Server 2008R2 connecting to a couple of Linked Servers.

I was able to connect Linked Servers, but I cannot point to a specific database in a Linked Server, also, I cannot rename Linked Server's name.

How to point the linked server to a specific database? How to rename the Linked Server?

The following is the code that I am using right now:

USE [master]
GO
EXEC master.dbo.sp_addlinkedserver
    @server = N'Machine123\Instance456',
    @srvproduct=N'SQL Server' ;
GO

EXEC sp_addlinkedsrvlogin 'Machine123\Instance456', 'false', NULL, 'username', 'password'  


Viewing all articles
Browse latest Browse all 5123


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>