Comment on page
Lesson 19. Deleting Data
Deleting data is a dangerous operation. Like INSERT, DELETE operates on entire rows. You need to be extremely careful with its usage. It is not hard to blow away an entire table because coding got monotonous and your attention drifted. In order to prevent this catastrophe from happening, I recommend that you verify what you are deleting with a SELECT statement before you write your DELETE.
DELETE --That is it. Just delete.
FROM --The table you want to delete from.
WHERE --The thing that saves you from being fired.
Example Deletion Of One Record
DECLARE @Person AS TABLE (ID INT, FName NVARCHAR(100), LNAME NVARCHAR(100))
INSERT INTO @Person(ID, FName, LNAME)
SELECT 1,'Bob', 'Wakefield'
--Begin delete process
WHERE ID = 1