Insert range of numbers into a table automatically SQL

1

The question is the following I want to insert in a field of a table a range of numbers that goes from 100 to 1 000 000 000 and did not want to be doing 1 to 1. How can I do this automatically?

In SQL Server

    
asked by anonymous 03.10.2016 / 13:15

1 answer

1

I already found a response is as follows:

DECLARE @num INT = 100
WHILE(@num<200)
begin
INSERT  INTO [dbo].[tableName]([row1],[row2],[row3],[row4])
VALUES (@num,value2,value3,value4)
SET @num = @num + 1
end
    
03.10.2016 / 13:38