GST Billing Software

header image

SQL Data types

Erachana Line

3. SQL Data types

SQL Data Type is an attribute that specifies the type of data of any object. Each column, variable and expression has a related data type in SQL.

Exact Numeric Data Types

DATA TYPE

FROM

TO

int

-2,147,483,648

2,147,483,647

decimal

-10^38 +1

10^38 -1

numeric

-10^38 +1

10^38 -1


Approximate Numeric Data Types

DATA TYPE

FROM

TO

float

-1.79E + 308

1.79E + 308

real

-3.40E + 38

3.40E + 38


Date and Time Data Types

DATA TYPE

FROM

TO

datetime

Jan 1, 1753

Dec 31, 9999

date

Stores a date like June 30, 1991

time

Stores a time of day like 12:30 P.M.


Character Strings Data Types

Sl.No.

DATA TYPE & Description

1

char

Maximum length of 8,000 characters.( Fixed length non-Unicode characters)

2

varchar

Maximum of 8,000 characters.(Variable-length non-Unicode data).

3

varchar(max)

Maximum length of 2E + 31 characters, Variable-length non-Unicode data (SQL Server 2005 only).

4

text

Variable-length non-Unicode data with a maximum length of 2,147,483,647 characters.