Best practice Update rows on SQL Server
This is the safest way to update the records.
WITH d AS
SELECT UserID, EmailAddress, Password, Gender, DOB, Location, Active FROM Facebook.Users
UPDATE d SET Active = 0
This is the way you can clearly see what we are going to update.
This instruction specifies a temporary named result set, known as a common table expression. It is derived from a simple query and defined within the execution scope of a single SELECT, INSERT, UPDATE, DELETE or MERGE statement.
This is stack flow’s best answer stackflow