标签:begin color declare char blog class img nvarchar style
DECLARE @monthDay INT; SET @monthDay = DAY(DATEADD(MONTH, 1, GETDATE()) - DAY(GETDATE())); DECLARE @n INT; SET @n = 1; DECLARE @montDayhstr NVARCHAR(200); SET @montDayhstr =‘‘ WHILE @n <= @monthDay BEGIN SET @montDayhstr = @montDayhstr +‘"‘+ CAST(CONVERT(NVARCHAR(7), DATEADD(MONTH, -0, GETDATE()), 20)AS NVARCHAR(30)) + ‘-‘ + CAST(@n AS NVARCHAR(4))+‘",‘ ; SET @n = @n + 1; END; PRINT @montDayhstr --SELECT CAST(CONVERT(NVARCHAR(7), DATEADD(MONTH, -0, GETDATE()), 20)AS NVARCHAR(30))
标签:begin color declare char blog class img nvarchar style
原文地址:http://www.cnblogs.com/yzenet/p/6958499.html