title: How to avoid While Loop in Sql
body: <p>I know I should try to avoid while loop in sql but I could not get it done, can someone please suggest a better way to achieve same result without using while loop. Here is my code -</p>
  
  <pre><code>begin transaction
  
  declare @count int;
  set @count = 1;
  
  declare @Id bigint;
  set @Id = 3781543256;
  
  while @count &lt;=35000
  
  begin
  
  INSERT INTO [Table_name]
             ([Column1]
             ,[Column2]
             ,[Column3]
             ,[Column4]
             ,[Column5])
       VALUES
             (7,
             @Id,
             '20130909 16:42:43.157',
             0,
             NEWID())
  
  set @Id = @Id+1; 
  
  set @count = @count+1;
  end
  </code></pre>