CREATE FUNCTION fun_plus(@a INT)RETURNS BIGINTASBEGINDECLARE @b BIGINTSET @b = 1WHILE @a > 1BEGINSET @b = @b * @aSET @a = @a - 1ENDRETURN(@b)END
https://bbs.csdn.net/topics/392250381