{"id":300,"date":"2016-09-13T13:40:14","date_gmt":"2016-09-13T12:40:14","guid":{"rendered":"https:\/\/sqldoubleg.live-website.com\/?p=300"},"modified":"2022-12-25T10:13:04","modified_gmt":"2022-12-25T10:13:04","slug":"t-sql-tuesday-82-my-first-steps-on-azure-database","status":"publish","type":"post","link":"https:\/\/www.sqldoubleg.com\/es\/2016\/09\/13\/t-sql-tuesday-82-my-first-steps-on-azure-database\/","title":{"rendered":"T-SQL Tuesday #82 &#8211; My first steps on Azure Database"},"content":{"rendered":"<p>This week I want to walk my first steps into SQL Azure database, create a new database and run a query, totally for novices like me&nbsp;<a href=\"https:\/\/devjef.wordpress.com\/2016\/09\/06\/invitation-t-sql-tuesday-82-to-the-cloud-and-beyond\/\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/sqldoubleg.live-website.com\/wp-content\/uploads\/2016\/07\/tsql2sday150x150.jpg\" alt=\"tsql2sday150x150\" width=\"154\" height=\"154\" style=\"float:left;margin-right:7px\" \/><\/a><\/p>\n<p>&nbsp;<br \/>\nThis post is part of the <a href=\"https:\/\/voiceofthedba.wordpress.com\/t-sql-tuesday-topic-list\/\" target=\"_blank\" rel=\"noopener\">T-SQL Tuesday<\/a>, which is a monthly blog party on the second Tuesday of each month. Everyone is welcome and have the chance to write about SQL Server. <a href=\"https:\/\/devjef.wordpress.com\/2016\/09\/06\/invitation-t-sql-tuesday-82-to-the-cloud-and-beyond\/\" target=\"_blank\" rel=\"noopener\"><br \/>\nThis month&#8217;s topic about the cloud<\/a>, topic where I&#8217;m absolutely a newbie, even though here is my addition.<\/p>\n<p>&nbsp;<br \/>\nAs I said, I have no experience with SQL in the cloud, but that makes this week&#8217;s topic more challenging, because this is how everybody starts, so I&#8217;ll just tell you my experience trying to get started with SQL Azure.<\/p>\n<p>First a quick google\/bing search takes me to <a href=\"https:\/\/azure.microsoft.com\/en-us\/services\/sql-database\/\" target=\"_blank\" rel=\"noopener\">Microsoft Azure<\/a> where I see our favourite words \u00abStart free\u00bb, so there we go!<\/p>\n<p>After logging to my Microsoft account, another form to fill and some verifications (including card registration) we get some free credit ($200 or \u00a3125) to start playing around.<\/p>\n<p><a href=\"https:\/\/sqldoubleg.live-website.com\/wp-content\/uploads\/2016\/09\/01_Welcome_screen.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/sqldoubleg.live-website.com\/wp-content\/uploads\/2016\/09\/01_Welcome_screen.png\" alt=\"01_welcome_screen\" width=\"999\" height=\"983\" class=\"aligncenter size-full wp-image-301\" \/><\/a><\/p>\n<p>Small video to watch and some links, most interesting of course <a href=\"https:\/\/azure.microsoft.com\/en-gb\/documentation\/articles\/sql-database-get-started\/\" target=\"_blank\" rel=\"noopener\">SQL Database tutorials<\/a><\/p>\n<p>&nbsp;<br \/>\n<strong>The Azure Portal<\/strong><\/p>\n<p>The Azure Portal gives us the possibility of managing the multiple services the platform has to offer, VM&#8217;s, SQL Databases and much more but for now and considering the situation I&#8217;ll be happy if I manage to create a database and run a query against it.<\/p>\n<p>Clicking on <em>SQL Databases -> Add<\/em> will get us a form where to start configuring it.<\/p>\n<p><a href=\"https:\/\/sqldoubleg.live-website.com\/wp-content\/uploads\/2016\/09\/02_create_SQL_database.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/sqldoubleg.live-website.com\/wp-content\/uploads\/2016\/09\/02_create_SQL_database.png\" alt=\"02_create_sql_database\" width=\"547\" height=\"714\" class=\"aligncenter size-full wp-image-302\" \/><\/a><\/p>\n<p>Interesting choices for \u00abSelect Source\u00bb which has the following options<\/p>\n<ul>\n<li>Blank Database<\/li>\n<li>Sample, where we can choose from 2 different versions of AdventureWorks, legacy and V12 (latest)<\/li>\n<li>Backup, I don&#8217;t have any backups so it&#8217;s not a real choice for me right now<\/li>\n<\/ul>\n<p>&nbsp;<br \/>\nYou need to create a new server. Name, admin login and password and location is sufficient to get the job done<\/p>\n<p><a href=\"https:\/\/sqldoubleg.live-website.com\/wp-content\/uploads\/2016\/09\/03_create_new_server.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/sqldoubleg.live-website.com\/wp-content\/uploads\/2016\/09\/03_create_new_server.png\" alt=\"03_create_new_server\" width=\"1178\" height=\"678\" class=\"aligncenter size-full wp-image-303\" \/><\/a><\/p>\n<p>&nbsp;<br \/>\nPricing tier, since this is a demo and I only have \u00a3125 free credit, I&#8217;ll go for the cheapest option. Price is a combination of storage capacity plus processing capacity measured in DTU&#8217;s.<br \/>\nHow each DTU is calculated is a black box, but <a href=\"http:\/\/dtucalculator.azurewebsites.net\/\" target=\"_blank\" rel=\"noopener\">there is a tool<\/a> which by giving some metrics of your current workload will help you determine how many DTU&#8217;s you&#8217;d need in the cloud to handle it.<\/p>\n<p>As I said, <em>gimme<\/em> the cheapest!<\/p>\n<p>Funny that the default collation is SQL_Latin1_General_CP1_CI_AS so be aware if you want to migrate data from on-premises to the cloud. In this case, collation is determined by the sample database I&#8217;ve chosen.<\/p>\n<p>Once we click &#8216;Create&#8217; the deployment of our database will start, when finishes we can see it in our list of databases.<\/p>\n<p><a href=\"https:\/\/sqldoubleg.live-website.com\/wp-content\/uploads\/2016\/09\/04_database_list.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/sqldoubleg.live-website.com\/wp-content\/uploads\/2016\/09\/04_database_list.png\" alt=\"04_database_list\" width=\"1032\" height=\"367\" class=\"aligncenter size-full wp-image-304\" \/><\/a><\/p>\n<p>&nbsp;<br \/>\n<strong>Running my first query on Azure<\/strong><\/p>\n<p>This is so exciting! Microsoft has been publishing that transitioning to the cloud would be kind of seamless so most of the on-prem knowledge is an asset.<\/p>\n<p>How do I query my SQL Databases on-prem? You&#8217;re right, SSMS.<\/p>\n<p><a href=\"https:\/\/sqldoubleg.live-website.com\/wp-content\/uploads\/2016\/09\/05_using_SSMS_to_connect_azure.png\" target=\"_blank\" style=\"float:left\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/sqldoubleg.live-website.com\/wp-content\/uploads\/2016\/09\/05_using_SSMS_to_connect_azure.png\" alt=\"05_using_ssms_to_connect_azure\" width=\"477\" height=\"315\" class=\"aligncenter size-full wp-image-305\" \/><\/a><br \/>\n<a href=\"https:\/\/sqldoubleg.live-website.com\/wp-content\/uploads\/2016\/09\/06_signing_to_azure.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/sqldoubleg.live-website.com\/wp-content\/uploads\/2016\/09\/06_signing_to_azure.png\" alt=\"06_signing_to_azure\" width=\"327\" height=\"293\" class=\"aligncenter size-full wp-image-306\" \/><\/a><\/p>\n<p>In the process we need to sign in to Azure and add an exception on our firewall which seems pretty straight forward and we are ready.<\/p>\n<p>You can see how our new server and database shows in SSMS like any of our local (or remote) SQL Servers, if we want to dig in into properties we&#8217;ll soon find the new specific settings for Azure and how some of our on-prem are greyed out, but the it&#8217;s true we can use it as any other, so I can run queries as normal.<\/p>\n<p><a href=\"https:\/\/sqldoubleg.live-website.com\/wp-content\/uploads\/2016\/09\/07_querying_Azure.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/sqldoubleg.live-website.com\/wp-content\/uploads\/2016\/09\/07_querying_Azure.png\" alt=\"07_querying_azure\" width=\"920\" height=\"556\" class=\"aligncenter size-full wp-image-314\" srcset=\"https:\/\/www.sqldoubleg.com\/wp-content\/uploads\/2016\/09\/07_querying_Azure.png 920w, https:\/\/www.sqldoubleg.com\/wp-content\/uploads\/2016\/09\/07_querying_Azure-300x181.png 300w, https:\/\/www.sqldoubleg.com\/wp-content\/uploads\/2016\/09\/07_querying_Azure-150x91.png 150w\" sizes=\"(max-width: 920px) 100vw, 920px\" \/><\/a><\/p>\n<p>&nbsp;<br \/>\n<strong>Conclusion<\/strong><\/p>\n<p>This is soon for me to have a well based opinion about the Azure Database, but in general I found the process quite simple to start with, however I&#8217;m sure to get all the juice you need to expend quite long hours of learning.<\/p>\n<p>Hopefully this is not going to stop here and I&#8217;ll try myself to keep learning as lots of people are now moving to the cloud the possibilities are huge.<\/p>\n<p>Thanks for reading and thanks to <a href=\"https:\/\/devjef.wordpress.com\/\" target=\"_blank\" rel=\"noopener\">Jeffrey Verheul<\/a> for hosting this month&#8217;s event!<br \/>\n&nbsp;<br \/>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This week I want to walk my first steps into SQL Azure database, create a new database and run a query, totally for novices like me&nbsp; &nbsp; This post is part of&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,43],"tags":[46,57,60],"_links":{"self":[{"href":"https:\/\/www.sqldoubleg.com\/es\/wp-json\/wp\/v2\/posts\/300"}],"collection":[{"href":"https:\/\/www.sqldoubleg.com\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqldoubleg.com\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqldoubleg.com\/es\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqldoubleg.com\/es\/wp-json\/wp\/v2\/comments?post=300"}],"version-history":[{"count":0,"href":"https:\/\/www.sqldoubleg.com\/es\/wp-json\/wp\/v2\/posts\/300\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqldoubleg.com\/es\/wp-json\/wp\/v2\/media?parent=300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqldoubleg.com\/es\/wp-json\/wp\/v2\/categories?post=300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqldoubleg.com\/es\/wp-json\/wp\/v2\/tags?post=300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}