SQL Server Tables

Tables are objects of database. In tables data is organized logically like row-column spreadsheet.

Table Rules:

  • Table name should start with alphabet.
  • Spaces and special characters are not allowed in table name except _(underscore).
  • A table name can contain maximum 1024 column names.
  • A table name contain maximum 128 characters.
  • A table can have any number of rows.

Table Syntax:

CREATE TABLE table_name(
column1 datatype,
column2 datatype,
column3 datatype,
column4 datatype,
column5 datatype)


CREATE TABLE [dbo].[emp](
[empname] [varchar](20) NULL,
[empno] [numeric](18, 0) NULL,
[job] [varchar](30) NULL,
[joindate] [date] NULL,
[salary] [money] NULL,
[deptno] [nchar](10) NULL,
[location] [nchar](10) NULL

Creating SQL Server tables usng GUI:

  1. Expand the database then right click on tables


  3. Click on New Table


  5. Enter column names and save
Powered by k2schools