Best way to store UInt32 on Sql server

I am working on an application that uses a third-party component, and this component returns a value of type UInt32.

I need to save this UInt32 in a Sql Server table. I thought to just use a simple int column and insert a value like this:

int value = (int)(cs - int.MaxValue);

But I'm not sure if this is the best way to do this.

+3
source share
3 answers

You should probably take + int.MinValue. Since max is 2147483647 and min is -2147483648 for a 32-bit signed integer. Zero steals one value from the positive side.

0
source
  • bigint (10,0) , 0 4 .

  • CLR

+6

I suggest you store it in the bigint column.

+3
source

Source: https://habr.com/ru/post/1705526/


All Articles