title: Interpreting type codes in sys.objects in SQL Server
body: <p>On SQL Server, the sys.objects table includes "Type" and "Type_Desc" attributes. For example, for one of my DBs:</p>
  
  <pre><code>SELECT DISTINCT [Type], Type_Desc
  FROM Sys.Objects
  ORDER BY [Type]
  </code></pre>
  
  <p>Returns:  </p>
  
  <pre>
  C       CHECK_CONSTRAINT  
  D       DEFAULT_CONSTRAINT  
  F       FOREIGN_KEY_CONSTRAINT  
  FN      SQL_SCALAR_FUNCTION  
  FS      CLR_SCALAR_FUNCTION  
  IT      INTERNAL_TABLE  
  P       SQL_STORED_PROCEDURE  
  PK      PRIMARY_KEY_CONSTRAINT  
  S       SYSTEM_TABLE  
  SQ      SERVICE_QUEUE  
  TR      SQL_TRIGGER  
  U       USER_TABLE  
  UQ      UNIQUE_CONSTRAINT  
  V       VIEW  
  </pre>
  
  <p>Different DBs have different results, depending on what types are used. </p>
  
  <p>Is there a comprehensive list of these types somewhere? There isn't a constraint on sys.objects that points me to table of these, and sys.types contains data types. I've searched SQL BOL but haven't found it. Any help would be appreciated. </p>
  
  <p>EDIT: Some DBs use only a subset of these types. For example, if I have a database with no views, when I query Sys.Objects as above, there are no "V" rows in the results. I am looking for a list of all possible types and descriptions used by SQL Server. </p>