UDF --获取某年某月有多少天 --drop function fn_GetDayofMonth_1 /* HLERP ( [dbo].[GetMonths] ) */ go create function dbo.fn_GetDayofMonth_1 (@Month smallint, @Year int) returns smallint /*获取当月的天数*/ as begin RETURN( Day(Dateadd(dd, -1, Dateadd(m, 1, Cast(@Year AS…