KIMKU
0
Q:

tsql print triangle

-- generate a guid table
;with guids( i, guid ) as
(
    select 1 as i, newid()
        union all
    select i + 1, newid()
        from guids
        where i < 20
)

-- print triangle  
select replicate('* ', i)    
from guids 
order by i asc
option (maxrecursion 30)

-- print triangle inverted manner
select replicate('* ', i)    
from guids 
order by i desc
0

New to Communities?

Join the community