Query Analyzer

  • Is there a way to display a table's properties using TSQL in QA?

    In Oracle, the command is "descr or describe":

    SQL> descr emp

    Name Null? Type

    ------------------- -------- ----

    EMPNO NOT NULL NUMBER(4)

    ENAME VARCHAR2(10)

    JOB VARCHAR2(9)

    MGR NUMBER(4)

    HIREDATE DATE

    SAL NUMBER(7,2)

    COMM NUMBER(7,2)

    DEPTNO NUMBER(2)

    Many thanks. Jeff

  • select * from information_schema.columns where table name = 'your table'

  • or

    sp_help tablename

  • quote:


    Is there a way to display a table's properties using TSQL in QA?


    Have you tried the object browser? F8 turns it on and off. The tables section will show you the columns, indexes, constraints (the primary key is a constraint) and triggers. If I need to review the definition of a table while writing a query, it's what I use.

  • In query Analyzer first highlight/select the Table, then click {ALT} & F1 together

    paul


    paul

  • Another way is, open Enterprise Manager, connect to the Server, Database, Table. On right hand side, select/highlight the table whose attribute you want, Press CTRL+C, come to Query Analyzer press CTRL+v

    paul


    paul

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply