We can use below code snippets to retrieve the information related to the user defined object.
Code Snippets:
- SELECT name AS ObjectName,
-
- type,
-
- OBJECT_NAME(schema_id) SchemaName,
-
- OBJECT_NAME(parent_object_id) ParentObjectName, *
-
- FROM sys.objects
-
- 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 |