Does anyone know how to rename a column using a variable?
DECLARE @user1 varchar(50)
SELECT @User1 = 'New_Column_Name'
SELECT User1 AS @user1
The AS clause doesn't work, nor does an = sign. The problem is that I have is that table 1 defines the labels of user defined fields in table 2 I am querying from. I would like the output to use the from table 2 to have the proper column lables as defined in table 1.
Thanks
Curtis