1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| --Partie 1
--Création d'une première table temporaire
select tra_id_tracteur as Tra into #T1 from tracteur where tra_id_tracteur in(1,2,3)
--Création d'une seconde table temporaire
select COL_COL as Col into #T2 from COL_OK where COL_ID in(1,2,3,15)
--Création d'une troisième table temporaire issue des deux premières
select ROW_NUMBER() over (order by col) as I,Tra,Col into #T3 from #T2 cross join #T1
--Partie 2
declare @i int
select @i =1;
print @i;
declare @l nvarchar(40)
select @l = (select Col from #T3 where I =@i);
while @i <36
Begin
print @i;
print @l;
select @i=@i+1
end |
Partager