The Hidden Danger of MAX()+1 Logic in Enterprise Applications
Generating the next number using MAX() + 1 is one of the most common approaches developers use when creating custom identifiers.
At first glance, the logic looks simple and perfectly valid:
var maxZid