In SSIS, tasks fail when there is an error. So, if your Execute SQL Task has a statement like the following, you should be able to force a fail.

BY Best Interview Question ON 04 Sep 2020

Example

declare @count int
select @count = select count(*) from my_table
if @count < 1000
begin
    raiserror(‘Too few rows in my_table’,16,1)
end
else
begin
    — Process your table here
end