I have a runbook that reads the *.xml files (oldest to newest) from a share. It then bulk inserts each XML file into an SQL DB.
This works fine. What I would like to have is that the processing stops completely when, for whatever reason, the bulk import fails. What happens now is that when there are 5 files in the share, and the 3th import fails, that files 4 and 5 are imported. Since there is a specific order in which the files need to be imported, the runbook needs to stop from processing any other files when one fails.
How can this be done?