I found this a bit odd. I have a group of pre-filters that are off hidden and they showed up in the query. Because I missed a pre-filter, I missed some data records. I don't think this can be correct.
WHERE (t1.tenant_id = convert(int,SESSION_CONTEXT(N'tenant_id'))
)
AND t1.[tenant_id] = @p0 AND t1.[process_id] = @p1 AND ((exists ( select 1
from dbo.get_caller_process_tabs() cpt
where cpt.process_id = t1.process_id
and cpt.is_cancel = 1 )
)
OR (exists ( select 1
from dbo.get_caller_process_tabs() cpt
where cpt.process_id = t1.process_id
and cpt.is_close = 1 )
)
OR (exists ( select 1
from dbo.get_caller_process_tabs() cpt
where cpt.process_id = t1.process_id
and cpt.is_late = 1 )
)
OR (exists ( select 1
from dbo.get_caller_process_tabs() cpt
where cpt.process_id = t1.process_id
and cpt.is_open = 1 )
)
OR (exists ( select 1
from dbo.get_caller_process_tabs() cpt
where cpt.process_id = t1.process_id
and cpt.is_wait = 1 )
)
)
Best answer by Anne Buit
View original