We store documents in our database (sql server), the documents are spread across various tables so there is no one table that contains all of them.
I now have a requirement to give all documents a system wide unique id, one that is semi-readable, not like a guid.
I've seen this done before by creating a single table with a single row/column with just a number that gets incremented when a new document is created.
Is this the best way to go about it, how do I ensure that no one reads the current number if someone is about to update and and vice versa?
In this case the number can be something like 001 and auto-increment as required, I'm mainly worried about stopping collisions rather than getting a fancy identifier.