Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2010
    Posts
    1

    Unanswered: get the table schema

    hello all!

    is this query is used to get the table schema?

    select * from tablename where 1!=1

    If yes, how does it work?

  2. #2
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    What do you mean with "table schema"?

    It seems that you want to display the structure of the query, not its schema (a Schema is a "namespace" in which the table is defined)

    To show the structure (= column definitions) of the table, simply run

    sp_help tablename

  3. #3
    Join Date
    Nov 2004
    Location
    on the wrong server
    Posts
    8,835
    Provided Answers: 6
    or SELECT * FROM INFORMATION_SCHEMA.columns WHERE TABLE_NAME = 'tablename'
    “If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.

Posting Permissions

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