创建包含前后255天所有天数的视图。

create view v as
select d from (
select getdate()-number d from
(select number from master..spt_values where type='p')t
union all
select getdate()+number from
(select number from master..spt_values where type='p')t)t

你可能感兴趣的:(视图)