I am trying to create a query where the column are variable
Exp
Declare @parm1 int ;
Declare @param2 varchar(50) ;
Declare @param3 int ;
Select Id, name, age from @table_variable
Where
Id=@param1
Name= @param2
Age=@param3
instead of manually typing the columns I want to select each time, I want to replace "I'd, name, age" With an array
@column_array =[list of columns I want to select ]
The list of columns is decided automatically from a winform app with check box list in visual studio that is variable in length, and values Is that even possible?
varchar, which is less than ideal.