Hello @anil kumar ,
Tempdb visibility in Azure SQL Database is limited, however you can accomplish what you described as follows:
exec tempdb.sys.sp_executesql N'
CREATE TYPE LocationTableType AS TABLE
( LocationName VARCHAR(50)
, CostRate INT );';
select *
from tempdb.sys.types
where name = 'LocationTableType';
Keep in mind that objects in tempdb are not persistent across database failovers, so you should have logic to recreate these types when they are not found, e.g. after database maintenance events that cause the database to fail over.
