Friday, April 24, 2015

Delete a specific Batch Job

 The sql script to only delete a specific entry would be:

declare @BatchJobRecId bigint

select top 1 @BatchJobRecId = RECID from BATCHJOB
    where CAPTION = 'Workflow message processing' and
            COMPANY = 'dat'

delete from BATCHJOB where RECID = @BatchJobRecId

delete from BATCH where BATCHJOBID = @BatchJobRecId 


if (exists(select top 1 RECID from BATCHJOB where CAPTION = 'Data upgrade'))
begin
    print ''
    print 'There are still other btch jobs registered in AX with this name. Run again this script'
end


No comments:

How to identify the user that was used to change an object from AOT in AX2012

Get the object name for which we need to track these (user and date&time) information's. Login to SQL Server Management Studio an...