PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.sqlserver.server > Metadata
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Metadata

Réponse
 
LinkBack Outils de la discussion
Vieux 30/08/2008, 23h23   #1
Richard Morey
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Metadata

Hi --

I am looking to migrate an old application built with ASP and running on SQL
Server 2000 to a RIA type app possibly using Java and SQL Server 2008. I
have been reading about SQL MetaData and I am curious to know if the
information obtained via the getColumnLabel() function in Java can be stored
as metadata in SQL Server.

From what I have read so far this column label data comes when you do a
SELECT FIELD as OTHERNAME, the column label would be "OTHERNAME" What I
would ideally like to do is store a text string that would be used as a
caption for a field. For example, the field FIRSTNAME would have a column
label of "First Name" Is this possible in SQL Server 2008?

Thanks

Rich


  Réponse avec citation
Vieux 31/08/2008, 05h07   #2
Daniel Jameson
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Metadata

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.

--
Thank you,

Daniel Jameson
SQL Server DBA
Children's Oncology Group
www.childrensoncologygroup.org


"Richard Morey" <rwmorey71@hotmail.com> wrote in message
news:eXCTsauCJHA.1224@TK2MSFTNGP02.phx.gbl...
> Hi --
>
> I am looking to migrate an old application built with ASP and running on
> SQL Server 2000 to a RIA type app possibly using Java and SQL Server 2008.
> I have been reading about SQL MetaData and I am curious to know if the
> information obtained via the getColumnLabel() function in Java can be
> stored as metadata in SQL Server.
>
> From what I have read so far this column label data comes when you do a
> SELECT FIELD as OTHERNAME, the column label would be "OTHERNAME" What I
> would ideally like to do is store a text string that would be used as a
> caption for a field. For example, the field FIRSTNAME would have a column
> label of "First Name" Is this possible in SQL Server 2008?
>
> Thanks
>
> Rich
>
>



  Réponse avec citation
Vieux 31/08/2008, 05h26   #3
Richard Morey
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Metadata

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

"Daniel Jameson" <no_danjam_spam@cyberdude.com> wrote in message
news:%23KRP0axCJHA.4576@TK2MSFTNGP05.phx.gbl...
> 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.
>
> --
> Thank you,
>
> Daniel Jameson
> SQL Server DBA
> Children's Oncology Group
> www.childrensoncologygroup.org
>
>
> "Richard Morey" <rwmorey71@hotmail.com> wrote in message
> news:eXCTsauCJHA.1224@TK2MSFTNGP02.phx.gbl...
>> Hi --
>>
>> I am looking to migrate an old application built with ASP and running on
>> SQL Server 2000 to a RIA type app possibly using Java and SQL Server
>> 2008. I have been reading about SQL MetaData and I am curious to know if
>> the information obtained via the getColumnLabel() function in Java can be
>> stored as metadata in SQL Server.
>>
>> From what I have read so far this column label data comes when you do a
>> SELECT FIELD as OTHERNAME, the column label would be "OTHERNAME" What I
>> would ideally like to do is store a text string that would be used as a
>> caption for a field. For example, the field FIRSTNAME would have a column
>> label of "First Name" Is this possible in SQL Server 2008?
>>
>> Thanks
>>
>> Rich
>>
>>

>
>



  Réponse avec citation
Vieux 31/08/2008, 16h09   #4
Andrew J. Kelly
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Metadata

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.

--
Andrew J. Kelly SQL MVP
Solid Quality Mentors


"Richard Morey" <rwmorey71@hotmail.com> wrote in message
news:ODhDplxCJHA.3432@TK2MSFTNGP05.phx.gbl...
> 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
>
> "Daniel Jameson" <no_danjam_spam@cyberdude.com> wrote in message
> news:%23KRP0axCJHA.4576@TK2MSFTNGP05.phx.gbl...
>> 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.
>>
>> --
>> Thank you,
>>
>> Daniel Jameson
>> SQL Server DBA
>> Children's Oncology Group
>> www.childrensoncologygroup.org
>>
>>
>> "Richard Morey" <rwmorey71@hotmail.com> wrote in message
>> news:eXCTsauCJHA.1224@TK2MSFTNGP02.phx.gbl...
>>> Hi --
>>>
>>> I am looking to migrate an old application built with ASP and running on
>>> SQL Server 2000 to a RIA type app possibly using Java and SQL Server
>>> 2008. I have been reading about SQL MetaData and I am curious to know if
>>> the information obtained via the getColumnLabel() function in Java can
>>> be stored as metadata in SQL Server.
>>>
>>> From what I have read so far this column label data comes when you do a
>>> SELECT FIELD as OTHERNAME, the column label would be "OTHERNAME" What I
>>> would ideally like to do is store a text string that would be used as a
>>> caption for a field. For example, the field FIRSTNAME would have a
>>> column label of "First Name" Is this possible in SQL Server 2008?
>>>
>>> Thanks
>>>
>>> Rich
>>>
>>>

>>
>>

>
>


  Réponse avec citation
Vieux 31/08/2008, 17h15   #5
Richard Morey
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Metadata

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 .

Rich

"Andrew J. Kelly" <sqlmvpnooospam@shadhawk.com> wrote in message
news:emwozM3CJHA.3352@TK2MSFTNGP05.phx.gbl...
>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.
>
> --
> Andrew J. Kelly SQL MVP
> Solid Quality Mentors
>
>
> "Richard Morey" <rwmorey71@hotmail.com> wrote in message
> news:ODhDplxCJHA.3432@TK2MSFTNGP05.phx.gbl...
>> 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
>>
>> "Daniel Jameson" <no_danjam_spam@cyberdude.com> wrote in message
>> news:%23KRP0axCJHA.4576@TK2MSFTNGP05.phx.gbl...
>>> 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.
>>>
>>> --
>>> Thank you,
>>>
>>> Daniel Jameson
>>> SQL Server DBA
>>> Children's Oncology Group
>>> www.childrensoncologygroup.org
>>>
>>>
>>> "Richard Morey" <rwmorey71@hotmail.com> wrote in message
>>> news:eXCTsauCJHA.1224@TK2MSFTNGP02.phx.gbl...
>>>> Hi --
>>>>
>>>> I am looking to migrate an old application built with ASP and running
>>>> on SQL Server 2000 to a RIA type app possibly using Java and SQL Server
>>>> 2008. I have been reading about SQL MetaData and I am curious to know
>>>> if the information obtained via the getColumnLabel() function in Java
>>>> can be stored as metadata in SQL Server.
>>>>
>>>> From what I have read so far this column label data comes when you do a
>>>> SELECT FIELD as OTHERNAME, the column label would be "OTHERNAME" What I
>>>> would ideally like to do is store a text string that would be used as a
>>>> caption for a field. For example, the field FIRSTNAME would have a
>>>> column label of "First Name" Is this possible in SQL Server 2008?
>>>>
>>>> Thanks
>>>>
>>>> Rich
>>>>
>>>>
>>>
>>>

>>
>>

>



  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 07h30.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,15101 seconds with 13 queries