代码如下:if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[f_getdate]’) and xtype in (N’FN’, N’IF’, N’TF’)) drop function [dbo].[f_getdate] GO create function [dbo].[f_getdate] ( year int, –要查询的年份 bz bit –bz=0 查询工作日,bz=1 查询休息日,bz IS N