Back to Home

CEM Termed

Overview

Business will send over a list of users that are no longer active. Requests will come over as CEM Termed with an attached excel file.

The following script will set the User to inactive and clean up tables that no longer need the user assignment.

Script 1: CEM Termed

SELECT UserNo INTO #TerminatedUser
FROM smart.sam_SetupUser
WHERE EmployeeID in (
    -- Add list of users here
) AND CurrentStatus = 1


UPDATE smart.sam_SetupUser SET CurrentStatus = 0
WHERE UserNo IN (SELECT UserNo FROM #TerminatedUser)
-- Remove the user from the team
DELETE FROM smart.sam_Team_Member
WHERE UserNo IN (SELECT UserNo FROM #TerminatedUser)
-- Remove the assigned menu
DELETE FROM smart.sam_User_Menu
WHERE UserNo IN (SELECT UserNo FROM #TerminatedUser)