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) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -