Notification

Icon
Error

User deletion requirements

Posted: Monday, February 24, 2020 2:45:58 PM(UTC)
Adam Poole

Adam Poole

Member Original PosterPosts: 2
0
Like
Hi folks,

Exactly what needs to be true (or not true) about any given user for me to be able to delete them via SQL maintenance tool? I am attempting to delete a bunch of users using the following statement:

DELETE FROM htblusers WHERE email not like '%something.ac.uk' and email not like '%something.co.uk' but am running into the following error:

The DELETE statement conflicted with the REFERENCE constraint "FK_htblhistory_htblusers". The conflict occurred in database "lansweeperdb", table "dbo.htblhistory", column 'userid'.
The statement has been terminated.


I assume this means there is a related entry in another table; I have ensured there are no tickets for any users which would be captured in the statement but I guess it's more than that?

Cheers in advance!
Erik.T
#1Erik.T Member Administration Posts: 63  
posted: 3/3/2020 8:39:12 AM(UTC)
Hi Adam,

The delete statement is not working because htblusers is linked to htblhistory. You'll first need to determine the userid from htblusers and delete all entries from htblhistory wit that userid.

Afterward you can delete the entries from htblusers.

Active Discussions

Installer Installer - Microsoft Office
by  Florian_Eigsi   Go to last post Go to first unread
Last post: 4/1/2020 3:44:03 PM(UTC)
Installer Windows 10 Upgrade
by  Michael Kop  
Go to last post Go to first unread
Last post: 3/27/2020 4:47:52 PM(UTC)
Installer Uninstall - Adobe Acrobat 9x
by  palemmo   Go to last post Go to first unread
Last post: 3/25/2020 7:25:05 PM(UTC)
Installer OneDrive Silent Install
by  Steven.C  
Go to last post Go to first unread
Last post: 3/13/2020 2:55:19 PM(UTC)
Installer Gotomeeting Desktop
by  TheITGuy   Go to last post Go to first unread
Last post: 3/12/2020 7:27:48 PM(UTC)
Installer Lenovo System Update
by  TheITGuy  
Go to last post Go to first unread
Last post: 3/12/2020 5:43:51 PM(UTC)
Installer KMS Activation: MS Office & Windows
by  Florian_Eigsi   Go to last post Go to first unread
Last post: 3/3/2020 10:45:41 AM(UTC)
Installer Sophos Silent Install
by  Esben.D  
Go to last post Go to first unread
Last post: 2/14/2020 10:41:20 AM(UTC)