Creates a column object representing an Binary datatype.
New-BinaryColumn [-Name] <String> [-Size] <Int32> [-Sparse] [-Default <String>] [-Description <String>] [<CommonParameters>]
New-BinaryColumn [-Name] <String> [-Size] <Int32> -NotNull [-Default <String>] [-Description <String>] [<CommonParameters>]
Use this function in the Column
script block for Add-Table
:
Add-Table 'Images' {
Binary 'Bits' 256
}
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Name | String | The column's name. |
true | false | |
Size | Int32 | The number of bytes the column will hold. |
true | 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 'Images' { Binary 'Bytes' 256 }
Demonstrates how to create an optional binary
column with a maximum length of 256 bytes.
Add-Table 'Images' { Binary 'Bytes' 256 -NotNull }
Demonstrates how to create a required binary
column with maximum length of 256 bytes.
Add-Table 'Images' { Binary 'Bytes' -Max }
Demonstrates how to create an optional binary
column with the maximum length (2^31 -1 bytes).
Add-Table 'Images' { Binary 'Bytes' -Max -FileStream }
Demonstrates now to create an optional binary
column with the maximum length, and stores the data in a filestream data container.