My personal adventures in the quest for virtual perfectness.
When trying to import users from LDAP I'm getting:
One or more users already exist and haven't been imported.
delete from uistate where userid=10;
delete from useraccount_setting where userid=10;
delete from useraccount userid=10;
Besides the fact the last query is wrong (it needs a 'where'), I've found it much faster to just delete everything above userid 1 (userid 1 = admin account, which I wouldn't touch), granted: only if you havn't imported LDAP users already.
delete from uistate where userid > '1';
delete from useraccount_setting where userid > '1';
delete from alertcontrol where userid > '1';
delete from useraccount where description like 'VC%';
Saved me from deleting like 30 x 4 individual queries .