LABEL ON not part of sql server?

  • Thread starter Thread starter Steve Richter
  • Start date Start date
S

Steve Richter

in sql server, how do I specify the column heading of a column? That
is a column heading other than the column name.

in the little sql I know, in the SQL on the IBM AS400, the following is
permitted:

Example 1: Enter a label on the DEPTNO column of table DEPARTMENT.
LABEL ON COLUMN DEPARTMENT.DEPTNO IS 'DEPARTMENT NUMBER'

thanks,

-Steve
 
Steve Richter said:
in sql server, how do I specify the column heading of a column? That
is a column heading other than the column name.

in the little sql I know, in the SQL on the IBM AS400, the following is
permitted:

Example 1: Enter a label on the DEPTNO column of table DEPARTMENT.
LABEL ON COLUMN DEPARTMENT.DEPTNO IS 'DEPARTMENT NUMBER'

thanks,

-Steve
Try SELECT column_name AS alias where column_name is the actual database
column name and alias is the column name you want to display in the query
results.
 
Peter said:
Try SELECT column_name AS alias where column_name is the actual database
column name and alias is the column name you want to display in the query
results.

thanks Peter.

-Steve
 
Although this should probably be directed to a SQL Server group, you can
alias the column like this:

SELECT DEPTNO [DEPARTMENT] -- Other columns go here
FROM DEPARTMENTS d -- d is an alias for the DEPARTMENTS table

The brackets aren't really necessary in this case but help make it a bit
more readable. The brackets become necessary when violating any SQL Server
naming rules.

HTH
 
Back
Top