ZERO
Updated 2023-10-19 16:00:37.660000
Syntax
SELECT [westclintech].[wct].[ZERO](
<@m, int,>
,<@n, int,>)
Description
Use the scalar function ZERO to generate an m-by-n matrix of zeroes.
Arguments
@m
The number of rows in the zeroes matrix.
@n
The number of columns in the zeroes matrix.
Return Type
nvarchar(max)
Remarks
@m must be greater than or equal to 1.
@n must be greater than or equal to 1.
Examples
The following statement will produce the 5-by-5 zeroes matrix.
SELECT wct.ZERO(5, 5) as ZEROES;
This produces the following result.
{"columns":[{"field":"ZEROES"}],"rows":[{"ZEROES":"0,0,0,0,0;0,0,0,0,0;0,0,0,0,0;0,0,0,0,0;0,0,0,0,0"}]}
We can use the table-valued function MATRIX to produce the output in third-normal form.
SELECT *
FROM wct.MATRIX(wct.ZERO(5, 5));