Currently, I have a stored procedure that runs many different queries. One query in particular will perform a bulk insert of a CSV file stored on my computer, when a file is available, this bulk insert works great. Unfortunately, I don't always have a file for this query to retrieve, resulting in my stored procedure stopping and throwing an error when that file doesn't exist. What is a good way to handle this situation so that the stored procedure continues to execute fully, even if there isn't a file for the bulk insert query to retrieve?
I tried playing around with a try catch
block, but it still gave me the same issues when I tried running the procedure. With that being said, it could have simply been because I didn't implement the try catch
block correctly. I'm open to trying other ways besides try catch
blocks, that was just the one I've seen used the most.