Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 Fail a task depending on results..

Author  Topic 

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2003-08-27 : 04:44:40
Hiya guys, haven't been around in a while, but feeling very thick today, can't work this out, where has my brain gone?

If I have a check for number of records in a DTS task, how do I fail it if the reult isn't what I want?

For example:-

If (select count(*) from table) = 0
begin
--I want to fail it here
end
else
begin
--I want it to continue here
end

Can you help please?

Stoad
Freaky Yak Linguist

1983 Posts

Posted - 2003-08-27 : 07:41:43
If (select count(*) from table) = 0
begin
drop table someNonExistingTable
--I want to fail it here
end
Go to Top of Page

RickD
Slow But Sure Yak Herding Master

3608 Posts

Posted - 2003-08-27 : 10:11:13
Cheers, thought I was being thick... :D
Go to Top of Page
   

- Advertisement -