Wednesday, March 11, 2009

Microsoft SQL Data Services.

Microsoft SQL Data Services  known as  SDS its part of the  Windows Azure Platform. SDS are highly scalable and its built on Microsoft SQL Server and Windows Server Technology.  SDS provides industry standard  protocol such as SOAP and REST way to Program and query the data.


SDS data model is three level of containment model that is known as  ACE .

A- Authority  , C – Container , E- Entity.


Authority :

Authority is the top level  of this Three level containment. An authority is represented by a DNS name for example where sreenicontact is an authority and refers to the service. You can create more than one authority  The DNS name of an authority resolves to an IP address that maps to a specific data center.

Container :

Authority is a collection of containers.  A single authority can have zero or more containers Each containers have unique Id within authority. containers stores entity this is noting but Data. Containers can have  zero or more entities.

Entities :

Each entity inside a container can store any number of user-defined properties and corresponding values. for example i can store the following entity model in a container. 


Right now the following Data types are supported by  SDS. when you create a  XML payload either using  SOAP or REST.

  • string
  • base64Binary
  • boolean
  • decimal
  • dateTime

By default all the Entity has the following fixed set  of metadata properties.  Id, Version , Kind.

Id – This  properties uniquely  identifies a flexible entity .

Version – This property value is assigned by system when ever any entity is created.  current date time value will be assigned .

Kind –This property values  is user defined Identifiers to identifies entity  type ( for example  HContact,  Employee, Orders etc..);

Now let us Access SDS via programming to do create  Authority , Container and  Entity  after that  we will store and query the data as well.

I am going to use SOAP based API to  program against  SQL Data Service . Here is the  URL  for SOAP format to access SDS.   Here i am going to create simple  C# console application . First we need to add Service reference to  the console application.


After adding SDS service reference you can see the list of  operations.


Now we need to create a methods for to  Create Authority , Container , Entity and store and Query the SDS data.

Please make sure that you provide  small case letter for authority id

private static string authority="sreenicontact";

private static string container = "contact";




Now Call the above created the function in main program and  store some data in above created Entity.


Here is output of the above Query [ from e in entities select e"]




No comments: