I have to extract data from my SQL
Database is : client info
Table name is: production order
I need to extract data from SQL and stored in excel
1. I want Top 13 datas
2. I want bottom 5 datas only
How can I achieve this please explain me
Thanks & regards,
Use Execute Query query to fetch data from Database and it will give output as DataTable. And then use Write Range activity and pass above output DataTable to write into Excel file.
How about Using below!
—> To take 13 datarows DT.AsEnumerable.Take(13).CopyToDatatable
---->To take last five datarows DT.AsEnumerable.skip(DT.Rows.count-5).CopyToDatatable**
Here Dt is mention as our sql tablename right
Dt refers to the Datatable Which re you getting Out Dt from Using ExecuteQuery Activity!
It’s through error like this
in ‘sql’ field you have to use your sql query.
So use something like this:
Select top 15 *
from [production order]
The SQL field in the activity property expects a String that contains your script.
“SELECT field1, field2, field3 FROM table”
I believe that the filters mentioned by other colleagues are applied after extracting information from the database to a DataTable type variable.
Your question is about how to filter the DataTable variable or how to make the script to extract data from the DB?
For better understanding refer to the screenshot below!
Can you provide that assign activit value from screenshot again I am getting error
Try Converting from string to datatable variable
and Use Write range to write the datatable
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.