Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2007
    Posts
    6

    Unanswered: Field Descriptions through ASP

    Is there any way to access the field descriptions in SQL Server 2000 using classic ASP?

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    What do you mean when you say field descriptions?? Are you talking about column names in a recordset or are you talking about the description field that you get in the SQL 2000 table designer?

    If it is the later I don't think there is unless you start looking at the system tables.

    If it is the column names of a recordset then I think there is but I would have to look it up.

    Let me know which one you are after and I will provide what help I can.

  3. #3
    Join Date
    Jul 2007
    Posts
    6
    thanks

    yes I am talking about the description field in the table designer.

    I managed to access these through the following query:
    select * from INFORMATION_SCHEMA.columns
    order by TABLE_CATALOG,TABLE_SCHEMA,TABLE_NAME,COLUMN_NAME

    SELECT
    [Table Name] = i_s.TABLE_NAME,
    [Column Name] = i_s.COLUMN_NAME,
    [Description] = s.value,
    [Data Type] = i_s.DATA_TYPE,
    [Data Length] = i_s.CHARACTER_MAXIMUM_LENGTH
    FROM
    INFORMATION_SCHEMA.COLUMNS i_s
    LEFT OUTER JOIN
    sysproperties s
    ON
    s.id = OBJECT_ID(i_s.TABLE_SCHEMA+'.'+i_s.TABLE_NAME)
    AND s.smallid = i_s.ORDINAL_POSITION
    AND s.name = 'MS_Description'
    WHERE
    OBJECTPROPERTY(OBJECT_ID(i_s.TABLE_SCHEMA+'.'+i_s. TABLE_NAME), 'IsMsShipped')=0
    -- AND i_s.TABLE_NAME = 'table_name'
    ORDER BY
    i_s.TABLE_NAME, i_s.ORDINAL_POSITION

  4. #4
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    You'll need to establish an ADO connection from the asp script to the database, and issue your select statement via the connection.execute method. Ref ASP101 for asp database examples.
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


Posting Permissions

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