Removes rows from a table.
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]
(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.
(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.
is a standard where clause.
cursor_name causes Adaptive Server to delete the table row or view indicated by the current cursor position for cursor_name.
delete from authors where au_lname = “McBadden”
You cannot use delete with a multi-table view.
If you do not use a where clause, all rows are deleted from the table or view that is named after the delete [from] T-SQL keyword parameter.
Upon completion of the delete command, the number of rows affected must be indicated.