In this tutorial i will explain how to Create table manually and by script in Sql Server. Table : A Table is a set of values and a table has a specified number of columns, but can have any number of rows.
There is two ways to create Sql Table
1. We can create table manually in Sql Server. Open Microsoft SQL Server Management Studio and select Database in which you want to create Table then Right Click on Table Menu and select New Table. Give Proper name, Data Type and Size of each Columns. You can set ID column as Primary Key.See below.
Primary key: Primary keys contain unique values and a primary key column cannot contain NULL values.
And in last Right Click on table Tab then click on Save Table and then Give Table Name.See below.
2.The second method is use to script for creating Table in SQL Server.
Right click on Database in which you want to make table then click on New Query menu ,New Query window will open right side as below,then write the script and after complete the script press f5.Table Created sucessfully.
Create table empoyee
EmpID int NOT NULL,
EmpName varchar(50) NOT NULL,
PRIMARY KEY (EmpID)