Can someone list widely used methods for generating unique IDs to be used in DB tables (PK or otherwise)
Should the table field be string always (for flexibility) or GUID (tight coupling) or simply use IDENTITY always ?
If it is string then, of course i have option to change generator logic anytime.
With IDENTITY i feel constrained because i have to depend on database. But is it good option for fields to publish outside like an Invoice #.
For small size of data say 10000 records, what option i have to get smallest length unique but random alpha-numeric ?
I face many situations where i need such unique number for various purposes, if i am unable to think through a good option, i have to fallback to good old and quick .NET Guid.newGuid.ToString().
But i need to hear from experienced folks, What are the general guidelines and things to watch out for ?