SQL Server 2005 Metadata

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • N002213F
    New Member
    • Sep 2007
    • 38

    SQL Server 2005 Metadata

    Does SQL Server 2005 have system tables that you can select to see meta data about a table? I have seem such tables in Oracle.

    I would like to retrieve certain tables properties for analysis and comparisons

    Any pointers most appreciated
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    yes those are also available here.

    Comment

    • N002213F
      New Member
      • Sep 2007
      • 38

      #3
      Some names or web page might help.

      Thanks in advance

      Comment

      • ck9663
        Recognized Expert Specialist
        • Jun 2007
        • 2878

        #4
        Depending on the version of SQL Server you're working on, there's a table called sysobjects.

        If you're working with SQL 2005, there's a view called sys.tables

        So, try the following:

        Code:
        select * from sys.tables
        
        select * from sysobjects

        -- CK

        Comment

        • N002213F
          New Member
          • Sep 2007
          • 38

          #5
          Found it;
          Code:
          SELECT NAME FROM SYS.TABLES ORDER BY NAME
          and
          Code:
          EXEC SP_SPACEUSED[TABLENAME]
          I used Java to do the the looping, will look at using SQL procedures.

          Comment

          • N002213F
            New Member
            • Sep 2007
            • 38

            #6
            Originally posted by ck9663
            Depending on the version of SQL Server you're working on, there's a table called sysobjects.

            If you're working with SQL 2005, there's a view called sys.tables

            So, try the following:

            Code:
            select * from sys.tables
            
            select * from sysobjects

            -- CK
            Thanks, if selecting from the sysobjects, one may have to specify the type, lest you get all the objects.

            Comment

            Working...