DECLARE @ INT = ##Size:INT?7##; SELECT IIF(u IN(1,s),REP...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

DECLARE @ INT = ##Size:INT?7##;

SELECT IIF(u IN(1,s),REPLICATE(s,s),CONCAT(s,REPLICATE(' ',s-2*LEN(s)),s))
FROM(SELECT @ s)z CROSS APPLY(SELECT TOP(s)ROW_NUMBER()OVER(ORDER BY 1/0)u FROM sys.messages)v

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results