利用select * from master.dbo.spt_values


declare @StartDate DATETIME = '2015/05/01'
declare @EndDate DATETIME ='2015/06/03'
select dateadd(day,number,@StartDate) as dt
 from master.dbo.spt_values  where type ='P'
and number <=DATEDIFF(day, @StartDate,   @EndDate)
/*
dt
-----------------------
2015-05-01 00:00:00.000
2015-05-02 00:00:00.000
2015-05-03 00:00:00.000
2015-05-04 00:00:00.000
2015-05-05 00:00:00.000
2015-05-06 00:00:00.000
2015-05-07 00:00:00.000
2015-05-08 00:00:00.000
...
*/

相关文章:

  • 2022-12-23
  • 2021-09-03
  • 2021-11-13
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
猜你喜欢
  • 2022-01-29
  • 2022-12-23
  • 2022-12-23
  • 2022-01-19
相关资源
相似解决方案