I am trying to generate a unique ID for the primary key of a table and I am using DateTime.Now.Ticks
for it. That\'s a requirement for now we can\'t use Ident
The better approach is use auto-generated Id
but If you want to stick with DataTime Tick option, then you can use this approach that will give you a unique number base on your time.
Random rand = new Random(DateTime.Now.Millisecond);
Also, you can use
Guid guid = Guid.NewGuid();
That'll also give you a unique number.
Thanks!