I have created a table called table1 which has a column called column1.
How can I populate column1 with (e.g.) 1000 rows in which each row has a unique number going from 1 to 1000? The first row has number 1, the second 2, the third has 3, etc.
I have created a table called table1 which has a column called column1.
How can I populate column1 with (e.g.) 1000 rows in which each row has a unique number going from 1 to 1000? The first row has number 1, the second 2, the third has 3, etc.
You can do it like this
DECLARE @i INT = 1
WHILE @i <= 1000
BEGIN
INSERT INTO table1 (column1) VALUES (@i)
SET @i = @i + 1
END