0

I have a scenario to use Alias name to access database from SP, and I would like to know if there is any method to achieve this in SQL Server.

Since Linked Servers only allows Server objects and SYNONYM only allow object inside the database.

SteveC
  • 15,808
  • 23
  • 102
  • 173

1 Answers1

0

You can create a SYNONYM which includes the database name of the linked server ...

CREATE SYNONYM LinkedTableA
FOR DEVLINK.testdata.dbo.customer

and can then query ...

SELECT * FROM dbo.LinkedTableA
SteveC
  • 15,808
  • 23
  • 102
  • 173