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 creating database table, we used to write a Create table script and execute the same in the Query analyzer of the SQL Server Management Studio but in the latest version of SQL Azure Microsoft has provided an interface to create tables using online portal.
[more]Let us see how to create the table in Azure portal step by step.
Steps:
Log in to the Azure portal using the below link. You can see the screen look similar to below
http://www.microsoft.com/windowsazure/
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
Now we can see the Database Menu at the bottom left, Click on that will go to the Database Subscription window as shown in the screen below
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
Now we have a database created(LearnAzure) with a Max size of 1GB and ready to use it for 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
Check my previous article on how to connect to the manage portal using the credentials and the firewall using the link(https://f5debug.net/all-articles/). Once logged in you screen will look like below
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
New script window will be opened with the options to create a new table with the column values as shown in the screen below
Now create our requirements as a table, here I am creating a simple table with 4 columns as shown in the screen below
Here we can add additional columns using the +Column buttin at the bottom as shown in the screen below
Once we are done with adding a new column and designing our database we are now ready save the table. Click on the save button at the top right corner and you will see some green symbols indicated that the table is saved as shown in the screen below
Now go back to the database option available at the top right corner as shown in the below screen to open the query analyzer and execute the query by clicking on New Query as shown in the screen below
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
Now we will write some insert script to insert a record to the table as shown in the screen below
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
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
Conclusion:
So in this article we have seen how to create a new table in SQL Azure Manage portal with the new interface.