Add file name to Database insert

Hello,

I have a sequence that loads csv files into SQL db. Is there a way that I can add a file name variable to last column in SQL?

Any help or direction would be appreciated.

Thanks,

Tim

Hi @timothy.mullady ,

Could you let us know how is the loading of CSV files done ?

@timothy.mullady

I’m assuming that you’re using UiPath’s SQL activities package to insert your DT to your SQL DB. In that case after reading the CSV file, add a column to your DT using the Add Data Column activity with the default value as your filename.

wouldn’t the filename need to be variable? I’m looping through multiple files

Check the properties of your Add Data Column activity and configure as below:

Column Name: “File Name”
Data Table: DtTableCsv
Default Value: item.ToString

Thanks, Do I need to have the column name already added to the SQL table? Or the activity will automatically add the column to the SQL table

Hi @timothy.mullady ,

The Column would require to be added also to the SQL Table, we would not be able to add it using the Datatable prepared.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.