We can use below code snippets to retrieve the information related to the user defined object.
Code Snippets:

  1. SELECT name AS ObjectName,
  2. type,
  3. OBJECT_NAME(schema_id) SchemaName,
  4. OBJECT_NAME(parent_object_id) ParentObjectName, *
  5. FROM sys.objects
  6. WHERE type = 'U'

Output:
In the above query we defined the "U" for user defined table type in where clause. You can use the following annotations to retrieve the information related to other user defined objects.
Symbol User Defined Object
C Check Constraint
D Default
P SQL Stored Stored Procedure
AF Aggregate Function
F Foreign Key
FN SQL Scalar Function
S System Table
SN Synonym
V View
IT Internal Table
U User Table
TR Trigger
UQ Unique Constraint
X Extended Stored Procedure
IF Inline Tabled valued Function
PK Primary Key

2 Comments

Join the conversation! Your thoughts help the community grow.