command-delete

Use this command to delete row(s) from a table.

Format

DELETE FROM Table [ WHERE bool-condition ]

Remarks

NOTICE

UNEXPECTED BEHAVIOR OF APPLICATION

Be aware that this command will include Group Templates if they exist in the database and are matched by the WHERE clause. Take care to exclude Group Templates when using the command to delete rows from Group Instances. Likewise, take care to exclude Group Instances when using the command to delete rows from Group Templates.
Failure to follow these instructions can result in unexpected or incomplete configuration changes.

The searched DELETE command deletes row(s) from a table. The operation is multi-row, in that zero or more rows will be deleted from a table in a single operation. The optional WHERE clause defines a condition, which identifies which rows will be deleted.

CAUTION: Omitting the WHERE clause will delete all rows from a table.

Example:

DELETE

FROM CDBPoint

WHERE FullName = 'System.Obsolete Point'

Required Permissions

To successfully use this command, the User Account of the user that is executing the command has to be assigned the Configure permission on every database item that is being deleted. If this includes Groups, Group Templates, and/or Group Instances, then this also applies to every item in those Groups, Group Templates, and/or Group Instances, recursively down to the lowest level of nesting within those groups.

If any of the database items are security related, the User Account also has to be assigned the Security permission on those security-related database items (see User Access Considerations when Working with SQL).

Some types of table are special cases; for further information, see User Access Considerations when Working with SQL.