How to print how many rows are entered in sql database?
Thanks in advance
Hi @Cuberoot
Can you use Execute Query activity to retrieve the data from Database.
Then the output as DataTable. Let’s say dtOutput. And then you can check row count as below.
dtOutput.Rows.Count
Regards
Gokul
but it shows rows is not a member of a string and I have used Execute non query.
Here dtOutput
is the System.Datatable as the variable type
one thing more could you pls help me while using Execute non-Query, it inserts 1 row 6 times.
Assumption: you do interact with the datatable via SQL commands:
SELECT COUNT (*) FROM YourDataTableName;
Above SQL command will retrun the rows count
I want to write in log message not in sql
you want to retrieve the rows count before logging, right?
No,after inserting the data into database because whenevr I enter the problem comes
where should I used after Execute non query?
should I used run query or execute non query or both queries?
You can use Run Query activity @Cuberoot
when I am using run query, it execute only 1 query
Can you share the screenshot ? @Cuberoot
Can I use run command activity?
You can’t able to get the count if you use Run commend activity @Cuberoot
Hi @Cuberoot
Can you share the expression in the Run Query?
After the Run Query activity Just use message and print the row count in the Dt.
Have you use Run query inside the For each row activity?
Yes i have used in for each activity
Hello @Cuberoot
You can get the affected records from the output as integer, You can print it.
Once the data inserted, it results the affected rows.