O'Reilly logo

SQL Server 2012 T-SQL Recipes: A Problem-Solution Approach by Jonathan Gennick, Wayne Sheffield, Andy Roberts, David Dye, Jason Brimhall

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 8

image

Inserting, Updating, Deleting

by Andy Roberts

In this chapter, I review how to modify data using the Transact-SQL INSERT, UPDATE, DELETE, and MERGE statements. I’ll review the basics of each statement and cover specific techniques such as inserting data from a stored procedure and outputting the affected rows of a data modification.

Before going into the new features, let’s start the chapter off by reviewing basic INSERT concepts.

The simplified syntax for the INSERT command is as follows:

INSERT [ INTO]table_or_view_name [ ( column_list ) ] VALUES (({DEFAULT | NULL | expression } [ ,...n ]) [ ,...n ])

Table 8-1 describes the arguments ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required