Thursday, January 21, 2010

SQL Azure

My first step with SQL Azure:-

Though I am an active one way communicator (i.e., only posting queries) in Azure’s forum, I am here to share my experience of kick starting with the SQL Azure. Before going hands on with MS Azure, my mind got into nostalgic mood by rushing through the user friendly services offered by MS. After my successful interaction with MS Azure, I whole heartedly appreciate Microsoft for offering such a user friendly experience with programming interface etc, which make a lot of difference with various other cloud service providers.


Getting an Account:-

To access SQL Azure you might want to get an invitation code from Microsoft

https://connect.microsoft.com/site681

Once you request an ID you will receive an E-mail with ID in couple of days and then you are ready to use SQL Azure.

Creating First Data Base:-

Browse to the following page where you will see the Server Administration of SQL Azure

https://sql.azure.com/ProjectViewer.aspx

http://csslab.s3.amazonaws.com/csslabs/Siva/Apps/Dash+Board.bmp

http://csslab.s3.amazonaws.com/csslabs/Siva/Apps/List+Of+Data+Base.bmp


In the above image (List Of Data Base.bmp) there is a tab called Firewall Settings where you need to configure the firewall settings to all your system to access it.

How to Create new Data Base?

Make sure you will be able to create data bases only through web portal; management console will not help you to do that.

Firewall settings:-

Most important step is your Local Network port 1433 has to be opened to talk with the Data base which is created through Application or SQL Server 2008 Management console.

SQL 2008 Management Console:-

You need SQL Server 2008 Management Console to do all administrative activities.

   1. Enter your credentials as like shown in below
http://csslab.s3.amazonaws.com/csslabs/Siva/Apps/SQL+Authendication.bmp

   2. Click Options
http://csslab.s3.amazonaws.com/csslabs/Siva/Apps/DB+Selection.bmp

   3. In the Connection Properties tab you need to enter the data base that you want to connect against the filed “Connect to Database”

   4. Once you hit Connect button then you are ready to use and perform all operations.

Sample ASP.Net application is available in the following link for your reference.

http://csslab.s3.amazonaws.com/csslabs/Siva/Apps/SQLServerApp.rar

Best Practice:-

I always recommend you not to send parameters as part of query instead use “SqlParameterCollection” to avoid injection. Since most of the time you are on Internet and probability of hacking is high.

http://msdn.microsoft.com/en-us/library/ms998271.aspx

2 comments:

Partner Portal said...

Thanks for sharing this, step by step and the tips. More power.

data recovery disk said...

I will follow your step shared because i want to seek knowledge of SQL. Thanks for sharing this.