This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Yes. You can do this either using a database specific mechanism. You don't mention the database type, but you could use a sequence, or an identity column, or an autoincremenet column, or a timestamp colum depending on the database. Or you can do this in your app. Its easy enough to do that - you'll need to use some sort of pattern (for example the HILO key generation pattern) to get a value and just update the database accordingly.
If you have an entity that needs a unique, unchanging, not null complaint number; is that not a primary key?