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.
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.
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