title: Create @TableName dynamically with number based on loop number
body: <p>so I have a while loop and inside the loop, I want to create tables based on how many loops the sql has done. For example, @TableName1, @TableName2, @TableName3 and so on. A sample of the code below shows what I needed:</p>
  
  <pre><code>Declare @LoopCounter int =1
  Declare @TotalCount int =10
  While (@LoopCounter &lt; @TotalCount)
  BEGIN
  Declare @TableName + (select @LoopCounter) TABLE(
  );
  END
  </code></pre>