Creates a column object representing a float
datatype.
New-FloatColumn [-Name] <String> [[-Precision] <Int32>] [-Sparse] [-Default <String>] [-Description <String>] [<CommonParameters>]
New-FloatColumn [-Name] <String> [[-Precision] <Int32>] -NotNull [-Default <String>] [-Description <String>] [<CommonParameters>]
Use this function in the Column
script block for Add-Table
:
Add-Table 'Items' {
Float 'Price'
}
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Name | String | The column's name. |
true | false | |
Precision | Int32 | Maximum total number of Numeric digits that will be stored |
false | false | 0 |
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' { Float 'Price' -Precision 5 }
Demonstrates how to create an optional float
column called Price
, with a precision of 5.
Add-Table 'Items' { Float 'Price' -NotNull }
Demonstrates how to create a required float
column called Price
. Uses SQL Server's default precision.
Add-Table 'Items' { Float 'Price' -Sparse }
Demonstrates how to create a sparse, optional float
column called Price
. Uses SQL Server's default precision.
Add-Table 'Items' { Float 'Price' -NotNull -Default '0.0' }
Demonstrates how to create a required float
column called Price
with a default value of 0
. Uses SQL Server's default precision.
Add-Table 'Items' { Float 'Price' -NotNull -Description 'The price of the item.' }
Demonstrates how to create a required float
column with a description. Uses SQL Server's default precision.