samedi 2 juillet 2016

SQL Server 2005 Insert with WHILE LOOP

I want to get the result like this

enter image description here

Here is my code

declare @current int
declare @Temp Table(c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int, c8 int, c9 int, c10 int)
select @current = 1
while @current <= 10
    begin
        --I want to insert here
        select @current = @current + 1
    end
select * from @Temp

How can I insert? Thanks for any help.

Aucun commentaire:

Enregistrer un commentaire