Skip to content

Latest commit

 

History

History
40 lines (31 loc) · 2.09 KB

File metadata and controls

40 lines (31 loc) · 2.09 KB
title Create Column Aliases
ms.custom seo-lt-2019
ms.date 01/19/2017
ms.prod sql
ms.prod_service sql-tools
ms.technology ssms
ms.topic conceptual
helpviewer_keywords
columns [SQL Server], aliases
aliases [SQL Server], columns
ms.assetid e2e1c166-8ea7-47a2-b6a7-e419bf0fa3bb
author markingmyname
ms.author maghan
ms.manager jroth
ms.reviewer

Create Column Aliases (Visual Database Tools)

[!INCLUDEappliesto-ss-asdb-asdw-pdw-md] You can create aliases for column names to make it easier to work with column names, calculations, and summary values. For example, you can create a column alias to:

  • Create a column name, such as "Total Amount," for an expression such as (quantity * unit_price) or for an aggregate function.

  • Create a shortened form of a column name, such as "d_id" for "discounts.stor_id."

After you have defined a column alias, you can use the alias in a Select query to specify query output.

To create a column alias

  1. In the Criteria Pane, locate the row containing the data column for which you want to create an alias, and if necessary, mark it for output. If the data column is not already in the grid, add it.

  2. In the Alias column for that row, enter the alias. The alias must follow all naming conventions for SQL. If the alias name you enter contains spaces, the Query and View Designer automatically puts delimiters around it.

See Also

Add Columns to Queries (Visual Database Tools)
Sort and Group Query Results (Visual Database Tools)
Summarize Query Results (Visual Database Tools)
Perform Basic Operations with Queries (Visual Database Tools)