delete (minimum)

Description

Removes rows from a table.

Syntax

Transact-SQL Syntax

delete [from][[database.]owner.]{view_name | table_name}
 [where search_conditions]
delete [[database.]owner.]{table_name | view_name}
 [from [[database.]owner.]{view_name | table_name
[(index index_name [prefetch size][lru | mru])]}
 [, [[database.]owner.]{view_name | table_name
(index index_name [prefetch size][lru | mru])]} ]...]
 [where search_conditions]

ODBC Syntax

DELETE FROM table_name [WHERE search_condition]

Parameters

from

(after delete) allows you to name more than one table or view to use with a where clause when specifying the rows to delete. The from clause allows you to delete rows from one table based on data stored in other tables, giving you much of the power of an embedded select statement.

from

(after table_name or view_name) is an optional keyword used for compatibility with other versions of SQL. Follow it with the name of the table or view from which you want to remove rows.

where

is a standard where clause.

where current of

cursor_name causes Adaptive Server to delete the table row or view indicated by the current cursor position for cursor_name.

Examples

Example 1

delete from authors
 where au_lname = “McBadden”

Usage