Which sql data type should we use for number bases primary key:
- int
- bigint
- numeric
- float
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Generally,
int.bigintif you think you’ll have more rows than there are atoms in the universe.uniqueidentifieris useful if you need globally unique keys (keys that are guaranteed to be unique across all tables in your schema, maybe even universally unique (I don’t remember))The other two I wouldn’t use they’re not integral types (they have fractions, which just don’t make a lot of sense as keys)