Type Casts
Expression | Example | Description |
|
| Converts an expression to another data type. For conversions to a TEXT type, use TRY_CAST. |
|
| Converts a text to a non-text type, returning null if the conversion could not be successfully performed. |
|
| Converts a none-encoded text type to a dictionary-encoded text type. |
The following table shows cast type conversion support.
FROM/TO: |
|
|
|
|
|
|
|
|
|
|
|
|
| - | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | n/a |
| Yes | - | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No | n/a |
| Yes | Yes | - | Yes | Yes | Yes | Yes | Yes | Yes | No | No | No |
| Yes | Yes | Yes | - | Yes | Yes | Yes | Yes | No | No | No | No |
| Yes | Yes | Yes | Yes | - | Yes | No | Yes | No | No | No | No |
| Yes | Yes | Yes | Yes | Yes | - | No | Yes | No | No | No | n/a |
| Yes | Yes | Yes | Yes | Yes | Yes | - | Yes | No | No | No | n/a |
| Yes (Use TRY_CAST) | Yes (Use TRY_CAST) | Yes (Use TRY_CAST) | Yes (Use TRY_CAST) | Yes (Use TRY_CAST) | Yes (Use TRY_CAST) | Yes (Use TRY_CAST) | - | Yes (Use TRY_CAST) | Yes (Use TRY_CAST) | Yes (Use TRY_CAST) | Yes (Use TRY_CAST) |
| No | No | Yes | No | No | No | No | Yes | - | n/a | n/a | n/a |
| No | No | No | No | No | No | No | Yes | n/a | - | No | Yes |
| No | No | No | No | No | No | No | Yes | n/a | No | - | n/a |
| No | No | No | No | No | No | No | Yes | n/a | Yes | No | - |
Last updated