2019年5月10日 星期五

刪除使用者帳號

 DECLARE @userId nvarchar(100) = '[工號]' 
DECLARE @userOID char(32) = (SELECT OID FROM Users WHERE id = @userId)

DELETE FROM Users where id = @userId;
DELETE FROM Employee WHERE employeeId = @userId;
DELETE FROM Functions where occupantOID = @userOID;