Is there a table that holds the listing of sysobjects.xtype descriptions?

前端 未结 2 2088
旧巷少年郎
旧巷少年郎 2021-02-05 19:12

According to the sysobjects documentation, sysobjects.xtype can be one of these object types:

| xtype |             


        
相关标签:
2条回答
  • 2021-02-05 19:46

    There is this

    SELECT name 
    FROM master..spt_values
    WHERE type = 'O9T'
    

    Output

    AF: aggregate function
    AP: application
    C : check cns
    D : default (maybe cns)
    EN: event notification
    F : foreign key cns
    FN: scalar function
    FS: assembly scalar function
    FT: assembly table function
    IF: inline function
    IS: inline scalar function
    IT: internal table
    L : log
    P : stored procedure
    PC : assembly stored procedure
    PK: primary key cns
    R : rule
    RF: replication filter proc
    S : system table
    SN: synonym
    SQ: queue
    TA: assembly trigger
    TF: table function
    TR: trigger
    U : user table
    UQ: unique key cns
    V : view
    X : extended stored proc
    sysobjects.type, reports
    
    0 讨论(0)
  • 2021-02-05 20:10

    Here is what I came up with to get total of database objects and its description.

        select xtype1, Description, total_count, last_crdate, last_refdate 
        from 
        (SELECT xtype as xtype1, total_count = COUNT(*), last_crdate = MAX(crdate), last_refdate = MAX(refdate)
         FROM sysobjects 
         GROUP BY xtype
         )o
        left outer join 
        (SELECT LEFT(name,PATINDEX('%:%',name)-1) AS xtype2, RIGHT(name, (LEN(name) - PATINDEX('%:%',name))) AS Description
        FROM master..spt_values 
        WHERE type = 'O9T' AND number  = -1
        )x 
        on o.xtype1 = x.xtype2
        order by Description;
    
    0 讨论(0)
提交回复
热议问题