Creating a linked server and database alias

I have two servers Server1 and Server2

On both servers, I have a database called QAI

There is a way that I can create a linked server with an alias from Server2 to Server1, but instead of Server1.QAI.dbo.tbBlah

He has an alias QAI.dbo.tbBlah

This is necessary because of the failure of the QAI DB on server2 and the need to return to the instance of Server1 while it is fixed.

thank

+5
source share
4 answers

It works. Tested on SQL2012

http://alexpinsker.blogspot.se/2007/08/how-to-give-alias-to-sql-linked-server.html

SQL- . , , ? :

1) 1:
• SQL Server Management Studio Linked Servers, " " ".
• - " ".
• " ".
• SQL .
• sql_server " "( ).
• " "- , .

2) 2:
• " "- (, ).

3) 3:
• " "" ", RPC," Rpc Out "" ".

4) 4:
• .

+6

, .

CREATE SYNONYM [dbo].[DimProduct]
FOR
[AdventureWorksDW].[dbo].[DimProduct]

DimProduct

+2

, , Server1 . , , , , server1 server2.

+1

in fact. How can yo uexpect invoke a linked server without saying its name? Another option you can do is:

select * from OPENQUERY ( LS_NAME, 'select * from tblBlah')
-1
source

All Articles