Create PROCEDURE Factorial
@Number as int,
@Factorial as int OUTPUT
AS
Begin
DECLARE @Input int
DECLARE @Output int
IF @Number != 1
BEGIN
set @Input = @Number - 1
EXEC Factorial @Input, @Output OUTPUT
SELECT @Factorial = @Number * @Output
END
ELSE
BEGIN
SELECT @Factorial = 1
END
RETURN
End
Tuesday, July 28, 2009
Monday, July 27, 2009
Generate Serial Number In SQL Server 2005
select Row_Number() over (order by Emp_Id) as SrNo ,Emp_Id,Emp_Name
from mstEmployee
from mstEmployee
Subscribe to:
Posts (Atom)