Chapter 8. Data Modification

SQL has a set of statements known as Data Manipulation Language (DML) that deals with, well, data manipulation. Some people think that DML involves only statements that modify data, but in fact it also involves data retrieval. DML includes the statements SELECT, INSERT, UPDATE, DELETE, TRUNCATE, and MERGE. Up to this point in the book, I’ve focused on the SELECT statement. This chapter focuses on data modification statements. In addition to covering standard aspects of data modification, in this chapter, I’ll also cover aspects specific to T-SQL.

To avoid changing data in your existing sample databases, for demonstration purposes, most of the examples in this chapter create, populate, and operate against tables in the ...

Get Microsoft® SQL Server® 2012 T-SQL Fundamentals now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.