Forum Discussion

Harsha_Rachapal's avatar
9 years ago

How to delete custodian managers in DA using SQL query

We accidentally loaded all users from our AD into DA using ADSynchronization. There are around 60,000 custodians now, while we only need 500 custodian. Can anyone please suggest any helpful solutions? We are looking to delete unwanted custodians using a SQL query. Is there a SQL query to delete multiple custodian managers from DA? Any help is greatly appreciated. Thanks.

1 Reply

Replies have been turned off for this discussion
  • Delete in the below order
    ----------------------------------
    DELETE FROM [dbo].[tblAddress]
    WHERE AddressOwnerID = 16369;


    DELETE FROM [dbo].[tblAddressUser]
    WHERE AddressOwnerID = 16369;

    //The below only use if you are planning to delete the Custodian Group as well

    DELETE FROM [dbo].[tblPrincipal]
    WHERE TargetGroupID = 11;

    DELETE FROM [dbo].[tblTargetGroup]
    WHERE TargetGroupID = 11;
    ------------------------------------------------------------------