Currently my application is 32-bit.
This means that all tables running on SQL Server 2008 IDs’ are INT that is equal to System.Int32 and everywhere where I parse strings to integers, I use Int32.TryParse().
I called this Implicit int size indication.
If I will want to make my application to be 64-bit I think there will be 2 scenarios:
- Rename all
Int32toInt64andINTtoBIGINT.
or
- Rename all
Int32tointNOW and make int size indication beExplicit.
Which is better, how do you think?
C# and SQL Server both have fixed size of integers on all platforms.
intin C# (which is simply an alias forSystem.Int32structure) and SQL Server is always 32 bits. Similarly,longin C# (an alias forSystem.Int64structure and SQL Server’sbigintare always 64 bits regardless of the platform.In C#, it’s more natural to use the language defined alias for types (
intinstead ofInt32,longinstead ofInt64) except for public method names (ReadInt64is preferable toReadLong) as the method might be used in a language without or with different type aliases and it’s better to use the .NET Framework name instead of the C# alias.