<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Automation on Andy M Mallon - AM²</title><link>https://am2.co/tag/automation/</link><description>Recent content in Automation on Andy M Mallon - AM²</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Tue, 06 Jul 2021 09:00:52 -0400</lastBuildDate><atom:link href="https://am2.co/tag/automation/index.xml" rel="self" type="application/rss+xml"/><item><title>Stop using sp_hexadecimal &amp; sp_help_revlogin</title><link>https://am2.co/2021/07/06/dba-serverlogins/</link><pubDate>Tue, 06 Jul 2021 09:00:52 -0400</pubDate><guid>https://am2.co/2021/07/06/dba-serverlogins/</guid><description>&lt;figure class="wp-caption alignright" style="max-width:400px"&gt;&lt;a href="https://vm.tiktok.com/ZMduBrPEB/" rel="noopener" target="_blank"&gt;&lt;img src="https://am2.co/wp-content/uploads/GreenCaterpillar.png" alt="" width="400" height="400" class="size-medium wp-image-8240" /&gt;&lt;/a&gt; Caterpillars transform into beautiful butterflies to realize their full self, much in the same way &lt;code&gt;CONVERT()&lt;/code&gt; changes binary into beautiful hexadecimal strings.&lt;/figure&gt;&#10;&lt;p&gt;Since &lt;a href="https://twitter.com/AMtwo/status/1384126645053771780" rel="noopener" target="_blank"&gt;I started at Stack Overflow&lt;/a&gt;, I&amp;rsquo;ve had the chance to see some of the interesting challenges with running our databases at our scale.&lt;/p&gt;</description></item><item><title>Code to purge data based on creation date</title><link>https://am2.co/2019/04/04/code-to-purge-data-on-creation-date/</link><pubDate>Thu, 04 Apr 2019 08:30:16 -0400</pubDate><guid>https://am2.co/2019/04/04/code-to-purge-data-on-creation-date/</guid><description>&lt;figure class="wp-caption alignright" style="max-width:678px"&gt;&lt;a href="https://www.youtube.com/watch?v=nHlJODYBLKs"&gt;&lt;img src="https://am2.co/wp-content/uploads/MarieKondoData-678x381.png" alt="" width="678" height="381" class="size-mh-magazine-lite-content wp-image-1743" /&gt;&lt;/a&gt; Only one thing can spark more joy than cleaning up old data. Doggos. &lt;/figure&gt;&#10;Yesterday, &lt;a href="https://am2.co/2019/04/03/purging-data-with-batched-deletes/"&gt;I talked about batching deletes&lt;/a&gt;, and the day before I talked about &lt;a href="https://am2.co/2019/04/02/the-thrill-of-purging-old-data/"&gt;how much I like to delete data&lt;/a&gt;, and why it's necessary to do it, despite being a data packrat.&#10;&lt;p&gt;Today, let&amp;rsquo;s look at just one scenario, and how I like to handle it. In my experience, this is one of the most common purge requirements (and probably the easiest), so first, let&amp;rsquo;s look at the business requirements.&lt;/p&gt;</description></item><item><title>Purging data with batched deletes</title><link>https://am2.co/2019/04/03/purging-data-with-batched-deletes/</link><pubDate>Wed, 03 Apr 2019 08:30:13 -0400</pubDate><guid>https://am2.co/2019/04/03/purging-data-with-batched-deletes/</guid><description>&lt;figure class="wp-caption alignright" style="max-width:678px"&gt;&lt;a href="https://www.youtube.com/watch?v=4VO1nYGHw0c" target="_blank" rel="noopener noreferrer"&gt;&lt;img src="https://am2.co/wp-content/uploads/pawel-czerwinski-759725-unsplash-678x381.jpg" alt="" width="678" height="381" class="size-mh-magazine-lite-content wp-image-1739" /&gt;&lt;/a&gt; This person understands that batching deletes can be helpful.&lt;/figure&gt;&#10;Yesterday, I wrote about &lt;a href="https://am2.co/2019/04/02/the-thrill-of-purging-old-data/"&gt;the importance of planning your data purges&lt;/a&gt;. Today, let's look at the simplest requirement for purging data: Keep data for X days after it's created. There are &lt;strong&gt;tons&lt;/strong&gt; of cases where this is the rule. Log data, telemetry data, even transactional data is often retained based on X days since it is created.&#10;&lt;p&gt;Given how common this scenario is, let&amp;rsquo;s talk in a bit more detail about I like to go about deleting it. Deleting data is easy, right? &lt;code&gt; DELETE t FROM dbo.Transactions AS t WHERE CreateDate &amp;lt;= DATEADD(dd,-90,GETDATE());&lt;/code&gt;&lt;/p&gt;</description></item><item><title>The thrill of purging old data</title><link>https://am2.co/2019/04/02/the-thrill-of-purging-old-data/</link><pubDate>Tue, 02 Apr 2019 09:00:54 -0400</pubDate><guid>https://am2.co/2019/04/02/the-thrill-of-purging-old-data/</guid><description>&lt;figure class="wp-caption alignright" style="max-width:678px"&gt;&lt;a href="https://www.youtube.com/watch?v=wdGARtyNaQQ" target="_blank" rel="noopener noreferrer"&gt;&lt;img src="https://am2.co/wp-content/uploads/priscilla-du-preez-101759-unsplash-678x381.jpg" alt="" width="678" height="381" class="size-mh-magazine-lite-content wp-image-1737" /&gt;&lt;/a&gt; I get a thrill from roller coasters, but for some people it just makes them purge their lunch.&lt;/figure&gt;&#10;&lt;p&gt;DBAs &amp;amp; Data professionals tend to be digital pack rats. My personal Google Drive is filled with random files that I refused to part with&amp;ndash;even though it&amp;rsquo;s of questionable value. I lament that I do not have a copy of every paper I typed in high school or college&amp;ndash;and I envy those who do. You never know when you&amp;rsquo;ll need notes from that meeting 6 years ago, or when you&amp;rsquo;ll need that funny GIF you created for an inside joke you no longer remember.&lt;/p&gt;</description></item><item><title>Building a Twitter-bot RSS Aggregator</title><link>https://am2.co/2017/01/11/building-twitter-bot-rss-aggregator/</link><pubDate>Wed, 11 Jan 2017 23:13:34 -0500</pubDate><guid>https://am2.co/2017/01/11/building-twitter-bot-rss-aggregator/</guid><description>&lt;h2 id="i-hate-rssreaders"&gt;I hate RSS readers&lt;/h2&gt;&#10;&lt;figure class="wp-caption alignright" style="max-width:512px"&gt;&lt;a href="https://www.youtube.com/watch?v=BxtKAvv1hLA"&gt;&lt;img class="wp-image-824" src="https://am2.co/wp-content/uploads/BotLove-1024x709.jpg" width="512" height="354" /&gt;&lt;/a&gt; I love my new bot&lt;/figure&gt;&#10;&lt;p&gt;For some reason, about once a year, I go hunting for a new RSS reader so I can keep track of blogs that I like to read.  It&amp;rsquo;s always the same process:&lt;/p&gt;&#10;&lt;ol&gt;&#10; &#9;&lt;li&gt;Dig through reviews to find an app that I think I will love.&lt;/li&gt;&#10; &#9;&lt;li&gt;Come up with a list of blogs that I like to read.&lt;/li&gt;&#10; &#9;&lt;li&gt;Install and configure RSS reader app.&lt;/li&gt;&#10; &#9;&lt;li&gt;Spend the night reading blog posts.&lt;/li&gt;&#10; &#9;&lt;li&gt;Use app for a week.&lt;/li&gt;&#10; &#9;&lt;li&gt;Never open RSS reader app again.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;Well, it's time to &lt;a href="https://www.youtube.com/watch?v=ZjfB4qDx3RM" target="_blank" rel="noopener noreferrer"&gt;stop the insanity&lt;/a&gt;. Its time to stop doing the same thing over and over again, hoping it will work this time. Its time to find a solution that really works.&#10;&lt;p&gt;Before I can find something that works, I need to think about&lt;/p&gt;</description></item></channel></rss>