DECLARE @max INT = 40000; SELECT rn = CAST([key] AS INT)...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

DECLARE @max INT = 40000;

SELECT rn = CAST([key] AS INT) 
FROM OPENJSON(CONCAT('[1', REPLICATE(CAST(',1' AS VARCHAR(MAX)),@max-1),']'))

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results