In myTable, there're several columns as Avg1, Avg2 ....Avg92, they all are float type.
in my SQL code:
The last line of the code gives cast error.
How can I get the variable passed correctly into select statement?
thanks in advance.
in my SQL code:
Code:
declare @counter int declare @parm nvarchar(20) set @counter=0 while @counter<10 set @counter=@counter+1 set @parm='Avg'+ cast(@counter as char) Select @parm from myTable ////// error happens here
How can I get the variable passed correctly into select statement?
thanks in advance.
Comment