Determining SQL 2005 System Object Types

 

The SysObjects table contains one row for each object that has been created in your SQL server database when you install SMS or MOM or if you create a new database yourself.

 

The Data type for the object types is a 2 character (Char) value and can be executed from any database as mentioned above as well as the systems databases.

 

By executing the script below you can find what type of object is in your database. You can see which objects are stored procedures, Tables, Views or even system tables.

 

 

SQL Query:

 

Select

Name,

 

'Object Type' = Case

When XType = 'C' Then 'Check Constraint'

When XType = 'D' Then 'Default or Default Constraint'

When XType = 'F' Then 'Foreign Key Constraint'

When XType = 'L' Then 'Log'

When XType = 'FN' Then 'Scalar Function'

When XType = 'IF' Then 'Inlined Table Function'

When XType = 'P' Then 'Stored Procedure'

When XType = 'PK' Then 'Primary Key Constraint'

When XType = 'RF' Then 'Replication Filter Stored Procedure'

When XType = 'S' Then 'System Table'

When XType = 'TF' Then 'Table Function'

When XType = 'TR' Then 'Trigger'

When XType = 'U' Then 'User Table'

When XType = 'UQ' Then 'Unique Constraint'

When XType = 'V' Then 'View'

Else 'Extended Stored Procedure'

End

 

From SysObjects

Group By Name, XType

 

Published Saturday, August 19, 2006 10:18 AM by dhite

Comments

No Comments