I am trying to figure out a way to name my columns in a newly declared table by fetching the name from another source like another string or value in another table.
What I want to know is something like this is possible or not?
In below code I have declared a string and entered a value.
I want this value to be the column name in my table below. Can anyone help me fix this?
declare @string3 varchar(max);
set @string3 = 'LIST_TYPE';
select @string3;
DECLARE @TABP TABLE
(
id int,
@string3 varchar(max)
)