Conditional Alias in SQL
You should use a dynamic query.




 DECLARE @f1 NVARCHAR(10);
 set @f1= 'MyCategory'

 DECLARE @CMD NVARCHAR(MAX);
 SET @CMD = 'SELECT Field1 AS ' + @f1 + ' FROM MyTable';

 SELECT @CMD;
  --EXEC (@CMD);
GO



| (No column name)                         |
| :--------------------------------------- |
| SELECT Field1 AS MyCategory FROM MyTable |



dbfiddle here