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 2005 Forums
 SSIS and Import/Export (2005)
 SQL task returning value to control the run

Author  Topic 

philthe
Starting Member

1 Post

Posted - 2010-09-28 : 15:51:26
I need to check for system dates via a SQL query task, if the dates are not the same as today`s then stop the package.


DECLARE @Current_date DATE
SET @Current_date = (SELECT current_date())

DECLARE @MaxSysdate DATE
SET @MaxSysdate = (SELECT Max(M_H_DT_SYS) FROM MUREXDB.DATES_PROD_CDP)


IF @Current_date <> @MaxSysdate
BEGIN
set @[User::Package_go_nogo] = 1
END

My question is how do i program the SQL task to stop the run? So I did create a user variable that I am trying to populate with the result of the query, to then try to stop the master packge from running, am I in the right direction? Or how should i do this?
   

- Advertisement -