Psst! Check what courses we have in our offer, and get them all here to save $727. Tick-tock—this deal ends on 3/21.
Introduction
Default values
How to auto-generate values in a database
14. Generating a GUID in the UPDATE statement
Summary

Instruction

Excellent! You can also use NEWID to update a record. Look at the query:

UPDATE Author
SET Id = NEWID()
WHERE FirstName = N'John' 
AND LastName = N'Williams';

This updates the Id field for John Williams with a new uniqueidentifier value.

Exercise

Generate a new Id value (of uniqueidentifier type) for the author whose LastName = N'Nowak'.