Have you thought about using GUIDs/UniqueIdentifiers?
>Hi to all,
>
> I need a code that will generate a numeric primary key (w/ a length of 10) in my invoice records (300,000) table stored in SQL Server database. I don't want to resort on the auto increment keys being generated SQL server. What i'm planning is to let my front end program do the generation of numeric primary keys (unique).
>
> Badly needed this code.
>
> Thanks in advance
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell