the temp table is created with nvarchar(50) in both screenshots, is this correct?
"
CREATE TABLE #TestUDTs (AddressTypeID int NOT NULL,
[Name] nvarchar(50) NOT NULL PRIMARY KEY CLUSTERED(AddressTypeID))
It will fail with the following error:
Msg 2715, Level 16, State 7, Line 1
Column, parameter, or variable #2: Cannot find data type dbo.Name.
The work around is to use the native data type of the user defined data type:
CREATE TABLE #TestUDTs (AddressTypeID int
NOT NULL,
[Name] nvarchar(50) NOT NULL PRIMARY KEY CLUSTERED(AddressTypeID))
"