What type of data do you use to store identifiers?

Why is there a minimum number of characters to post questions? oo

Do you use int, bigint, tinyint what?

This seems like a small thing, I think I'm just curious about what is common practice.

+4
source share
7 answers

It all depends on my favorite answer to the question! =)

In most cases, we use Guids. Although they are larger, larger than int, tinyint, etc., I like the fact that my business objects can know what value is before by inserting records into the database.

In other cases, I can use strings for things like a client identifier, where when working with a database, it can be easily recognized .

+6
source

I found int big enough.

Going less is pointless.,.

+1
source

We also use a GUID.

It is better to synchronize multiple external databases into one data warehouse. The disadvantage is that it is not so easy to determine which elements were created in the first place, but you can still save the creation date or autonomy if this is really a problem.

+1
source

I really like the Guide. Best of all, they can be easily created on the client or server without any trips to the database. Also, if you need to synchronize databases, someday they will be sending God. The only drawback I find is web applications, if you pass the key in the url then you can easily get messy query strings.

+1
source

Will it depend on how many identifiers you are likely to need to keep throughout the life of the application?

0
source

Additional information required. What identifiers do you store? Anything smaller than int is probably a bad idea, a string may make sense, given that it doesn't have a tiny problem running numbers, and it is not limited by number restrictions, so you can use the username as an identifier, for example.

0
source

I will let Jason always have a comparative column when using commands. I prefer sequences over guides, although you need consistency anyway.

By data type, it depends on how many records you need to keep, but int is usually enough.

0
source

All Articles