<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>2019 on Andy M Mallon - AM²</title><link>https://am2.co/2019/</link><description>Recent content in 2019 on Andy M Mallon - AM²</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Tue, 24 Dec 2019 10:38:36 -0500</lastBuildDate><atom:link href="https://am2.co/2019/index.xml" rel="self" type="application/rss+xml"/><item><title>Blocking with OBJECT_NAME()</title><link>https://am2.co/2019/12/blocking-with-object_name/</link><pubDate>Tue, 24 Dec 2019 10:38:36 -0500</pubDate><guid>https://am2.co/2019/12/blocking-with-object_name/</guid><description>&lt;p&gt;As a DBA, you probably use the &lt;code&gt;OBJECT_NAME()&lt;/code&gt; function quite a bit. I know I do. If you aren&amp;rsquo;t familiar with it, you can read &lt;a href="https://docs.microsoft.com/en-us/sql/t-sql/functions/object-name-transact-sql?view=sql-server-ver15" rel="noopener noreferrer" target="_blank"&gt;the documentation&lt;/a&gt; if you want, but it&amp;rsquo;s a pretty straightforward function that converts object IDs into object names.&lt;/p&gt;&#10;&lt;p&gt;I ran into a scenario where one of my scripts in my stored procedures in my &lt;a href="https://github.com/amtwo/dba-database/" rel="noopener noreferrer" target="_blank"&gt;DBA Database&lt;/a&gt; was being blocked, and it turned out that using &lt;code&gt;OBJECT_NAME()&lt;/code&gt; was the culprit.&lt;/p&gt;</description></item><item><title>Do triggers start to degrade in performance (or sometimes fail) on highly transactional tables?</title><link>https://am2.co/2019/12/do-triggers-start-to-degrade-in-performance-or-sometimes-fail-on-highly-transactional-tables/</link><pubDate>Sat, 21 Dec 2019 02:41:00 -0500</pubDate><guid>https://am2.co/2019/12/do-triggers-start-to-degrade-in-performance-or-sometimes-fail-on-highly-transactional-tables/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/256083/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;How many transactions per second can SQL Server table triggers handle? If I had a highly transactional table that was inserted into 1,000 times a second, are insert triggers on that table reliable to fire every single time?&lt;/p&gt;&#10;&lt;p class="qa-attribution qa-attribution-asked"&gt;&lt;span class="qa-attribution-label"&gt;Asked&lt;/span&gt;&lt;span class="qa-attribution-date"&gt;&lt;a href="https://dba.stackexchange.com/q/256083/52344" rel="noopener" target="_blank"&gt;2019-12-21&lt;/a&gt;&lt;/span&gt;&lt;span class="qa-attribution-by"&gt;by&lt;/span&gt;&lt;span class="qa-attribution-user"&gt;&lt;a href="https://dba.stackexchange.com/users/150011" rel="noopener" target="_blank"&gt;J.D.&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;</description></item><item><title>What the heck is the dbcreator role?</title><link>https://am2.co/2019/12/what-the-heck-is-the-dbcreator-role/</link><pubDate>Thu, 19 Dec 2019 07:30:14 -0500</pubDate><guid>https://am2.co/2019/12/what-the-heck-is-the-dbcreator-role/</guid><description>&lt;p&gt;&lt;a href="https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/server-level-roles?view=sql-server-ver15#fixed-server-level-roles" rel="noopener noreferrer" target="_blank"&gt;Microsoft docs&lt;/a&gt; defines the dbcreator role as:&lt;/p&gt;&#10;&lt;blockquote&gt;Members of the dbcreator fixed server role can create, alter, drop, and restore any database.&lt;/blockquote&gt;&#10;&lt;p&gt;But what specific permissions are actually included in that role? If we scroll down in the docs just a little, we&amp;rsquo;ll see a diagram that tells us that &lt;code&gt;dbcreator&lt;/code&gt; grants two permissions:&lt;/p&gt;</description></item><item><title>Testing as another user...without their password</title><link>https://am2.co/2019/12/testing-as-another-user-without-their-password/</link><pubDate>Wed, 18 Dec 2019 11:50:35 -0500</pubDate><guid>https://am2.co/2019/12/testing-as-another-user-without-their-password/</guid><description>&lt;p&gt;As a DBA or SQL Developer, you&amp;rsquo;ve surely encountered a scenario where something worked for you, but not for another user. DBAs usually are part of the sysadmin role, or have a collection of powerful permissions. If I run code as myself, I will &lt;em&gt;never&lt;/em&gt; have permissions problems because my account is sysadmin. If I want to ensure permissions are correct, I need to run the code as the less-privileged account.&lt;/p&gt;</description></item><item><title>I hate sp_estimate_data_compression_savings</title><link>https://am2.co/2019/12/i-hate-sp_estimate_data_compression_savings/</link><pubDate>Tue, 17 Dec 2019 10:55:26 -0500</pubDate><guid>https://am2.co/2019/12/i-hate-sp_estimate_data_compression_savings/</guid><description>&lt;p&gt;If you&amp;rsquo;re working with compressed indexes, SQL Server provides &lt;a href="https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-estimate-data-compression-savings-transact-sql?view=sql-server-ver15" rel="noopener noreferrer" target="_blank"&gt;a system stored procedure&lt;/a&gt; to help test the space savings of implementing data compression: &lt;code&gt;sp_estimate_data_compression_savings&lt;/code&gt;. Starting in SQL Server 2019, &lt;a href="http://www.nikoport.com/2018/09/27/columnstore-indexes-part-125-estimate-columnstore-compression-as-a-system-stored-proc/" rel="noopener noreferrer" target="_blank"&gt;it can even be used to estimate savings with columnstore&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;I really don&amp;rsquo;t like &lt;code&gt;sp_estimate_data_compression_savings&lt;/code&gt;. In fact, I kind of hate it. It&amp;rsquo;s not always very accurate&amp;ndash;and even when it is accurate, the results can be misleading. Before I get ranty about why I don&amp;rsquo;t like it, let&amp;rsquo;s look at it in action.&lt;/p&gt;</description></item><item><title>INSERT EXEC statement cannot be nested</title><link>https://am2.co/2019/12/insert-exec-statement-cannot-be-nested/</link><pubDate>Fri, 13 Dec 2019 23:16:21 -0500</pubDate><guid>https://am2.co/2019/12/insert-exec-statement-cannot-be-nested/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/255615/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;I have a stored proc spGetSites that returns three columns for SiteName, SiteId and UnitCount. The stored proc runs perfectly fine.&#10;I'm trying to store the results of the stored proc to a temp table @Site to use for my report with below syntax. This time I got an error message: "INSERT EXEC statement cannot be nested"&lt;/p&gt;</description></item><item><title>Changing a column from `int` to `bigint`, without downtime</title><link>https://am2.co/2019/12/changing-a-column-from-int-to-bigint-without-downtime/</link><pubDate>Wed, 11 Dec 2019 08:00:41 -0500</pubDate><guid>https://am2.co/2019/12/changing-a-column-from-int-to-bigint-without-downtime/</guid><description>&lt;p&gt;Changing a column from &lt;code&gt;int&lt;/code&gt; to &lt;code&gt;bigint&lt;/code&gt; has gotten a lot easier since I started working on SQL Server back at the turn of the century. SQL Server 2016 introduced the ability to do &lt;code&gt;ALTER TABLE...ALTER COLUMN&lt;/code&gt; as an online operation using the &lt;code&gt;WITH (ONLINE=ON)&lt;/code&gt; syntax in Enterprise Edition. This wonderful syntax now allows you to alter a column from &lt;code&gt;int&lt;/code&gt; to &lt;code&gt;bigint&lt;/code&gt; without causing major blocking. The &lt;code&gt;int&lt;/code&gt; to &lt;code&gt;bigint&lt;/code&gt; conversion is one of the most popular data type changes I see&amp;ndash;A developer inevitably creates the table thinking they will never have more than 2 billion rows&amp;hellip; then some years or months later 2 billion becomes a reality.&lt;/p&gt;</description></item><item><title>How to see restore history of a deleted database?</title><link>https://am2.co/2019/11/how-to-see-restore-history-of-a-deleted-database/</link><pubDate>Sat, 23 Nov 2019 21:33:37 -0500</pubDate><guid>https://am2.co/2019/11/how-to-see-restore-history-of-a-deleted-database/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/253996/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;For example, I had a database and I want to see which physical backup file was used to restore into it. The problem is that the database was deleted. How can I see the record?&lt;/p&gt;&#10;&lt;p class="qa-attribution qa-attribution-asked"&gt;&lt;span class="qa-attribution-label"&gt;Asked&lt;/span&gt;&lt;span class="qa-attribution-date"&gt;&lt;a href="https://dba.stackexchange.com/q/253996/52344" rel="noopener" target="_blank"&gt;2019-11-23&lt;/a&gt;&lt;/span&gt;&lt;span class="qa-attribution-by"&gt;by&lt;/span&gt;&lt;span class="qa-attribution-user"&gt;&lt;a href="https://dba.stackexchange.com/users/174155" rel="noopener" target="_blank"&gt;sql-noob&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&#10;&lt;hr&gt;&#10;&lt;h2 id="answer"&gt;Answer&lt;/h2&gt;&#10;&lt;p&gt;Depending on how the database was dropped, your luck will vary considerably.&lt;/p&gt;</description></item><item><title>Can't use GitKraken on private repositories</title><link>https://am2.co/2019/11/stack-overflow-template/</link><pubDate>Fri, 08 Nov 2019 12:03:21 -0500</pubDate><guid>https://am2.co/2019/11/stack-overflow-template/</guid><description>&lt;p&gt;&lt;a href="https://superuser.com/q/1500265/630094"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;I&amp;rsquo;ve been using GitKraken for a while now, since about May of this year and it never gave me any trouble, except for now. I was working on a school project and GitKraken now prevents me from opening its repository, because, apparently, this is now a Pro feature, although, I have a Github Pro account, which I use to login in Gitkraken, so, I should have access to Pro features, but I don&amp;rsquo;t.&lt;/p&gt;</description></item><item><title>Cannot connect to my SQL Management studio after moving a tempDB</title><link>https://am2.co/2019/11/cannot-connect-to-my-sql-management-studio-after-moving-a-tempdb/</link><pubDate>Fri, 01 Nov 2019 22:27:39 -0400</pubDate><guid>https://am2.co/2019/11/cannot-connect-to-my-sql-management-studio-after-moving-a-tempdb/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/252407/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;In quite a bad position here. This afternoon on my tempDB I ran the query:&#10; &lt;code&gt;sp_helpfile&lt;/code&gt; to locate where my MDF and LOG file were. My MDF was on my C: drive and my LOG file was on a D: drive so I've run the following query to move this Log file from the D: drive back to C: drive. (This may not have been exactly the query I run as I don't remember what it was precisely!)&lt;/p&gt;</description></item><item><title>Is it possible to re-use a query plan from the plan cache from one database in another database?</title><link>https://am2.co/2019/11/is-it-possible-to-re-use-a-query-plan-from-the-plan-cache-from-one-database-in-another-database/</link><pubDate>Fri, 01 Nov 2019 18:08:43 -0400</pubDate><guid>https://am2.co/2019/11/is-it-possible-to-re-use-a-query-plan-from-the-plan-cache-from-one-database-in-another-database/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/252394/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;For example, if I hit the sys dynamic views to select a specific query plan, am I able to insert that query plan into another database's plan cache, that runs the same exact query? (I know the query is hashed and compared to determine when to generate a new plan, so in my example I would ensure the query truly is exactly the same character by character.)&lt;/p&gt;</description></item><item><title>SQL Server Page File location - where to put it?</title><link>https://am2.co/2019/10/sql-server-page-file/</link><pubDate>Thu, 31 Oct 2019 08:32:27 -0400</pubDate><guid>https://am2.co/2019/10/sql-server-page-file/</guid><description>&lt;p&gt;&lt;a href="https://serverfault.com/q/990091/299354"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;There are a lot of recommendations about the sizing of the windows page file. What I am looking for is the correct placement.&lt;/p&gt;&#10;&lt;p&gt;We are running a MS SQL server on a Server 2012R2 VM with multiple seperate virtual disks:&lt;/p&gt;</description></item><item><title>Why can't I restore encrypted backup through front end?</title><link>https://am2.co/2019/10/restore-encrypted-backup/</link><pubDate>Wed, 30 Oct 2019 12:41:23 -0400</pubDate><guid>https://am2.co/2019/10/restore-encrypted-backup/</guid><description>&lt;p&gt;&lt;a href="https://serverfault.com/q/989930/299354"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;I&amp;rsquo;m just starting to experiment with encrypting backups, I think I now understand it and have got the process working, but something strange is happening with restoring.&lt;/p&gt;&#10;&lt;p&gt;On &lt;strong&gt;Server A&lt;/strong&gt; (SQL 2014 Standard) I have created a new master key and certificate and successfully produced an encrypted bak file and have also exported the key and cert files.&lt;/p&gt;</description></item><item><title>How to create date buckets in T-SQL</title><link>https://am2.co/2019/10/how-to-create-date-buckets-in-t-sql/</link><pubDate>Mon, 28 Oct 2019 10:00:47 -0400</pubDate><guid>https://am2.co/2019/10/how-to-create-date-buckets-in-t-sql/</guid><description>&lt;p&gt;I was fiddling around with some data, looking at making a quick aging report. I probably should have reached for &lt;a href="https://powerbi.microsoft.com/en-us/desktop/" rel="noopener noreferrer" target="_blank"&gt;Power BI Desktop&lt;/a&gt;, but sometimes I can be stubborn, and I wanted to get my T-SQL to work&amp;ndash;if nothing else to figure out how to make it work.&lt;/p&gt;</description></item><item><title>Does a Window 10 license allow using it as a Web server?</title><link>https://am2.co/2019/10/does-a-window-10-license-allow-using-it-as-a-web-server/</link><pubDate>Sun, 27 Oct 2019 17:50:53 -0400</pubDate><guid>https://am2.co/2019/10/does-a-window-10-license-allow-using-it-as-a-web-server/</guid><description>&lt;p&gt;&lt;a href="https://superuser.com/q/1496496/630094"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;I am looking to set up a Web server for a project.&lt;/p&gt;&#10;&lt;p&gt;The server would be using a custom application developed in VB.Net using SQL Server for data storage. The application uses 3rd party components (DLL&amp;rsquo;s) that are available for Windows only.&lt;/p&gt;</description></item><item><title>How to implement a unique key for a long VARCHAR column in MySQL</title><link>https://am2.co/2019/10/how-to-implement-a-unique-key-for-a-long-varchar-column-in-mysql/</link><pubDate>Sun, 27 Oct 2019 04:43:04 -0400</pubDate><guid>https://am2.co/2019/10/how-to-implement-a-unique-key-for-a-long-varchar-column-in-mysql/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/252009/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;I need to let MySQL to check the uniqueness of a VARCHAR column which is 5000 max length and is not the primary key. I can use an index of length 500 on the column to speed up query, but how to create an unique key that works? &lt;/p&gt;</description></item><item><title>convert sql-excel date to recognizable format</title><link>https://am2.co/2019/10/convert-sql-excel-date-to-recognizable-format/</link><pubDate>Sat, 26 Oct 2019 10:27:37 -0400</pubDate><guid>https://am2.co/2019/10/convert-sql-excel-date-to-recognizable-format/</guid><description>&lt;p&gt;&lt;a href="https://superuser.com/q/1496171/630094"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;I have a large csv file(1.1G) exported from SQL Server. I would like to do data wrangling in python, but I had a few problems doing this. The original csv file dates look like this &lt;code&gt;00:07.5, 00:08.3, 00:48.7&lt;/code&gt;, I can manually convert them to &lt;code&gt;1/12/2015 12:00:07 am, 1/12/2015 12:00:08 am, 1/12/2015 12:00:49 am&lt;/code&gt; in excel by formatting the entire column to make it in &lt;code&gt;d/m/yy h:mm:ss&lt;/code&gt;, but sometimes output is weird like &lt;code&gt;100:00:00&lt;/code&gt;, or it just kept the time but not the dates, when I finally successfully did this, I noticed that the file size had shrank to &lt;code&gt;36.6 MB&lt;/code&gt; from &lt;code&gt;1.1G&lt;/code&gt;. I received the excel notification:&lt;/p&gt;</description></item><item><title>How does a database RESTORE affect plan cache?</title><link>https://am2.co/2019/10/how-does-a-database-restore-affect-plan-cache/</link><pubDate>Thu, 24 Oct 2019 10:12:48 -0400</pubDate><guid>https://am2.co/2019/10/how-does-a-database-restore-affect-plan-cache/</guid><description>&lt;p&gt;If you restore a database, what does that do to the plan cache? Well, let&amp;rsquo;s start by looking at &lt;a href="https://web.archive.org/web/20190906084812/https://docs.microsoft.com/en-us/sql/t-sql/statements/restore-statements-transact-sql?view=sql-server-2017#general-remarks" rel="noopener noreferrer" target="_blank"&gt;the documentation for RESTORE&lt;/a&gt;. (Emphasis mine)&lt;/p&gt;&#10;&lt;blockquote&gt;&lt;strong&gt;Restoring a database clears the plan cache for the instance of SQL Server.&lt;/strong&gt; Clearing the plan cache causes a recompilation of all subsequent execution plans and can cause a sudden, temporary decrease in query performance. For each cleared cachestore in the plan cache, the SQL Server error log contains the following informational message: " SQL Server has encountered %d occurrence(s) of cachestore flush for the '%s' cachestore (part of plan cache) due to some database maintenance or reconfigure operations". This message is logged every five minutes as long as the cache is flushed within that time interval.&lt;/blockquote&gt;&#10;&lt;figure class="wp-caption alignright" style="max-width:512px"&gt;&lt;a href="https://www.youtube.com/watch?v=RuW1f6FI18g" rel="noopener noreferrer" target="_blank"&gt;&lt;img src="https://am2.co/wp-content/uploads/joshua-naidoo-J954SeqDitQ-unsplash.jpg" alt="Restored classic Mini Cooper parked on a street." width="512" height="342" class="size-large wp-image-2248" /&gt;&lt;/a&gt; This beautifully restored Mini would clear some cash from my bank account.&lt;/figure&gt;&#10;&lt;p&gt;Yikes. That first sentence sounds like it is going to clear the cache for &lt;strong&gt;the entire instance&lt;/strong&gt;. That seems excessive. If I restore a new database (ie, I am creating a new database from backup), that shouldn&amp;rsquo;t affect the plan cache at all. And if I restore over top an existing database, I would only expect the cache for that one database to be affected. I can&amp;rsquo;t think of a scenario where I would want to &amp;ldquo;clear the plan cache for the instance&amp;rdquo; when doing a restore.&lt;/p&gt;</description></item><item><title>What the heck is Accelerated Database Recovery?</title><link>https://am2.co/2019/10/what-the-heck-is-accelerated-database-recovery/</link><pubDate>Mon, 21 Oct 2019 10:00:15 -0400</pubDate><guid>https://am2.co/2019/10/what-the-heck-is-accelerated-database-recovery/</guid><description>&lt;p&gt;Last week, I wrote about the &lt;a href="https://am2.co/2019/10/15/what-the-heck-is-the-sql-server-version-store/" rel="noopener noreferrer" target="_blank"&gt;SQL Server Version Store&lt;/a&gt;. The week before, I looked at &lt;a href="https://am2.co/2019/10/12/recovery-of-database-is-0-complete-approximately-1000000-seconds-remain/" rel="noopener noreferrer" target="_blank"&gt;crash recovery&lt;/a&gt;. Let&amp;rsquo;s look next at a new feature in SQL Server 2019, where these two features intersect: Accelerated Database Recovery.&lt;/p&gt;&#10;&lt;h2 id="what-is-it"&gt;What is it?&lt;/h2&gt;&#10;&lt;p&gt;Accelerated Database Recovery(ADR) is a new feature intended to speed up the recovery process, which could be very slow, particularly when there are long-running, large transactions. ADR is not just for recovery after a crash, but also helps in other scenarios where the transaction log needs to be recovered&amp;ndash;including Availability Group secondary redo and Failover Cluster Instance failovers.&lt;/p&gt;</description></item><item><title>SQL log file 2TB is not enough, now what?</title><link>https://am2.co/2019/10/sql-log-file-2tb-is-not-enough-now-what/</link><pubDate>Fri, 18 Oct 2019 12:04:01 -0400</pubDate><guid>https://am2.co/2019/10/sql-log-file-2tb-is-not-enough-now-what/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/251455/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;This is a hypothetical question, that flows from the answer &lt;a href="https://dba.stackexchange.com/a/251451/21924"&gt;by sepupic&lt;/a&gt; where they explain that 2TB is the physical limit for SQL log file.&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;if you need it more than 2Tb you add the second log file.&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;I have long held the belief that multiple log files are bad as outlined in the post &lt;a href="https://dba.stackexchange.com/q/62344/21924"&gt;Multiple Transaction Log files and performance impact&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Copying SQL Server settings to new server</title><link>https://am2.co/2019/10/copying-sql-server-settings-to-new-server/</link><pubDate>Thu, 17 Oct 2019 13:26:20 -0400</pubDate><guid>https://am2.co/2019/10/copying-sql-server-settings-to-new-server/</guid><description>&lt;p&gt;&lt;a href="https://serverfault.com/q/988391/299354"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;We are a small business using a single SQL Server 2014 instance as our main data platform.&lt;/p&gt;&#10;&lt;p&gt;We now need to set up a second instance (2017) to hold additional data - this is to be standalone, ie not replicated or actively linked to the main server.&lt;/p&gt;</description></item><item><title>What the heck is the SQL Server Version Store?</title><link>https://am2.co/2019/10/what-the-heck-is-the-sql-server-version-store/</link><pubDate>Tue, 15 Oct 2019 10:30:13 -0400</pubDate><guid>https://am2.co/2019/10/what-the-heck-is-the-sql-server-version-store/</guid><description>&lt;p&gt;Maybe you&amp;rsquo;ve read about the &lt;a href="https://www.sql.kiwi/2014/05/read-committed-snapshot-isolation/" rel="noopener noreferrer" target="_blank"&gt;Read Committed Snapshot&lt;/a&gt; (RCSI) or &lt;a href="https://www.sql.kiwi/2014/06/the-snapshot-isolation-level/" rel="noopener noreferrer" target="_blank"&gt;Snapshot&lt;/a&gt; Isolation levels. Or maybe you were trying to figure out &lt;a href="https://littlekendra.com/2016/02/18/how-to-choose-rcsi-snapshot-isolation-levels/" rel="noopener noreferrer" target="_blank"&gt;the difference between the two snapshot isolation levels&lt;/a&gt;. Perhaps you&amp;rsquo;ve looked into &lt;a href="https://docs.microsoft.com/en-us/sql/database-engine/availability-groups/windows/active-secondaries-readable-secondary-replicas-always-on-availability-groups" rel="noopener noreferrer" target="_blank"&gt;read-only secondary replicas in your Availability Group&lt;/a&gt;, or even &lt;a href="https://dba.stackexchange.com/questions/237671/long-running-query-on-read-only-replica-that-takes-moments-on-the-primary" rel="noopener noreferrer" target="_blank"&gt;had some problems with AG secondaries&lt;/a&gt;. Along the way, people and articles have mentioned this &amp;ldquo;version store&amp;rdquo; thing.&lt;/p&gt;</description></item><item><title>Recovery of database is 0% complete (approximately 1000000 seconds remain)</title><link>https://am2.co/2019/10/recovery-of-database-is-0-complete-approximately-1000000-seconds-remain/</link><pubDate>Sat, 12 Oct 2019 10:52:29 -0400</pubDate><guid>https://am2.co/2019/10/recovery-of-database-is-0-complete-approximately-1000000-seconds-remain/</guid><description>&lt;p&gt;If you&amp;rsquo;ve ever had a server reboot unexpectedly, you&amp;rsquo;ve probably seen SQL Server start up, with some databases &amp;ldquo;stuck&amp;rdquo; in recovery status, then eventually they come online. Or maybe you thought &amp;ldquo;this session is stuck in rollback. It&amp;rsquo;ll be quicker if I just reboot the server than wait for it to roll back!&amp;rdquo; &amp;hellip;only to find out that after restart, the database went into recovery, and you were left waiting impatiently for the database to come online.&lt;/p&gt;</description></item><item><title>SQL database stuck in recovery</title><link>https://am2.co/2019/10/sql-database-stuck-in-recovery/</link><pubDate>Sat, 12 Oct 2019 00:11:33 -0400</pubDate><guid>https://am2.co/2019/10/sql-database-stuck-in-recovery/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/250903/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;I have SQL server 2017. I have one 3 TB size database there. Somehow due to long running transaction the database got stuck 'IN Recovery' mode after SQL server Restarted. When I checked the sql error logs it says 2 189 255 seconds remaining (Phase 2 of 3) completed which is almost 25 days. My goal is to bring the database online even if I lose some data.&lt;/p&gt;</description></item><item><title>How To Fix High DTU Usage on Specific Query</title><link>https://am2.co/2019/10/how-to-fix-high-dtu-usage-on-specific-query/</link><pubDate>Thu, 10 Oct 2019 18:03:01 -0400</pubDate><guid>https://am2.co/2019/10/how-to-fix-high-dtu-usage-on-specific-query/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/250789/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;I have a query that runs every few seconds on a Microsoft SQL Azure Database. It is from a web job that checks if there are actions that need to be done based on rows in a specific table (its a queueing table). Based on the image attached, does anyone have any suggestion of how i could reduce the DTU usage for the query in question, it is causing the database to reach 100% CPU. &lt;/p&gt;</description></item><item><title>Updates to the Data Blogger Resource Kit</title><link>https://am2.co/2019/10/updates-to-the-data-blogger-resource-kit/</link><pubDate>Wed, 09 Oct 2019 10:31:46 -0400</pubDate><guid>https://am2.co/2019/10/updates-to-the-data-blogger-resource-kit/</guid><description>&lt;p&gt;Earlier this year, I published &lt;a href="https://am2.co/2019/05/27/data-blogger-resource-kit/"&gt;the first crack&lt;/a&gt; at a &lt;a href="http://datablogger.info" rel="noopener noreferrer" target="_blank"&gt;Data Blogger Resource Kit&lt;/a&gt;. When I initially created the kit, I wasn&amp;rsquo;t quite sure exactly what direction I would go with it. In the months since, I&amp;rsquo;ve started to get a better idea of where I want to go, and I&amp;rsquo;ve collected some additional resources that might be helpful for folks who are bloggers or who are interested in becoming bloggers.&lt;/p&gt;</description></item><item><title>Linked server from SQL server on AWS RDS to On premises MS SQL server database</title><link>https://am2.co/2019/10/linked-server-from-sql-server-on-aws-rds-to-on-premises-ms-sql-server-database/</link><pubDate>Mon, 07 Oct 2019 07:17:18 -0400</pubDate><guid>https://am2.co/2019/10/linked-server-from-sql-server-on-aws-rds-to-on-premises-ms-sql-server-database/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/250409/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;We are planing to migrate an on-premises SQL Server db to AWS RDS SQL Server. My only concern is how can I create a linked server from AWS RDS SQL Server to on-premises SQL Server db? Is it possible? I am checking it because there are many views using linked server to other on-premises dbs.&lt;/p&gt;</description></item><item><title>Supporting the LGBTQ #SQLFamily</title><link>https://am2.co/2019/09/supporting-the-lgbtq-sqlfamily/</link><pubDate>Mon, 23 Sep 2019 22:54:39 -0400</pubDate><guid>https://am2.co/2019/09/supporting-the-lgbtq-sqlfamily/</guid><description>&lt;p&gt;I won&amp;rsquo;t be at PASS Summit this year, so unlike &lt;a href="https://am2.co/2018/10/08/lgbtq-meetup-at-pass-summit-2018/"&gt;last year&lt;/a&gt;, I won&amp;rsquo;t be organizing an LGBTQ Meetup at PASS Summit. I&amp;rsquo;m hoping that even without the meetup, all my LGBTQ #SQLFamily friends will still get together for some fun and networking.&lt;/p&gt;&#10;&lt;p&gt;Keep scrolling down for a full list of all the LGBTQ happenings at Summit in Seattle. But first, lets talk about &lt;a href="https://give.thetrevorproject.org/fundraiser/2362330" rel="noopener noreferrer" target="_blank"&gt;my fundraising page&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Monetary value in integer over decimal datatype</title><link>https://am2.co/2019/09/monetary-value-in-integer-over-decimal-datatype/</link><pubDate>Sun, 15 Sep 2019 09:08:25 -0400</pubDate><guid>https://am2.co/2019/09/monetary-value-in-integer-over-decimal-datatype/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/248815/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;I have came across several articles that mentioned that advise on not to store monetary value as decimal, but use integer instead.&#10;The reasoning that it does not store actual value and will cause some rounding difference/errors.&#10;But i have yet ever participate in any project that use an integer datatype for monetary value in database storage.&lt;/p&gt;</description></item><item><title>When to put a non-clustered index on your clustering key</title><link>https://am2.co/2019/09/when-to-put-a-non-clustered-index-on-your-clustering-key/</link><pubDate>Tue, 03 Sep 2019 21:17:14 -0400</pubDate><guid>https://am2.co/2019/09/when-to-put-a-non-clustered-index-on-your-clustering-key/</guid><description>&lt;h2 id="first-off-lets-remember-the-difference-between-clustered--nonclustered-indexes"&gt;First off, let&amp;rsquo;s remember the difference between clustered &amp;amp; nonclustered indexes&lt;/h2&gt;&#10;&lt;p&gt;The &lt;strong&gt;clustered index&lt;/strong&gt; is organized by the key columns. It also includes every other column as part of the row structure (ie, it has the entire row).&lt;/p&gt;&#10;&lt;p&gt;The &lt;strong&gt;nonclustered index&lt;/strong&gt; is also organized by the key columns. It implicitly includes the clustering key columns (if the table is clustered), or a pointer to the row (if the table&amp;rsquo;s a heap). If any &lt;code&gt;INCLUDE&lt;/code&gt; columns are explicitly specified, they will also be included in the index structure (but these included columns don&amp;rsquo;t affect order).&lt;/p&gt;</description></item><item><title>Why does ALTER let me DROP?</title><link>https://am2.co/2019/08/why-does-alter-let-me-drop/</link><pubDate>Wed, 28 Aug 2019 09:00:19 -0400</pubDate><guid>https://am2.co/2019/08/why-does-alter-let-me-drop/</guid><description>&lt;p&gt;I was recently chatting with a coworker, discussing why there is no discrete &lt;code&gt;DROP&lt;/code&gt; permission for tables, procedures, etc. The conversation actually came from a &lt;a href="https://sqlcommunity.slack.com/messages/C1MS1RA4B" rel="noopener noreferrer" target="_blank"&gt;#SQLHelp&lt;/a&gt; question on &lt;a href="http://sqlslack.com" rel="noopener noreferrer" target="_blank"&gt;SQL Slack&lt;/a&gt; that was asked along the lines of &amp;ldquo;What if I want to let a user &lt;code&gt;CREATE&lt;/code&gt; and &lt;code&gt;ALTER&lt;/code&gt; objects, but not &lt;code&gt;DROP&lt;/code&gt; them?&amp;rdquo;&lt;/p&gt;</description></item><item><title>Data Blogger Resource Kit</title><link>https://am2.co/2019/05/data-blogger-resource-kit/</link><pubDate>Mon, 27 May 2019 09:00:04 -0400</pubDate><guid>https://am2.co/2019/05/data-blogger-resource-kit/</guid><description>&lt;p&gt;When I started out blogging 5 years ago, there was a lot that I didn&amp;rsquo;t know. I figured things out as I went. The &lt;a href="https://am2.co/2019/05/17/year-2-2015-2016/"&gt;FreeCon&lt;/a&gt; helped give me a giant push in the right direction. But there are some things that nobody ever tells you. While sitting in a coffee shop I decided that I wanted to have a place to drop helpful tidbits that might be useful for other bloggers, new &amp;amp; old.&lt;/p&gt;</description></item><item><title>Year 5: May 2018 - May 2019</title><link>https://am2.co/2019/05/year-5-2018-2019/</link><pubDate>Wed, 22 May 2019 09:00:38 -0400</pubDate><guid>https://am2.co/2019/05/year-5-2018-2019/</guid><description>&lt;p&gt;In my last few posts, I&amp;rsquo;ve walked down memory lane, and talked about a ton of great successes I&amp;rsquo;ve had in my five years as blogger &amp;amp; speaker. It&amp;rsquo;s been fun to reminisce about how far I&amp;rsquo;ve come and brag about some success. Today&amp;rsquo;s post has a bit of a different theme.&lt;/p&gt;</description></item><item><title>Year 4: May 2017 - May 2018</title><link>https://am2.co/2019/05/year-4-2017-2018/</link><pubDate>Tue, 21 May 2019 08:30:21 -0400</pubDate><guid>https://am2.co/2019/05/year-4-2017-2018/</guid><description>&lt;p&gt;In &lt;a href="https://am2.co/2019/05/20/year-3-2016-2017/" rel="noopener noreferrer" target="_blank"&gt;Year Three&lt;/a&gt;, I had a pretty big year. I kind of felt like I had peaked. I had received the &lt;a href="https://blogs.sentryone.com/aaronbertrand/2016-community-influencer/" rel="noopener noreferrer" target="_blank"&gt;Community Influencer of the Year Award&lt;/a&gt; and &lt;a href="2017/03/congratulations-2017-microsoft-mvp/" rel="noopener noreferrer" target="_blank"&gt;Microsoft MVP Award&lt;/a&gt;. Where do you go from there? Mostly, I just wanted to keep up what I was doing, and keep sharing what I was doing.&lt;/p&gt;</description></item><item><title>Year 3: May 2016 - May 2017</title><link>https://am2.co/2019/05/year-3-2016-2017/</link><pubDate>Mon, 20 May 2019 09:00:52 -0400</pubDate><guid>https://am2.co/2019/05/year-3-2016-2017/</guid><description>&lt;p&gt;&lt;a href="https://am2.co/2019/05/17/year-2-2015-2016/" rel="noopener noreferrer" target="_blank"&gt;Year Two&lt;/a&gt; was a busy year, and I was taking blogging seriously. In Year Three, my goal was to keep focused on what I learned in the FreeCon the year before, and keep moving forward with both blogging and speaking at conferences and user groups. I was putting a bit more effort into my speaking (and thus easing off on the blogging some). I was still trying to get into a regular cadence of blogging, and most Sunday mornings, I was at a coffee shop in front of my laptop trying to focus. Dedicating time to blog doesn&amp;rsquo;t guarantee completed posts&amp;ndash;but it helped. I published 27 blog posts during this 12 months&amp;ndash;fewer than the prior year, but still averaging one post every other week. I have a full-time day job that doesn&amp;rsquo;t pay for me to blog&amp;ndash;so those posts (and all my in-person speaking presentations) were written nights &amp;amp; weekends in my &amp;ldquo;free&amp;rdquo; time.&lt;/p&gt;</description></item><item><title>Year 2: May 2015 - May 2016</title><link>https://am2.co/2019/05/year-2-2015-2016/</link><pubDate>Fri, 17 May 2019 08:00:41 -0400</pubDate><guid>https://am2.co/2019/05/year-2-2015-2016/</guid><description>&lt;p&gt;&lt;a href="https://am2.co/2019/05/16/year-1-2014-2015/" rel="noopener noreferrer" target="_blank"&gt;In Year 1&lt;/a&gt;, I only wrote 6 blog posts. In Year 2, I made a conscious decision to take things seriously, and kicked things into high gear. During this 12-month period, I wrote 36 blog posts&amp;ndash;my best 12-months as far as pace &amp;amp; productivity in these five years.&lt;/p&gt;</description></item><item><title>Year 1: May 2014 - May 2015</title><link>https://am2.co/2019/05/year-1-2014-2015/</link><pubDate>Thu, 16 May 2019 09:00:29 -0400</pubDate><guid>https://am2.co/2019/05/year-1-2014-2015/</guid><description>&lt;p&gt;I wrote a little bit about starting my blog in &lt;a href="https://am2.co/2019/05/15/blogging-on-a-whim/" target="_blank" rel="noopener noreferrer"&gt;my last post&lt;/a&gt;. But let&amp;rsquo;s take a closer look at that first 12 months.&lt;/p&gt;&#10;&lt;p&gt;I&amp;rsquo;ve lost my blog stats for that first year, so I can&amp;rsquo;t say exactly how many visitors I had. I can say that the number of views was so low that it didn&amp;rsquo;t matter. If I were going to offer a generous estimate, I would guess I got whopping 100 page views in year one (mostly from me).&lt;/p&gt;</description></item><item><title>Blogging on a whim</title><link>https://am2.co/2019/05/blogging-on-a-whim/</link><pubDate>Wed, 15 May 2019 09:00:06 -0400</pubDate><guid>https://am2.co/2019/05/blogging-on-a-whim/</guid><description>&lt;p&gt;On May 16, 2014, I bought a domain on a whim. I&amp;rsquo;d been sitting in the NOCC (Network Operations &amp;amp; Control Center) at my employer, helping with maintenance. I was waiting on another team to perform their task, and &lt;a href="https://en.wiktionary.org/wiki/champ_at_the_bit" target="_blank" rel="noopener noreferrer"&gt;champing at the bit&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;My boss was in the room with me, and teasing me about my impatience. He very jokingly said, &amp;ldquo;It&amp;rsquo;s like you&amp;rsquo;re ImpatientDBA.com!&amp;rdquo; Within seconds, I was checking to see if the domain was available. Within minutes, I owned ImpatientDBA.com. I had no idea what I was going to do with that domain, but it was mine.&lt;/p&gt;</description></item><item><title>#LGBT channel on SQL Slack!</title><link>https://am2.co/2019/05/lgbt-sql-slack/</link><pubDate>Tue, 14 May 2019 09:00:34 -0400</pubDate><guid>https://am2.co/2019/05/lgbt-sql-slack/</guid><description>&lt;p&gt;Last night while having dinner with my husband, I had a thought and messaged Chrissy LeMaire (&lt;a href="https://blog.netnerds.net" rel="noopener noreferrer" target="_blank"&gt;blog&lt;/a&gt;) on the &lt;a href="http://sqlslack.com" rel="noopener noreferrer" target="_blank"&gt;SQL Server Community Slack&lt;/a&gt;.&lt;/p&gt;&#10;&lt;blockquote&gt;Thoughts on an LGBTQ channel here? I doubt it would be very active... But I'd love to have a spot for the data queers to find each other. Especially if anyone ever has a gay in the workplace question or whatever.&lt;/blockquote&gt;&#10;&lt;p&gt;It was super duper late at night in Chrissy&amp;rsquo;s timezone, but I sent the message so I wouldn&amp;rsquo;t forget. Chrissy is one of the admins on the SQL Slack workspace, and fellow member of Team Gay, so I was really looking for validation that it was a good idea, and help getting it created.&lt;/p&gt;</description></item><item><title>What the heck is downtime, anyway?</title><link>https://am2.co/2019/04/what-the-heck-is-downtime-anyway/</link><pubDate>Mon, 15 Apr 2019 09:00:17 -0400</pubDate><guid>https://am2.co/2019/04/what-the-heck-is-downtime-anyway/</guid><description>&lt;p&gt;There&amp;rsquo;s a lot of discussion about preventing downtime. As a DBA and IT professional, it&amp;rsquo;s my sworn duty to prevent downtime. I usually describe my job as DBA something along the lines of, &amp;ldquo;to make sure data is always available to the people and applications that need it, and never available to the people and applications that shouldn&amp;rsquo;t have it.&amp;rdquo; Preventing downtime is certainly important for that first part&amp;ndash;but how the heck do you define downtime?&lt;/p&gt;</description></item><item><title>Configuring the distribution database in an Availability Group</title><link>https://am2.co/2019/04/configuring-the-distribution-database-in-an-availability-group/</link><pubDate>Mon, 08 Apr 2019 08:00:23 -0400</pubDate><guid>https://am2.co/2019/04/configuring-the-distribution-database-in-an-availability-group/</guid><description>&lt;p&gt;Starting with SQL Server 2017 CU6 and SQL Server 2016 SP2-CU3, you can now configure your distribution database as part of an Availability Group (AG). Up until now, your distribution database could only be part of a standalone instance, or failover cluster instance (FCI). In this first round, there&amp;rsquo;s a pretty big &lt;a href="https://docs.microsoft.com/en-us/sql/relational-databases/replication/configure-distribution-availability-group" rel="noopener noreferrer" target="_blank"&gt;list of limitations &amp;amp; restrictions&lt;/a&gt;. In fact, you&amp;rsquo;ll notice that the &amp;ldquo;supported scenarios&amp;rdquo; list is shorter than the &amp;ldquo;limitations or exclusions.&amp;rdquo;&lt;/p&gt;</description></item><item><title>Code to purge data based on creation date</title><link>https://am2.co/2019/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/code-to-purge-data-on-creation-date/</guid><description>&lt;p&gt;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&amp;rsquo;s necessary to do it, despite being a data packrat.&lt;/p&gt;&#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/purging-data-with-batched-deletes/</link><pubDate>Wed, 03 Apr 2019 08:30:13 -0400</pubDate><guid>https://am2.co/2019/04/purging-data-with-batched-deletes/</guid><description>&lt;p&gt;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&amp;rsquo;s look at the simplest requirement for purging data: Keep data for X days after it&amp;rsquo;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.&lt;/p&gt;</description></item><item><title>The thrill of purging old data</title><link>https://am2.co/2019/04/the-thrill-of-purging-old-data/</link><pubDate>Tue, 02 Apr 2019 09:00:54 -0400</pubDate><guid>https://am2.co/2019/04/the-thrill-of-purging-old-data/</guid><description>&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>How to pause the subscriber end of transactional replication</title><link>https://am2.co/2019/02/how-to-pause-the-subscriber-end-of-transactional-replication/</link><pubDate>Tue, 12 Feb 2019 08:10:04 -0500</pubDate><guid>https://am2.co/2019/02/how-to-pause-the-subscriber-end-of-transactional-replication/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/229484/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;How do I go about pausing transactional replication on the subscriber end.&lt;/p&gt;&#10;&lt;p&gt;We have a publisher on Server A, a distributor on Server B and a subscriber on Server C. All are in the same network.&lt;/p&gt;&#10;&lt;p&gt;Some background, we have quite a busy BizTalk server where we replicate the data from the BAM parts to a separate database server which will be used for a customized web application for statistics, searching etc. Seeing as the tables in the BizTalk server are both quite large and missing indexes etc since they're basically just there to have data dumped into them we opted to have the second, replicated database in which we can apply various optimizations for reading the data.&lt;/p&gt;</description></item><item><title>SQL: A love story</title><link>https://am2.co/2019/01/sql-love-story/</link><pubDate>Mon, 21 Jan 2019 08:00:54 -0500</pubDate><guid>https://am2.co/2019/01/sql-love-story/</guid><description>&lt;p&gt;I&amp;rsquo;m a college drop-out. When I was trying to figure out my life, a friend (my brother&amp;rsquo;s ex) referred me to a software company where she was working&amp;ndash;I got the job because I was (a) breathing, (b) eager to do the job, and (c) cheap. The application we built and sold was built with VB6, SQL Server, and later a bit of VB.NET. In my one year of college, I&amp;rsquo;d decided that I hate software development, but I fell in love with SQL Server. I&amp;rsquo;ve spent most of my career working with SQL Server (albeit a brief stint doing Oracle stuff), and I&amp;rsquo;m very happy that I fell in love with the SQL language and SQL Server in particular.&lt;/p&gt;</description></item><item><title>Failure is always an option</title><link>https://am2.co/2019/01/failure-is-always-an-option/</link><pubDate>Tue, 15 Jan 2019 08:00:49 -0500</pubDate><guid>https://am2.co/2019/01/failure-is-always-an-option/</guid><description>&lt;div style="float:right;max-width:400px;margin-left:10px;border-style:solid;border-width:3px;border-color:#999a9d;padding-right:10px;padding-left:10px;background-color:#e6e7e8"&gt; &#10;&lt;img src="https://am2.co/wp-content/uploads/sql-with-bert-logo-300x68.png" alt="SQL with Bert podcast logo." width="300" height="68" class="aligncenter size-medium wp-image-1661" /&gt;&#10;&lt;p&gt;A while back, I had the pleasure of sitting down to talk with Bert Wagner (&lt;a href="https://bertwagner.com/" rel="noopener" target="_blank"&gt;blog&lt;/a&gt;), Erin Stellato (&lt;a href="http://www.sqlskills.com/blogs/erin/" rel="noopener" target="_blank"&gt;blog&lt;/a&gt;), and an anonymous friend about some of our #SQLFail moments.&lt;/p&gt;&#10;&lt;p&gt;&lt;a href="https://youtu.be/osqoWOw2jss"&gt;https://youtu.be/osqoWOw2jss&lt;/a&gt;&lt;/p&gt;&#10;&lt;/div&gt;&#10;&lt;h2 id="everyone-screws-up"&gt;Everyone screws up&lt;/h2&gt;&#10;&lt;p&gt;Everyone has their failures. Nobody is perfect. But failure can be a good thing. We can learn from our failures, and learn not to make the same mistakes again in the future. Failure only becomes a problem when we make the same mistake repeatedly. Bloggers spend a lot of time writing about our successes, but we&amp;rsquo;re human and we make mistakes, too. This post is a chance to share one of my memorable failures.&lt;/p&gt;</description></item><item><title>Managed Instance Restart</title><link>https://am2.co/2019/01/managed-instance-restart/</link><pubDate>Sat, 05 Jan 2019 02:07:58 -0500</pubDate><guid>https://am2.co/2019/01/managed-instance-restart/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/226393/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;Does anyone know how to restart a SQL Server Managed Instance?&lt;/p&gt;&#10;&lt;p&gt;The stop / start / reset are all grayed out, so that’s really. It an option.&lt;/p&gt;&#10;&lt;p&gt;Any thoughts?&lt;/p&gt;&#10;&lt;p&gt;Thanks...&lt;/p&gt;&#10;&lt;p class="qa-attribution qa-attribution-asked"&gt;&lt;span class="qa-attribution-label"&gt;Asked&lt;/span&gt;&lt;span class="qa-attribution-date"&gt;&lt;a href="https://dba.stackexchange.com/q/226393/52344" rel="noopener" target="_blank"&gt;2019-01-05&lt;/a&gt;&lt;/span&gt;&lt;span class="qa-attribution-by"&gt;by&lt;/span&gt;&lt;span class="qa-attribution-user"&gt;&lt;a href="https://dba.stackexchange.com/users/169407" rel="noopener" target="_blank"&gt;Kevin Wilkie&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&#10;&lt;hr&gt;&#10;&lt;h2 id="answer"&gt;Answer&lt;/h2&gt;&#10;&lt;p&gt;You don't restart Managed Instance. The beauty of PaaS is that the cloud service provider ensures that you get a certain uptime SLA-- 99.99% in this case. &lt;/p&gt;</description></item><item><title>How to analyze compression options for Azure SQL Database?</title><link>https://am2.co/2019/01/how-to-analyze-compression-options-for-azure-sql-database/</link><pubDate>Fri, 04 Jan 2019 19:52:41 -0500</pubDate><guid>https://am2.co/2019/01/how-to-analyze-compression-options-for-azure-sql-database/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/226369/52344"&gt;&lt;img src="https://am2.co/images/stack-exchange-question-mark.svg" alt="Question on Stack Exchange" width="96" height="96" class="stack-exchange-question-icon" /&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;h2 id="question"&gt;Question&lt;/h2&gt;&#10;&lt;p&gt;What is the most efficient way to determine whether row or page or columnstore compression (or none) would be most effective for each index in an Azure SQL Database (standard or premium tier) used for OLTP, where &lt;strong&gt;sp_estimate_data_compression_savings&lt;/strong&gt; is not supported?&lt;/p&gt;</description></item></channel></rss>