Tag: User Defined Type

How to identify User Defined Table(UDT) Type Information in SQL Server

Here is a script to identify the User Defined Table Type information.

The script will list down the information like column name, type name and Schema name.


SELECT 
	TT.NAME TABLE_NAME, C.NAME COLUMN_NAME 
        ,TYPE_NAME(TT.SYSTEM_TYPE_ID) [TYPE_NAME]
	,SCHEMA_NAME(SCHEMA_ID) [SCHEMA_NAME]
FROM SYS.TABLE_TYPES TT
INNER JOIN SYS.COLUMNS C ON C.OBJECT_ID = TT.TYPE_TABLE_OBJECT_ID
ORDER BY TT.NAME
 
Advertisements