
You are getting below error message while performing the SAP system copy in the Microsoft SQL Server database environment.
Errors when executing sql command:
[Microsoft][ODBC Driver 17 for SQL Server]
[SQL Server]Could not drop login 'USER_ABC' as the user
is currently logged in.

Solution
Firstly, you have to find the session ID with the user (example, USER_ABC).
select session_id from sys.dm_exec_sessions where login_name = 'USER_ABC'
Use the session ID from above output and kill the user session. (example, 88 is the session number)
kill 88
Finally, you can drop the user. (example, USER_ABC).
drop login USER_ABC
If the drop is not possible due to logged user, please try with another user and perform the drop command again.



SWPM should not be started by SIDADM user, see SAP Note
3216263 – SWPM: Could not drop login SIDADM as the user is currently logged in – NetWeaver
https://me.sap.com/notes/3216263