Results for “CMD”
Small, practical examples. Search by task or narrow things down below.
Undo a multi-row transfer atomically
SQL Server: The first transaction commits the fixtures. Rolling back the second transaction restores both sides of the attempted transfer.
SQL Server✓ Tested
Undo only the work after a savepoint
SQL Server: After committing the fixtures, roll back a trial change while keeping earlier work in the second transaction.
SQL Server✓ Tested
Update a JSON property
Create updated JSON text with JSON_MODIFY.
JSON_MODIFY✓ Tested
Update one row using its primary key
SQL Server: Use a precise WHERE condition to change only the intended row in a scratch table.
SQL Server✓ Tested
Update rows selected by a related table
SQL Server: Use EXISTS to limit updates based on an independent eligibility table.
SQL Server✓ Tested
Update several classifications in one statement
SQL Server: A CASE expression computes the new value for each row covered by the update predicate.
SQL Server✓ Tested
Use a counted loop
PowerShell: Use a counted loop using PowerShell 7.
PowerShell✓ Tested
Use a fallback for a missing hashtable entry
PowerShell: Test the key explicitly so legitimate false or zero values are preserved.
PowerShell✓ Tested
Use a literal value in a regular expression
PowerShell: Regex.Escape prevents a literal dot or other metacharacter from changing the match.
PowerShell✓ Tested
Use a session-scoped temporary table
Store intermediate rows in a local # table.
temporary table✓ Tested
Use a small table variable
Declare rows for a short batch.
table variable✓ Tested
Write a multiline string without expanding variables
PowerShell: A single-quoted here-string preserves dollar signs literally.
PowerShell✓ Tested