I was wondering if there is a way to select a column by using a SQL variable. Eg. Table is - ID, Name, Address
DECLARE @Column varchar(25)
SET @Column = 'Name' -- This can be another column also
SELECT @Column
FROM MyTable
This shows me 'Name' as many times as there are rows in my table. Is it even possible to do what I want ?
thanks.