How to copy files from one folder to another folder. Before copying need to check the file name which is present in sql db. If, the file name is already present in the db need not copy that file to another folder.
As @Dave explained you can compare both the object one from the sql and second from the list of files, it should resolve your issue, however unfortunately you still facing the issue, so could you please explain what kind of issue you are still facing