知道一个对象(包括表,存储过程....),怎样得到它的详细信息(列名,创建日期...),有没有什么系统的存储过程可以得到

解决方案 »

  1.   

    sp_help 'tablename'Name                                                                                                                             Owner                                                                                                                            Type                            Created_datetime                                       
    -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- ------------------------------- ------------------------------------------------------ 
    a                                                                                                                                dbo                                                                                                                              user table                      2007-04-04 17:26:53.770 
     
    Column_name                                                                                                                      Type                                                                                                                             Computed                            Length      Prec  Scale Nullable                            TrimTrailingBlanks                  FixedLenNullInSource                Collation                                                                                                                        
    -------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- ----------------------------------- ----------- ----- ----- ----------------------------------- ----------------------------------- ----------------------------------- -------------------------------------------------------------------------------------------------------------------------------- 
    FoodID                                                                                                                           int                                                                                                                              no                                  4           10    0     yes                                 (n/a)                               (n/a)                               NULL
    FoodWeight                                                                                                                       int                                                                                                                              no                                  4           10    0     yes                                 (n/a)                               (n/a)                               NULL
    SaleTime                                                                                                                         datetime                                                                                                                         no                                  8                       yes                                 (n/a)                               (n/a)                               NULL
    ProducerID                                                                                                                       char                                                                                                                             no                                  5                       yes                                 no                                  yes                                 Chinese_PRC_CI_AS 
      

  2.   

    Identity                                                                                                                         Seed                                     Increment                                Not For Replication 
    -------------------------------------------------------------------------------------------------------------------------------- ---------------------------------------- ---------------------------------------- ------------------- 
    No identity column defined.                                                                                                      NULL                                     NULL                                     NULL 
    RowGuidCol                                                                                                                       
    -------------------------------------------------------------------------------------------------------------------------------- 
    No rowguidcol column defined. 
    Data_located_on_filegroup                                                                                                        
    -------------------------------------------------------------------------------------------------------------------------------- 
    PRIMARY 
    index_name                                                                                                                       index_description                                                                                                                                                                                                  index_keys                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
    -------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
    dddd                                                                                                                             clustered located on PRIMARY                                                                                                                                                                                       FoodID
    ffff                                                                                                                             nonclustered located on PRIMARY                                                                                                                                                                                    FoodID 
    constraint_type                                                                                                                                    constraint_name                                                                                                                  delete_action update_action status_enabled status_for_replication constraint_keys                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
    -------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------- ------------- ------------- -------------- ---------------------- ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 
    DEFAULT on column ProducerID                                                                                                                       DF_a_ProducerID                                                                                                                  (n/a)         (n/a)         (n/a)          (n/a)                  (100) 
    没有外键引用此表。
    没有架构绑定的视图引用此表。