August 12, 2008 at 12:53 pm
After running a series of SSIS tasks, I want to check a table to be sure it has rows. If the row count is zero, I want the job to fail. Is there an easy way to do this in SSIS?
August 12, 2008 at 12:55 pm
Easiest way would be to use a SQL task and run a check in it.
If not Exists(Select count(Null) From MyTable)
RaisError("Table is empty!", 16, 1)
Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!
August 12, 2008 at 1:16 pm
Crispin Proctor (8/12/2008)
Easiest way would be to use a SQL task and run a check in it.If not Exists(Select count(Null) From MyTable)
RaisError("Table is empty!", 16, 1)
This seems to fail the task whether or not the table is empty.
August 12, 2008 at 2:10 pm
sorry, remove count(Null) and just have null.
Select null from table.
Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!
August 12, 2008 at 3:39 pm
Crispin Proctor (8/12/2008)
sorry, remove count(Null) and just have null.Select null from table.
That did the trick. Thanks!
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply