I have a request of how to write a Execute SQL task in SSIS. More of a fail safe for when a vendor's file does not make it to our system. This is causing the below issue.
I have a SQL job that pulls using a WINSCP Windows task script to retrieve the latest CSV file from a SFTP site. Then the SQL job Step 2 sends the file to the SSIS package for loading into SQL. The problem occurs when the SFTP site does not receive a new file.
Step 1 does not fail because it successfully retrieved the latest file, however, Step 2 using the package fails because the file that was pulled already exists from the previous pull. I need a way to check in the SSIS package to see if the dynamic named CSV file exists before processing. I am very green to writing variables and I have never used the Script task command. Is there a way to do this check before my package kicks off the For each file task by using the Execute SQL task ?
As a side note, I do not have permissions to delete older files off of the SFTP site. And, even though the SQL Job Step 2 says it failed, it still executes the CSV file so now I have duplicate records for the same day.
People often wonder how they can safely dispose of their old computers without it costing too much. Here's a guide to a totally free method that I came up with.
1. Remove the hard drive, put a drill bit through it until you hear the platters inside shatter. Toss it in the bin. 2. Run a cleaning rag around the case and make it nice and shiny. 3. Place the computers in full view on the back seat of your car. 4. Park car in a quiet public car park with the windows cracked just enough so it's easy to reach in an unlock one of the doors. 5. Go and have some lunch or dinner.
When you return, I can almost guarantee the computers will be gone.