Modifying Data in T-SQL

Modifying Data in T-SQL: Inserting Data, Updating Data, Deleting Data, Transactions.

Updated

  1. Inserting Data (Apprentice): Add rows to a table with INSERT INTO, name the columns you fill, let identity columns number new rows, and respect the table's keys.
  2. Updating Data (Apprentice): Change existing rows with UPDATE ... SET, always limited by a WHERE that you've tested first with a SELECT.
  3. Deleting Data (Apprentice): Remove rows with DELETE FROM ... WHERE, test the WHERE first, and delete in the order the foreign keys allow.
  4. Transactions (Apprentice): Group changes into a transaction so they all happen or none do, and use ROLLBACK as a safety net while you work.