ARRAY_APPEND Function

Creates a new array by copying an existing array and appending one or more elements to the end. The existing array is not modified.

Syntax

ARRAY_APPEND(array, value, ...)

Parameters

Return Value

The new array, formed from the original array plus the new values at the end.

Example

DECLARE @a = ARRAY(111, 222, 333);
DECLARE @b = ARRAY_APPEND(@a, 999, 1000);
PRINT @a; -- "[111, 222, 333]"
PRINT @b; -- "[111, 222, 333, 999, 1000]"

See Also