I have a project where I need to pull in a lot of records and modify them based on some criteria.
Basically, we have a system where users can upload documents. Those documents get tagged in the database for validation reasons from other users. We validate the files based on certain criteria and then mark them as being valid. So we have 2 columns isValid and validated.
I can’t depend on the database to validate the files so I have an application that does some work to validate them. There could potentially be hundreds of thousands of files to validate. What is the best approach for the application to iterate the database? One thought I had, was to write a SP to pull the TOP X amount of records that do not have the validated flag set to true. Then run another query to see if there are still records left. If so, run that same SP again, pull the records and process them. I am not sure how the application would handle that amount of records.