declare @BeginDate DATETIME
declare @EndDate DATETIME
SET @BeginDate='2011-7-1'
SET @EndDate='2011-7-30'
while @BeginDate <= @EndDate
begin
PRINT @BeginDate
SET @BeginDate=dateadd(day,1,@BeginDate)
end
declare @BeginDate DATETIME
declare @EndDate DATETIME
SET @BeginDate='2011-7-1'
SET @EndDate='2011-7-30'
while @BeginDate <= @EndDate
begin
PRINT @BeginDate
SET @BeginDate=dateadd(day,1,@BeginDate)
end