Describe & v$views in SQL Server

  • Dears,

    In oracle DB from command line to describe the table columns / definition you can use : describe "Table Name " what is the equivalent command in SQL Server ?!

    Also in Oracle DB we have dba_views to get all system views and search for the required information like : users , objects , system info what is the equivalent command in SQL Server ?!

    Regards,

  • 1) For Describe 'TableName', In SQL SERVER you can use sp_help 'Table Name'.

    2) For dba_views, In SQL SERVER you can use select * from INFORMATION_SCHEMA.TABLES.

  • halmuslim12 (1/19/2015)


    Dears,

    In oracle DB from command line to describe the table columns / definition you can use : describe "Table Name " what is the equivalent command in SQL Server ?!

    Also in Oracle DB we have dba_views to get all system views and search for the required information like : users , objects , system info what is the equivalent command in SQL Server ?!

    Regards,

    As previously stated, you can use sp_HELP 'tablename" to get information about a table.

    As for the second question, there are multiple methods.

    INFORMATION_SCHEMA views.

    System tables, views, and functions in the "sys" schema.

    Other special purpose system functions too numerous to list here.

    See "Books Online" for information on INFORMATION_SCHEMA and "sys" objects.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Many thanks

  • Do not use INFORMATION_SCHEMA.* views in SQL Server. They are very slow compared to sys.* views and seem to cause much more locking/deadlocking. Based on research, it seems they can also be inaccurate at times. [When you look at the view definitions for I_S.* views, it doesn't look like they should be worse, but in reality they are.]

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

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

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