Modifying Data in T-SQL
Modifying Data in T-SQL: Inserting Data, Updating Data, Deleting Data, Transactions.
Updated
- 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.
- Updating Data (Apprentice): Change existing rows with UPDATE ... SET, always limited by a WHERE that you've tested first with a SELECT.
- Deleting Data (Apprentice): Remove rows with DELETE FROM ... WHERE, test the WHERE first, and delete in the order the foreign keys allow.
- Transactions (Apprentice): Group changes into a transaction so they all happen or none do, and use ROLLBACK as a safety net while you work.