To Declare a list of integers in sql, we use the following code
declare @listOfIDs table (id int);
insert @listOfIDs(id) values(1),(2),(3);
However I would like to declare a long list from 1 to n. Is it possible to finish this in one command without using loop?
declare @listOfIDs table (id int);
insert @listOfIDs(id) values ????From 1 to n?????