create a table in mssql server

To create a table in sql server we cam follow two steps:

  1. Design View
  2. Using Query window


Design View

Click to open sql server management studio and login to the server.

Then select database by expanding database section

If you dont have any database then create it by right clicking on database and then create database.

create table expand database
create table expand database

Then Select database and expand it and right click on tables and click on new table.

create table using sql server design view
create table using sql server design view

Follow the data type with column names and allow nulls to fields which would be null or not null.

Now save the table by following Ctrl+S or save icon and give a table name .

create table and save in design view
create table and save in design view


To create a table using query window we need to use sql query.

The sql query to create table is:

CREATE TABLE [dbo].[mytable] (
[id] [bigint] NOT NULL,
[colum1] [varchar](50) NULL,
[column2] [datetime] NULL,
[column3] [bit] NULL


Happy coding

How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: