SQL 2008
Hello,
I have a completely different task that I have to do in SQL. This is a little more than that, but I will try to make it simple.
I need to somehow SELECT a column dynamically. Like this:
declare @ColName varchar(50)
select @ColName = 'Column1'
select @ColName from MyTable where Column2 = 123
Is there a way to do something like this? Any help or guidance would be greatly appreciated!
Thanks Jason
user724198
source
share