As a user, you need to create tables to store data in database. While creating the tables in database, you have to follow specify certain rules and constraints for columns that specify the kind of data to be stored.

You can create table by using the CREATE TABLE statement as well as GUI MODE as shown below:
CREATE TABLE statement
 Create table "tablename"
 "ColumnName1" "data type",
 "ColumnName2" "data type",
 "ColumnName3" "data type"
Create table EmplyoeeDetail
      Id char(4),
      Name varchar(20),
      City varchar(20),
      Age varchar(20)

Before executing Create table statement you have to specify in which database you want to create your table as shown below:

Create table in SQL Server

In screen shot you can see table is creating in Detail database, it means you have to specify database before executing create table statement.

After database selection select all table statement and then press F5 and also can click on Execute button as shown below:

Create table in SQL Server

After click on Execute button “Command(s) completed successfully”message will display on Message window and table has created in Detail database as show below:

Create table in SQL Server

When we want to see the table columns and records you have to select database from database list where table is stored and write simple query and result will display in result window as shown below:

select * from EmplyoeeDetail

Create Table

In screen shot Result window showing only column name because table has no record this time.


Open the SQL Server in  the Object Explorer Click on the  Databases folderà Then click on the  System Databases folderàSelect database where table want to createàRight click on the  Tables folder àSelect New Table as shown below:

Create table in SQL Server

When clicked on the New Table, table creation window will be visible as shown below:

Create table in SQL Server

In Column Name you have to pass column name as well as you have to specify Data Type of field, in Allow Nulls column if click on the check box it will allow null in specify column than right click on the tab menu and click on the Save Table_1 and pass your table name.



  Modified On Nov-29-2017 07:05:35 PM

Leave Comment