T-SQL循环

代码
DECLARE    @price_date   DATETIME
SET   @price_date   =   CONVERT ( DATETIME , ' 2007-01-01 ' )
WHILE   @price_date   <=   CONVERT ( DATETIME , ' 2007-12-31 ' )
 
BEGIN
  
PRINT   CONVERT ( CHAR ( 10 ), @price_date , 120 )
  
SET   @price_date   =   Dateadd ( DAY , 1 , @price_date )
 
END

 

你可能感兴趣的:(t-sql)