This is mostly a TSQL question but C# enters in as well (down at the bottom).
What is the biggest TSQL data type for positive integer values? Is it bigint?
If I am getting an overflow, what can be done?
I read somewhere that any calculations are done with both numbers as integers and the result is only casted as a bigint, or something or other. I understand that to mean:
integer * integer = bigint
because you can't do this:
bigint * bigint = bigint --(overflow??)
I think it is this line in the TSQL that is causing the problem:
(excerpted from the stored proc):
SET @LookupListKey = (SELECT MAX(LookupListKey) * MAX(LookupListKey) FROM UNAdmin.SystemLocations)
I've been thinking of storing the result as a string, thinking that a string representation could represent an integer value far larger than int or bigint.
Suggestions for storing very large numbers that won't fit in a bigint?
Side question: What C# data type can hold the largest positive integer value? What is the C# data type compatible with bigint?