I have a very large input file that will become many tables (80 of them) with different formats but all with the same key. I use VS 2015 and C# with T-SQL for the backend.
For each item a 'start' record with the item ID and then many records for different tables denoted by the first column (like +A, +B, +FC, etc.) Then a stop record for that one item ID.
Now one uses a StreamReader to read and a rather long IF statement with 80 'else' statements to split the file into the 80 tables and process depending on what data is in each of the record types. A INSERT is done in these functions function/methods to load that table with INSERT.
How does one make a rollback that will start with the 'start' method and end with the 'stop' method and allow the rollback of all the data from that particular item ID if it needs to (one of the records being bad.)?