Rename-DataType

Renames data types.

Syntax

Rename-DataType [-SchemaName <String>] [-Name] <String> [-NewName] <String> [<CommonParameters>]

Description

This function wraps the sp_rename stored procedure, and can be used to rename USERDATATYPE types.

Use Rename-Index to rename an index. Use Rename-Column to rename a column. Use Rename-Object to rename an object.

Related Commands

Parameters

Name Type Description Required? Pipeline Input Default Value
SchemaName String

The schema of the table. Default is dbo.

false false dbo
Name String

The current name of the table.

true false
NewName String

The new name of the table.

true false

EXAMPLE 1

Rename-DataType -Name 'FooBar' -NewName 'BarFoo'

Changes the name of the FooBar type to BarFoo.

EXAMPLE 2

Rename-DataType -SchemaName 'fizz' -Name 'Buzz' -NewName 'Baz'

Demonstrates how to rename a data type that is in a schema other than dbo.