I have a table in which there is an int field. This field should be filled with random number and it should be unique. What is the best solution? Should I generate a random number and check if it exists in the table? By the way I’m developing a web application using ASP.NET and C#.
Share
Do you really need it to be random? If you just need an unique integer value, use Identity. Check this link
Edit:
For random number (BigInt) you may try this:
Found it in here