title: TSQL string concatenation is not working within WHILE loop?
body: <p>Code bellow is not working, any ideas why?</p>
  
  <pre><code>declare @Counter int
  set @Counter = 0
  declare @ConcText nvarchar(1000)
  
  while @Counter &lt; 5
  begin
      --set @ConcText = @ConcText + cast(@Counter as nvarchar(10)) + N' counter,'
      --set @ConcText = @ConcText + convert(nvarchar(10), @Counter) + N' counter,'
      set @ConcText = @ConcText + N' counter,'
      set @Counter = @Counter + 1
  end
  print @ConcText --&lt;-- this is null, why  ??
  </code></pre>