Print * Triangle In SQL Server Using REPLICATE( ) Function
In SQL Server we can print * triangle in many methods.One of the simple method is here
/*
PRINT STAR TRIANGLE IN SQL
*/
DECLARE @Limit INT =5
DECLARE @Iteration INT =1
WHILE (0<@Limit)
BEGIN
PRINT SPACE(@Limit-1)+REPLICATE('*',@Iteration)
SELECT @Limit=@Limit-1
SET @Iteration=@Iteration+2
END
OUT PUT :
*
***
*****
*******
*********
***
*****
*******
*********