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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.