<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogical.se/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Johan Åhlén : SQL Azure</title><link>http://blogical.se/blogs/jahlen/archive/tags/SQL+Azure/default.aspx</link><description>Tags: SQL Azure</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 20917.1142)</generator><item><title>SQL Azure new user interface - Project Houston</title><link>http://blogical.se/blogs/jahlen/archive/2010/09/02/sql-azure-new-user-interface-project-houston.aspx</link><pubDate>Thu, 02 Sep 2010 10:27:00 GMT</pubDate><guid isPermaLink="false">19a535f3-07d9-4378-9c5a-8d019d91e842:13054</guid><dc:creator>jahlen</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogical.se/blogs/jahlen/rsscomments.aspx?PostID=13054</wfw:commentRss><comments>http://blogical.se/blogs/jahlen/archive/2010/09/02/sql-azure-new-user-interface-project-houston.aspx#comments</comments><description>&lt;p&gt;&amp;quot;Project Houston&amp;quot; is the new user interface for SQL Azure. If you have tried SQL Azure you know that the user interface on the web portal is very brief. You can&amp;#39;t do almost anything from there (except create new database and setup security). To do anything with your SQL Azure database you need to use the &amp;quot;non-cloud&amp;quot; tools like Management Studio (in SQL Server 2008 R2).&lt;/p&gt;
&lt;p&gt;The new user interface is a Silverlight application. It&amp;#39;s got a fresh new look:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogical.se/blogs/jahlen/ProjectHouston20100902/projecthouston.gif"&gt;&lt;img border="0" src="http://blogical.se/blogs/jahlen/ProjectHouston20100902/projecthouston.gif" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can use it to design and edit the contents of your database objects. However it is not the fastest (I managed to hang it when I opened a too large table).&lt;/p&gt;
&lt;p&gt;So what is it useful for? I&amp;#39;d say it&amp;#39;s useful for situations where you don&amp;#39;t have access to Management Studio (or similar tool) or people who&amp;#39;d be scared of Management Studio. I think the idea is good that a cloud database should also have a cloud based user interface, although in most cases it will be more convenient to use the traditional user interfaces.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://blogical.se/aggbug.aspx?PostID=13054" width="1" height="1"&gt;</description><category domain="http://blogical.se/blogs/jahlen/archive/tags/SQL+Server/default.aspx">SQL Server</category><category domain="http://blogical.se/blogs/jahlen/archive/tags/SQL+Azure/default.aspx">SQL Azure</category><category domain="http://blogical.se/blogs/jahlen/archive/tags/Cloud/default.aspx">Cloud</category><category domain="http://blogical.se/blogs/jahlen/archive/tags/Azure/default.aspx">Azure</category></item><item><title>SQL Azure - some tips &amp; tricks</title><link>http://blogical.se/blogs/jahlen/archive/2009/12/20/sql-azure-some-tips-amp-tricks.aspx</link><pubDate>Sun, 20 Dec 2009 05:34:00 GMT</pubDate><guid isPermaLink="false">19a535f3-07d9-4378-9c5a-8d019d91e842:10443</guid><dc:creator>jahlen</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogical.se/blogs/jahlen/rsscomments.aspx?PostID=10443</wfw:commentRss><comments>http://blogical.se/blogs/jahlen/archive/2009/12/20/sql-azure-some-tips-amp-tricks.aspx#comments</comments><description>&lt;p&gt;In this blog post I&amp;#39;d like to share some of my experience working with SQL Azure so far. First&amp;nbsp;a background on what SQL Azure really is and then I will give you some of my tips and tricks.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What is SQL Azure&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Microsoft SQL Azure Database is a cloud-based relational database service that works much like an ordinary stand-alone instance of Microsoft SQL Server. It support most of the functionality in the SQL Server 2008 relational database engine, including SQLCLR support. It doesn&amp;#39;t have the Business Intelligence components like Integration Services, Analysis Services, Reporting Services. Also it doesn&amp;#39;t support typical DBA features, but that&amp;#39;s logical since the whole idea of SQL Azure is that you should not need any DBA. Microsoft promises a 99.9% availability during a calendar month.&lt;/p&gt;
&lt;p&gt;Currently SQL Azure is free to evaluate if you have an invitation. In production, the pricing will be a fixed cost per month which depends on edition and a data transfer cost. The web edition is limited to 1 GB database size and currently costs $9.99 / month. The business edition allows up to 10 GB database size and costs $99.99 / month. SQLCLR is supported only by the business edition. Data transfer costs is dependent on location, but costs less than a dollar per gigabyte.&lt;/p&gt;
&lt;p&gt;Below is a screenshot from the SQL Azure management web site. There you create your databases and configure your firewall settings. This web site is located at &lt;a href="http://sql.azure.com/"&gt;http://sql.azure.com/&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogical.se/blogs/jahlen/SQLAzureTips/sqlazure.gif"&gt;&lt;img border="0" src="http://blogical.se/blogs/jahlen/SQLAzureTips/sqlazure.gif" width="535" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Connecting to SQL Azure&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Once you have created your SQL Azure databases, you need to enable access to the in the firewall settings. After doing that and waiting a couple of minutes for the changes to take effect, you can connect to your database. You can click on the Connection Strings button to get the necessary information to connect.&lt;/p&gt;
&lt;p&gt;Previously there was no support for any graphical user interface to SQL Azure. When I started looking at SQL Azure I used the SQLCMD command line utility to execute my SQL commands. Thankfully now you can download the &lt;strong&gt;November CTP of SQL Server 2008 R2&lt;/strong&gt; and from there connect to SQL Azure through &lt;strong&gt;SQL Server Management Studio&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Below is a screenshot of the connection dialog where I connect to my SQL Azure database. Only SQL Server Authentication is supported. You need to type in your login in the format &lt;em&gt;&lt;strong&gt;username@server&lt;/strong&gt;&lt;/em&gt;. Also it is a good idea to click on &lt;strong&gt;Options&lt;/strong&gt; and on the &lt;strong&gt;Connection Properties&lt;/strong&gt; tab select your desired database in the &lt;strong&gt;Connect to database&lt;/strong&gt; drop down list.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogical.se/blogs/jahlen/SQLAzureTips/ssmsconnect.gif"&gt;&lt;img border="0" src="http://blogical.se/blogs/jahlen/SQLAzureTips/ssmsconnect.gif" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Scripting&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Typically you develop databases locally in SQL Server 2008 and then deploy the SQL Azure. As mentioned earlier, SQL Azure doesn&amp;#39;t support typical DBA features like filegroups settings. That means you need to limit the scripting options when copying objects from a local SQL Server 2008 database to SQL Azure. Luckily there is a new settings in the November CTP of SQL Server 2008 R2 where you can choose &lt;strong&gt;database engine type&lt;/strong&gt; in the &lt;strong&gt;Generate Scripts...&lt;/strong&gt; wizard. See the screenshot below:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogical.se/blogs/jahlen/SQLAzureTips/scriptoption.gif"&gt;&lt;img border="0" src="http://blogical.se/blogs/jahlen/SQLAzureTips/scriptoption.gif" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;By setting &amp;quot;Script for the database engine type&amp;quot; to SQL Azure Database, you exclude the features that are not compatible with SQL Azure.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Copying data&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If developing in a local SQL Server 2008 environment, you may want to copy data between your environment and SQL Azure. Basically there are two ways in Management Studio to do this. &lt;/p&gt;
&lt;p&gt;Either you can use the &lt;strong&gt;Generate Scripts...&lt;/strong&gt; wizard and through the &lt;strong&gt;Types of data to script&lt;/strong&gt; option make it generate INSERT STATEMENTS for your data.&lt;/p&gt;
&lt;p&gt;My preferred way however is to use the &lt;strong&gt;Import and Export data wizard&lt;/strong&gt;. That wizard build an SSIS package in the background and executes to copy your data. It supports a variety of data sources like SSIS does.&lt;/p&gt;
&lt;p&gt;The key to use the &lt;strong&gt;Import and Export data wizard&lt;/strong&gt; is to use the right database provider. Currently it seems that SQL Azure only works with the &lt;strong&gt;.Net Framework Data Provider for SqlServer&lt;/strong&gt; and not with the default provider suggested by the wizard. Below is a screenshot of my settings.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogical.se/blogs/jahlen/SQLAzureTips/importexportwizard.gif"&gt;&lt;img border="0" src="http://blogical.se/blogs/jahlen/SQLAzureTips/importexportwizard.gif" width="535" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Encryption&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Encryption is mandatory in all connections to SQL Azure. Usually you do not need to worry about it as it is automatically set by the server upon connecting.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Connection closing&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The save resources, SQL Azure closes connections after they have been idle for some time. In Management Studio, this is not a big problem. You can just retry your queries. However it causes more problems in your applications.&lt;/p&gt;
&lt;p&gt;Here is my theory what happens. By default, Windows and web applications use connection pooling to improve performance. Connection pooling means that connections are reused instead of being opened and closed. When your application closes a connection, it actually stays open in the connection pool. When it&amp;#39;s been idle long enough it get&amp;#39;s killed by SQL Azure. Guess what happens when your application tries to connect? Yes, it gets the save connection that&amp;#39;s dead.&lt;/p&gt;
&lt;p&gt;Your could either disable connection pooling or add try/catch error handling to retry your queries when they fail. I have successfully used the try/catch method to get rid of all problems. That should be the preferred method since disabling connection pooling would hurt your performance much more.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Collations&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There is no way to set collation on database level. I&amp;#39;ve tried! Upon creation, the databases are set to SQL_LATIN1_GENERAL_CP1_CI_AS. For people like me who write applications in other languages than English, this is an annoyance.&lt;/p&gt;
&lt;p&gt;What to do? The good news is that SQL Azure supports collations on column level even if I&amp;#39;d prefer a global setting on database level instead. Also you can do a collation cast in your queries, for example:&lt;/p&gt;
&lt;p&gt;SELECT LastName&lt;br /&gt;FROM MyTable&lt;br /&gt;ORDER BY&amp;nbsp;LastName COLLATE Finnish_Swedish_CI_AS ASC&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Final words&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The core of SQL Azure seems to be relatively complete, but it still lacks quite a bit in the user interface support. That makes it useful for experienced SQL Server users. However, I think there soon will be much better support from SQL Server 2008 R2 Management Studio.&lt;/p&gt;
&lt;p&gt;SQL Azure is one of three cloud platforms from Microsoft. The other two are Windows Azure and the AppFabric. I&amp;#39;ve developed a Windows Azure application that uses my SQL Azure database. Doing that&amp;nbsp;I missed the possibility to host them in the same Affinity Group. That should be a key requirement to get optimal performance from your cloud applications. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://blogical.se/aggbug.aspx?PostID=10443" width="1" height="1"&gt;</description><category domain="http://blogical.se/blogs/jahlen/archive/tags/SQL+Azure/default.aspx">SQL Azure</category><category domain="http://blogical.se/blogs/jahlen/archive/tags/Cloud/default.aspx">Cloud</category><category domain="http://blogical.se/blogs/jahlen/archive/tags/Azure/default.aspx">Azure</category></item><item><title>Nyhetskoll - my contribution to the Windows Azure Developer Challenge</title><link>http://blogical.se/blogs/jahlen/archive/2009/11/13/nyhetskoll-my-contribution-to-the-windows-azure-developer-challenge.aspx</link><pubDate>Fri, 13 Nov 2009 10:43:00 GMT</pubDate><guid isPermaLink="false">19a535f3-07d9-4378-9c5a-8d019d91e842:10291</guid><dc:creator>jahlen</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogical.se/blogs/jahlen/rsscomments.aspx?PostID=10291</wfw:commentRss><comments>http://blogical.se/blogs/jahlen/archive/2009/11/13/nyhetskoll-my-contribution-to-the-windows-azure-developer-challenge.aspx#comments</comments><description>&lt;p&gt;I submitted today my contribution to the &lt;a title="WADC" href="http://wadc.cloudapp.net/"&gt;Swedish Windows Azure Developer Challenge&lt;/a&gt;. It&amp;#39;s an application, &lt;a href="http://nyhetskoll.cloudapp.net/"&gt;Nyhetskoll&lt;/a&gt;, where you can automatically monitor the Swedish newssites for keywords (such as persons, companies or your interests).&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blogical.se/blogs/jahlen/Nyhetskoll%20WADC/nyhetskoll.gif"&gt;&lt;img border="0" src="http://blogical.se/blogs/jahlen/Nyhetskoll%20WADC/nyhetskoll.gif" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The application runs on Windows Azure and it uses SQL Azure för storage and query logics.&lt;/p&gt;
&lt;p&gt;I started writing the application last weekend and after having spent a few evening finishing it in time for the deadline, today at 12:00, I was disappointed that they extended the deadline by two months. So much for my hurry!&lt;/p&gt;
&lt;p&gt;Well, it made me really explore the Windows Azure platform. It looks promising for the future, but still I would say it is far from stable. Several times when I deployed it got stuck in the &amp;quot;Initializing&amp;quot; phase. It will be very interesting to see what happens at the official release the 19th of November during the PDC.&lt;/p&gt;
&lt;p&gt;Feel free to visit Nyhetskoll at:&lt;br /&gt;&lt;a href="http://nyhetskoll.cloudapp.net/"&gt;http://nyhetskoll.cloudapp.net&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://blogical.se/aggbug.aspx?PostID=10291" width="1" height="1"&gt;</description><category domain="http://blogical.se/blogs/jahlen/archive/tags/SQL+Azure/default.aspx">SQL Azure</category><category domain="http://blogical.se/blogs/jahlen/archive/tags/Windows+Azure/default.aspx">Windows Azure</category><category domain="http://blogical.se/blogs/jahlen/archive/tags/WADC/default.aspx">WADC</category></item></channel></rss>