Before understanding about SQL Server data types we should understand what is Sql server and why we are going to use sql server. The Word SQL stands for Structured Query Language. As we all know SQL Server is the relational database management system and it is developed by Microsoft. It is mainly used for storing and retrieving the data or we can say maintaining the data. We can do all types of operations to maintain the database. we can say that the SQL server is the database server that helps in implementing the structured query language. In simple words, we can say that data types tell the compiler what type of data is used in the programming.
In SQL Server there are different types of data types.

Given below are the examples of SQL Server Data Types:
CREATE TABLE Employees
(
column1 datatype [ NULL | NOT NULL ],
column2 datatype [ NULL | NOT NULL ],
column3 datatype [ NULL | NOT NULL ],
column4 datatype [ NULL | NOT NULL ],
...
);
Explanation:
All the columns in a table must have a data type. It should be defined an either null or not null and if we are placing value in left blank the database automatically assumes default as Null.
CREATE TABLE Table_Name
( Custimer_id INT NOT NULL,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(50)
CTC MONEY
);
Explanation:
Select
ISDATE('2019-09-25') As P,
ISDATE('2019-09-25 14:49') As Q,
ISDATE('2019-09-25 14:49:54') As R,
ISDATE('13:45) As S,
ISDATE('2019-09-31) As T,
ISDATE('13:67) As U,
ISDATE('27:45) As V
Explanation:
Before going to maintain the database using SQL Server we need to learn the basics of SQL Server, without knowing the basic concepts like Data types, Functions, etc we cannot use the SQL for example if we want to use ant data type first we need to know the maximum size, type, and range of values. We cannot write the SQL script without having the knowledge of Datatypes. All types of data types will not support all types of databases.
Below are a few examples:
Not a member yet? Register now
Are you a member? Login now