Click here to Skip to main content
15,886,519 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i declare my primary key "ID" as bigint. If huge data is entered that exceed bigint limitation what can i do?what is the solution for bigint size overflow?
Posted
Comments
ZurdoDev 24-Apr-13 8:07am    
Can you give an example? It's possible there may be an alternative solution.
gvprabu 24-Apr-13 8:27am    
bigint Range : -2^63 (-9,223,372,036,854,775,808) to 2^63-1 (9,223,372,036,854,775,807)
Ur Data Cross this Range or what..?
Foothill 24-Apr-13 11:33am    
I have to ask, what kind of data are you putting into the primary key? If it is an auto-incrementing identity, then the chances of exceeding the size of BigInt are remote. However, if the size of the table does get big enough to exceed BigInt, the easiest way around that is to create a new table and store more data there.

1 solution

You could consider using a GUID instead of a number. There are a few more combinations for a GUID vs. bigint... It'll take more space. Also, like the comments above, bigint has a HUGE range, I doubt you'll run out any time soon.

As an additional consideration, consider archiving your data to history tables if it gets that big.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900