Rich,
I don't believe there is any way to put a default override for column names,
because how would you then ever get the real name from a SELECT query.
However you can create a view to have alternate column names.
CREATE VIEW vSpelledOut AS
SELECT FIRSTNAME AS [First Name], ...
FROM MyTable
Note that you need to use [] (or some other delimeter based on server
settings) to delimit identifiers with spaces or other special characters.

Signature
Thank you,
Daniel Jameson
SQL Server DBA
Children's Oncology Group
www.childrensoncologygroup.org
> Hi --
>
[quoted text clipped - 13 lines]
>
> Rich
Richard Morey - 31 Aug 2008 04:26 GMT
Hi --
Thanks for the feedback. I don't want to override the column names, but it
appears to me that Java supports a getColumnLabel() and getColumnName()
which are the same unless a select query uses an AS statement. I was hoping
I could associate a column label parameter with the column name.
I appreciate your idea of the view, however, I would like to have the column
label parameter available whenever I did a select query and not have to do a
seperate query to get the labels.
Thanks,
Rich
> Rich,
>
[quoted text clipped - 26 lines]
>>
>> Rich
Andrew J. Kelly - 31 Aug 2008 15:09 GMT
I am not sure I follow you here. If you want a different name or label for a
column the appropriate and preferred method is to use an alias as Daniel
suggested in the query itself of using a view. I don't see how you intend to
get a label if the column does not use an alias without making two calls. I
don't know of the getColumnLabel() function in Java but it appears to
require an alias to work. So you either need a predefined object that has
the labels you require or you need to make additional calls. You can use the
SQL Server extended property to assign a description to pretty much any
object but you cannot retrieve this information via the select. Again that
is what alias's are for. But you may want to check out the extended
properties in BooksOnLine to see if they will get you closer to your goal
but I think what you are asking for is not feasible.

Signature
Andrew J. Kelly SQL MVP
Solid Quality Mentors
> Hi --
>
[quoted text clipped - 41 lines]
>>>
>>> Rich
Richard Morey - 31 Aug 2008 16:15 GMT
Hi --
I was hoping to store the alias so that if, for example, I did a SELECT *
FROM TABLE the alias would be available via the getColumnLabel() while the
field name would be available via getColumnName(). I think you are right in
that what I want to do is not feasible so I will look into creating a view
or storing the information in some other way.
Thanks for your help.
Rich
>I am not sure I follow you here. If you want a different name or label for
>a column the appropriate and preferred method is to use an alias as Daniel
[quoted text clipped - 56 lines]
>>>>
>>>> Rich