Question for SQL guru

Results 1 to 2 of 2

Thread: Question for SQL guru

  1. #1
    Join Date
    Dec 1969

    Default Question for SQL guru

    Would you please help with this question. I have 1 table. Here is the data in my TABLE1<BR><BR>ID name<BR>1 A<BR>2 B<BR><BR><BR>How do I run the query so that the result will also include a title(or description of each collums)<BR><BR>For example, the result would be:<BR><BR>ID Name<BR>UserID UserName<BR>1 A<BR>2 B<BR><BR>UserID, and UserName are also part of the result .<BR><BR>Thanks in advance<BR>

  2. #2
    Join Date
    Dec 1969

    Default Not SQL...

    ...can&#039;t be done with SQL.<BR><BR>That is, I *assume* that you mean you want to get the descriptions from info stored in the DB, yes? <BR><BR>If so, the only way I&#039;ve seen that *might* work (and I&#039;ve never tested it and it would certainly depend on the DB in use, in any case) is to use ADODB.Connection.OpenSchema and use one of the schema types. As I recall, there&#039;s only one that *might* return a per-field annotation.<BR><BR>OTHER THAN THAT...<BR><BR>What you *could* do would be to have a table of tables of your own. Something like:<BR><BR>Table: TableDescriptions<BR>tableName : text, name of table in db<BR>fieldName : text<BR>description : text<BR><BR>But since you couldn&#039;t JOIN that with the recordset with the data (or even UNION it), you&#039;d have to get back two separate recordsets.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts