1. Synonyms (synonym) is a new feature in SQL Server 2005
It is an alias that is given to an existing or potential new object. This alias can be used in the same database or across data, which replaces the original object. An object that can be built with aliases:
2. Advantages:
2.1 Flexibility to change the position of the object without changing the existing program code, the UI configuration of the database links without changes.
2.2 Create synonyms in the same database to provide backward compatibility for older applications to avoid deleting
or rename the object.
2.3 Create synonyms across databases to simplify statements that provide cross-database access.
3. Disadvantages
Synonyms (synonyms) are very loosely bound to the referenced object, and no warnings and hints are removed when the referenced synonym is deleted
4. Examples, creating synonyms across databases
Use [Bencalx]
GO
CREATE synonym [dbo]. [Synuspwebsnapshotemployeewebpullfromdallas] for [Bencalxweb]. [dbo]. [Usp_snapshotemployeewebpullfromdallas]
GO
--Create a new synonym Synuspwebsnapshotemployeewebpullfromdallas in the database Bencalx, point to the stored procedure in the database Bencalxweb usp_ Snapshotemployeewebpullfromdallas
EXEC Synuspwebsnapshotemployeewebpullfromdallas can be executed directly in Bencalx @JobID
Calling a stored procedure in a Bencalxweb database
Https://msdn.microsoft.com/en-us/library/ms177544.aspx
Http://www.ccidnet.com/2010/0714/2115519.shtml
.
SQL Server2005 Synonyms