If you’re getting SQL Server error 4199 that reads “Argument value 0 is invalid for argument 3 of generate_series function“, it’s probably because you’re passing zero as the third argument to the GENERATE_SERIES()
function.
The GENERATE_SERIES()
function accepts an optional third argument, but this argument can’t be zero.
To fix this error, either pass a non-zero expression as the third argument, or omit the argument altogether (in order to use the default step of 1).
Continue reading