Renames data types.
Rename-DataType [-SchemaName <String>] [-Name] <String> [-NewName] <String> [<CommonParameters>]
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.
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
SchemaName | String | The schema of the table. Default is |
false | false | dbo |
Name | String | The current name of the table. |
true | false | |
NewName | String | The new name of the table. |
true | false |
Rename-DataType -Name 'FooBar' -NewName 'BarFoo'
Changes the name of the FooBar
type to BarFoo
.
Rename-DataType -SchemaName 'fizz' -Name 'Buzz' -NewName 'Baz'
Demonstrates how to rename a data type that is in a schema other than dbo
.