USE [dba_reporting]

SELECT 
    [batch_id]
    ,[node_id]
    ,[channel_id]
    ,[status]
    ,[error_flag]
    ,[create_time]
    ,[summary]
    ,[byte_count]/1024.0/1024.0 AS MByte_count
    ,[extract_row_count]
    --,[extract_millis]
    ,RIGHT('0' + CAST([extract_millis] / 3600000 AS VARCHAR), 2) + ':' +RIGHT('0' + CAST(([extract_millis] % 3600000) / 60000 AS VARCHAR), 2) + ':' +RIGHT('0' + CAST(([extract_millis] % 60000) / 1000 AS VARCHAR), 2) AS [extract_human]
    --,[load_millis]
    ,RIGHT('0' + CAST([load_millis] / 3600000 AS VARCHAR), 2) + ':' +RIGHT('0' + CAST(([load_millis] % 3600000) / 60000 AS VARCHAR), 2) + ':' +RIGHT('0' + CAST(([load_millis] % 60000) / 1000 AS VARCHAR), 2) AS [load_human]
    ,[extract_start_time]
    ,[transfer_start_time]
    ,[load_start_time]
FROM [dbo].[sym_outgoing_batch]
WHERE [channel_id]='reload'
AND [node_id]='bag'
AND [status]<>'OK'

RETURN

SELECT * 
--UPDATE s SET [s].[source_catalog_name]='sl2007'
FROM [dbo].[sym_trigger] s
WHERE [channel_id]='sl2007_push'


UPDATE [dbo].[sym_outgoing_batch]
SET [status]='IG'
WHERE [batch_id]=305