Results 1 to 4 of 4

Thread: COl_NAME

  1. #1
    Join Date
    Mar 2004
    Posts
    5

    Unanswered: COl_NAME

    Hi there

    I'm trying to make some dynamic updated documentation for a MS SQL database, in flash.

    So I want to make an SQL which gives the same output as when you look at "Design Table" (Column names, Data type, Lenght, Allow Nulls)

    I know how to make a Query for a specific column (COL_NAME) but how do I make a QUERY for all the Columns in a table?

    All help is appreciated!!!

    Thanks

    OIS

  2. #2
    Join Date
    Mar 2004
    Posts
    80

    Re: COl_NAME

    exec sp_columns TableName
    may fetch u required result set.


    Originally posted by OIS
    Hi there

    I'm trying to make some dynamic updated documentation for a MS SQL database, in flash.

    So I want to make an SQL which gives the same output as when you look at "Design Table" (Column names, Data type, Lenght, Allow Nulls)

    I know how to make a Query for a specific column (COL_NAME) but how do I make a QUERY for all the Columns in a table?

    All help is appreciated!!!

    Thanks

    OIS

  3. #3
    Join Date
    May 2003
    Posts
    26
    This info is stored in sys tables and can be retrieved through the INFORMATION_SCHEMA.Columns view.

    Code:
    select *
    from Information_Schema.Columns where Table_Name = #yourtable#
    You may also need to specify a TABLE_CATALOG and TABLE_SCHEMA and keep in mind that the information for different data types is stored in different columns of the view.
    Last edited by Donner; 03-12-04 at 13:33.

  4. #4
    Join Date
    Mar 2004
    Posts
    5
    Exec sp_Columns is precisly what I was looking for.


    Thanks for the help!!!!!

Posting Permissions

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