Clear GP Users

delete from DYNAMICS..ACTIVITY

where USERID not in

(select loginame from master..sysprocesses)

delete from tempdb..DEX_SESSION

where session_id not in

(select SQLSESID from DYNAMICS..ACTIVITY)

delete from tempdb..DEX_LOCK

where session_id not in

(select SQLSESID from DYNAMICS..ACTIVITY)

delete from DYNAMICS..SY00800

where USERID not in

(select USERID from DYNAMICS..ACTIVITY)

delete from DYNAMICS..SY00801

where USERID not in

(select USERID from DYNAMICS..ACTIVITY)

Leave a Reply

Your email address will not be published. Required fields are marked *