When developers working with SQL Server “Denali”, MS SQL Server 2008 R2 and MS SQL Server 2005 want to create an alias for a table or table-valued object, they should follow the next steps:
1. Add the table or table-valued object to their query.
2. In the Diagram Pane, right-click the object for which they want to create an alias, then select Properties from the shortcut menu.
3. In the Properties window, enter the alias in the Alias field.
Developers use table aliases when:
– They want to make the statement in the SQL Pane shorter and easier to read.
– They refer to the table name often in their query — such as in qualifying column names — and want to be sure they stay within a specific character-length limit for their query.
– They are working with multiple instances of the same table (such as in a self-join) and need a way to refer to one instance or the other.