Hello,
I need to delete records from the table which contains more than 24 million records. I need to delete them based on the created date time field. I used delete_record and there is an index on the filed "created date time" but anyway it takes too much time. I checked then in SQL management studio that it doesn't fall to record level deleting row by row. It is still delete_from command on the SQL server and doesn't turn into while select{delete}is there any chance to somehow delete records using order by and only first 10 thousand using AX?
Or I need to write direct SQL statement?
something like this
WITH MyCTE AS (
SELECT TOP (10) *
FROM SalesOrderDetail
ORDER BY SalesOrderID DESC)
DELETE FROM MyCTE;
thanks.