Hopefully that title makes sense.
I currently have an SQL task that copies data from a staging table to the final destination and creates a log entry in another table on success or failure.
I had to add an if statement to the task to have it check to make sure it matches a value in another table of the db. The SQL task of course evaluates to true and the incorrect status is logged.
How can I get the task to fail if the if statement is not met? I tried using RAISERROR() but that does not work.