I have a table with a integer primary key. The inserts to the table are made via a stored procedure.
I want to use random numbers for the primary key, for example:
ID
4345,
3432,
6686,
8556
The length of the number must be the same for each row.
I tried using identity specifications but it is incremental, not random.
ABS(CHECKSUM(NEWID()))?SUBSTRING(CAST(ABS(CHECKSUM(NEWID())) AS VARCHAR),0,5)and retrying until the id doesnt exits. Thanks!