mssql delete row code example

Example 1: sql delete all values in a column

UPDATE TableName SET ColumnName = NULL

Example 2: sql server delete row

DELETE FROM my_table WHERE id = 3;
DELETE FROM my_table;                   -- All rows
DELETE TOP 10 FROM my_table;            -- First 10 rows
DELETE TOP 10 PERCENT FROM my_table;    -- First 10% of rows

Example 3: delete row mssql

DELETE FROM table_name WHERE condition;

-- Note: Be careful when deleting records in 
-- a table! Notice the WHERE clause in the DELETE 
-- statement. The WHERE clause specifies which record(s) 
-- should be deleted. If you omit the WHERE clause, all records 
-- in the table will be deleted!

Tags:

Misc Example