Update rows on SQL Server
Essentially, a poka-yoke is a safeguard that avoids having problems in the SQL statements, in this case we can avoid perhaps deleting an entire table in the absence of the WHERE A=?? statement.
WITH is the safest way to update the records.
WITH d AS ( SELECT UserID, EmailAddress, Password, Gender, Location, Active FROM codegr.Users ) UPDATE d SET Location = 'amsterdam'
What Is the WITH Clause in SQL?
Sometimes, you face a complex problem that cannot quickly be answered via a single SQL statement.
The WITH clause is very equivalent to creating tables. When you create a table needs to give it a name, this name essentially acts as a table name in the main SQL statement.
The benefits of the usage of instruction WITH are that does not create a table or a view, the tables associated with the WITH statement disappear after the main SQL statement is executed, and there is nothing to drop or clean.