How to create table in Azure SQL database

How to create table in Azure SQL database

In this Azure SQL article, we will discuss a step-by-step guide to create a table in the Azure SQL database quickly.

How to create table in Azure SQL database

Before discussing the actual functionality, let’s discuss the prerequisites needed here.

Prerequisites

Assuming that you are ready with all the prerequisites needed here. Let’s start with the actual functionality. Follow the below steps

  1. The First and most important step is to connect your Azure SQL database from your SQL Server Management Studio.
  2. Once you are connected to your Azure SQL Database, Click on the + button to expand the Databases node.
how to create a table in azure sql

3. Right-click on the Database name –> Click on the New Query option.

create table azure sql

4. On the New Query window, copy and paste the below query and change the table name, column name, etc based on your need.

CREATE TABLE TsInfo
(
    EmpId INT IDENTITY PRIMARY KEY,
    EmpName NVARCHAR(128) NOT NULL,
    Email NVARCHAR(256)
)

Then, click on the Execute button or press F5 to execute the SQL query.

how to create table in azure sql

Now, the query is executed successfully without any issues.

create table in azure sql

Now, To cross-check check the table got created successfully, Expand the Databases node and then expand the Tables node. You can able to see the table is present here.

how to create azure sql table

Note: If you are not able to see the table here, you can right-click on the Tables node and click on the Refresh option. Expand the Tables node again and this time you should able to see the Azure SQL table that you have created.

azure sql database how to create table

Example-2: Let’s create a Student table.

1. On the Query window, write the query below.

CREATE TABLE Student
(
    StudentId INT IDENTITY PRIMARY KEY,
    FirstName NVARCHAR(128) NOT NULL,
    LastName NVARCHAR(128) NOT NULL,
    DateOfBirth DATE NOT NULL
)

2. After writing the Query click on the Execute button as shown below.

How To Create Tables In Azure SQL Database

3. Now, you can able to see that it is showing Commands completed successfully.

How To Create a Table In Azure SQL Database

4. To, verify if the table is created, you can expand the Database node –> Expand the Tables –> You can able to see the dbo.Student table has been created successfully without any issues.

Create a Table In Azure SQL Database

This is how to create tables In the SQL Azure database.

You may also like following the below articles

Wrapping Up

Well, In this article, we discussed how to create a table in the Azure SQL database. Thanks for reading this article and hope this article will help you !!!