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