The Alias name is the name that is referred to any column name or table name that is given by user. The alias name also used to represent some column or table without using its real name. As we will proceed in this article we will see that how we can use both the alias column name and alias table name in SQL Server.



Before understanding the alias here we have a table that contains some records.
pic
As we can see that there are two columns in the above table. Now we will see that how we can use the alias name for these columns.
Query: select name as EmployeeName, Salary as EmployeeSalaryHours from EmployeeMaster;

The output should be like this. As we know that the column name were Name and Salary but while displaying the content we changed the name of column and give them alias name.
pic1

Author Bio : I am Rajendra Kumar B.Tech Mechanical student, started career as a Blogger owning various blogs and one of my Favorite is T20 World 2014 .

Suggested Enrty:

Cast() Function in SQL Server
Convert() Function in SQL Server
Constraints and Type of Constraints in SQL
SQL Server Database Backup and Restore Database
Fetching Records from Multiple Tables in SQL Database
admin (155 Posts)


Tagged with →  

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Set your Twitter account name in your settings to use the TwitterBar Section.