<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>SDS</title>
        <link>http://geekswithblogs.net/sxk/category/8934.aspx</link>
        <description>SQL Data Services</description>
        <language>en-US</language>
        <copyright>sxk</copyright>
        <managingEditor>stan.kitsis@microsoft.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>Accessing SQL Data Services (SDS) using ADO.NET Data Services (Astoria)</title>
            <link>http://geekswithblogs.net/sxk/archive/2008/10/31/accessing-sql-data-services-sds-using-ado.net-data-services-astoria.aspx</link>
            <description>&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt"&gt;&lt;font face="Calibri" size="3"&gt;With the latest release of the SQL Data Services (SDS) we announced a tech preview of the work we did with ADO.NET Data Services (Astoria/adods) team (&lt;/font&gt;&lt;a href="http://www.microsoft.com/azure/sqllabs.mspx"&gt;&lt;font face="Calibri" color="#800080" size="3"&gt;http://www.microsoft.com/azure/sqllabs.mspx&lt;/font&gt;&lt;/a&gt;&lt;font face="Calibri" size="3"&gt;).&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;As part of this preview we made available a new SDS service head that supports a subset of conventions outlined by ADO.NET Data Services.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;A number of people stopped at our PDC demo booth and ask for details.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;Here are some of the answers.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;Keep in mind that this is just a tech preview and can change in future service updates.&lt;/font&gt;&lt;/p&gt;
&lt;h2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;font face="Cambria" color="#4f81bd" size="4"&gt;Scope&lt;/font&gt;&lt;/h2&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt"&gt;&lt;font face="Calibri" size="3"&gt;This preview version of adods service head supports GET, POST, PUT and DELETE requests within a container.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;This means that you can use ADO.NET Data Services conventions to create, modify, query and delete entities within a container.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;However, you cannot perform any operations on authorities or containers.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;At this point we also don’t support cross-container operations.&lt;/font&gt;&lt;/p&gt;
&lt;h2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;font face="Cambria" color="#4f81bd" size="4"&gt;Accessing adods service head&lt;/font&gt;&lt;/h2&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt"&gt;&lt;font face="Calibri" size="3"&gt;Accessing adods service head is very similar to accessing our existing soap head – all you need to do is add /adods/v1/ to the service URI:&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt"&gt;&lt;span style="mso-field-code: HYPERLINK"&gt;&lt;span class="MsoHyperlink"&gt;&lt;u&gt;&lt;font face="Calibri" color="#0000ff" size="3"&gt;https://&amp;lt;authorityID&amp;gt;.data.database.windows.net/adods/v1/&lt;/font&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt"&gt;&lt;font face="Calibri" size="3"&gt;Since all requests have to be targeted at a single container, you will also have to specify the name of the container in the URL:&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="mso-field-code: HYPERLINK"&gt;&lt;span class="MsoHyperlink"&gt;&lt;u&gt;&lt;font color="#0000ff"&gt;https://&amp;lt;authorityID&amp;gt;.data.database.windows.net/adods/v1/&amp;lt;containerID/&lt;/font&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt; &lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt"&gt;&lt;font face="Calibri" size="3"&gt;Any request that doesn’t specify a container will result in HTTP 501 Not Implemented error.&lt;/font&gt;&lt;/p&gt;
&lt;h2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;font face="Cambria" color="#4f81bd" size="4"&gt;Querying SDS using ADO.NET Data Services conventions&lt;/font&gt;&lt;/h2&gt;
&lt;p class="MsoListParagraphCxSpFirst" style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="3"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt &amp;quot;Times New Roman&amp;quot;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;Let’s start with a few simple queries.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;The following query returns all entities within a container: &lt;span style="mso-field-code: HYPERLINK"&gt;&lt;span class="MsoHyperlink"&gt;&lt;u&gt;&lt;font color="#0000ff"&gt;https://&amp;lt;authorityID&amp;gt;.data.database.windows.net/adods/v1/&amp;lt;containerID&amp;gt;/Entities()&lt;/font&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="3"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt &amp;quot;Times New Roman&amp;quot;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;To retrieve a specific entity, you can specify its ID: &lt;span style="mso-field-code: HYPERLINK"&gt;&lt;span class="MsoHyperlink"&gt;&lt;u&gt;&lt;font color="#0000ff"&gt;https://&amp;lt;authorityID&amp;gt;.data.database.windows.net/adods/v1/&amp;lt;containerID&amp;gt;/Entities('entityID')&lt;/font&gt;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="3"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt &amp;quot;Times New Roman&amp;quot;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Calibri" size="3"&gt;You can use $filter to filter the set returned to you: https://&amp;lt;authorityID&amp;gt;.data.database.windows.net/adods/v1/&amp;lt;containerID&amp;gt;/Entities()?$filter=Kind eq 'Books'&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpMiddle" style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="3"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt &amp;quot;Times New Roman&amp;quot;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Calibri" size="3"&gt;You can also order the set by using $orderby: https://&amp;lt;authorityID&amp;gt;.data.database.windows.net/adods/v1/&amp;lt;containerID&amp;gt;/Entities()?$filter=Kind eq 'Books'&amp;amp;$orderby=Title&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;You can also specify multiple orderby parameters as well as ascending or descending order.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;If $orderby is not specified, the entities are ordered by Id. &lt;u&gt;Note: &lt;/u&gt;$orderby option will not result in filtering of the entities set returned by the filter.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;This means that a query with an $orderby clause will return the same number of entities as the same query without the $orderby.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;It also means that all entities, including the ones which do not have the $orderby proprety, will be returned.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoListParagraphCxSpLast" style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;span style="FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font size="3"&gt;·&lt;/font&gt;&lt;span style="FONT: 7pt &amp;quot;Times New Roman&amp;quot;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face="Calibri" size="3"&gt;Finally, you can limit the number of results returned using $top: https://&amp;lt;authorityID&amp;gt;.data.database.windows.net/adods/v1/&amp;lt;containerID&amp;gt;/Entities()?$filter=Kind eq 'Books'&amp;amp;$orderby=Title&amp;amp;$top=10&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;As with REST and SOAP heads, SDS will return a maximum of 500 entities at a time.&lt;/font&gt;&lt;/p&gt;
&lt;h2 style="MARGIN: 10pt 0in 0pt"&gt;&lt;font face="Cambria" color="#4f81bd" size="4"&gt;System properties&lt;/font&gt;&lt;/h2&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt"&gt;&lt;font face="Calibri" size="3"&gt;All SDS entities have three system properties: Id, Kind and Version.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;While it is possible to create and access flexible properties with the same names using REST or SOAP heads, it isn’t possible with adods head.&lt;span style="mso-spacerun: yes"&gt;  &lt;/span&gt;If “Kind”, “Id” or “Version” appear in the $filter or $orderby clauses, SDS will filter/order on the system properties.&lt;/font&gt;&lt;/p&gt; &lt;img src="http://geekswithblogs.net/sxk/aggbug/126434.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>sxk</dc:creator>
            <guid>http://geekswithblogs.net/sxk/archive/2008/10/31/accessing-sql-data-services-sds-using-ado.net-data-services-astoria.aspx</guid>
            <pubDate>Fri, 31 Oct 2008 15:08:46 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/sxk/comments/126434.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/sxk/archive/2008/10/31/accessing-sql-data-services-sds-using-ado.net-data-services-astoria.aspx#feedback</comments>
            <slash:comments>7</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/sxk/comments/commentRss/126434.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>
