Thursday , August 16 2018
Home / DataBase / SQL SERVER / Sql Server Data Types

Sql Server Data Types

Sql Server Data Types:

1.Numeric Datatypes :

Data Type Explanation
BIT
TINYINT
SMALLINT
INT
BIGINT
DECIMAL(m,d) Where m is the total digits and d is the number of digits after the decimal.
DEC(m,d) Where m is the total digits and d is the number of digits after the decimal.

This is a synonym for the DECIMAL datatype.

NUMERIC(m,d) Where m is the total digits and d is the number of digits after the decimal.

This is a synonym for the DECIMAL datatype.

FLOAT(n) Where n is the number of number of bits to store in scientific notation.
REAL
SMALLMONEY
MONEY

2.String DataTypes:

Data Type Explanation
CHAR(size) Where size is the number of characters to store. Fixed-length. Space padded on right to equal size characters. Non-Unicode data.
VARCHAR(size) or VARCHAR(max) Where size is the number of characters to store. Variable-length. If max is specified, the maximum number of characters is 2GB. Non-Unicode data.
TEXT Variable-length. Non-Unicode data.
NCHAR(size) Fixed-length. Unicode data.
NVARCHAR(size) or NVARCHAR(max) Where size is the number of characters to store. Variable-length. If max is specified, the maximum number of characters is 2GB. Unicode data.
NTEXT Variable length. Unicode data.
BINARY(size) Where size is the number of characters to store. Fixed-length. Space padded on right to equal size characters. Binary data.
VARBINARY(size) or VARBINARY(max) Where size is the number of characters to store. Variable-length. If max is specified, the maximum number of characters is 2GB. Non-Binary data.
IMAGE Variable length . Binary data.

3.Date/Time Datatypes:

Data Type
DATE
DATETIME
DATETIME2(fractional seconds precision)
SMALLDATETIME
TIME
DATETIMEOFFSET(fractional seconds precision)

Thanks for reading this article if you like this article please share with your Friends.

Print Friendly, PDF & Email

Give us your valuable feedback

comments

About Murali

Hello everyone I am Software Developer having 3+ years of Experience in Microsoft Technologies and Others. My skills :- Asp.net, C#,Ado.net, SQL SERVER, web services, windows Service,Windows applications,HTML,CSS, JavaScript,JQuery,AnjularJs

Check Also

sql server backup script

Backup all databases in SQL Instance with one script

Backup: A copy of SQL Server data that can be used to restore and recover the …