If you need to change the name of the column returned by a query use can use the “AS” clause. Without the AS clause, the returned column name will be the table field name and may not be clear enough for the person looking at the returned results. I also use this in Views when a user or program is expecting a different column name than the real column name.
SELECT EmployeeID, LastName AS [Last Name], FirstName AS [First Name] FROM Employees
|EmployeeID||Last Name||First Name|
Square Bracket Or Quotes?
SQL Server uses it’s own proprietary square brackets to handle spaces in column names. The ISO standard is to use double quotes like:
SELECT EmployeeID, LastName AS "Last Name", FirstName AS "First Name" FROM Employees
SQL Server handles both ways and doesn’t really care which one you use.