I am dynamically trying to pass a particular column name to the select list of a select statement.
that is
@var = 'Col1'
so I need the following query
select col1 from tbl1
I will not know the column name is 'Col1' but the value will be in @var. How can I use it?
By the way I am using SQL Server 2000