We have SQL Server 2012.
We want SQL Server Agent Job, which has task to check database table every 30min to see if SSIS should be called or not.
We can use create SSIS package or stored procedure. Which one is better?
What kind of SQL statement is needed? Specially interested about how to check if timestamp is today and how to handle return value logic.
I would like to check:
-IF ETL_started_value (datetime) is not NOT NULL
-IF ETL_finished value (datetime) is TODAY
-IF ETL_result is 1 (smallint)
If all criteria is OK-> call SSIS, which includes Business Logic
If not all criteria is OK- Do nothing and Job Task will try again aftern 30min.
THIS IS OUR TABLE AND ANOTHER ETL TOOL MAKES UPDATE TO IT:
CREATE TABLE [dbo].[ETL_status](
[ETL_started] [datetime] NOT NULL,
[ETL_finished] [datetime] NULL,
[ETL_result] [smallint] NULL,
) ON [PRIMARY]
GO
Kenny_I