in reply to DBI fetchrow_array

Been there, done that. My bet is that you're looking in the wrong direction. Perl DBI can fetch any number of rows, and SQL server is happy to return them.

Look at your spreadsheet and/or your spreadsheet writer. Make sure it doesn't have a limit. Spreadsheet::WriteExcel has a limit of 65536 rows (and, IIRC, also a limit on filesize). If you're using Spreadsheet::WriteExcel, you may want to use Spreadsheet::WriteExcel::Big instead.