cancel
Showing results for 
Search instead for 
Did you mean: 

Distinguish Task Type in hsi.tasklist?

Jonna_Pantelis
Star Contributor
Star Contributor

Is there a way to distinguish specifically "System Tasks" from hsi.tasklist?

I was able to identify one of the system tasks and use the flags column value and pull back a list of other Tasks, but I wanted to verify if that's correct or not.


Thank you!

2 REPLIES 2

Joel_Moore1
Star Contributor
Star Contributor

Hi Jonna,

This is a column where we leverage bitwise operators to set multiple flags in the column. The following query will return legacy System Tasks only:

SELECT * FROM hsi.tasklist 

WHERE

flags & 64 = 64

AND

flags & 67108864 <> 67108864


If you want to return Unity System Tasks only, this query will do the trick:

SELECT * FROM hsi.tasklist 

WHERE

flags & 67108864 = 67108864


If you wanted to return Legacy and Unity System Tasks, this query should return all of them:

SELECT * FROM hsi.tasklist 

WHERE

flags & 64 = 64


This is probably more than you wanted, but I am hopefully the additional queries will help other inquiring minds. One more detail is that the queries above are for SQL Server specifically. An Oracle query would need to leverage the bitwise AND operator. Here's an example of what that would look like:

SELECT * FROM hsi.tasklist 

WHERE

bitand(flags, 64) = 64; 


Hope this helps!

Best,

Joel

Hi Joel - This is very helpful, could you also provide a method to identify ad hoc tasks in tasklist? Thanks!

eta: looks like it's bitand(flags,8192)=8192, but if someone can confirm that would be great.