Hi I have a little problem. I must exec query in that style.
In the example, something like that
declare @name varchar(max)
set @name = 'ColumnID'
select @name from Account
that return a lot of ‘ColumnID’ but I will have a result column ColumnID in Account table
You’ll be wanting to execute a dynamic SQL Statement:
Be wary of over-liberal use of these, as they can come with pretty hefty baggage:
Advantages
code written
Disadvantages
As the SQL query is not known until runtime, it can be harder to performance-tune SQL