I am trying to use this approach to get the final query but doesnt seems to work
Code:
declare @CurrentRow int set @CurrentRow =0; declare @RowsToProcess int declare @FinalHistoricalQuery varchar(5000) WHILE @CurrentRow<3 BEGIN SET @FinalHistoricalQuery =' select 11'+convert(varchar(20),@CurrentRow)