SQL Azure - Creating New Database Table in Azure Portal


Introduction:


In this article we are going to see how to create a new table and insert some records using the new Azure portal instead of using the SQL Server Management Studio.

Overview:


Traditionally, when creating a database table, we would write a Create table script and execute it in the Query analyzer of the SQL Server Management Studio but the latest version of SQL Azure Microsoft has provided an interface to create tables using online portal. Let us see how to create a table in Azure portal step by step.

Steps:


Log in to the Azure portal using the link below. You can see the screen look similar to below.
http://www.microsoft.com/windowsazure/
image
Login to the portal using your Microsoft Windows Live credentials with Azure credentials to the management portal and you will see the screen as shown in the screen below:
screenshot_02
Now we can see the Database Menu at the bottom left; clicking on that will show the Database Subscription window as shown in the screen below:
image
Clicking on the subscription name will provide the complete details of the server created and the new database created as shown in the screen below:
image
Now we have a database created (LearnAzure) with a maximum size of 1GB ready for use by the application based on the requirement. To create a new table click on Manage at the top menu tool bar as shown in the screen below:
image
Check my previous article on how to connect to the manage portal using the credentials and the firewall using the link. Once log in; the screen will look like below:
image
Now let us see the steps on how to create a new table and insert a record into the table using this Manage portal. Click on the New Table menu at the top right section as shown in the screen below:
image
A new script window will open with the options to create a new table with the column values as shown in the screen below:
image
Now create our requirements as a table; here I am creating a simple table with 4 columns as shown in the screen below:
image
Here we can add additional columns using the +Column buttin at the bottom as shown in the screen below:
image
Once we are done with adding a new column and designing our database we are now ready to save the table. Click on the save button at the top right corner and you will see some green symbols indicating that the table is saved as shown in the screen below:
image
Now go back to the database option available at the top right corner as shown in the following screen to open the query analyzer and execute the query by clicking on New Query as shown in the screen below:
image
We will get a query analyzer to write our query to fetch the data. Now to check the table is created correctly with the columns specified we write a simple Select query and check the result which will have no records to pull up as shown in the screen below:
image
Now we will write some insert script to insert a record to the table as shown in  the screen below:
image
Execute the insert scripts one by one and we will get the result message at the bottom itself indicating if the record has been inserted correctly or not. Now we will fetch the records by executing the Select query to see the results as shown in the screen below:
image
We can see the number of rows affected as well by clicking the Message tab at the bottom of the result tab as shown in the screen below:
image

Conclusion:


So in this article we have seen how to create a new table in SQL Azure Manage portal with the new interface.

Up Next
    Ebook Download
    View all
    Learn
    View all