You can make your own function like this: CREATE FUNCTION NUMERIC(18,10)) Need for randomness is usually a design smell (randomness is often used for fake security, and is not good for storing indexes in Sql Server). But really I recommend looking harder at your design that is wanting random numbers for an identifier. (Is any number in computing really random?) But it does allow generating numbers that fit in the number range you want. They can be limited to 8 digits(with stop and start values), and can skip values (for example it could count by 8's or 3's or whatever). Second: SequenceĪ sequence is an object in Sql Server designed to make numbers. Note that it is usually a bad idea to make this type of value a clustered index. ![]() ![]() This is more than 8 chars long, and is alpha numeric, so I does not quite fit with your request. ![]() NewId generates a "seemingly" random value of type `UniqueIdentifier'. This answer may help, even if it does not fully meet with your specifications.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |