{"id":11760,"date":"2020-08-23T10:06:21","date_gmt":"2020-08-23T10:06:21","guid":{"rendered":"https:\/\/www.itwriting.com\/blog\/?p=11760"},"modified":"2020-08-23T10:07:47","modified_gmt":"2020-08-23T10:07:47","slug":"restore-a-handy-built-in-feature-in-azure-sql","status":"publish","type":"post","link":"https:\/\/www.itwriting.com\/blog\/11760-restore-a-handy-built-in-feature-in-azure-sql.html","title":{"rendered":"Point-in-time restore: a handy built-in feature in Azure SQL"},"content":{"rendered":"<p>I am working on a project that is hosted in Azure and I made a mistake, running a SQL script that was dependent on another SQL script that I had forgotten to run. It messed up the foreign keys and I would have to restore a backup \u2026 but my most recent backup was from the day before. Annoying.<\/p>\n<p>But wait. Looking the Azure portal I saw this:<\/p>\n<p><a href=\"https:\/\/www.itwriting.com\/blog\/wp-content\/uploads\/2020\/08\/image.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1028\" height=\"569\" title=\"image\" style=\"display: inline; background-image: none;\" alt=\"image\" src=\"https:\/\/www.itwriting.com\/blog\/wp-content\/uploads\/2020\/08\/image_thumb.png\" border=\"0\"><\/a><\/p>\n<p>This is a plain Azure SQL instance with no extras, but look, you can restore the database from 6 minutes ago.<\/p>\n<p>I did it; it restored to a second database. I deleted the bad one, renamed the restored one, ran my scripts in the right order, and all was well.<\/p>\n<p>I recommend you do not run scripts in the wrong order \u2026 but if you do, or make some other error, this is a handy feature of Azure SQL which I was not aware of before.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am working on a project that is hosted in Azure and I made a mistake, running a SQL script that was dependent on another SQL script that I had forgotten to run. It messed up the foreign keys and I would have to restore a backup \u2026 but my most recent backup was from &hellip; <a href=\"https:\/\/www.itwriting.com\/blog\/11760-restore-a-handy-built-in-feature-in-azure-sql.html\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Point-in-time restore: a handy built-in feature in Azure SQL<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,80,1519],"tags":[185,858],"class_list":["post-11760","post","type-post","status-publish","format-standard","hentry","category-cloud-computing","category-software-development","category-tech","tag-azure","tag-sql-server"],"_links":{"self":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/11760","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/comments?post=11760"}],"version-history":[{"count":2,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/11760\/revisions"}],"predecessor-version":[{"id":11762,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/posts\/11760\/revisions\/11762"}],"wp:attachment":[{"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/media?parent=11760"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/categories?post=11760"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itwriting.com\/blog\/wp-json\/wp\/v2\/tags?post=11760"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}