title: How to select alias name from a table in sql server?
body: <p>I have a language table and I want to select aliases from that table according to the specified language. </p>
  
  <pre><code>ALTER PROCEDURE sp_executesql
  (@parameter1 NVARCHAR(MAX)
  ,@parameter2 NVARCHAR(MAX)
  ,@code NVARCHAR(MAX),@language NVARCHAR(MAX))
  
  DECLARE @sql NVARCHAR(MAX)
  
  SET @sql = 'SELECT '+@parameter1+' AS (SELECT @language FROM Languages WHERE code=somecolumn) '+@paramter2+' AS (SELECT @language FROM Languages WHERE code='+@code+') FROM mytable' 
  </code></pre>
  
  <p>EDIT:
  in Stored Procedure, I need something like that.</p>
  
  <p>Thanks for answers..</p>