SQL Loop dynamic select "equals" in stored procedure -


i trying following , not understand why not work. not understand.

declare @month_1 nvarchar(50) declare @month_2 nvarchar(50) declare @month_3 nvarchar(50)  declare @intflag nvarchar(50)  set @intflag = 1 while (@intflag <=3) begin select  '@month' +'_'+ @intflag = datepart(month, getdate())  print '@month' +'_'+ @intflag  set @intflag = @intflag + 1 end go 


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

xcode - Swift Playground - Files are not readable -

jboss7.x - JBoss AS 7.3 vs 7.4 and differences -