title: ADO command tsql insert query issues
body: <p>In my C++ code, when I try to run the ADO command to insert rows into a table, it only inserts a certain number of rows. The same command works well when using System.Data.SqlClient in .NET. </p>
  
  <p>Sql profiler shows the same textdata when using ADO or a sqlclient. Below is my insert commandtext, I'm not sure what else to do to uncover the issue here. </p>
  
  <p>Any help on this is appreciated.</p>
  
  <p>Command text : </p>
  
  <pre><code>declare @i int set @i = 1 while (@i &lt; 255) 
  begin 
    insert into table1 (name,type, order, state) values (@i, N'type',0,0) 
       set @i = @i +1 
  end
  </code></pre>
  
  <p>The above command ends at 153 rows. Is this dependent on table size ? 
  If I send the command execute twice, consecutively one ranging from @i 0 to 150 and another from 150 to 255, all rows are inserted fine.
  Am I'm hitting a limit on ADO command execute ?</p>
  
  <p>This is my connection string and the code I'm using to build the connection :</p>
  
  <pre><code>CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
  ADODB::_ConnectionPtr m_Conn = NULL;  
  TCHAR connString[255];
    _stprintf(connString, 
        _T("DRIVER=SQL Server;SERVER=np:(local)\\MyInstance;DATABASE=test;"));
  
     HRESULT hr;
     hr = m_Conn.CreateInstance(__uuidof(ADODB::Connection));
     if (hr != S_OK) {
       wprintf(_T("CreateInstance(__uuidof(ADODB::Connection)) failed. Error: %d"), hr);
       return 0;
     }
  
     m_Conn-&gt;ConnectionTimeout = 1800;
     m_Conn-&gt;CommandTimeout = 1800;
  
     hr = m_Conn-&gt;Open((LPCTSTR)connString, _T(""), _T(""), 
         ADODB::adConnectUnspecified);
     if (hr != S_OK) {
       wprintf(_T("Open(%ws, '', '', ADODB::adConnectUnspecified) failed."),
           connString);
       return 0;
     }
  </code></pre>
  
  <p>Thanks for your help.</p>