Cannot delete SQL Server User Defined Data Type; Cannot drop type 'dbo.xxx' because it is currently in use.

Problem

You got the following error message when you tried to delete a user defined data type in SQL Server. You also got a empty list when you view the dependencies.

        Msg 3732, Level 16, State 1, Line 3
        Cannot drop type 'dbo.xxx' because it is currently in use.
    

Solution

You need to find out all dependent objects and change them. Here is the sql script.

        SELECT o.name as 'Table', c.name as 'Column' 
        FROM sys.columns c
        Join sys.objects o On o.object_id = c.object_id
        Join sys.types t On t.user_type_id = c.user_type_id
        Where t.name = 'your_type'    
    

Navigator

Other Knowledgebase Articles

Shared Hosting

# of Domains: 2
# of SQL Server Databases: 2
Disk Space: Unlimited
Bandwidth: Unlimited
Email: Unlimited
SQL Server 2008 R2
Monthly: $4.99
More Information About Unlimited Shared Windows Hosting Plan

Windows Hyper-V Server

Dedicated Memory:2GB
Disk Space: 200GB
Bandwidth: Unlimited
Windows 2008/2003: Free
Monthly: $49.99
More Information About Unlimited Windows Hyper-V Server

Dedicated SQL Server

CPU: Intel Dual-Core Sandy Bridge I3-2100
RAM: 8GB RAM
Disk: 2x320GB SATA
RAID: Host RAID 1
Bandwidth: Unlimited
Windows 2008/2003: Free
Monthly: $99.00
More Information About Unlimited Dedicated SQL Server