How to Drop a Populated User | DROP USER Statement | Teradata Vantage - 17.10 - Dropping a Populated User - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Detailed Topics

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1184-171K
Language
English (United States)

A user must not contain any database objects or you cannot drop it. In other words, you cannot drop a populated user. Complete the following procedure to ensure that a user is empty before you attempt to drop it.

  1. Drop any hash and join indexes in another database or user that reference a table in the current user. See DROP HASH INDEX  and DROP JOIN INDEX.
  2. Drop any triggers in another database or user that reference a table in the current user. See DROP MACRO.
  3. Drop any journal tables in the current user. See MODIFY USER.
  4. Perform either of the following procedures:
    • Delete the current user. See DELETE USER.
    • Drop all the objects within the current user.
      See the appropriate statement set from the following list for more information:
      • DROP FUNCTION
      • DROP INDEX
      • DROP PROFILE and DROP ROLE in Teradata Vantage™ - SQL Data Definition Language Syntax and Examples, B035-1144
  5. Drop the current user.