In this article we will explain how to create a table in sql server database with example.
SQL Server CREATE TABLE statement is used to create table in a database.
If you want to create a table in sqlserver database, you should name the table and define its column and each column's data type.
Let's see the simple syntax to create the table.
Let us take an example to create a Customer table with ID as primary key with auto increment and NOT NULL are the constraint showing that these fields cannot be NULL while creating records in the table.
CREATE TABLE Customer
[ID] INT PRIMARY KEY IDENTITY(1,1),
[NAME] VARCHAR (20) NOT NULL,
[AGE] INT NOT NULL,
[ADDRESS] VARCHAR (250)
I hope this article will help to you..