Here we will learn different type of data types available in sql server with examples.
In SQL Server data type is an attribute which we will used to specify type of the data column can hold like numeric type, character type, binary type, date and time type, etc.
Generally we will declare column datatype while creating table like as shown below. We have different ways to declare columns like through query or directly while creating table in database
CREATE TABLE SampleTable
In SQL Server we have different type of Data Types those are
- Exact Numeric Data Types (int, smallint, bigint, etc.)
- Approximate Numeric Data Types (float, real)
- Date and Time Data Types (date, datetime, time, smalldatetime, etc.)
- Character String Data Types (char, varchar, text, etc.)
- Unicode character string data types (nchar,nvarchar,ntext)
- Binary Data Types
- Miscellaneous Data Types or Other Data Types