<img src="//trc.taboola.com/1222697/log/3/unip?en=page_view" width="0" height="0" style="display:none">


The Knowledgebase articles are deprecated. Please visit the new Guides and Resources here: https://www.uipath.com/developers/guides-and-resources.

Knowledge Base

Export Data From Database to CSV file


  • To be able to run this example you need to install UiPath.Excel.Activities and UiPath.Database.Activities. See more details on how to install packages here.


This sample extracts information from a database and put them into a CSV file.

Steps to automate

  1. Connect to the database.
  2. Specify the columns that you want to extract from the database.
  3. Put the information extracted into CVS file.


  1. Connect to a database using "Connect" activity. You will need a server name, username and password.
  2. Use an "Execute query" activity to specify the name of the database and the columns that you want to extract.
  3. "Execute query"  activity returns a datatable so you have to use a "Write CSV" activity to take all the information from datatable and write into CVS file.