Print numbers
-
I have to call function to print numbers. For Example if I pass 5 as parameter function has to return 1 2 3 4 5 Is declaring Temp table and Get this result is good way? Is there any alternate
-
I have to call function to print numbers. For Example if I pass 5 as parameter function has to return 1 2 3 4 5 Is declaring Temp table and Get this result is good way? Is there any alternate
Here it is
DECLARE @InputValue INT
SET @InputValue=3DECLARE @PrintValue INT
SET @PrintValue=1WHILE @InputValue > 0
BEGINPRINT @PrintValue SET @PrintValue=@PrintValue+1 SET @InputValue=@InputValue-1
END
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post. www.aktualiteti.com
-
I have to call function to print numbers. For Example if I pass 5 as parameter function has to return 1 2 3 4 5 Is declaring Temp table and Get this result is good way? Is there any alternate
That doesn't sound like a database question.