I'm looking to figure out a way to run the following:select case when sum(items_processed) = sum(total_items) and count(type) = 9 then 0 else 1 endfrom logwhere [type] = 'History' and user_name = 'MI\techimc' and description <> '' and convert(VARCHAR(10), scheduled_date, 110) = convert(VARCHAR(10), getdate(), 110)group by [type]
having it keep running until 0 is returned, when 0 is returned, i want to run the following sqlinsert into PERFORM..schedule (Event_Type_ID, Start_Time, Input_XML, Time_Type, Exclude_Holidays, User_Name, Enable, Name, Stop_Time, Days_To_Run, Exclude_Dates) Values ( '1', dateadd(mi,1,(cast(getdate()as smalldatetime))), --Change This and the following highlighted sections 'dd', 'O', '0', 'MI-MKE-IMCPAPP3', '1', 'Run Report:MV on All Composites', '12/30/1899 12:00:00 AM', '', '' )
Any thoughts or help you can provide i would appreciate. I'm basically looking for a way to trigger something in the application to run once another job is complete, and since the vendor is useless, we are trying to come up with a solution that doesn't require a console app and that can just be done using sql.