
/*------ ATD 438150 ------*/
IF EXISTS (SELECT 1 FROM SESSAOAPLICATIVO where executavel like '%MONITOR%' and inicio is not null and termino is null)
   update sessaoaplicativo set termino=getdate() where executavel like '%MONITOR%' and inicio is not null and termino is null
