fjtello / SQL-C-sharp

Common programming and coding tips and howtos
0 stars 0 forks source link

SQL [#sysobjects #xtype] #38

Open fjtello opened 6 years ago

fjtello commented 6 years ago

select xtype, (case xtype when 'AF' then 'Aggregate function (CLR)' when 'C' then 'CHECK constraint' when 'D' then 'Default or DEFAULT constraint' when 'F' then 'FOREIGN KEY constraint' when 'FN' then 'Scalar function' when 'FS' then 'Assembly (CLR) scalar-function' when 'FT' then 'Assembly (CLR) table-valued function' when 'IF' then 'In-lined table-function' when 'IT' then 'Internal table' when 'L' then 'Log' when 'P' then 'Stored procedure' when 'PC' then 'Assembly (CLR) stored-procedure' when 'PK' then 'PRIMARY KEY constraint (type is K)' when 'RF' then 'Replication filter stored procedure' when 'S' then 'System table' when 'SN' then 'Synonym' when 'SQ' then 'Service queue' when 'TA' then 'Assembly (CLR) DML trigger' when 'TF' then 'Table function' when 'TR' then 'SQL DML Trigger' when 'TT' then 'Table type' when 'U' then 'User table' when 'UQ' then 'UNIQUE constraint (type is K)' when 'V' then 'View' when 'X' then 'Extended stored procedure'

when 'AF' then 'Aggregate function (CLR)' when 'C' then 'CHECK constraint' when 'D' then 'DEFAULT (constraint or stand-alone)' when 'F' then 'FOREIGN KEY constraint' when 'FN' then 'Scalar function' when 'FS' then 'Assembly (CLR) scalar-function' when 'FT' then 'Assembly (CLR) table-valued function' when 'IF' then 'In-lined table-function' when 'IT' then 'Internal table' when 'L' then 'Log' when 'P' then 'SQL Stored Procedure' when 'PC' then 'Assembly (CLR) stored-procedure' when 'PG' then 'Plan guide' when 'PK' then 'PRIMARY KEY constraint (type is K)' when 'R' then 'Rule (old-style, stand-alone)' when 'RF' then 'Replication filter stored procedure' when 'S' then 'System table' when 'SN' then 'Synonym' when 'SO' then 'Sequence object' when 'SQ' then 'Service queue' when 'TA' then 'Assembly (CLR) DML trigger' when 'TF' then 'SQL table-valued-function' when 'TR' then 'SQL DML Trigger' when 'TT' then 'Table type' when 'U' then 'Table (user-defined)' when 'UQ' then 'UNIQUE constraint (type is K)' when 'V' then 'View' when 'X' then 'Extended stored procedure'

end) tipo, count(*) from sysobjects group by xtype order by 1