Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the equivalent SQL Server type for the C# long type?

Tags:

c#

sql-server

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

like image 515
JanivZ Avatar asked Jan 07 '13 13:01

JanivZ


People also ask

Is SQL the same as C#?

The main difference between C# and SQL is that C# is a back-end programming language, whereas SQL is a database language. Unlike the C sharp that focuses majorly on programming, SQL focused more on data management and information retrieval.

How do I find the SQL Server type?

Use TYPE_NAME() to Get the Name of a Data Type in SQL Server This can be useful when querying a system view such as sys. columns that returns the type's ID but not its name. You can use TYPE_NAME() for system data types and user-defined data types.


2 Answers

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

like image 163
Oded Avatar answered Oct 12 '22 05:10

Oded


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.

like image 34
Sergey Kalinichenko Avatar answered Oct 12 '22 04:10

Sergey Kalinichenko