create FUNCTION dbo.Factorial ( @iNumber bigint ) RETURNS INT AS BEGIN DECLARE @i bigint IF @iNumber <= 1 SET @i = 1 ELSE SET @i = @iNumber * dbo.Factorial( @iNumber - 1 ) RETURN (@i) END declare @int bigint exec @int= dbo.Factorial 12 select @int
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)