Abba
2008-12-24 10:11:18 UTC
Hello,
[SQL2000]
Iam syncing data from PROD to BETA using an SSIS package. After I load the
data to stage table from PROD, I compare the dates between stage and load
table. If the stage table only has latest data then only I need the rest of
the steps in the package to be executed.
So, in my SQL Execute task, I write:
IF EXISTS(SELECT 1 FROM Stage WHERE upd_date <= (SELECT MAX(upd_date) FROM
load))
BEGIN
RAISERROR('There is no recent data in PROD', 11, 1)
END
This works fine as it errors out when we dont have latest PROD data, but
then the scheduled job that runs the SSIS package always completes as
'failed'. How can I change the query or logic to accomplish what I want?
TIA,
AbbA
[SQL2000]
Iam syncing data from PROD to BETA using an SSIS package. After I load the
data to stage table from PROD, I compare the dates between stage and load
table. If the stage table only has latest data then only I need the rest of
the steps in the package to be executed.
So, in my SQL Execute task, I write:
IF EXISTS(SELECT 1 FROM Stage WHERE upd_date <= (SELECT MAX(upd_date) FROM
load))
BEGIN
RAISERROR('There is no recent data in PROD', 11, 1)
END
This works fine as it errors out when we dont have latest PROD data, but
then the scheduled job that runs the SSIS package always completes as
'failed'. How can I change the query or logic to accomplish what I want?
TIA,
AbbA