I am creating normal GUIDs and then storing these as strings in a table. They are very long and I don't need to have them that long as my table only will ever have a maximum of 10,000 rows and if it so happens that a value is created twice I can arrange for a second attempt at an insert.
I am creating the column for that holds the random value and its default like this:
ALTER TABLE [dbo].[Question] ADD GlobalId VARCHAR (50) DEFAULT(NEWID());
Is there some way I can shorten a GUID and still retain some randomness for example 1 in a million repeat values? Note that insert time of a row is not a big concern. What is most important for me is that every time there's an insert I would like to have a random string placed into GlobalId.
Update:
It's been suggested that I use a 4 byte INT and I would be okay with that but I am not sure how to generate a number that would fit in a 4 byte INT as a default in SQL Server.