90

I'd like to know what the equivalent SQL Server type is for a long in C#.

user247702
  • 23,641
  • 15
  • 110
  • 157
JanivZ
  • 2,265
  • 3
  • 25
  • 31
  • 4
    Answered here, along with the equivalent for other types: http://stackoverflow.com/questions/1440620/which-sql-server-data-type-best-represents-a-double-in-c/1440631#1440631 – David Jan 07 '13 at 13:42
  • right, thank you all... silly question ... – JanivZ Jan 07 '13 at 14:26
  • I don't see why this was worth a downvote. it's a legitimate question. – David Jan 07 '13 at 14:30
  • yeh, I saw that thread but failed to see the simple fact that long is an int64 ... Anyways fair enough - its been asked and answered b4 ... – JanivZ Jan 07 '13 at 14:34

2 Answers2

135

The mapping table is clear - BIGINT is the equivalent of Int64 (which is long in C#).

Oded
  • 489,969
  • 99
  • 883
  • 1,009
24

The equivalent type is bigint which is a 64-bit numeric type.

It fits numbers in the range from -2^63 to 2^63-1 which is the same as the C# long type.

plr108
  • 1,201
  • 11
  • 16
Sergey Kalinichenko
  • 714,442
  • 84
  • 1,110
  • 1,523