|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
LABEL ON not part of sql server?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 Show quote
"Steve Richter" <StephenRich***@gmail.com> wrote in message Try SELECT column_name AS alias where column_name is the actual database news:1112119904.066906.277920@f14g2000cwb.googlegroups.com... > 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 > column name and alias is the column name you want to display in the query results. -- Peter [MVP Visual Developer] Jack of all trades, master of none. Peter van der Goes wrote:
Show quote > "Steve Richter" <StephenRich***@gmail.com> wrote in message thanks Peter. > news:1112119904.066906.277920@f14g2000cwb.googlegroups.com... > > 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. > -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 ---------------- Dave Fancher http://davefancher.blogspot.com Show quote "Steve Richter" <StephenRich***@gmail.com> wrote in message news:1112119904.066906.277920@f14g2000cwb.googlegroups.com... > 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 > |
|||||||||||||||||||||||