title: concatenate String with Int in column
body: <p>I need to dynamically loop through column names and fetch the records.</p>
  
  <p>Below is my table, and I am using SQL Server 2017.</p>
  
  <pre><code>-- DECLARE @cnt INT = 1;
  
  -- WHILE @cnt &lt; 3
  -- BEGIN
  --     SELECT 'Name' + @cnt FROM Emp
  --     SET @cnt = @cnt + 1;
  -- END;
  --GO
  </code></pre>
  
  <p>but this query is not working.</p>
  
  <p>How to loop through columns such as <code>Name+@cnt</code>?</p>
  
  <p>Expected output:</p>
  
  <pre><code>User1
  User2
  User3
  </code></pre>
  
  <p><code>Emp</code> table:</p>
  
  <p><a href="https://i.stack.imgur.com/JdTc5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JdTc5.png" alt="enter image description here"></a></p>