<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Joseph Idziorek's Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/joseph_idzioreks_blog/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/joseph_idzioreks_blog/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 04:10:46 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Azure SQL Database: 0xDBE Database IDE on Mac OS X</title>
      <link>https://docs.microsoft.com/archive/blogs/joseph_idzioreks_blog/azure-sql-database-0xdbe-database-ide-on-mac-os-x</link>
      <pubDate>Sat, 31 Oct 2015 07:16:00 GMT</pubDate>
      <dc:creator><![CDATA[Joseph Idziorek]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joseph_idzioreks_blog/2015/10/31/azure-sql-database-0xdbe-database-ide-on-mac-os-x/</guid>
      <description><![CDATA[Previously, we looked at querying Azure SQL Database from a command line tool on Mac OS X [Azure SQL...]]></description>
      <content:encoded><![CDATA[<p>Previously, we looked at querying Azure SQL Database from a command line tool on Mac OS X [<a href="https://blogs.msdn.com/b/joseph_idzioreks_blog/archive/2015/10/26/query-azure-sql-db-from-mac-os-x.aspx">Azure SQL Database: CLI on Mac OS X</a>].&nbsp;While CLI is a great tool for administration and basic data exploration, sometimes it is nicer to have a fully featured graphical IDE for more complex or data intensive tasks. There are a handful of UI tools that can act as a surrogate for SQL Server Management Studio on Mac OS X [<a href="https://en.wikipedia.org/wiki/Comparison_of_database_tools">comparison</a>]. One of the tools that stands out above the rest is codename "<a href="https://www.jetbrains.com/dbe/">0xDBE</a>" from <a href="https://www.jetbrains.com/">JetBrains</a> (also makers of Intellij, PyCharm, and ReSharper to name a few).</p>
<p>Because the JetBrains folks do such a nice job of explaining the features and utility of 0xDBE on their website, the focus of this blog entry will be connecting to and querying Azure SQL Database once you have 0xDBE installed.</p>
<p>If you want to keep up to date with Azure SQL Database, follow us on Twitter (<a class="ProfileHeaderCard-screennameLink u-linkComplex js-nav" href="https://twitter.com/AzureSQLDB">@</a><span class="u-linkComplex-target"><a class="ProfileHeaderCard-screennameLink u-linkComplex js-nav" href="https://twitter.com/AzureSQLDB">AzureSQLDB</a>). If you have questions, please ask us on [<a href="https://stackoverflow.com/questions/tagged/sql-azure">Stack Overflow]</a>&nbsp;or&nbsp;[<a href="https://social.msdn.microsoft.com/Forums/en-US/home?forum=ssdsgetstarted&amp;filter=alltypes&amp;sort=lastpostdesc">MSDN</a>].</span></p>
<p><strong>Prerequisites:</strong></p>
<ul>
<li>Access to an Azure SQL Database [<a href="https://azure.microsoft.com/en-us/documentation/articles/sql-database-get-started/">link</a>]</li>
</ul>
<p>To connect Azure SQL Database, in the "Database" view, click the "+", "Data Source" and then "SQL Server (Microsoft)".</p>
<p style="padding-left: 30px;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/46/4834.Screen%20Shot%202015-10-31%20at%207.23.55%20AM.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-46/4834.Screen-Shot-2015_2D00_10_2D00_31-at-7.23.55-AM.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/46/4834.Screen%20Shot%202015-10-31%20at%207.23.55%20AM.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-46/4834.Screen-Shot-2015_2D00_10_2D00_31-at-7.23.55-AM.png" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>You will be prompted with the following screen to describe your database connection. In the dropdown box next to the "URL" field, ensure that "default" is selected. Enter in the appropriate information for your database and click "Test Connection". If everything is correct (and your Azure SQL Database firewall rules are set to allow access from your machine), 0xDBE will tell you that the connection is successful. Click "Ok" at the bottom of the window.</p>
<p style="padding-left: 30px;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/46/7534.Screen%20Shot%202015-10-31%20at%207.48.32%20AM.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-46/7534.Screen-Shot-2015_2D00_10_2D00_31-at-7.48.32-AM.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/46/7534.Screen%20Shot%202015-10-31%20at%207.48.32%20AM.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-46/7534.Screen-Shot-2015_2D00_10_2D00_31-at-7.48.32-AM.png" alt="" border="0" /></a></p>
<p>You can now query your database. &nbsp;Enter a query in the "Azure SQL Database Connection.sql" window and click "&gt;". The results will be displayed in the output tab below.</p>
<p style="padding-left: 30px;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/46/2235.Screen%20Shot%202015-10-31%20at%208.00.52%20AM.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-46/2235.Screen-Shot-2015_2D00_10_2D00_31-at-8.00.52-AM.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/46/2235.Screen%20Shot%202015-10-31%20at%208.00.52%20AM.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-46/2235.Screen-Shot-2015_2D00_10_2D00_31-at-8.00.52-AM.png" alt="" border="0" /></a></p>
<p>You have now connected and queried your Azure SQL Database with 0xDBE on your Mac (or Linux machine). If you are familiar with SQL Server Management Studio, one of the immediate stylistic differences that you will notice when exploring your database with the object explorer (tree view of the database objects) is that 0xDBE organizes a database's objects by the schema, not by the tables. The default schema for a database is "dbo", unless specifically specified. Thus, your tables can be found under "dbo" as shown above.</p>]]></content:encoded>
    </item>
    <item>
      <title>Azure SQL Database: CLI on Mac OS X</title>
      <link>https://docs.microsoft.com/archive/blogs/joseph_idzioreks_blog/azure-sql-database-cli-on-mac-os-x</link>
      <pubDate>Mon, 26 Oct 2015 12:46:00 GMT</pubDate>
      <dc:creator><![CDATA[Joseph Idziorek]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joseph_idzioreks_blog/2015/10/26/azure-sql-database-cli-on-mac-os-x/</guid>
      <description><![CDATA[In the last blog [Azure SQL Database: SQLCMD and BCP on Ubuntu Linux], we looked at connecting and...]]></description>
      <content:encoded><![CDATA[<p>In the last blog [<a href="https://blogs.msdn.com/b/joseph_idzioreks_blog/archive/2015/09/13/sql-server-sqlcmd-and-bcp-on-ubuntu-linux.aspx">Azure SQL Database: SQLCMD and BCP on Ubuntu Linux</a>], we looked at connecting and querying an Azure SQL Database from the command line on Ubuntu Linux with SQLCMD. In this blog we are going to connect and query an Azure SQL Database from the Mac OS X Terminal using the mssql utility [<a href="https://www.npmjs.com/package/sql-cli">source</a>] &ndash; cross platform command line interface for SQL Server and Azure SQL Database (mssql also works on Linux or wherever Node.js runs).</p>
<p>If you want to keep up to date with Azure SQL Database, follow us on Twitter (<a class="ProfileHeaderCard-screennameLink u-linkComplex js-nav" href="https://twitter.com/AzureSQLDB">@</a><span class="u-linkComplex-target"><a class="ProfileHeaderCard-screennameLink u-linkComplex js-nav" href="https://twitter.com/AzureSQLDB">AzureSQLDB</a>). If you have questions, please ask us on [<a href="https://stackoverflow.com/questions/tagged/sql-azure">Stack Overflow]</a>&nbsp;or&nbsp;[<a href="https://social.msdn.microsoft.com/Forums/en-US/home?forum=ssdsgetstarted&amp;filter=alltypes&amp;sort=lastpostdesc">MSDN</a>].</span></p>
<p><strong>Prerequisites:</strong></p>
<ul>
<li>Access to an Azure SQL Database [<a href="https://azure.microsoft.com/en-us/documentation/articles/sql-database-get-started/">link</a>] or SQL Server (Express [<a href="https://www.microsoft.com/en-us/download/details.aspx?id=42299">link</a>])</li>
<li>Install Node.js and npm on Mac OS X [<a href="https://shapeshed.com/setting-up-nodejs-and-npm-on-mac-osx/">link</a>]</li>
</ul>
<div>Using Terminal, install the mssql utility:</div>
<div>
<pre class="scroll"><code class="js">npm install -g sql-cli</code></pre>
</div>
<div>
<p>Connect to Azure SQL Database (similar for SQL Server):</p>
<pre class="scroll"><code class="js">mssql&nbsp;-s&nbsp;yourServerName.database.windows.net&nbsp;-u&nbsp;yourUsername@yourServerName -p&nbsp;yourPassword -d&nbsp;yourDatabase &ndash;e</code></pre>
<p>Execute a command</p>
<pre class="scroll"><code class="js">SELECT @@version</code></pre>
<p>One of the cool features of the mssql utility is that it has a number of handy, built-in "usage hints" for listing databases, tables, and schema for a table. &nbsp;This alleviates the need for having to remember and type queries such as "Select name from sys.databases". &nbsp;Instead, it is simply ".databases".</p>
<pre class="scroll"><code class="js">sql-cli version 0.4.5<br /> Enter ".help" for usage hints.<br /> mssql&gt; .help<br /> <br /> command description <br /> -------------- ------------------------------------------<br /> .help Shows this message <br /> .tables Lists all the tables <br /> .databases Lists all the databases <br /> .read FILENAME Execute commands in a file <br /> .run FILENAME Execute the file as a sql script <br /> .schema TABLE Shows the schema of a table <br /> .indexes TABLE Lists all the indexes of a table <br /> .analyze Analyzes the database for missing indexes.<br /> .quit Exit the cli <br /> <br /> mssql&gt; </code></pre>
<p>In the next blog, we'll look at querying Azure SQL Database from a graphical tool on Mac OS X.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>]]></content:encoded>
    </item>
    <item>
      <title>Azure SQL Database: SQLCMD and BCP on Ubuntu Linux</title>
      <link>https://docs.microsoft.com/archive/blogs/joseph_idzioreks_blog/azure-sql-database-sqlcmd-and-bcp-on-ubuntu-linux</link>
      <pubDate>Sun, 13 Sep 2015 10:02:00 GMT</pubDate>
      <dc:creator><![CDATA[Joseph Idziorek]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joseph_idzioreks_blog/2015/09/13/azure-sql-database-sqlcmd-and-bcp-on-ubuntu-linux/</guid>
      <description><![CDATA[Azure SQL Database abstracts the underlying operating system from the developer.&nbsp; To the...]]></description>
      <content:encoded><![CDATA[<p>Azure SQL Database abstracts the underlying operating system from the developer.&nbsp; To the developer, this means that they have access to a database via a TDS connection but have no access to the underlying operation system.&nbsp; The Azure SQL Database could be running on Ubuntu or Minix and the developer would not know the difference (spoiler alert, Azure SQL Database runs on Windows).&nbsp;</p>
<p>While its true that developers do not have to worry about the underlying operating system of Azure SQL Database, they certainly do have to worry about their application operating system.&nbsp; With greater than 20% of the VMs in Azure running Linux [<a href="https://arstechnica.com/information-technology/2014/10/microsoft-loves-linux-as-it-makes-azure-bigger-better/">link</a>] and the popularity of Azure SQL Database, the SQL Database naturally gets many questions on how to connect to and manager Azure SQL Database from non-Windows platforms.&nbsp; This blog will kick-off a series of articles and tutorials on how to do just that.</p>
<p>For Linux, the most natural place to start is with the Linux command line. In this blog we will install (and use) the quintessential SQL Server/SQL Database command line tools on Linux: SQLCMD and BCP.&nbsp; For this tutorial, we&rsquo;ll use Ubuntu 14.04 LTS as it is the least common denominator for the many flavors of Linux between developers and cloud providers. &nbsp;</p>
<p>If you want to keep up to date with Azure SQL Database, follow us on Twitter (<a class="ProfileHeaderCard-screennameLink u-linkComplex js-nav" href="https://twitter.com/AzureSQLDB">@</a><span class="u-linkComplex-target"><a class="ProfileHeaderCard-screennameLink u-linkComplex js-nav" href="https://twitter.com/AzureSQLDB">AzureSQLDB</a>). If you have questions, please ask us on [<a href="https://stackoverflow.com/questions/tagged/sql-azure">Stack Overflow]</a>&nbsp;or&nbsp;[<a href="https://social.msdn.microsoft.com/Forums/en-US/home?forum=ssdsgetstarted&amp;filter=alltypes&amp;sort=lastpostdesc">MSDN</a>].</span></p>
<p><strong>Prerequisites:</strong></p>
<ul>
<li>Ubuntu 14.04 machine whether it is on your laptop, dev machine, in Azure [<a href="https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-tutorial-portal-rm/">link</a>], or another cloud provider</li>
<li>Access to an Azure SQL Database [<a href="https://azure.microsoft.com/en-us/documentation/articles/sql-database-get-started/">link</a>] or SQL Server (Express [<a href="https://www.microsoft.com/en-us/download/details.aspx?id=42299">link</a>])</li>
</ul>
<p><strong>Download the install script [</strong><a href="https://gallery.technet.microsoft.com/scriptcenter/SQLCMD-and-BCP-for-Ubuntu-c88a28cc">source</a><strong>]:</strong></p>
<pre class="scroll"><span style="background-color: #efefef;"><code class="php">wget https://gallery.technet.microsoft.com/scriptcenter/SQLCMD-and-BCP-for-Ubuntu-c88a28cc/file/142121/1/Ubuntu%2014.04%20MSFT%20ODBC%20Driver.sh</code></span></pre>
<p><strong><span style="background-color: #efefef;">I</span>nstall the SQLCMD, BCP and the Linux ODBC driver (execute the script from your user directory i.e, /home/nickfury/)</strong></p>
<pre class="scroll"><span style="background-color: #efefef;"><code class="php">sudo bash Ubuntu\ 14.04\ MSFT\ ODBC\ Driver.sh</code></span>&nbsp;</pre>
<p><strong>Connect to Azure SQL Database (similar for SQL Server)</strong></p>
<pre class="scroll"><span style="background-color: #efefef;"><code class="php">sqlcmd &ndash;S yourServerName.database.windows.net &ndash; U yourUsername &ndash; P yourPassword<br /> </code></span></pre>
<p><strong>Execute a command:</strong></p>
<pre class="scroll"><span style="background-color: #efefef;"><code class="php"> 1&gt; Select @@version;<br /> 2&gt; Go</code></span></pre>
<p>For more information:</p>
<ul>
<li>SQLCMD: <a href="https://msdn.microsoft.com/en-us/library/ms162773.aspx">https://msdn.microsoft.com/en-us/library/ms162773.aspx</a></li>
<li>BCP: <a href="https://msdn.microsoft.com/en-us/library/ms162802.aspx">https://msdn.microsoft.com/en-us/library/ms162802.aspx</a></li>
<li>Linux ODBC: <a href="https://www.microsoft.com/en-us/download/details.aspx?id=28160">https://www.microsoft.com/en-us/download/details.aspx?id=28160</a></li>
</ul>
<p>For questions:</p>
<ul>
<li>Stack Overflow [<a href="https://stackoverflow.com/questions/tagged/sql-azure">link</a>]</li>
<li>MSDN [<a href="https://social.msdn.microsoft.com/Forums/en-US/home?forum=ssdsgetstarted&amp;filter=alltypes&amp;sort=lastpostdesc">link</a>]</li>
</ul>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Azure SQL Database: Hello World</title>
      <link>https://docs.microsoft.com/archive/blogs/joseph_idzioreks_blog/azure-sql-database-hello-world</link>
      <pubDate>Sat, 07 Feb 2015 16:20:00 GMT</pubDate>
      <dc:creator><![CDATA[Joseph Idziorek]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joseph_idzioreks_blog/2015/02/07/azure-sql-database-hello-world/</guid>
      <description><![CDATA[In many different forums, I often get ask how one can quickly write a sample application for Azure...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: Calibri; font-size: small;">In many different forums, I often get ask how one can quickly write a sample application for </span><a href="https://azure.microsoft.com/en-us/services/sql-database/"><span style="color: #0563c1; font-family: Calibri; font-size: small;">Azure SQL Database</span></a><span style="font-family: Calibri; font-size: small;">.&nbsp; While there are many different code snippets scattered through the web, one often has to stitch together bits and pieces of code to get a complete solution.&nbsp; If one is not experienced in C# and ADO.NET, this is not always a straightforward task.&nbsp; The objective of this blog is to present a simplified solution to get started with Azure SQL Database.&nbsp; For the solution provided, all one needs to do is simply enter their database credentials, hit F5, and they are programming against their database.</span></p>
<p><span style="font-family: Calibri; font-size: small;">There are, however, a few prerequisites: 1) </span><a href="https://azure.microsoft.com/en-us/documentation/articles/sql-database-get-started/#Subscribe"><span style="color: #0563c1; font-family: Calibri; font-size: small;">create an Azure Subscription</span></a><span style="font-family: Calibri; font-size: small;">, 2) </span><a href="https://azure.microsoft.com/en-us/documentation/articles/sql-database-get-started/#Subscribe"><span style="color: #0563c1; font-family: Calibri; font-size: small;">provision a SQL Database</span></a><span style="font-family: Calibri; font-size: small;">, 3) </span><a href="https://azure.microsoft.com/en-us/documentation/articles/sql-database-get-started/#ConfigFirewall"><span style="color: #0563c1; font-family: Calibri; font-size: small;">configure the firewall</span></a><span style="font-family: Calibri; font-size: small;">, and 4) </span><a href="https://azure.microsoft.com/en-us/documentation/articles/sql-database-get-started/#createschema"><span style="color: #0563c1; font-family: Calibri; font-size: small;">create a schema</span></a><span style="font-family: Calibri; font-size: small;"> and </span><a href="https://azure.microsoft.com/en-us/documentation/articles/sql-database-get-started/#insertData"><span style="color: #0563c1; font-family: Calibri; font-size: small;">insert sample data</span></a><span style="font-family: Calibri; font-size: small;">. The following video [</span><a href="https://www.youtube.com/watch?v=0YkaforM4Ao"><span style="color: #0563c1; font-family: Calibri; font-size: small;">link</span></a><span style="font-family: Calibri; font-size: small;">] provides a great guide on to accomplish steps 2) and 4) above. For the full getting started guide, please see the following [</span><a href="https://azure.microsoft.com/en-us/documentation/articles/sql-database-get-started/"><span style="color: #0563c1; font-family: Calibri; font-size: small;">link</span></a><span style="font-family: Calibri; font-size: small;">].</span></p>
<p><span style="font-family: Calibri; font-size: small;">To get the code, please see the </span><a href="https://code.msdn.microsoft.com/Azure-SQL-Database-Hello-ba73aa74"><span style="color: #0563c1; font-family: Calibri; font-size: small;">Azure SQL Database: Hello World</span></a><span style="font-family: Calibri; font-size: small;"> in the MSDN sample gallery.</span></p>
<p><span style="font-family: Calibri; font-size: small;">Below is the simplified code that will enable one to quickly write a console application to connect to and read from an Azure SQL Database.</span><code class="csharp"><span style="font-family: Times New Roman; font-size: small;"><br /></span></code></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;"><code class="csharp"><span style="font-family: Times New Roman;"><span style="color: blue; font-family: Consolas; mso-bidi-font-family: Arial;">using System;</span><br /></span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;"><code class="csharp"><span style="color: blue; font-family: Consolas; mso-bidi-font-family: Arial;">using System.Collections.Generic;</span></code><code class="csharp"><span style="font-family: Times New Roman;"><br /></span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;"><code class="csharp"><span style="color: blue; font-family: Consolas; mso-bidi-font-family: Arial;">using System.Linq;</span></code><code class="csharp"><span style="font-family: Times New Roman;"><br /></span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;"><code class="csharp"><span style="color: blue; font-family: Consolas; mso-bidi-font-family: Arial;">using System.Text;</span></code><code class="csharp"><span style="font-family: Times New Roman;"><br /></span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;"><code class="csharp"><span style="color: blue; font-family: Consolas; mso-bidi-font-family: Arial;">using System.Threading.Tasks;</span></code><code class="csharp"><span style="font-family: Times New Roman;"><br /></span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;"><code class="csharp"><span style="color: blue; font-family: Consolas; mso-bidi-font-family: Arial;">using System.Data.SqlClient;</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;"><code class="csharp"></code><code class="csharp"><span style="font-family: Times New Roman;"><br /></span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;"><code class="csharp"><span style="color: blue; font-family: Consolas; mso-bidi-font-family: Arial;">namespace HelloWorldAzureSQLDatabase</span></code><code class="csharp"><span style="font-family: Times New Roman;"><br /></span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;"><code class="csharp"><span style="color: black; font-family: 'Arial',sans-serif;">{</span></code><code class="csharp"><span style="font-family: Times New Roman;"><br /></span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;"><code class="csharp"><span style="color: blue; font-family: Consolas; mso-bidi-font-family: Arial;">&nbsp;classProgram</span></code><code class="csharp"><span style="font-family: Times New Roman;"><br /></span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;"><code class="csharp"><span style="color: black; font-family: 'Arial',sans-serif;">&nbsp; {</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: blue; font-family: Consolas; mso-bidi-font-family: Arial;">static void Main()</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: black; font-family: 'Arial',sans-serif;">{</span></code><code class="csharp"><span style="font-family: Times New Roman;"><br /></span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;"><code class="csharp"><span style="color: #2b91af; font-family: Consolas; mso-bidi-font-family: Arial;">&nbsp;&nbsp;&nbsp; SqlConnectionStringBuilder builder = </span><span style="color: blue; font-family: Consolas; mso-bidi-font-family: Arial;">newSqlConnectionStringBuilder();</span></code><code class="csharp"><span style="font-family: Times New Roman;"><br /></span></code></span></p>
<p style="margin: 0in 0in 0pt;">&nbsp;</p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: green; font-family: Consolas; mso-bidi-font-family: Arial;">//The name of the Azure SQL Database server</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: green; font-family: Consolas; mso-bidi-font-family: Arial;">//Example: myFirstDatabase.database.windows.net</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: black; font-family: Consolas; mso-bidi-font-family: Arial;">builder[</span><span style="color: #a31515; font-family: Consolas; mso-bidi-font-family: Arial;">"Server"] = </span><span style="color: #a31515; font-family: Consolas; mso-bidi-font-family: Arial;">"&lt;name&gt;.database.windows.net";</span></code><code class="csharp"><span style="font-family: Times New Roman;"><br /></span></code></span></p>
<p style="margin: 0in 0in 0pt;">&nbsp;</p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: green; font-family: Consolas; mso-bidi-font-family: Arial;">//User ID of the entity attempting to connect to the database</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: black; font-family: Consolas; mso-bidi-font-family: Arial;">builder[</span><span style="color: #a31515; font-family: Consolas; mso-bidi-font-family: Arial;">"User ID"] = </span><span style="color: #a31515; font-family: Consolas; mso-bidi-font-family: Arial;">"&lt;userID&gt;";</span></code></span></p>
<p style="margin: 0in 0in 0pt;">&nbsp;</p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: green; font-family: Consolas; mso-bidi-font-family: Arial;">//The password associated the User ID</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: black; font-family: Consolas; mso-bidi-font-family: Arial;">builder[</span><span style="color: #a31515; font-family: Consolas; mso-bidi-font-family: Arial;">"Password"] = </span><span style="color: #a31515; font-family: Consolas; mso-bidi-font-family: Arial;">"&lt;passowrd&gt;";</span></code></span></p>
<p style="margin: 0in 0in 0pt;">&nbsp;</p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: green; font-family: Consolas; mso-bidi-font-family: Arial;">//Name of the target database</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: black; font-family: Consolas; mso-bidi-font-family: Arial;">builder[</span><span style="color: #a31515; font-family: Consolas; mso-bidi-font-family: Arial;">"Database"] = </span><span style="color: #a31515; font-family: Consolas; mso-bidi-font-family: Arial;">"&lt;databaseName&gt;";</span></code></span></p>
<p style="margin: 0in 0in 0pt;">&nbsp;</p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: green; font-family: Consolas; mso-bidi-font-family: Arial;">//Denotes that the User ID and password are specified in the connection</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: black; font-family: Consolas; mso-bidi-font-family: Arial;">builder[</span><span style="color: #a31515; font-family: Consolas; mso-bidi-font-family: Arial;">"Integrated Security"] = </span><span style="color: blue; font-family: Consolas; mso-bidi-font-family: Arial;">false;</span></code></span></p>
<p style="margin: 0in 0in 0pt;">&nbsp;</p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: green; font-family: Consolas; mso-bidi-font-family: Arial;">//By default, Azure SQL Database uses SSL encryption for all data sent between</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: green; font-family: Consolas; mso-bidi-font-family: Arial;">//the client and the database</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: black; font-family: Consolas; mso-bidi-font-family: Arial;">builder[</span><span style="color: #a31515; font-family: Consolas; mso-bidi-font-family: Arial;">"Encrypt"] = </span><span style="color: blue; font-family: Consolas; mso-bidi-font-family: Arial;">true;</span></code></span></p>
<p style="margin: 0in 0in 0pt;">&nbsp;</p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: green; font-family: Consolas; mso-bidi-font-family: Arial;">//Create a SqlConnection from the provided connection string</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: blue; font-family: Consolas; mso-bidi-font-family: Arial;">using (</span><span style="color: #2b91af; font-family: Consolas; mso-bidi-font-family: Arial;">SqlConnection connection = </span><span style="color: blue; font-family: Consolas; mso-bidi-font-family: Arial;">newSqlConnection(builder.ToString()))</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: black; font-family: 'Arial',sans-serif;">{</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: green; font-family: Consolas; mso-bidi-font-family: Arial;">//Begin to formulate the command</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: #2b91af; font-family: Consolas; mso-bidi-font-family: Arial;">SqlCommand command = </span><span style="color: blue; font-family: Consolas; mso-bidi-font-family: Arial;">newSqlCommand();</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: black; font-family: 'Arial',sans-serif;">command.Connection = connection;</span></code></span></p>
<p style="margin: 0in 0in 0pt;">&nbsp;</p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: green; font-family: Consolas; mso-bidi-font-family: Arial;">//Sets the wait time (10 seconds) before terminating the attempt to execute a command and generate an error</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: green; font-family: Consolas; mso-bidi-font-family: Arial;">//Default value is 30 seconds;</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: black; font-family: 'Arial',sans-serif;">command.CommandTimeout = 10;</span></code></span></p>
<p style="margin: 0in 0in 0pt;">&nbsp;</p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: green; font-family: Consolas; mso-bidi-font-family: Arial;">//Specify the query to be executed</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: black; font-family: Consolas; mso-bidi-font-family: Arial;">command.CommandType = System.Data.</span><span style="color: #2b91af; font-family: Consolas; mso-bidi-font-family: Arial;">CommandType.Text;</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: black; font-family: Consolas; mso-bidi-font-family: Arial;">command.CommandText = </span><span style="color: #a31515; font-family: Consolas; mso-bidi-font-family: Arial;">"Select count(*) from &lt;tableName&gt;";</span></code></span></p>
<p style="margin: 0in 0in 0pt;">&nbsp;</p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: green; font-family: Consolas; mso-bidi-font-family: Arial;">//Open connection to database</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: black; font-family: 'Arial',sans-serif;">connection.Open();</span></code></span></p>
<p style="margin: 0in 0in 0pt;">&nbsp;</p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: green; font-family: Consolas; mso-bidi-font-family: Arial;">//Read data from the query</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: #2b91af; font-family: Consolas; mso-bidi-font-family: Arial;">SqlDataReader reader = command.ExecuteReader();</span></code></span></p>
<p style="margin: 0in 0in 0pt;">&nbsp;</p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code class="csharp"><span style="color: blue; font-family: Consolas; mso-bidi-font-family: Arial;">while (reader.Read())</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code class="csharp"><span style="color: black; font-family: 'Arial',sans-serif;">{</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: green; font-family: Consolas; mso-bidi-font-family: Arial;">//Formatting will depend on the contents of the query</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: #2b91af; font-family: Consolas; mso-bidi-font-family: Arial;">Console.WriteLine(</span><span style="color: #a31515; font-family: Consolas; mso-bidi-font-family: Arial;">"Value: {0}", reader[0]);</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<code class="csharp"><span style="color: black; font-family: 'Arial',sans-serif;">}<br /></span></code></span></p>
<p style="margin: 0in 0in 0pt;">&nbsp;</p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: #2b91af; font-family: Consolas; mso-bidi-font-family: Arial;">Console.WriteLine(</span><span style="color: #a31515; font-family: Consolas; mso-bidi-font-family: Arial;">"\nPress any key to continue");</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <code class="csharp"><span style="color: #2b91af; font-family: Consolas; mso-bidi-font-family: Arial;">Console.ReadLine();</span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;"><code class="csharp"><span style="color: black; font-family: 'Arial',sans-serif;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></code><code class="csharp"><span style="font-family: Times New Roman;"><br /></span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;"><code class="csharp"><span style="color: black; font-family: 'Arial',sans-serif;">&nbsp;&nbsp;&nbsp; }</span></code><code class="csharp"><span style="font-family: Times New Roman;"><br /></span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;"><code class="csharp"><span style="color: black; font-family: 'Arial',sans-serif;">&nbsp; }</span></code><code class="csharp"><span style="font-family: Times New Roman;"><br /></span></code></span></p>
<p style="margin: 0in 0in 0pt;"><span style="font-size: x-small;"><code class="csharp"><span style="color: black; font-family: 'Arial',sans-serif;">}</span></code>&nbsp;</span></p>
<p><span style="font-family: Calibri; font-size: small;">From the link provided above, there are two quick ways that you can get going with this sample code.&nbsp; First is to simply download the sample code for the MSDN Code Gallery.&nbsp; The other option is to open Visual Studio, click File -&gt; New -&gt; Project.&nbsp; On the left-hand side of the New Project Window, click &ldquo;Online&rdquo; -&gt; Samples -&gt; Visual C#.&nbsp; In the search box in the top-right hand corner of the windows, search for &ldquo;Azure SQL Database: Hello World&rdquo;. Select the appropriate project and &ldquo;click&rdquo; OK.</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Creating Premium, Standard, and Basic Databases with PowerShell</title>
      <link>https://docs.microsoft.com/archive/blogs/joseph_idzioreks_blog/creating-premium-standard-and-basic-databases-with-powershell</link>
      <pubDate>Sun, 25 May 2014 13:40:00 GMT</pubDate>
      <dc:creator><![CDATA[Joseph Idziorek]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/joseph_idzioreks_blog/2014/05/25/creating-premium-standard-and-basic-databases-with-powershell/</guid>
      <description><![CDATA[With the introduction of the new Azure SQL&nbsp;DB&nbsp;service tiers&nbsp;comes the desire to...]]></description>
      <content:encoded><![CDATA[<p>With the introduction of the new Azure <a href="https://azure.microsoft.com/blog/2014/04/24/azure-sql-database-introduces-new-service-tiers/">SQL</a>&nbsp;<a href="https://blogs.technet.com/b/dataplatforminsider/archive/2014/05/01/azure-sql-database-new-service-tiers-q-amp-a.aspx">DB</a>&nbsp;<a href="https://msdn.microsoft.com/en-us/library/azure/dn741336.aspx">service tiers</a>&nbsp;comes the desire to programmatically provision these new service tiers &ndash; more specifically, Basic, Standard (S1, S2), and Premium (P1, P2, and P3) databases. This blog post will provide the basic steps to create a new SQL DB service tier (and old) via a PowerShell script.&nbsp; While the example script below demonstrates the creation of a Standard S2 database, the script can easily be modified to create any Basic, Standard, Premium, Web or Standard database.</p>
<p><strong>Prerequisites:</strong></p>
<ul>
<li>Install <a href="https://technet.microsoft.com/en-us/scriptcenter/powershell.aspx">PowerShell</a>&nbsp;(example script below was performed on PowerShell version 4.0 &ndash; current PowerShell version can be found by executing $PSVersionTable from the PowerShell command line</li>
<li>Install <a href="https://azure.microsoft.com/en-us/documentation/articles/install-configure-powershell/">Azure PowerShell</a></li>
<li>Register for the <a href="https://azure.microsoft.com/en-us/services/preview/">New Service Tiers preview feature</a> for SQL Database</li>
<li>SQL database server that supports database editions &ldquo;Basic, Standard, Premium&rdquo;</li>
</ul>
<p><strong>PowerShell Script:</strong></p>
<p style="padding-left: 30px;"><code class="php"><span style="color: #008000;">&lt;#</span><br /><span style="color: #008000;"> .SYNOPSIS</span><br /><span style="color: #008000;"> Create a Standard database with an S2 performance level</span><br /> <br /><span style="color: #008000;"> .PARAMETER Name</span><br /><span style="color: #008000;"> N/A</span><br /> <br /><span style="color: #008000;"> .NOTES</span><br /><span style="color: #008000;"> Last Updated: 5/25/2014 </span><br /><span style="color: #008000;"> #&gt;</span><br /> <br /> <span style="color: #008000;"># Azure SQL Database server (Ex: bzb98er9bp)</span><br /> $ServerName = "&lt;ServerName&gt;"<br /> <br /> <span style="color: #008000;"># Username for Azure SQL Database server</span><br /> $ServerLogin = "&lt;ServerLogin&gt;"<br /> <br /> <span style="color: #008000;"># Password for Azure SQL Database server</span><br /> $serverPassword = "&lt;ServerPassword&gt;"<br /> <br /> <span style="color: #008000;"># Name of new database to be created</span><br /> $NewDbName = "MyS2Db"<br /> <br /> <span style="color: #008000;"># Establish credentials for Azure SQL Database Server</span> <br /> $Servercredential = new-object System.Management.Automation.PSCredential($ServerLogin, ($ServerPassword | ConvertTo-SecureString -asPlainText -Force)) <br /> <br /> <span style="color: #008000;"># Create connection context for Azure SQL Database server</span><br /> $CTX = New-AzureSqlDatabaseServerContext -ManageUrl &ldquo;https://$ServerName.database.windows.net&rdquo; -Credential $ServerCredential<br /> <br /> <span style="color: #008000;"># Specify the specific performance level for the $NewDbName</span><br /> $PerformanceLevel = Get-AzureSqlDatabaseServiceObjective -Context $CTX -ServiceObjectiveName "S2"<br /> <br /> <span style="color: #008000;"># Create new Basic database</span><br /> New-AzureSqlDatabase -ConnectionContext $CTX -DatabaseName $NewDbName -Edition "Standard" -MaxSizeGB 10 -ServiceObjective $PerformanceLevel&nbsp;</code>&nbsp;</p>
<p>Success looks like the following:</p>
<p style="padding-left: 30px;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/46/7041.success1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-46/7041.success1.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/46/7041.success1.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-46/7041.success1.png" alt="" border="0" /></a></p>
<p><br />The creation of the new database will take a few moments to complete and presence of the new database can be seen in the <a href="https://manage.windowsazure.com/">Azure Portal</a> immediately.&nbsp; The progress of the readiness of the new database can further be tracked with the following command:</p>
<p style="padding-left: 30px;">Get-AzureSqlDatabase $CTX &ndash;DatabaseName $NewDbName</p>
<p>Once the Standard S2 database has been fully provisioned, success looks like the following:</p>
<p style="padding-left: 30px;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/46/1205.success2.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-46/1205.success2.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/65/46/1205.success2.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-65-46/1205.success2.png" alt="" border="0" /></a><br />&nbsp;</p>
<p>To enumerate all the available database service tiers and their respective performance levels, one augment the example script with the following (and omit the New-AzureSqlDatabse command):</p>
<p style="padding-left: 30px;">Get-AzureSqlDatabaseServiceObjective -Context $CTX</p>
<p>The same script can be also be used to provision Basic or Premium database too. To create a Basis&nbsp;database, the example script can be modified as follows:</p>
<p style="padding-left: 30px;"><span style="color: #008000;"># Specify the specific performance level for the $NewDbName</span><br /> $PerformanceLevel = Get-AzureSqlDatabaseServiceObjective -Context $CTX -ServiceObjectiveName "Basic"<br /><br /><span style="color: #008000;"># Create new Basic database</span><br /> New-AzureSqlDatabase -ConnectionContext $CTX -DatabaseName $NewDbName -Edition "Basic" -MaxSizeGB&nbsp;2 -ServiceObjective $PerformanceLevel&nbsp;&nbsp;</p>]]></content:encoded>
    </item>
  </channel>
</rss>