CREATE FUNCTION dbo.Fibonacci (@Num integer, @prev integer, @next integer) RETURNS VARCHAR(4000) AS BEGIN DECLARE @returnValue as VARCHAR (4000) = cast(@prev as varchar(4000)); IF (@Num > 0) BEGIN IF (LEN(@returnValue) > 0) BEGIN SET @returnValue = @returnValue + ','; END SET @returnValue = @returnValue + dbo.Fibonacci(@Num - 1, @next, @next + @prev) ; END RETURN @returnValue; END GO ---------------get list select dbo.Fibonacci(10,0,1)
ChaudharyTechBlog is a technology-focused blog dedicated to providing simple, practical, and easy-to-understand tech guides.
Here, you’ll find tutorials, blogging tips, SEO basics, and helpful resources designed to make technology accessible for everyone.
Our content is carefully researched and written to help you learn, grow, and make informed decisions in the digital world.