Remove-DataType

Drops a user-defined datatype.

Syntax

Remove-DataType [-SchemaName <String>] [-Name] <String> [<CommonParameters>]

Description

Handles all three datatypes: alias, CLR, and table. If the datatype is in use, you'll get an error. Make sure to remove/alter any objects that reference the type first.

Related Commands

Parameters

Name Type Description Required? Pipeline Input Default Value
SchemaName String

The name of the type's schema. Default is dbo.

false false dbo
Name String

The name of the datatype to drop.

true false

EXAMPLE 1

Remove-DataType 'GUID'

Demonstrates how to remove the GUID user-defined data type.

EXAMPLE 2

Remove-DataType -SchemaName 'rivet' 'GUID'

Demonstrates how to remove a datatype in a schema other than dbo.