How to pass a datatable variable to execute query activity to use sql queries

Hi,

I’m trying to pass a datatable variable in execute query activity to make some actions in sql query. But I couldn’t. Can anyone able to assist me. As a workaround , I’m writing those data table into a excel file using writerange activity and reading it again by using execute query! Kindly assist me if anyone know the way to fulfil my requirement.

Thanks,
Ukesh Kumar D

Hi @ukeshd,

Execute query is used to get the datatable from the database, it works like below example

Select * from tablename

To insert the datatable into database use insert activity of the Database activities

Refer the below thread for reference

1 Like

Hi @anil5,

Is there any option to pass a data table variable in execute query activity like reading a excel values using execute query by changing connection string in execute query.

Thanks

First, why you want to pass a datatable variable to an execute query activity.

If you want to get the datatable from any source, you can use execute query activity by providing the table name.

I have to update some fields based on some values in the datatable. Instead of doing it in write cell activity. I’m trying to update those fields in datatable variable itself and trying to use write range activity to met my requirement.

I am trying to do the same, were you able to pass a datatable variable to a sql query?

Hi ManuH,

Can you able to explain in detail, How you are trying to pass a datatable variable to a sql query?
Can you able to share the same?

Thanks,
Ukesh Kumar