How to distinguish b/w Remove Account and Remove Access tasks in ARS_TASKS DB Table through query

New Contributor II
New Contributor II

Hi Team,

I see that the task type is 2 in ARS_TASKS DB table for both the tasks 'Remove Account' and 'Remove Access'. In that case, how can we filter out only the 'Remove Account' tasks in SQL query(which will be used in analytic report). Task types for other tasks like New Account, Add Access is unique :

Task type : 1 - Add Access, 3 - New Account


Valued Contributor II
Valued Contributor II

Hi @mkaushal ,

you can differentiate remove access and remove account on the basis of entitlement present in the task or not.

Use below queries 

For Remove Access:
Select * from arstasks where tasktype=2 and ENTITLEMENT_VALUEKEY is not null;

For Remove Account:
Select * from arstasks where tasktype=2 and ENTITLEMENT_VALUEKEY is null;


Pandharinath Mahalle(Paddy)
If this reply answered your question, please Accept it As Solution to help others who may have a similar problem.


For Task Type =2 in arstasks

If there is no entitlement (entitlement_valuekey column null in arstaks ) then Remove account  else Remove Access


Rushikesh Vartak
If the response is helpful, please click Accept As Solution and kudos it.