Thursday, May 16, 2013

Script to calculate number sequence and insert into a table


Calculating number sequence

DECLARE @idt bigINT
SET @idt = 0
WHILE (@idt < 1000)
BEGIN
SELECT @idt = @idt + 1
insert into dbo.NumberSequence (number)
values (@idt)
END

Inserting into a table

DECLARE @idt bigINT
SET @idt = 0
WHILE (@idt < 1000)
BEGIN
SELECT @idt = @idt + 1
insert into dbo.NumberSequence (number)
values (@idt)
END

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.