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: 94  
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

Lansweeper Unable to send to External Email
by  pryan67   Go to last post Go to first unread
Last post: Yesterday at 8:21:01 PM(UTC)
Lansweeper Lansweeper assets not being Scanned
by  Jordan  
Go to last post Go to first unread
Last post: Yesterday at 6:42:22 PM(UTC)
Lansweeper Database size growing too large
by  bladd   Go to last post Go to first unread
Last post: Yesterday at 4:26:44 PM(UTC)
Lansweeper Searching Specific File
by  mzipperer  
Go to last post Go to first unread
Last post: Yesterday at 4:23:29 PM(UTC)
Lansweeper Exchange 2010 information is not populating
by  Moe   Go to last post Go to first unread
Last post: Yesterday at 12:30:38 PM(UTC)
Lansweeper Routinely Exploited Vulnerabilities Query Report
by  pryan67  
Go to last post Go to first unread
Last post: Yesterday at 12:25:31 PM(UTC)
Lansweeper Creating a report for new devices every 2 hours to alert
by  Moe   Go to last post Go to first unread
Last post: 6/4/2020 7:26:11 PM(UTC)
Lansweeper Changes in the licensing model
by  BullGates  
Go to last post Go to first unread
Last post: 6/4/2020 6:27:23 PM(UTC)