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.
- 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. 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,
Then, click the Execute button or press F5 to execute the SQL query.
Now, the query is executed successfully without any issues.
Now, To cross-check the table that was 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.
This is how to create tables In the SQL Azure database.
You may also like following the articles below
- How to get Azure SQL database connection string
- How to rename the Azure SQL database
- Azure SQL Database Vs. SQL Server
- How to backup Azure SQL database
- How To Change User ID and Password For Azure SQL Server Database
- How to Export Azure SQL Database
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 have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machine, 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.