Sunday, October 08, 2006

Unique Numbers

In my last job, each till transaction required a unique number, because all sales where collected from the tills databases and stored in main server database.

The problem was when you had independent tills in a couple of branches, how do you generate unique numbers.

Our final solution was to use the date and time, prefixed by the branch and till id. EG: 0123320061008160000

If you need more than one record per second, you can add milliseconds to the transaction ID.

No comments: