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

Lansweeper Close ticket failed
by  JohnnyL   Go to last post Go to first unread
Last post: Yesterday at 6:51:21 PM(UTC)
Lansweeper SNMP Asset dont work
by  implenia  
Go to last post Go to first unread
Last post: Yesterday at 3:44:02 PM(UTC)
Lansweeper Remote IT Asset MGMT during the Covid-19 Crisis
by  Esben.D   Go to last post Go to first unread
Last post: Yesterday at 1:14:27 PM(UTC)
Lansweeper Unable to transfer user's data prior to removal
by  jbruyet  
Go to last post Go to first unread
Last post: 4/1/2020 11:40:35 PM(UTC)
Lansweeper Scanning IP Range Subnet
by  ethanthekiwi   Go to last post Go to first unread
Last post: 4/1/2020 9:16:35 PM(UTC)
Lansweeper Toner Levels Missing
by  brodiemac-too  
Go to last post Go to first unread
Last post: 4/1/2020 8:42:19 PM(UTC)
Lansweeper WLC 5508 question
by  Faktotum   Go to last post Go to first unread
Last post: 4/1/2020 1:10:23 PM(UTC)
Lansweeper SNMPv3 global credentials ?
by  JeremySG  
Go to last post Go to first unread
Last post: 4/1/2020 9:01:16 AM(UTC)