Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gdzierzon/1fda84d1c3aae1fc86319343b1aba7eb to your computer and use it in GitHub Desktop.
Save gdzierzon/1fda84d1c3aae1fc86319343b1aba7eb to your computer and use it in GitHub Desktop.
This is an example of a database update script that is not idempotent.
--this code increases the price of all products
--in the category by 20% each time the script is run
--The result of the script is different each time the script is run.
UPDATE Product
SET Price = Price * 1.2
WHERE CategoryId = 3001
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment