# Sunday, August 01, 2004
« Data Transformation Services for SQL Ser... | Main | Hurst Castle Day Trip »

I noticed this whilst browsing the SQL Server 2005 online help. It creates a permanent (until you DROP SYNONYM) alias to an object in SQL Server. This could be very useful in shortening the amount SQL you need to type. Imagine you have a remote database containing a schema and table. You can either:

SELECT * FROM REMOTE_SERVER.SCHMEA_NAME.THE_TABLE_IN_QUESTION

Or:

CREATE SYNONYM THE_TABLE
    FOR REMOTE_SERVER.SCHMEA_NAME.THE_TABLE_IN_QUESTION
GO
SELECT * FROM THE_TABLE

Useful? Yes, but even more so when you need to use a database that has daft object naming conventions like Remedy managed systems.

CREATE SYNONYM Customers
    FOR dbo.C0183
GO
SELECT * FROM Customers
This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Sunday, August 01, 2004 10:51:09 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
Related posts:
Do you have great business intelligence skills?
Integration Services Design Principals
Physical Data Warehouse Design
Analysis Services Essential Reading
When should you do an incremental extract?
Post TechReady and Popfly Invites
Comments are closed.