select ownerId, ownerType, template, callbackId from tbl_API_Callbacks where callbackId = and resolvedOn is null and between createdOn and expiresOn update tbl_API_Callbacks set attempts = coalesce( attempts, 0 ) + 1 where callbackId = update tbl_API_Callbacks set resolvedOn = , callbackRequest = , attempts = coalesce( attempts, 0 ) + 1 where callbackId = update tbl_API_Log set response = , responseTime = , statusCode = '200 OK' where url = ( select top 1 callbackURL from tbl_API_Callbacks cb with (nolock) where cb.callbackId = ) and transactionType = 'CALLBACK' update tbl_API_Callbacks set error = where callbackId =