Question
How do I list user defined types in a SQL Server database?
I need to enumerate all the user defined types created in a SQL Server
database with CREATE TYPE
, and/or find out whether they have already been defined.
With tables or stored procedures I'd do something like this:
if exists (select * from dbo.sysobjects where name='foobar' and xtype='U')
drop table foobar
However I can't find the equivalent (or a suitable alternative) for user defined types! I definitely can't see them anywhere in sysobjects
.
Can anyone enlighten me?