# Export huge MS sql table to csv without fetching all records together

**URL:** <https://forum.knime.com/t/export-huge-ms-sql-table-to-csv-without-fetching-all-records-together/15105>\
**Category:** KNIME Analytics Platform\
**Created:** [May 7, 2019, 4:23pm UTC](https://forum.knime.com/t/export-huge-ms-sql-table-to-csv-without-fetching-all-records-together/15105 "2019-05-07T16:23:15Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [May 7, 2019, 7:39pm UTC](https://forum.knime.com/t/export-huge-ms-sql-table-to-csv-without-fetching-all-records-together/15105/2 "2019-05-07T19:39:58Z")

</div>

have you thought about doing it in chunks? And then appending the result to a CSV file. The example attached uses ROWIDs from SQLite. You could see if you either have a ROWIDs present or you could create one yourself. You can choose the size of the chunk/batch yourself (I use integers you might have to see if with very large numbers you might need big integers or something. Even a workaround with using strings might be possible).

Only other idea would be to write a CSV file directly on a Big Data (Hive) cluster, but that would not work with an MS sql table.

 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/3/3b4a3213d2c50a81c03af5f4be164170d5fb08a5.png)

 ![image](https://forum-cdn.knime.com/uploads/default/original/2X/6/62ab6d5aa5c89357feb65615e45b7fc5d3455afb.png)

[kn\_example\_huge\_db\_to\_csv.knar](https://forum-cdn.knime.com/uploads/default/original/2X/9/9f17d1264210ef21176291e5f186c95a05f73a43.knar) (433.4 KB)

---

_[View the full topic](https://forum.knime.com/t/export-huge-ms-sql-table-to-csv-without-fetching-all-records-together/15105)._
