New-FloatColumn

Creates a column object representing a float datatype.

Syntax

New-FloatColumn [-Name] <String> [[-Precision] <Int32>] [-Sparse] [-Default <String>] [-Description <String>] [<CommonParameters>]
New-FloatColumn [-Name] <String> [[-Precision] <Int32>] -NotNull [-Default <String>] [-Description <String>] [<CommonParameters>]

Description

Use this function in the Column script block for Add-Table:

Add-Table 'Items' {
    Float 'Price'
}

ALIASES

Parameters

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 NULL values in this column.

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

EXAMPLE 1

Add-Table 'Items' { Float 'Price' -Precision 5  }

Demonstrates how to create an optional float column called Price, with a precision of 5.

EXAMPLE 2

Add-Table 'Items' { Float 'Price' -NotNull }

Demonstrates how to create a required float column called Price. Uses SQL Server's default precision.

EXAMPLE 3

Add-Table 'Items' { Float 'Price' -Sparse }

Demonstrates how to create a sparse, optional float column called Price. Uses SQL Server's default precision.

EXAMPLE 4

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.

EXAMPLE 5

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.