Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2003
    Posts
    12

    Unanswered: Simple SQL Question

    Hi all,

    I am new to SQL Server 2000. I have been using Oracle for a while. To get to the table description in oracle, I can do something like

    DESC TABLE_NAME

    How can I do the same in Sql Server. Also what will be an equivalent query for the following oracle query
    Select table_name from user_tables;

    I need to create documentation for a SQL Server database. It should include Table Name, Column Name ,Column Type and width. I was wondering how can I do this in SQL Server.

    Thank you,
    Amar

  2. #2
    Join Date
    Jan 2003
    Location
    Midwest
    Posts
    138
    1. To view the table structure in sql server...you can type in the following in the query analyzer.

    sp_help table_name

    2. the select statement would be the same for sql server.

    "SELECT field_name FROM table_name"

  3. #3
    Join Date
    Feb 2003
    Posts
    12

    XML Output

    It is possible to retrieve an XML output of the database structure using some built in tool?

    Thank you/Amar

  4. #4
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    Select table_name from user_tables
    in MSSQL would be select name from sysobjects where type = 'U'
    Paul Young
    (Knowledge is power! Get some!)

  5. #5
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    to my knowledge there is no tool that would provide and XML dump of a table's structure, however I don't think is would take more than 20 min. to create a select statment to gather up all the metadata you require and than add the appropreate XML convertion.

    The attached is an HTML document outlining all the systables used my MSSQL Server.
    Attached Files Attached Files
    Paul Young
    (Knowledge is power! Get some!)

  6. #6
    Join Date
    Feb 2003
    Posts
    12
    Thanks folks. You have been very helpful.

    Amar Das

Posting Permissions

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