<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>2017 on Andy M Mallon - AM²</title><link>https://am2.co/2017/</link><description>Recent content in 2017 on Andy M Mallon - AM²</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Sun, 31 Dec 2017 08:10:43 -0500</lastBuildDate><atom:link href="https://am2.co/2017/index.xml" rel="self" type="application/rss+xml"/><item><title>Backing up to NUL:</title><link>https://am2.co/2017/12/backup-nul/</link><pubDate>Sun, 31 Dec 2017 08:10:43 -0500</pubDate><guid>https://am2.co/2017/12/backup-nul/</guid><description>&lt;p&gt;Linux folks have lots of jokes &amp;amp; &lt;a href="http://amzn.to/2C4hini" target="_blank" rel="noopener"&gt;fun t-shirts about /dev/null/&lt;/a&gt;. The &lt;a href="https://en.wikipedia.org/wiki/Null_device" target="_blank" rel="noopener"&gt;null device&lt;/a&gt; is a handy location to dump output to, when you don&amp;rsquo;t actually care about the output. In PowerShell, you can use &lt;a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/out-null" target="_blank" rel="noopener"&gt;Out-Null&lt;/a&gt; to dump extra output into the ether, and keep your logs or console clean.&lt;/p&gt;</description></item><item><title>Interviewed by Mohammad Darab</title><link>https://am2.co/2017/12/interviewed-mohammad-darab/</link><pubDate>Wed, 20 Dec 2017 10:01:42 -0500</pubDate><guid>https://am2.co/2017/12/interviewed-mohammad-darab/</guid><description>&lt;p&gt;As part of Mohammad&amp;rsquo;s series of interviews, he interviewed me on my thoughts on the future of SQL Server, the DBA role, and the cloud.&lt;/p&gt;&#10;&lt;p&gt;Read the interview on &lt;a href="https://mohammaddarab.com/interview-andy-mallon/" target="_blank" rel="noopener"&gt;Mohammad&amp;rsquo;s site&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Alerting on SQL Server Blocking</title><link>https://am2.co/2017/12/alerting-sql-server-blocking/</link><pubDate>Mon, 18 Dec 2017 09:00:02 -0500</pubDate><guid>https://am2.co/2017/12/alerting-sql-server-blocking/</guid><description>&lt;p&gt;Identifying blocking is one of the most basic things that a DBA should be monitoring for. I previously wrote about how to &lt;a href="https://am2.co/2017/10/26/finding-leader-blocker/"&gt;identify blocking in SQL Server and find the leading blocker&lt;/a&gt;. Recently, my friend Jim Donahoe (&lt;a href="http://sqlflipflopsdba.com/" target="_blank" rel="noopener noreferrer"&gt;blog&lt;/a&gt;) asked me about setting up email alerts related to blocking, which prompted me to clean up some additional code I have that does just this. If you haven&amp;rsquo;t already read &lt;a href="https://am2.co/2017/10/26/finding-leader-blocker/"&gt;my previous post&lt;/a&gt;, you should probably do that now.&lt;/p&gt;</description></item><item><title>Q&amp;A with the MVP Award Program</title><link>https://am2.co/2017/11/qa-mvp-award-program/</link><pubDate>Wed, 01 Nov 2017 11:38:58 -0400</pubDate><guid>https://am2.co/2017/11/qa-mvp-award-program/</guid><description>&lt;p&gt;I was recently interviewed by the Microsoft MVP Award Program about organizing the LGBT meetup at PASS Summit last year, and about running diverse, inclusive tech events here in Boston. We discuss why it&amp;rsquo;s important to have LGBT events, and other events that focus on under-represented groups, as well as how we run inclusive events here in Boston.&lt;/p&gt;</description></item><item><title>Ten tips for PASS Summit Attendees</title><link>https://am2.co/2017/10/ten-tips-pass-summit-attendees/</link><pubDate>Sun, 29 Oct 2017 11:54:54 -0400</pubDate><guid>https://am2.co/2017/10/ten-tips-pass-summit-attendees/</guid><description>&lt;p&gt;I won&amp;rsquo;t be at PASS Summit this year, but that doesn&amp;rsquo;t mean I can&amp;rsquo;t give advice to those who will be there. I got an email asking for advice for Summit First-Timers, and after sending over the list of tips, I figured I&amp;rsquo;d write a blog post on the topic while I was thinking about it.&lt;/p&gt;</description></item><item><title>Finding the Leader Blocker</title><link>https://am2.co/2017/10/finding-leader-blocker/</link><pubDate>Thu, 26 Oct 2017 23:55:09 -0400</pubDate><guid>https://am2.co/2017/10/finding-leader-blocker/</guid><description>&lt;p&gt;During the course of normal processing in a database, blocking happens. Blocking is &amp;ldquo;by design&amp;rdquo; because &lt;a href="https://en.wikipedia.org/wiki/ACID" target="_blank" rel="noopener noreferrer"&gt;your database is on ACID&lt;/a&gt;. In an OLTP database, most of your transactions are short in duration, so we expect blocking to also be short in duration. If blocking occurs for a long time, this can cause problems.&lt;/p&gt;</description></item><item><title>Change in plans for LGBT+ Meetup at PASS Summit 2017</title><link>https://am2.co/2017/10/no-lgbt-meetup-pass-summit-2017/</link><pubDate>Sun, 01 Oct 2017 14:24:20 -0400</pubDate><guid>https://am2.co/2017/10/no-lgbt-meetup-pass-summit-2017/</guid><description>&lt;p&gt; &lt;/p&gt;&#10;&lt;p&gt;Unfortunately, due to a change in plans, I&amp;rsquo;m not going to be at PASS Summit this year, so I won&amp;rsquo;t be hosting this meetup in 2017. Hopefully, next year the event will be back!&lt;/p&gt;&#10;&lt;h2 id="still-want-to-meet-up"&gt;Still want to meet up?&lt;/h2&gt;&#10;&lt;p&gt;If you&amp;rsquo;re bummed that this meetup isn&amp;rsquo;t happening (I know I am), I have two suggestions:&lt;/p&gt;</description></item><item><title>Shortcuts From an Impatient DBA Recording- DBA Fundamentals</title><link>https://am2.co/2017/09/shortcuts-recording/</link><pubDate>Wed, 20 Sep 2017 08:54:21 -0400</pubDate><guid>https://am2.co/2017/09/shortcuts-recording/</guid><description>&lt;p&gt;I often get asked, &amp;ldquo;Do you have any of your sessions recorded so I can watch them online?&amp;rdquo; And the answer has always been, &amp;ldquo;No, you&amp;rsquo;ll have to come see me in person.&amp;rdquo; I&amp;rsquo;m a tad of a perfectionist, so if I was going to record something &lt;strong&gt;just&lt;/strong&gt; for publication online, I&amp;rsquo;d never be happy with it. Therefore, I never even tried&amp;ndash;I knew the time investment I&amp;rsquo;d need to be happy with the product was too steep.&lt;/p&gt;</description></item><item><title>LOG_RATE_GOVERNOR Wait Stat</title><link>https://am2.co/2017/09/log_rate_governor-wait-stat/</link><pubDate>Mon, 18 Sep 2017 13:17:55 -0400</pubDate><guid>https://am2.co/2017/09/log_rate_governor-wait-stat/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/186211/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'm noticing this wait stat on my Azure SQL database, and I've never seen it before. I've tried Googling this wait stat but haven't been able to come up with any good information on what this is, although I saw a couple mentions of it possibly being related to exceeding the Azure performance tier set for the database.&lt;/p&gt;</description></item><item><title>Rebuild Very Large Primary Key Index</title><link>https://am2.co/2017/09/rebuild-very-large-primary-key-index/</link><pubDate>Sat, 02 Sep 2017 22:40:43 -0400</pubDate><guid>https://am2.co/2017/09/rebuild-very-large-primary-key-index/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/184973/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 SQL database that is hosted on Azure. The problem is that the size is getting out of control, I can see up to 99% fragmentation in the Primary Key clustered indexes.&lt;/p&gt;&#10;&lt;p&gt;I'm able to rebuild all other indexes with &lt;code&gt;online=on&lt;/code&gt; option and it won't affect performance. The size of one of the PK Clustered indexes is greater than 200GB, and for this one a &lt;code&gt;REBUILD...WITH (ONLINE=ON)&lt;/code&gt; causes locking.&lt;/p&gt;</description></item><item><title>Multi-Statement TVFs in Dynamics CRM</title><link>https://am2.co/2017/08/multi-statement-tvfs-in-dynamics-crm/</link><pubDate>Tue, 22 Aug 2017 13:19:18 -0400</pubDate><guid>https://am2.co/2017/08/multi-statement-tvfs-in-dynamics-crm/</guid><description>&lt;p&gt;If you&amp;rsquo;re familiar with supporting the database behind Microsoft Dynamics CRM, you probably know that it&amp;rsquo;s not the fastest-performing database. Honestly, that shouldn&amp;rsquo;t be a surprise&amp;ndash;it&amp;rsquo;s not designed to be a screaming-fast database. It&amp;rsquo;s designed to be a &lt;em&gt;flexible&lt;/em&gt; database. Most Customer Relationship Management (CRM) systems are designed to be flexible so that they can meet the needs of many businesses in many industries with vastly different business requirements. They put those requirements ahead of database performance. That&amp;rsquo;s probably smart business, but I&amp;rsquo;m not a business person&amp;ndash;I&amp;rsquo;m a database person. My experience with Dynamics CRM is when people come to me and say&lt;/p&gt;</description></item><item><title>Query a view in a procedure in which the view name is a variable</title><link>https://am2.co/2017/08/query-a-view-in-a-procedure-in-which-the-view-name-is-a-variable/</link><pubDate>Wed, 16 Aug 2017 18:18:49 -0400</pubDate><guid>https://am2.co/2017/08/query-a-view-in-a-procedure-in-which-the-view-name-is-a-variable/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/183661/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;My problem: I have a set of views from which I want to query dynamically.&#10;I want to load the view names by &lt;strong&gt;&lt;code&gt;SELECT * from sys.all_views&lt;/code&gt;&lt;/strong&gt; into a cursor (let's call it &lt;code&gt;view_cursor&lt;/code&gt;) and then do something like this in a procedure:&lt;/p&gt;</description></item><item><title>Can SQL Server 2016 log files be applied on SQL Server 2012</title><link>https://am2.co/2017/08/can-sql-server-2016-log-files-be-applied-on-sql-server-2012/</link><pubDate>Tue, 15 Aug 2017 03:53:35 -0400</pubDate><guid>https://am2.co/2017/08/can-sql-server-2016-log-files-be-applied-on-sql-server-2012/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/183494/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 in relation to a rollback scenario from a 2012 -&gt; 2016 upgrade.&lt;/p&gt;&#10;&lt;p&gt;The scenario is that the SQL Server 2012 database is restored onto 2016 and log files applied until it is up to date. Then production systems are cut over to 2016. Database is kept at compatibility level for 2012. Subsequently, incremental logs from the 2016 instance are kept until the need to roll back (let's say 8 hours worth).&lt;/p&gt;</description></item><item><title>Reconnect "not connected" query windows in SSMS to original connection</title><link>https://am2.co/2017/08/reconnect-not-connected-query-windows-in-ssms-to-original-connection/</link><pubDate>Mon, 14 Aug 2017 14:20:38 -0400</pubDate><guid>https://am2.co/2017/08/reconnect-not-connected-query-windows-in-ssms-to-original-connection/</guid><description>&lt;!-- REPLACE:&#10;Question ID: 183432&#10;Asker Name: David Hiltenbrand&#10;Asker ID: 132635&#10;Question Date: 2017-08-14&#10;&#10;Answer ID: 183434&#10;Answer Date: 2017-08-14&#10;&#10;--&gt;&#10;&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/183432/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;Is there a simple way to reconnect a query window that is &amp;ldquo;not connected&amp;rdquo; to the original connection that was used by that query without manually picking the server name needed? If I click the Connect button on the SQL Editor toolbar or right click -&amp;gt; Connection -&amp;gt; Connect&amp;hellip; it defaults the server name to the last connection I used in that SSMS session, not to the last connection used by that specific query window.&lt;/p&gt;</description></item><item><title>SentryOne Community Ambassador</title><link>https://am2.co/2017/07/sentryone-community-ambassador/</link><pubDate>Thu, 20 Jul 2017 10:13:28 -0400</pubDate><guid>https://am2.co/2017/07/sentryone-community-ambassador/</guid><description>&lt;p&gt;Last week, SentryOne &lt;a href="https://blogs.sentryone.com/aaronbertrand/introducing-our-pac-community-ambassadors/" target="_blank" rel="noopener"&gt;announced&lt;/a&gt; their new PAC Community Ambassador program. I&amp;rsquo;m incredibly excited to be part of this new program.&lt;/p&gt;&#10;&lt;h2 id="pac-huh"&gt;PAC? Huh?&lt;/h2&gt;&#10;&lt;p&gt;SentryOne doesn&amp;rsquo;t fuel their monitoring software with &lt;a href="https://www.google.com/logos/2010/pacman10-i.html" target="_blank" rel="noopener"&gt;power-pellets&lt;/a&gt;, the PAC is their Product Advisory Council. This is a group of their users and industry experts who help provide feedback on the product, new features, marketing, etc. Sometimes we&amp;rsquo;re beta testers, sometimes we&amp;rsquo;re a focus group, and sometimes we just share our performance woes.&lt;/p&gt;</description></item><item><title>The most important resume tip</title><link>https://am2.co/2017/07/resume-number-one-tip/</link><pubDate>Sun, 09 Jul 2017 10:52:24 -0400</pubDate><guid>https://am2.co/2017/07/resume-number-one-tip/</guid><description>&lt;p&gt;Writing a good resume is hard. People will tell you lots of rules about what you should always or never do with your resume. Should you follow those rules? Are things different because of your industry/background/geography/niche? Should you be clever or classic? &lt;strong&gt;It depends™&lt;/strong&gt;.&lt;/p&gt;&#10;&lt;p&gt;There is one important thing to keep in mind for your resume. This tip is not a rule, but it is a universal fact. Whether you&amp;rsquo;re a battle-scarred IT veteran, or a fresh-faced college grad, keep this one tip in mind when you read or update your resume.&lt;/p&gt;</description></item><item><title>SQL Server FCI won't start after OS Upgrade</title><link>https://am2.co/2017/07/sql-server-fci-wont-start-after-os-upgrade/</link><pubDate>Thu, 06 Jul 2017 22:25:48 -0400</pubDate><guid>https://am2.co/2017/07/sql-server-fci-wont-start-after-os-upgrade/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/178196/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 two node sql server 2008 r2 cluster that we just did an OS upgrade from windows 2008 r2 to windows 2012 r2, the OS upgrade was done in place so the SQL Server Installation stayed in tack. The cluster role won't come back online saying it's couldn't find any IP address that this instance depends on. &lt;/p&gt;</description></item><item><title>What’s wrong with DELETE EXISTS?</title><link>https://am2.co/2017/06/whats-wrong-delete-exists/</link><pubDate>Fri, 30 Jun 2017 14:26:41 -0400</pubDate><guid>https://am2.co/2017/06/whats-wrong-delete-exists/</guid><description>&lt;p&gt;This morning, when I logged into Twitter, the tweet at the top of my timeline was from Shane O&amp;rsquo;Neill (&lt;a href="https://nocolumnname.wordpress.com/" target="_blank" rel="noopener"&gt;blog&lt;/a&gt;). It was to his blog post, &lt;a href="https://nocolumnname.wordpress.com/2017/06/30/shane-whats-wrong-with-delete-exists/" target="_blank" rel="noopener"&gt;Shane, What&amp;rsquo;s wrong with DELETE EXISTS?&lt;/a&gt;.  It&amp;rsquo;s not that unusual that Shane would talk to himself in the third person, but I was intrigued by the title.&lt;/p&gt;</description></item><item><title>Why Best Practices Exist: Learning from others' mistakes</title><link>https://am2.co/2017/06/best-practices-exist-learning-others-mistakes/</link><pubDate>Wed, 28 Jun 2017 20:00:11 -0400</pubDate><guid>https://am2.co/2017/06/best-practices-exist-learning-others-mistakes/</guid><description>&lt;p&gt;The latest malware to make the headlines is really interesting to me. It&amp;rsquo;s a ransomware worm called &lt;strong&gt;Petya&lt;/strong&gt;. Ransomware is particularly interesting to me as a DBA, because DBAs are responsible for keeping data safe, and ransomware is specifically designed to destroy your data. I&amp;rsquo;m not a security expert, and I don&amp;rsquo;t even pretend I am&amp;ndash;but security is something we should all be interested in.&lt;/p&gt;</description></item><item><title>LGBT+ Meetup at PASS Summit 2017</title><link>https://am2.co/2017/06/announcing-lgbt-meetup-pass-summit-2017/</link><pubDate>Wed, 28 Jun 2017 10:27:26 -0400</pubDate><guid>https://am2.co/2017/06/announcing-lgbt-meetup-pass-summit-2017/</guid><description>&lt;blockquote&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; Unfortunately, due to a change in plans, I'm not going to be at PASS Summit this year, so I won't be hosting this meetup in 2017. Check out &lt;a href="https://am2.co/2017/10/01/no-lgbt-meetup-pass-summit-2017/" target="_blank" rel="noopener"&gt;details here&lt;/a&gt;.&lt;/blockquote&gt;&#10;&lt;p&gt;Last year, I organized &lt;a href="https://am2.co/2016/10/12/summit-2016-lgbt-meetup/"&gt;an (unofficial) PASS Summit LGBT Meetup&lt;/a&gt;. It was a bit of a last-minute party, and more than once I found myself saying, &amp;ldquo;Worst case scenario, I&amp;rsquo;ll end up having a chill cocktail party with some friends.&amp;rdquo; Turns out, I under estimated myself: I sold out of (free) tickets, the room was at full capacity, we raised over $3000 for &lt;a href="http://www.thetrevorproject.org/" target="_blank" rel="noopener"&gt;The Trevor Project&lt;/a&gt;, and everyone had a great time.&lt;/p&gt;</description></item><item><title>Spread workload with always on high availability groups</title><link>https://am2.co/2017/06/spread-workload-with-always-on-high-availability-groups/</link><pubDate>Tue, 27 Jun 2017 14:04:54 -0400</pubDate><guid>https://am2.co/2017/06/spread-workload-with-always-on-high-availability-groups/</guid><description>&lt;p&gt;&lt;a href="https://stackoverflow.com/q/24453807/1948808"&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 wondering if it is possible to split up a very large query to have parts of it done on the secondary read only servers, or If this feature only allows me to run separate queries or scripts on the secondary servers. I would also like to know if anyone is using AlwaysOn High availability groups for this purpose, how is it working for you?&lt;/p&gt;</description></item><item><title>What is the row overhead when using Page Compression?</title><link>https://am2.co/2017/04/what-is-the-row-overhead-when-using-page-compression/</link><pubDate>Fri, 28 Apr 2017 11:23:41 -0400</pubDate><guid>https://am2.co/2017/04/what-is-the-row-overhead-when-using-page-compression/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/172252/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 created a table with 650 &lt;code&gt;Numeric(19,4)&lt;/code&gt; columns.&#10;When I switch on Page Compression, by running&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;ALTER&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;TABLE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;fct&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;MyTable&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;REBUILD&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;WITH&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;DATA_COMPRESSION&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;PAGE&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I get &lt;/p&gt;&#10;&lt;div class="sql-output"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line hl"&gt;&lt;span class="cl"&gt;Msg 1975, Level 16, State 1&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Index &amp;#39;PK_Mytable&amp;#39; row length exceeds the maximum permissible length of &amp;#39;8060&amp;#39; bytes.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;but 650 times 9 bytes is only 5850 bytes, which is quite far from the stated limit of 8060 bytes.&lt;/p&gt;</description></item><item><title>Prevent Modification of dbo objects while allowing other schemas to be modified</title><link>https://am2.co/2017/04/prevent-modification-of-dbo-objects-while-allowing-other-schemas-to-be-modified/</link><pubDate>Thu, 20 Apr 2017 14:16:40 -0400</pubDate><guid>https://am2.co/2017/04/prevent-modification-of-dbo-objects-while-allowing-other-schemas-to-be-modified/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/171523/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 vendor solution that uses a sql server (2008r2) database. We are allowed to do anything we want in our own schema, but cannot modify dbo objects without vendor permission. Any customization we make is in our own schema (cust). We have full control of this server and have always allowed sysadmin rights to any developer. Lately, I've noticed these rules have not been followed, so I want to see if I can set up permissions to stop this in the first place.&lt;/p&gt;</description></item><item><title>Why does it take so long to view logs on a server?</title><link>https://am2.co/2017/04/why-does-it-take-so-long-to-view-logs-on-a-server/</link><pubDate>Thu, 20 Apr 2017 12:20:14 -0400</pubDate><guid>https://am2.co/2017/04/why-does-it-take-so-long-to-view-logs-on-a-server/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/171510/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 am just trying to look up more verbose information for a maintenance plan task that failed. I open up the log file viewer and check the box to view the logs for my maintenance plan. There are no active filters besides that in this example. Then I play the waiting game.....&lt;/p&gt;</description></item><item><title>Load balancing reads SQL Server 2016 AG</title><link>https://am2.co/2017/04/load-balancing-reads-sql-server-2016-ag/</link><pubDate>Wed, 19 Apr 2017 18:21:44 -0400</pubDate><guid>https://am2.co/2017/04/load-balancing-reads-sql-server-2016-ag/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/171438/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'm trying to balance read traffic between two SQL Server 2016 Enterprise Edition instances (Primary and Secondary) using availability groups and the read only routing. &lt;/p&gt;&#10;&lt;p&gt;Here is my current setup:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;The servers are in AWS in two different AZ&lt;/li&gt;&#10;&lt;li&gt;The servers are in a failover cluster without shared storage&lt;/li&gt;&#10;&lt;li&gt;AG is enabled on both instances&lt;/li&gt;&#10;&lt;li&gt;The databases in an Availability Group have the &amp;quot;Readable Secondary&amp;quot; option set to Yes&lt;/li&gt;&#10;&lt;li&gt;I've setup the AG with the read only routing on both the current primary and secondary instances&lt;/li&gt;&#10;&lt;li&gt;Adding the read only switch in my application connection string allows me to route traffic to the secondary&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Is there a way to have the AG Listener load balance read only traffic between the primary and secondary?&lt;/p&gt;</description></item><item><title>Troubleshooting Powershell errors from SQL Agent job</title><link>https://am2.co/2017/04/troubleshooting-powershell-errors-from-sql-agent-job/</link><pubDate>Wed, 19 Apr 2017 13:29:54 -0400</pubDate><guid>https://am2.co/2017/04/troubleshooting-powershell-errors-from-sql-agent-job/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/171395/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 powershell script that I am trying to add in to a sql agent job, but the job step is failing with the following error&lt;/p&gt;&#10;&lt;pre class="errorMsg"&gt;&lt;code&gt;A job step received an error at line 1 in a PowerShell script. The corresponding line is &amp;#39;import-module SQLPS -DisableNameChecking&amp;#39;. Correct the script and reschedule the job. The error information returned by PowerShell is: &amp;#39;Could not load file or assembly &amp;#39;file:///C:\Program Files (x86)\Microsoft SQL Server\130\Tools\PowerShell\Modules\SQLPS\Microsoft.SqlServer.Management.PSSnapins.dll&amp;#39; or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I assumed that the error was being caused by differences in the module path, so I explicitly set the path via $env:PSModulePath to match the path of my powershell session where the code runs fine. I am pretty new to powershell, so any help you could provide would be appreciated&lt;/p&gt;</description></item><item><title>Transaction Replication on AlwaysOn</title><link>https://am2.co/2017/04/transaction-replication-on-alwayson/</link><pubDate>Mon, 17 Apr 2017 22:21:43 -0400</pubDate><guid>https://am2.co/2017/04/transaction-replication-on-alwayson/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/171244/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 our AlwayOn environment I have two SQL servers 2014 Ent.edition (SERVER A, and SERVER B). I setup a transaction replication for [database A ], pointing to listener which shouldn't cause any issue if a failover happened. Tested, worked just fine after a failover, but when I shut off one of the servers in AOAG ,in test environment, replication stops working. There is no error on the replication monitor. For testing purpose,I have inserted few records on the database it works fine on AOAG, but on the Subscriber the data modification is not replicated until I bring up the other server. Once the server is up, then the replication start to work. I'm pretty sure, I might be missing something, this can't be this way by design. &lt;/p&gt;</description></item><item><title>How to take SQL Server databases backup using .bat script file with time stamp</title><link>https://am2.co/2017/04/how-to-take-sql-server-databases-backup-using-bat-script-file-with-time-stamp/</link><pubDate>Mon, 17 Apr 2017 13:24:49 -0400</pubDate><guid>https://am2.co/2017/04/how-to-take-sql-server-databases-backup-using-bat-script-file-with-time-stamp/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/171196/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 am using SQL Server Express edition, so there is no features for backup plan, I want to take databases backup using bat script, and create a scheduler to be run everyday. I have created .bat file but need to place a time stamp at the end of backup file like test_13_April_2017.&lt;/p&gt;</description></item><item><title>If the Database is in Readonly mode how can we drop/remove those unused roles</title><link>https://am2.co/2017/04/if-the-database-is-in-readonly-mode-how-can-we-drop-remove-those-unused-roles/</link><pubDate>Mon, 17 Apr 2017 11:03:22 -0400</pubDate><guid>https://am2.co/2017/04/if-the-database-is-in-readonly-mode-how-can-we-drop-remove-those-unused-roles/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/171187/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 SQL Server, if the Database is in &lt;code&gt;Read_only&lt;/code&gt; mode, can we drop/remove unused roles? Please let me know.&lt;/p&gt;&#10;&lt;p&gt;Thanks in advance&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/171187/52344" rel="noopener" target="_blank"&gt;2017-04-17&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/109681" rel="noopener" target="_blank"&gt;Bharath Kuamr reddy&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;If a database is in &lt;code&gt;READ_ONLY&lt;/code&gt; mode, it is &lt;strong&gt;completely&lt;/strong&gt; read-only. The read-only-ness is not limited to user data, but &lt;em&gt;anything&lt;/em&gt; contained in the database. This means that both DML commands (ie, &lt;code&gt;INSERT&lt;/code&gt;, &lt;code&gt;UPDATE&lt;/code&gt;, &lt;code&gt;DELETE&lt;/code&gt;), and DDL commands (ie, &lt;code&gt;CREATE&lt;/code&gt;, &lt;code&gt;ALTER&lt;/code&gt;, &lt;code&gt;DROP&lt;/code&gt;) are prohibited.&lt;/p&gt;</description></item><item><title>Preventing SQL injection in dynamic SQL</title><link>https://am2.co/2017/04/preventing-sql-injection-in-dynamic-sql/</link><pubDate>Fri, 14 Apr 2017 08:29:34 -0400</pubDate><guid>https://am2.co/2017/04/preventing-sql-injection-in-dynamic-sql/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/170990/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;Let's imagine a stored procedure that retreives data and do some kind of pagination. This procedure has some inputs describing which set of data we want and how we sort it.&lt;/p&gt;&#10;&lt;p&gt;Here is a very simple query, but let's take it as an example.&lt;/p&gt;</description></item><item><title>When setting up an AlwaysOn Availability Group, should the master database be one of the "Availability Databases"?</title><link>https://am2.co/2017/04/when-setting-up-an-alwayson-availability-group-should-the-master-database-be-one-of-the-availability-databases/</link><pubDate>Wed, 12 Apr 2017 17:44:16 -0400</pubDate><guid>https://am2.co/2017/04/when-setting-up-an-alwayson-availability-group-should-the-master-database-be-one-of-the-availability-databases/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/170856/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 just got a Sql Server 2016 Availability Group setup (A Primary, a Syncronous Secondary and a Async Secondary). I have five databases on the servers.&lt;/p&gt;&#10;&lt;p&gt;I setup an application to run queries against the server (using Entity Framework with a "failover partner" connection string.)&lt;/p&gt;</description></item><item><title>Releasing free space in mdf file to OS</title><link>https://am2.co/2017/04/releasing-free-space-in-mdf-file-to-os/</link><pubDate>Mon, 10 Apr 2017 13:29:43 -0400</pubDate><guid>https://am2.co/2017/04/releasing-free-space-in-mdf-file-to-os/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/170621/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 have a 120GB database. There was table with 60GB of data which is useless and we have truncated it. &lt;/p&gt;&#10;&lt;p&gt;Now database size is 120GB with free space 60GB. The database will not grow up to 60GB in at least 3 months. So can we shrink the data file.&lt;/p&gt;</description></item><item><title>Transaction log growth during BACKUP</title><link>https://am2.co/2017/04/transaction-log-growth-backup/</link><pubDate>Mon, 10 Apr 2017 08:06:37 -0400</pubDate><guid>https://am2.co/2017/04/transaction-log-growth-backup/</guid><description>&lt;p&gt;Over on Stack Exchange, &lt;a href="http://dba.stackexchange.com/questions/169174/sql-server-2014-transaction-log-is-growing-very-fast" target="_blank"&gt;someone asked&lt;/a&gt; why their transaction log was growing very fast during a full backup. An interesting tidbit to this question is that the database is in &lt;code&gt;SIMPLE&lt;/code&gt; recovery &amp;ndash; so the log should stay tiny, right?&lt;/p&gt;&#10;&lt;p&gt;Wrong. While taking a full backup of the database, SQL Server is unable to reuse the transaction log for the duration of the backup, &lt;em&gt;even if the database is in &lt;code&gt;SIMPLE&lt;/code&gt; recovery&lt;/em&gt;. If your database is very busy, or backups take a long period of time, this can require a large transaction log, &lt;em&gt;even if the database is in &lt;code&gt;SIMPLE&lt;/code&gt; recovery&lt;/em&gt;.&lt;/p&gt;</description></item><item><title>SQL Triggers not preventing insert</title><link>https://am2.co/2017/04/sql-triggers-not-preventing-insert/</link><pubDate>Mon, 10 Apr 2017 00:53:58 -0400</pubDate><guid>https://am2.co/2017/04/sql-triggers-not-preventing-insert/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/170564/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 am having trouble getting a trigger to work. What it needs to do is to prevent any customer with last name Glass from being inserted into the database. This is what I have:&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sql" data-lang="sql"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;TRIGGER&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;no_last_name_glass_trg&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;ON&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;customer&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;AFTER&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;INSERT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="k"&gt;UPDATE&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;AS&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;BEGIN&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;DECLARE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="n"&gt;CUSTOMER_LAST&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;SET&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="n"&gt;CUSTOMER_LAST&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;INSERTED&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;customer_last&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;INSERTED&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;IF&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="n"&gt;CUSTOMER_LAST&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Glass&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;BEGIN&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;ROLLBACK&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;RAISERROR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Applicant Glass Denied&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;END&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;END&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The issue is when I add customers with last name of Glass, it inserts without throwing an error. Any ideas? I can make it work in Oracle, but the same method does not work in MS SQL.&lt;/p&gt;</description></item><item><title>Why do I have to backup a transaction log twice for it to shrink?</title><link>https://am2.co/2017/04/why-do-i-have-to-backup-a-transaction-log-twice-for-it-to-shrink/</link><pubDate>Fri, 07 Apr 2017 06:42:17 -0400</pubDate><guid>https://am2.co/2017/04/why-do-i-have-to-backup-a-transaction-log-twice-for-it-to-shrink/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/169408/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 question was attempted twice on experts-exchange with no real answer.&lt;/p&gt;&#10;&lt;p&gt;I know that I should not shrink the log file - that is not the question.&lt;/p&gt;&#10;&lt;p&gt;If you feel like answering that one should not do it- that has been confirmed many times yes and it is not the goal of this question.&lt;/p&gt;</description></item><item><title>Converting date stored as a varchar</title><link>https://am2.co/2017/04/converting-date-stored-as-a-varchar/</link><pubDate>Thu, 06 Apr 2017 10:00:51 -0400</pubDate><guid>https://am2.co/2017/04/converting-date-stored-as-a-varchar/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/169287/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'm creating a query that has a column of dates stored as a VARCHAR in the format DD-MMM-YYYY.&lt;/p&gt;&#10;&lt;p&gt;Could you tell me how I can convert this into date format please?&lt;/p&gt;&#10;&lt;p&gt;I don't want to alter the original table in any way, as it's not mine to tinker!&lt;/p&gt;</description></item><item><title>Transaction log is growing very fast</title><link>https://am2.co/2017/04/transaction-log-is-growing-very-fast/</link><pubDate>Wed, 05 Apr 2017 19:45:50 -0400</pubDate><guid>https://am2.co/2017/04/transaction-log-is-growing-very-fast/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/169174/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;One of our SQL Server 2014 database transaction logs is growing very fast and I cannot find the root cause for this.&lt;/p&gt;&#10;&lt;p&gt;Database in Simple recovery mode. During full backup the log file grows to its limits (800GB) and backup fails.&lt;/p&gt;</description></item><item><title>Connecting to ReadOnly Secondary Replica of SQL Server via the Listener by Default</title><link>https://am2.co/2017/03/connecting-to-readonly-secondary-replica-of-sql-server-via-the-listener-by-default/</link><pubDate>Fri, 31 Mar 2017 00:56:41 -0400</pubDate><guid>https://am2.co/2017/03/connecting-to-readonly-secondary-replica-of-sql-server-via-the-listener-by-default/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/168708/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 have the ApplicationIntent=ReadOnly properly routing our users to the Secondary ReadOnly replica. Is there a way to make this the default behavior?&lt;/p&gt;&#10;&lt;p&gt;Apparently the default behavior seems to be ReadWrite, and if you don't specify an ApplicationIntent it will redirect to the Primary server.&lt;/p&gt;</description></item><item><title>What the heck is a DTU?</title><link>https://am2.co/2017/03/what-the-heck-is-a-dtu/</link><pubDate>Thu, 30 Mar 2017 09:42:18 -0400</pubDate><guid>https://am2.co/2017/03/what-the-heck-is-a-dtu/</guid><description>&lt;h2 id="no-seriously-what-is-a-dtu"&gt;No, seriously. What is a DTU?&lt;/h2&gt;&#10;&lt;p&gt;When you&amp;rsquo;re deploying any application, one of the first questions that comes up is &amp;ldquo;What will this cost?&amp;rdquo; Most of us have gone through this sort of exercise for sizing a SQL Server installation at some point, but what if you&amp;rsquo;re deploying to the cloud? With Azure IaaS deployments, not much has changed&amp;ndash;you&amp;rsquo;re still building a server based on CPU count, some amount of memory, and configuring storage to give you enough IOPS for your workload. However, when you make the jump to PaaS, Azure SQL Database is sized with different &lt;a href="https://docs.microsoft.com/en-us/azure/sql-database/sql-database-service-tiers" target="_blank" rel="noopener noreferrer"&gt;service tiers&lt;/a&gt;, where performance is measured in DTUs. &lt;strong&gt;What the heck is a DTU?&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>Blogging at SQLPerformance.com</title><link>https://am2.co/2017/03/guest-blogging-at-sqlperformance-com/</link><pubDate>Thu, 30 Mar 2017 09:40:00 -0400</pubDate><guid>https://am2.co/2017/03/guest-blogging-at-sqlperformance-com/</guid><description>&lt;p&gt;As part of my role on the &lt;a href="https://www.SentryOne.com" target="_blank"&gt;SentryOne&lt;/a&gt; Product Advisory Council (PAC), I&amp;rsquo;m going to occasionally be contributing posts over at &lt;a href="https://sqlperformance.com/" target="_blank"&gt;SQLPerformance.com&lt;/a&gt;. Today, my first post was published: &lt;a href="https://am2.co/2017/03/30/what-the-heck-is-a-dtu/"&gt;What the heck is a DTU?&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;SQLPerformance.com focuses on providing innovative and practical solutions for improving SQL Server performance. The site has long been a source of learning for me, and I&amp;rsquo;m incredibly excited to now be providing my own content to the site. Worry not, faithful reader! I&amp;rsquo;ll still be blogging here, at am2.co, but you can expect some of my performance-oriented posts to live over there.&lt;/p&gt;</description></item><item><title>Congratulations 2017 Microsoft MVP!</title><link>https://am2.co/2017/03/congratulations-2017-microsoft-mvp/</link><pubDate>Sun, 19 Mar 2017 09:42:01 -0400</pubDate><guid>https://am2.co/2017/03/congratulations-2017-microsoft-mvp/</guid><description>&lt;p&gt;Earlier this month, I got an email with the subject line &amp;ldquo;Congratulations 2017 Microsoft MVP!&amp;rdquo; I immediately commenced doing a &lt;a href="https://youtu.be/l4_VMcxoxrk?t=20s" target="_blank" rel="noopener noreferrer"&gt;Snoopy happy dance&lt;/a&gt; (my dog, Callie, picked up on the excitement and joined in). If you aren&amp;rsquo;t familiar with the MVP Program, you might be asking,&lt;/p&gt;</description></item><item><title>SQLSaturday Boston 2017 Roundup</title><link>https://am2.co/2017/02/sqlsaturday-boston-2017-roundup/</link><pubDate>Tue, 28 Feb 2017 07:00:45 -0500</pubDate><guid>https://am2.co/2017/02/sqlsaturday-boston-2017-roundup/</guid><description>&lt;p&gt;SQLSaturday Boston was February 25. I was invited into the organizing team in 2015, and this was my third time helping to put together the event. But this time was different. This time, I was running the show. I wanted to do a quick round-up of some of the things we did differently this time&amp;ndash;I&amp;rsquo;ll dive right in with the most important thing first&amp;hellip;&lt;/p&gt;</description></item><item><title>Risks of manual failover in Always On Availability Groups</title><link>https://am2.co/2017/02/risks-of-manual-failover-in-always-on-availability-groups/</link><pubDate>Thu, 09 Feb 2017 19:11:24 -0500</pubDate><guid>https://am2.co/2017/02/risks-of-manual-failover-in-always-on-availability-groups/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/163787/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 my environment, I have SQL 2014 with Always On Availability Group for databases in asynchronous with manual fail over.&lt;/p&gt;&#10;&lt;p&gt;We have 1 primary and 2 secondary replicas--secondary1 and sec2.&lt;/p&gt;&#10;&lt;p&gt;I have to do failover from primary to secondary1. I know some data loss will happen as it is a forced failover.&lt;/p&gt;</description></item><item><title>Customizing SSRS Sender Address</title><link>https://am2.co/2017/02/custom-ssrs-sender-address/</link><pubDate>Mon, 06 Feb 2017 20:19:43 -0500</pubDate><guid>https://am2.co/2017/02/custom-ssrs-sender-address/</guid><description>&lt;p&gt;In SQL Server Reporting Services (SSRS), you can configure the sender address for email subscriptions at the instance level. This means that every email sent from your SSRS server will come from the same address. (On each subscription, you can optionally supply a Reply-To address, which allows users to reply to the email directly, and respond to the right person&amp;hellip;but that&amp;rsquo;s not why we&amp;rsquo;re here.)&lt;/p&gt;</description></item><item><title>Keyboard shortcut to close a query tab in SSMS</title><link>https://am2.co/2017/01/close-ssms-tab/</link><pubDate>Fri, 27 Jan 2017 08:00:22 -0500</pubDate><guid>https://am2.co/2017/01/close-ssms-tab/</guid><description>&lt;h2 id="shortcuts--tips-from-an-impatient-dba"&gt;Shortcuts &amp;amp; tips from an Impatient DBA&lt;/h2&gt;&#10;&lt;p&gt;This series of short posts will demonstrate some lesser-known features, keyboard shortcuts, and other tips that make my day as a DBA more productive. None of these are groundbreaking super-secret features–they are the little things that I do as part of my daily work that make me more efficient.&lt;/p&gt;</description></item><item><title>SQL Agent Job Logs - Can't get the Error Log</title><link>https://am2.co/2017/01/sql-agent-job-logs-cant-get-the-error-log/</link><pubDate>Wed, 25 Jan 2017 09:59:18 -0500</pubDate><guid>https://am2.co/2017/01/sql-agent-job-logs-cant-get-the-error-log/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/177204/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've some logs that I want to extract to a report in order to get the SQL_Agent_Jobs status that runs during the night. If the Job fails then I want to receive the Error Log in a table. I am trying to get that information with this query:&lt;/p&gt;</description></item><item><title>Building a Twitter-bot RSS Aggregator</title><link>https://am2.co/2017/01/building-twitter-bot-rss-aggregator/</link><pubDate>Wed, 11 Jan 2017 23:13:34 -0500</pubDate><guid>https://am2.co/2017/01/building-twitter-bot-rss-aggregator/</guid><description>&lt;h2 id="i-hate-rssreaders"&gt;I hate RSS readers&lt;/h2&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;&lt;li&gt;Dig through reviews to find an app that I think I will love.&lt;/li&gt;&#10;&lt;li&gt;Come up with a list of blogs that I like to read.&lt;/li&gt;&#10;&lt;li&gt;Install and configure RSS reader app.&lt;/li&gt;&#10;&lt;li&gt;Spend the night reading blog posts.&lt;/li&gt;&#10;&lt;li&gt;Use app for a week.&lt;/li&gt;&#10;&lt;li&gt;Never open RSS reader app again.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;Well, it&amp;rsquo;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.&lt;/p&gt;</description></item><item><title>Nonclustered index storage on clustered columnstore</title><link>https://am2.co/2017/01/nonclustered-index-storage-on-clustered-columnstore/</link><pubDate>Fri, 06 Jan 2017 11:47:02 -0500</pubDate><guid>https://am2.co/2017/01/nonclustered-index-storage-on-clustered-columnstore/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/160158/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 SQL Server, a non-unique nonclustered index on a rowstore table incorporates the base object&amp;rsquo;s &lt;em&gt;bookmark&lt;/em&gt; (RID or clustering key) at all levels of the nonclustered index structure. The bookmark is stored as part of the nonclustered index &lt;em&gt;key&lt;/em&gt; at all index levels.&lt;/p&gt;</description></item><item><title>Cannot restore azure database to local due to missing master key</title><link>https://am2.co/2017/01/cannot-restore-azure-database-to-local-due-to-missing-master-key/</link><pubDate>Wed, 04 Jan 2017 09:26:09 -0500</pubDate><guid>https://am2.co/2017/01/cannot-restore-azure-database-to-local-due-to-missing-master-key/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/160007/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 create a bacpac from azure and restore to my local on-prem server. However, it throws an error like “Please create a master key in the database or open the master key in the session before performing this operation”. The reason is one of the column in the table is encrypted. I don’t know how to restore the database from azure with master key and certificate etc. Do you know what I could do?&lt;/p&gt;</description></item><item><title>How often to update SQL Server?</title><link>https://am2.co/2017/01/how-often-to-update-sql-server/</link><pubDate>Mon, 02 Jan 2017 19:10:39 -0500</pubDate><guid>https://am2.co/2017/01/how-often-to-update-sql-server/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/159754/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 am a new DBA at a company that has never had a DBA before me. SQL Servers are never upgraded unless it is part of a Windows Update on the server. Service Packs (or CUs) are never installed. We have a mix of versions from 2000 to 2014.&lt;/p&gt;</description></item></channel></rss>