Creates a column object representing an Bit datatype.
New-BitColumn [-Name] <String> [-Sparse] [-Default <String>] [-Description <String>] [<CommonParameters>]
New-BitColumn [-Name] <String> -NotNull [-Default <String>] [-Description <String>] [<CommonParameters>]
Use this function in the Column
script block for Add-Table
:
Add-Table 'Items' {
Bit 'IsAvailable'
}
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Name | String | The column's name. |
true | false | |
NotNull | SwitchParameter | Don't allow |
true | false | False |
Sparse | SwitchParameter | Store nulls as Sparse. |
false | false | False |
Default | String | A SQL Server expression for the column's default value |
false | false | |
Description | String | A description of the column. |
false | false |
Add-Table 'Items' { Bit 'IsAvailable' }
Demonstrates how to create an optional bit
column called IsAvailable
.
Add-Table 'Items' { Bit 'IsAvailable' -NotNull }
Demonstrates how to create a required bit
column called IsAvailable
.
Add-Table 'Items' { Bit 'IsAvailable' -Sparse }
Demonstrates how to create a sparse, optional bit
column called IsAvailable
.
Add-Table 'Items' { Bit 'IsAvailable' -NotNull -Default '1' }
Demonstrates how to create a required bit
column called IsAvailable
with a default value of 1
.
Add-Table 'Items' { Bit 'IsAvailable' -NotNull -Description 'The price of the item.' }
Demonstrates how to create a required bit
column with a description.