In this Azure SQL article, we will discuss a step-by-step guide to create a table in the Azure SQL database quickly.
Table of Contents
Create table in Azure SQL database
Before discussing the actual functionality, let’s discuss the prerequisites needed here.
Prerequisites
- You must have an Azure Subscription or Azure account. If you don’t have it, Create an Azure Free account now.
- You must install SQL Server Management Studio on your Machine.
- You must create an Azure SQL database in the Azure Portal.
I am assuming that you are ready with all the prerequisites needed here. Let’s start with the actual functionality.
To create table in Azure SQL database, follow the below steps
- The First and most important step is to connect your Azure SQL database from your SQL Server Management Studio.
- Once connected to your Azure SQL Database, Click on the + button to expand the Databases node.

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

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 the Execute button or press F5 to execute the SQL query.

Now, the query is executed successfully without any issues.

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

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

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.

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

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

Create table if not exists Azure SQL DB
You can execute the below SQL query
IF OBJECT_ID(N'your table name', N'U') IS NULL
CREATE TABLE your table name (
columnname1 data_type [NULL | NOT NULL],
columnname2 data_type [NULL | NOT NULL],
columnname3 data_type [NULL | NOT NULL],
...,
);Example
You can execute the below SQL query to create azurelessonsnew table if unavailable.
IF OBJECT_ID(N'azurelessonsnew', N'U') IS NULL
CREATE TABLE azurelessonsnew (
empID int NOT NULL,
EName nvarchar(128) NULL,
region nvarchar(128) NULL,
);After executing the above query, the table has been created successfully. Check out the below screenshot for your reference.

You may also like following the articles below
- How to get Azure SQL database connection string
- How to rename the Azure SQL database
- How To Change User ID and Password For Azure SQL Server Database
- How to Export Azure SQL Database
Wrapping Up
In this article, we discussed the steps to create a table in the Azure SQL database. Thanks for reading this article, and I hope this article will help you !!!

I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.
