<p>I need to enumerate all the user defined types created in a <code>SQL Server</code> database with <code>CREATE TYPE</code>, and/or find out whether they have already been defined.</p>

<p>With tables or stored procedures I'd do something like this:</p>

<pre><code>if exists (select * from dbo.sysobjects where name='foobar' and xtype='U')
    drop table foobar
</code></pre>

<p>However I can't find the equivalent (or a suitable alternative) for user defined types! I definitely can't see them anywhere in <code>sysobjects</code>. </p>

<p>Can anyone enlighten me?</p>

Types and UDTs don't appear in sys.objects.
You should be able to get what you're looking for with the following:
```
```
select * from sys.types
where is_user_defined = 1
```
```