SQL Azure - Creating New Database Stored Procedure in Azure Portal


Introduction:

In this article we are going to see how to create a new database stored procedure using the new Azure portal instead of using the SQL Server Management Studio.

Overview:

Stored procedures are created normally using the SQL Serve management studio, with the latest version of SQL Azure we have option to create a user stored procedure directly online without need to have a local interface. This way we have some control of using it anywhere anytime to do some updates regularly.  Let us see how to create the Stored procedure 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/

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, Click on that will go to 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 Max size of 1GB and ready to use it for the application based on the requirement. To create a new Stored Procedure 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 logged in you screen will look like below

image

To create a new stored procedure click on New Stored procedure menu at the top and we will see a script window as shown in the screen below

image

Now we will write our customized stored procedure for the EmpDetails table which we created in our earlier tutorial(Check my previous article for table creation) as shown in the screen below

image

Once we create the structure for the stored procedure as shown in the above screen we need to save it. Once save we can use the stored procedure to execute the same as shown in the screen below. We need to navigate to the new query window in the Database section and write a execute command as shown below.

image

We can create n Number of stored procedure as per the requirement and use it across the process which we normally do with the traditional SQL Server locally.

Conclusion:

So in this article we have seen how to create a new Stored procedure using the new SQL Azure management portal and use it across our requirement.


Similar Articles