title: batchwise Sql script to execute in SSIS
body: <p>I have SQL script which will generate millions of rows and insert to DB table. How can I execute that script in SSIS in batchwise? Is there any easier solution?</p>
  
  <p>Example:</p>
  
  <pre><code>declare @userinput1 int =1
  declare @userinput2 int =10000000;
  
  
  INSERT INTO table2(col1)
  SELECT ones.n + 10*tens.n + 100*hundreds.n + 1000*thousands.n + 10000*laks.n+100000*laks10.n +1000000*crore.n
  FROM (VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) ones(n),
       (VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) tens(n),
       (VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) hundreds(n),
       (VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) thousands(n),
       (VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) laks(n),
       (VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) laks10(n),
       (VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) crore(n)
  WHERE ones.n + 10*tens.n + 100*hundreds.n + 1000*thousands.n + 10000*laks.n +100000* laks10.n +1000000*crore.n  BETWEEN @userinput1 AND @userinput2
  ORDER BY 1
  </code></pre>