I am trying to become more efficient in my SQL programming.
I am trying to run a loop to repeat an update command on field names that only change by a numerical suffix.
while @count < @countOfSession
begin
if @day = 'Saturday' or @day = 'Tuesday'
begin
if @day='Saturday'
begin
select @date
set @day='Tuesday'
set @count=@count+1
set @date=@date+3
end
else if @day='Tuesday'
begin
select @date
set @day='Saturday'
set @count=@count+1
set @date=@date+4
end
end
end