<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>2016 on Andy M Mallon - AM²</title><link>https://am2.co/2016/</link><description>Recent content in 2016 on Andy M Mallon - AM²</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Sat, 31 Dec 2016 11:59:00 -0500</lastBuildDate><atom:link href="https://am2.co/2016/index.xml" rel="self" type="application/rss+xml"/><item><title>Community Influencer of the Year</title><link>https://am2.co/2016/12/community-influencer-2016/</link><pubDate>Sat, 31 Dec 2016 11:59:00 -0500</pubDate><guid>https://am2.co/2016/12/community-influencer-2016/</guid><description>&lt;p&gt;Last night, I was sitting at home with my husband, when I got an ominous message from Aaron Bertrand (&lt;a href="https://blogs.sentryone.com/aaronbertrand" target="_blank" rel="noopener noreferrer"&gt;blog&lt;/a&gt;):&lt;/p&gt;&#10;&lt;blockquote&gt;You up? I'm about to blog about you. You've been warned.&#10;~ Aaron Bertrand&lt;/blockquote&gt;&#10;Uhhh.... OK? It was 10:30 on a Friday night. I was pretty sure Aaron was still on vacation with his wife. Why would Aaron be blogging *__about__* me? And why was it so important that he would be publishing a blog post while he's on vacation? If it's that important, shouldn't I know about it? Well, it must be important because he had just sent me a message to warn me. I did what any level-headed, rational person would do: I brought up Aaron's blog and hit F5 every five seconds until &lt;a href="https://blogs.sentryone.com/aaronbertrand/2016-community-influencer/" target="_blank" rel="noopener noreferrer"&gt;the post went live&lt;/a&gt;.&#10;## 2016 Community Influencer of the Year&#10;&lt;figure class="wp-caption alignleft" style="max-width:300px"&gt;&lt;a href="https://am2.co/wp-content/uploads/CIY16-24.png"&gt;&lt;img class="wp-image-920 size-medium" src="https://am2.co/wp-content/uploads/CIY16-24-300x300.png" width="300" height="300" alt="Community Influencer of the Year badge made for Andy Mallon."&gt;&lt;/a&gt; I hounded Aaron for a cool badge, and he finally made one for me.&lt;/figure&gt;&#10;&lt;p&gt;Whoa! &lt;a href="https://blogs.sentryone.com/aaronbertrand/2016-community-influencer/"&gt;Aaron&amp;rsquo;s post&lt;/a&gt; named me as his first Community Influencer of the Year. It&amp;rsquo;s a funny feeling to be the first recipient of an award. Not only was I surprised that I was in the running, I was surprised that &lt;em&gt;&lt;strong&gt;anyone&lt;/strong&gt;&lt;/em&gt; was in the running.&lt;/p&gt;</description></item><item><title>Does the 'reads' column in SQL Profiler mean the same as IOPS?</title><link>https://am2.co/2016/12/does-the-reads-column-in-sql-profiler-mean-the-same-as-iops/</link><pubDate>Wed, 21 Dec 2016 11:25:14 -0500</pubDate><guid>https://am2.co/2016/12/does-the-reads-column-in-sql-profiler-mean-the-same-as-iops/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/158797/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 executed a query that went pretty fast and the SQL Profiler said it used 30.000 reads.&#10;Now I'm looking at this page: &lt;a href="https://cloud.google.com/compute/docs/disks/performance" rel="nofollow noreferrer"&gt;https://cloud.google.com/compute/docs/disks/performance&lt;/a&gt; and see that a standard persistent disk has 3000 reads IOPS.&lt;/p&gt;&#10;&lt;p&gt;Does that mean that my query would take 10 seconds when run there? Or does &lt;code&gt;SQL reads&lt;/code&gt; and &lt;code&gt;read IOPS&lt;/code&gt; mean a totally different thing?&lt;/p&gt;</description></item><item><title>What is the MySQL equivalent of SQL Server 2016 Always Encrypted technology?</title><link>https://am2.co/2016/12/what-is-the-mysql-equivalent-of-sql-server-2016-always-encrypted-technology/</link><pubDate>Tue, 20 Dec 2016 18:04:46 -0500</pubDate><guid>https://am2.co/2016/12/what-is-the-mysql-equivalent-of-sql-server-2016-always-encrypted-technology/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/158725/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 MySQL equivalent of SQL Server 2016 Always Encrypted technology or is there anything similar in MySQL that can act as AE?&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/158725/52344" rel="noopener" target="_blank"&gt;2016-12-20&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/113328" rel="noopener" target="_blank"&gt;dwkd&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;The Always Encrypted feature provides end-to-end encryption, which encrypts data both in-flight, and at rest. Data is encrypted &amp;amp; decrypted on the client at the driver. Data is encrypted everywhere except for on he client machine. This is one step beyond encryption at rest (which is handled in SQL Server by Transparent Data Encryption).&lt;/p&gt;</description></item><item><title>TSQL Tuesday #85: Backup + Recovery + ☁️</title><link>https://am2.co/2016/12/tsql-tuesday-85-backup-recovery/</link><pubDate>Tue, 13 Dec 2016 22:11:48 -0500</pubDate><guid>https://am2.co/2016/12/tsql-tuesday-85-backup-recovery/</guid><description>&lt;blockquote&gt;It’s T-SQL Tuesday,  the blog party that SQL Server expert &lt;strong&gt;Adam Machanic&lt;/strong&gt; (&lt;a href="http://dataeducation.com/blog/" target="_blank" rel="noopener"&gt;blog&lt;/a&gt;) started. This month’s episode is hosted by &lt;strong&gt;Kenneth Fisher&lt;/strong&gt; (&lt;a href="https://sqlstudies.com/" target="_blank" rel="noopener"&gt;blog&lt;/a&gt;). The topic: &lt;strong&gt;&lt;a href="https://sqlstudies.com/2016/12/06/4169/" target="_blank" rel="noopener"&gt;Backup &amp;amp; Recovery&lt;/a&gt;&lt;/strong&gt;&lt;/blockquote&gt;&#10;&lt;h2 id="your-backups-are-my-bread--butter"&gt;Your backups are my bread &amp;amp; butter&lt;/h2&gt;&#10;&lt;p&gt;Backup &amp;amp; recovery are a DBA&amp;rsquo;s &lt;a href="https://en.wikipedia.org/wiki/Glossary_of_baseball_(B)#bread_and_butter" target="_blank" rel="noopener"&gt;bread &amp;amp; butter&lt;/a&gt;. I always tell people that if you can&amp;rsquo;t restore from backup in an emergency, you should at least make sure your resume is up to date&amp;ndash;you&amp;rsquo;ll need it. Part of my approach to making sure I have foolproof backups is making sure my setup is scripted and fool-proof to configure. Traditionally, this has been as simple as some T-SQL scripts that create the &lt;a href="https://ola.hallengren.com/sql-server-backup.html"&gt;backup stored procedure&lt;/a&gt;, and create a few SQL Agent jobs.&lt;/p&gt;</description></item><item><title>How to add 1100 columns in SQL Server</title><link>https://am2.co/2016/12/how-to-add-1100-columns-in-sql-server/</link><pubDate>Sun, 04 Dec 2016 06:49:07 -0500</pubDate><guid>https://am2.co/2016/12/how-to-add-1100-columns-in-sql-server/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/157115/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 1100 columns in a single table.I already have 928 columns in same table, now I need to add new 150 columns.&lt;/p&gt;&#10;&lt;p&gt;I know SQL Server allow maximum 1024 columns.&lt;/p&gt;&#10;&lt;p&gt;Now I will not create new table. If I create new table and join my require table, I need to make changes in many places and this is not possible for me. So I want to add all columns in same table(require table).I know this is so tough to execute this table but presently I need to serve this requirement.&lt;/p&gt;</description></item><item><title>December SQLSaturdays--DC &amp; Providence, RI</title><link>https://am2.co/2016/11/december-sqlsaturdays-2016/</link><pubDate>Fri, 04 Nov 2016 13:08:19 -0400</pubDate><guid>https://am2.co/2016/11/december-sqlsaturdays-2016/</guid><description>&lt;p&gt;Next month, I&amp;rsquo;ll be speaking at two SQLSaturday events.&lt;/p&gt;&#10;&lt;h2&gt;Washington, DC - &lt;a href="https://twitter.com/hashtag/sqlsatdc?f=tweets&amp;amp;vertical=default&amp;amp;src=hash" target="_blank" rel="noopener noreferrer"&gt;#SqlSat574&lt;/a&gt; - December 3, 2016&lt;/h2&gt;&#10;&lt;p&gt;The DC SQL Saturday was the first SQL Saturday I spoke at&amp;ndash;so this one will always be a special event for me. Hopefully, I&amp;rsquo;ll be able to speak at this event every year.&lt;/p&gt;</description></item><item><title>T-SQL Tuesday #83: Roundup</title><link>https://am2.co/2016/10/t-sql-tuesday-83-roundup/</link><pubDate>Sun, 16 Oct 2016 20:49:50 -0400</pubDate><guid>https://am2.co/2016/10/t-sql-tuesday-83-roundup/</guid><description>&lt;p&gt;For this month&amp;rsquo;s T-SQL Tuesday, I asked people to blog about &lt;a href="https://am2.co/2016/10/04/t-sql-tuesday-83/"&gt;the same old problems we&amp;rsquo;ve been dealing with for years&lt;/a&gt;. There were some great posts, including a batch of first-time contributors. You&amp;rsquo;ll notice some overlapping themes as you read through these responses&amp;ndash;I think those themes represent some of the biggest, most important problems we have (like being able to restore backups). Thanks for everyone who contributed this month!&lt;/p&gt;</description></item><item><title>(Unofficial) PASS Summit 2016 LGBT Meetup</title><link>https://am2.co/2016/10/summit-2016-lgbt-meetup/</link><pubDate>Wed, 12 Oct 2016 09:00:51 -0400</pubDate><guid>https://am2.co/2016/10/summit-2016-lgbt-meetup/</guid><description>&lt;p&gt;PASS Summit has tons of opportunities to meet like-minded folks, in addition to seeing old friends. There are the &lt;a href="https://web.archive.org/web/20170115121454/http://www.sqlpass.org/summit/2016/Connect/Luncheons.aspx" target="_blank" rel="noopener noreferrer"&gt;Women In Tech and Birds of a Feather Luncheons&lt;/a&gt;. There is the Community Zone. Friends catch up over coffee and meals. There are vendor parties. There is &lt;a href="https://www.eventbrite.com/e/pass-summit-sql-karaoke-2016-tickets-26467678539" target="_blank" rel="noopener noreferrer"&gt;SQL Karaoke&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>We’re still dealing with the same problems</title><link>https://am2.co/2016/10/the-same-problems/</link><pubDate>Sat, 08 Oct 2016 16:03:29 -0400</pubDate><guid>https://am2.co/2016/10/the-same-problems/</guid><description>&lt;p&gt;Back in August, Allan Hirt (&lt;a href="http://sqlha.com/author/allanhirt/" target="_blank"&gt;blog&lt;/a&gt;) tweeted:&lt;/p&gt;&#10;&lt;div class="tweet-card" role="group" aria-label="Archived tweet by Allan Hirt"&gt;&#10; &lt;div class="tweet-card__header"&gt;&lt;img class="tweet-card__avatar" src="https://am2.co/images/tweet-profiles/allan-hirt.jpg" alt="" aria-hidden="true" loading="lazy"&gt;&#10; &lt;div class="tweet-card__identity"&gt;&lt;strong&gt;Allan Hirt&lt;/strong&gt;&lt;span&gt;@SQLHA&lt;/span&gt;&lt;/div&gt;&#10; &lt;div class="tweet-card__brand" aria-label="Twitter"&gt;&#10; &lt;svg class="tweet-card__bird" width="18" height="18" viewBox="0 0 24 24" aria-hidden="true"&gt;&lt;path d="M23.95 4.57a9.8 9.8 0 0 1-2.82.77 4.93 4.93 0 0 0 2.16-2.72 9.86 9.86 0 0 1-3.12 1.19 4.92 4.92 0 0 0-8.39 4.48A13.98 13.98 0 0 1 1.64 3.16a4.92 4.92 0 0 0 1.52 6.57 4.9 4.9 0 0 1-2.23-.62v.06a4.93 4.93 0 0 0 3.95 4.83 4.93 4.93 0 0 1-2.22.08 4.93 4.93 0 0 0 4.6 3.42A9.88 9.88 0 0 1 0 19.54a13.94 13.94 0 0 0 7.55 2.21c9.05 0 14-7.5 14-14v-.64a10 10 0 0 0 2.46-2.54z"/&gt;&lt;/svg&gt;&#10; &lt;span&gt;twitter&lt;/span&gt;&#10; &lt;/div&gt;&#10; &lt;/div&gt;&lt;div class="tweet-card__text"&gt;In the roughly 25 years of I have been in IT, we&amp;rsquo;re still dealing with the same problems.&lt;/div&gt;&#10; &lt;div class="tweet-card__footer"&gt;&lt;time datetime="2016-08-30T18:23:55Z"&gt;6:23 PM · Aug 30, 2016&lt;/time&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;I had a slow day, so I generated a storm of responses. &lt;a href="https://am2.co/2016/10/04/t-sql-tuesday-83/"&gt;This month&amp;rsquo;s T-SQL Tuesday&lt;/a&gt; is inspired by this tweet. Here&amp;rsquo;s my list of problems:&lt;/p&gt;</description></item><item><title>T-SQL Tuesday #83: We're still dealing with the same problems</title><link>https://am2.co/2016/10/t-sql-tuesday-83/</link><pubDate>Tue, 04 Oct 2016 09:00:37 -0400</pubDate><guid>https://am2.co/2016/10/t-sql-tuesday-83/</guid><description>&lt;h2 id="what-is-t-sql-tuesday"&gt;What is T-SQL Tuesday?&lt;/h2&gt;&#10;&lt;p&gt;T-SQL Tuesday is a monthly blog party hosted by a different blogger each month. This blog party was started by Adam Machanic (&lt;a href="http://dataeducation.com/blog/" target="_blank" rel="noopener"&gt;blog&lt;/a&gt;). You can take part by posting your own participating post that fits the topic of the month and follows the requirements below. Additionally, if you are interested in hosting a future T-SQL Tuesday, contact Adam Machanic on his blog.&lt;/p&gt;</description></item><item><title>Plan Explorer 3.0: More power and completely free</title><link>https://am2.co/2016/09/plan-explorer-3-0/</link><pubDate>Thu, 08 Sep 2016 11:00:04 -0400</pubDate><guid>https://am2.co/2016/09/plan-explorer-3-0/</guid><description>&lt;p&gt;Today, SQL Sentry &lt;a href="http://blogs.sqlsentry.com/greggonzalez/plan-explorer-pro-goes-free/" target="_blank"&gt;announced the release of Plan Explorer 3.0&lt;/a&gt;. There are a few big changes, so let&amp;rsquo;s dive right in.&lt;/p&gt;&#10;&lt;p&gt; &lt;/p&gt;&#10;&lt;h2 id="plan-explorer-just-got-free-er"&gt;Plan Explorer just got free-er&lt;/h2&gt;&#10;&lt;p&gt;Up until now, Plan Explorer was essentially a freemium product. There was the free edition (which was really awesome), or you could upgrade to Pro edition for some extra features (making it awesomer). With this release, everything is now included in a single edition, and it&amp;rsquo;s &lt;strong&gt;all 100% free&lt;/strong&gt;. Any feature that used to be Pro-only is now free. Multiple tabs, session history, opening deadlock files&amp;ndash;free, free, free. Any new features? You guessed it&amp;ndash;free.&lt;/p&gt;</description></item><item><title>AlwaysON Migrate from 2014 to 2016</title><link>https://am2.co/2016/09/alwayson-migrate-from-2014-to-2016/</link><pubDate>Thu, 01 Sep 2016 19:19:24 -0400</pubDate><guid>https://am2.co/2016/09/alwayson-migrate-from-2014-to-2016/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/148594/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 like 20 Listners on 2014 with approx 500 DBS, &lt;/p&gt;&#10;&lt;p&gt;what is the best way to migrate these with least downtime, effort&lt;/p&gt;&#10;&lt;p&gt;My idea is:&#10; Stop access&#10; Backup dbs&#10; Start restore dbs&#10; While restore is running:&#10; Drop AOG on 2014&#10; Create it on 2016&#10; Done&lt;/p&gt;</description></item><item><title>Podcast: Mirroring, Availability Groups, Replication, and Log shipping</title><link>https://am2.co/2016/08/podcast-mirroring-availability-groups-replication-log-shipping/</link><pubDate>Wed, 31 Aug 2016 09:29:03 -0400</pubDate><guid>https://am2.co/2016/08/podcast-mirroring-availability-groups-replication-log-shipping/</guid><description>&lt;p&gt;Have you ever wondered what the best option is for making your data available in your environment? I was asked by Carlos L Chacon (&lt;a href="http://sqldatapartners.com/author/carlosjr/" target="_blank"&gt;blog&lt;/a&gt;) to be part of a panel on his podcast for an episode discussing some of the options&amp;ndash;availability groups, mirroring, log shipping, and replication. We cover each topic in detail and explain the positives and negatives of each one.&lt;/p&gt;</description></item><item><title>Is it possible to change the family_guid in MSSQL?</title><link>https://am2.co/2016/08/is-it-possible-to-change-the-family_guid-in-mssql/</link><pubDate>Wed, 24 Aug 2016 19:17:43 -0400</pubDate><guid>https://am2.co/2016/08/is-it-possible-to-change-the-family_guid-in-mssql/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/147801/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;So I have a bit of a problem with some databases I'm trying to migrate to amazon RDS&lt;/p&gt;&#10;&lt;p&gt;We have about 20 Databases that are all derivatives of others that all share the same &lt;code&gt;family_guid&lt;/code&gt; because they are based on backups of others. The problem is that amazon will not allow you to restore a DB that has the same &lt;code&gt;family_guid&lt;/code&gt; of another even if they are two separate databases. This is where my question comes in, Is it possible to change the guid or am I out of luck and will need to do some exports/imports on these databases.&lt;/p&gt;</description></item><item><title>SQL Server 2014 slow insert</title><link>https://am2.co/2016/08/sql-server-2014-slow-insert/</link><pubDate>Wed, 24 Aug 2016 16:21:43 -0400</pubDate><guid>https://am2.co/2016/08/sql-server-2014-slow-insert/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/147774/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 very strange slow insert issue, here I am providing the table structure, and the insert statement used.&lt;/p&gt;&#10;&lt;p&gt;The database is clean, contains no other tables, no indices, no constraints, no triggers.&lt;/p&gt;&#10;&lt;p&gt;I tested this on two different machines, with high speed SSD drives, 8 cores 3.5 GHz processors. The server can read IO up to 700MB/s and can write up to 300MB/s&lt;/p&gt;</description></item><item><title>Why is this explicit cast causing problems only with a Linked Server?</title><link>https://am2.co/2016/08/why-is-this-explicit-cast-causing-problems-only-with-a-linked-server/</link><pubDate>Wed, 17 Aug 2016 07:42:23 -0400</pubDate><guid>https://am2.co/2016/08/why-is-this-explicit-cast-causing-problems-only-with-a-linked-server/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/147039/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 querying data from a linked server through a view on the origin server.&#10;The view has to include a couple of standardized columns, such as &lt;code&gt;Created&lt;/code&gt;, &lt;code&gt;Modified&lt;/code&gt; and &lt;code&gt;Deleted&lt;/code&gt;, but in this case the table on the source server doesn't have any suitable info. The columns are therefore explicitly cast to their respective types. I updated the view, changing a column from &lt;/p&gt;</description></item><item><title>Does it ever make sense to have a clustered and non clustered index for the same column</title><link>https://am2.co/2016/08/does-it-ever-make-sense-to-have-a-clustered-and-non-clustered-index-for-the-same-column/</link><pubDate>Tue, 16 Aug 2016 22:08:55 -0400</pubDate><guid>https://am2.co/2016/08/does-it-ever-make-sense-to-have-a-clustered-and-non-clustered-index-for-the-same-column/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/147011/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 it ever make sense to have a clustered and non clustered index for the same column&lt;/p&gt;&#10;&lt;p&gt;I inherited a database and a web service that goes with it.&lt;/p&gt;&#10;&lt;p&gt;Looking at the indexes for duplicates I see an two indexes that point at the same column (1 column and sorted the same way). One is clustered and one is not, that is the only difference I see.&lt;/p&gt;</description></item><item><title>I have 3 tables with dates to which I want to join to a date dimension table but it is returning many duplicates with left joins</title><link>https://am2.co/2016/08/i-have-3-tables-with-dates-to-which-i-want-to-join-to-a-date-dimension-table-but-it-is-returning-many-duplicates-with-left-joins/</link><pubDate>Tue, 16 Aug 2016 11:55:03 -0400</pubDate><guid>https://am2.co/2016/08/i-have-3-tables-with-dates-to-which-i-want-to-join-to-a-date-dimension-table-but-it-is-returning-many-duplicates-with-left-joins/</guid><description>&lt;p&gt;&lt;a href="https://stackoverflow.com/q/38665777/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 have 4 tables with dates to which I want to join to a date dimension table but it is returning many duplicates with left joins.&lt;/p&gt;&#10;&lt;p&gt;Tables are basically a date field which I want to count.&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="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;mdate&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;mordate&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="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="n"&gt;fteam&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="mi"&gt;20&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="n"&gt;sdate&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;fteam&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="mi"&gt;20&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="n"&gt;bdate&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;fteam&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="mi"&gt;20&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;These are actually one table with the separate dates which I am joining 3 times to the dimension table to get one dataset. Also this table&lt;/p&gt;</description></item><item><title>PowerShell can't see network locations after SQLPS module is loaded</title><link>https://am2.co/2016/08/powershell-cant-see-network-locations-after-sqlps-module-is-loaded/</link><pubDate>Mon, 15 Aug 2016 11:38:16 -0400</pubDate><guid>https://am2.co/2016/08/powershell-cant-see-network-locations-after-sqlps-module-is-loaded/</guid><description>&lt;p&gt;&lt;a href="https://superuser.com/q/1113679/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;m trying to automate a script that backups a database in one environment, copies it to the other, then restores it there. But there&amp;rsquo;s some strange behavior going on.&lt;/p&gt;&#10;&lt;p&gt;First, I try to access a network location. Works like a bliss:&lt;/p&gt;</description></item><item><title>Why is sql_text "select @@trancount" in open but sleeping transaction?</title><link>https://am2.co/2016/08/why-is-sql_text-select-trancount-in-open-but-sleeping-transaction/</link><pubDate>Fri, 12 Aug 2016 17:37:19 -0400</pubDate><guid>https://am2.co/2016/08/why-is-sql_text-select-trancount-in-open-but-sleeping-transaction/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/146654/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;Using SQL Server Management Studio, open a query window and execute&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;BEGIN&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;TRAN&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In another window execute&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;select&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;text&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;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sysprocesses&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;cross&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;apply&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dm_exec_sql_text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sql_handle&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;where&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;status&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;sleeping&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="k"&gt;and&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;open_tran&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="mi"&gt;1&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I see &lt;code&gt;select @@trancount&lt;/code&gt;&lt;/p&gt;&#10;&lt;p&gt;What's up with this? Who's counting transactions? Is this a Management Studio thing?&lt;/p&gt;</description></item><item><title>What is the benefit of having multiple databases in the same Availability Group vs single AG per database</title><link>https://am2.co/2016/08/what-is-the-benefit-of-having-multiple-databases-in-the-same-availability-group-vs-single-ag-per-database/</link><pubDate>Mon, 08 Aug 2016 06:11:50 -0400</pubDate><guid>https://am2.co/2016/08/what-is-the-benefit-of-having-multiple-databases-in-the-same-availability-group-vs-single-ag-per-database/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/146226/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 planning a migration from current mirroring architecture to Availability Groups for several databases. For every Database we have defined the primary/secondary replica configuration. &lt;/p&gt;&#10;&lt;p&gt;The question that I'm unsure is: do we need to group the databases with the same primary/secondary configuration into the same AG, or use one AG per Database. What are pros&amp;amp;cons of having individual AGs vs AG with multiple databases? Is there a best practice to determine if a database needs its own AG or can be combined with others? Any performance or failover advantages?&lt;/p&gt;</description></item><item><title>Will a SELECT . . . INTO use short-circuit evaluation for a COALESCE?</title><link>https://am2.co/2016/08/will-a-select-into-use-short-circuit-evaluation-for-a-coalesce/</link><pubDate>Tue, 02 Aug 2016 14:45:55 -0400</pubDate><guid>https://am2.co/2016/08/will-a-select-into-use-short-circuit-evaluation-for-a-coalesce/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/145644/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 building a stored proc that can take in two separate values that each can be used to identify a single record. One of these values may be null.&lt;/p&gt;&#10;&lt;p&gt;My logic is as follows: if &lt;code&gt;IN_ORDER_ID&lt;/code&gt; is not NULL, save it to &lt;code&gt;V_ORDER_ID&lt;/code&gt;. If it is NULL, then retrieve &lt;code&gt;ORDER_ID&lt;/code&gt; with a query and save that to &lt;code&gt;V_ORDER_ID&lt;/code&gt;. &lt;code&gt;V_ORDER_ID&lt;/code&gt; is then used in the rest of the procedure.&lt;/p&gt;</description></item><item><title>Job hunting for database professionals</title><link>https://am2.co/2016/07/job-hunting-database-professionals/</link><pubDate>Tue, 19 Jul 2016 10:00:44 -0400</pubDate><guid>https://am2.co/2016/07/job-hunting-database-professionals/</guid><description>&lt;p&gt;Like most people, I&amp;rsquo;ve changed jobs a few times in my life. My path from teenage grocery store cashier to Database Architect was a complicated and multi-step journey. During that journey, I&amp;rsquo;ve made some good decisions, and some bad decisions. If you&amp;rsquo;re like most tech folks, you&amp;rsquo;ve probably had a similar experience.&lt;/p&gt;</description></item><item><title>Benefits tell you a lot about a company</title><link>https://am2.co/2016/07/benefits-say-a-lot/</link><pubDate>Mon, 11 Jul 2016 10:00:58 -0400</pubDate><guid>https://am2.co/2016/07/benefits-say-a-lot/</guid><description>&lt;p&gt;When you&amp;rsquo;re interviewing with a new company, pay attention to their benefits. Even the ones that aren&amp;rsquo;t important to you personally.&lt;/p&gt;&#10;&lt;p&gt;Benefits don&amp;rsquo;t just include health/dental/vision insurance and retirement/pension (I&amp;rsquo;ll call these &amp;ldquo;core benefits&amp;rdquo;). It includes life insurance, disability, maternity leave, vacation, sick time, as well as &amp;ldquo;perks&amp;rdquo; like free snacks in the lunch room, paying your cell phone bill, or &lt;a href="https://www.brentozar.com/archive/2016/03/2016-company-retreat-photos/" target="_blank"&gt;a company retreat to Napa&lt;/a&gt;. Every one of these are important considerations.&lt;/p&gt;</description></item><item><title>Job hunting is like dating</title><link>https://am2.co/2016/07/job-hunting-like-dating/</link><pubDate>Mon, 11 Jul 2016 10:00:15 -0400</pubDate><guid>https://am2.co/2016/07/job-hunting-like-dating/</guid><description>&lt;p&gt;Most of us spend at least eight hours per day working. In America, &lt;a href="https://project.wnyc.org/commute-times-us/embed.html#5.00/42.000/-89.500" target="_blank"&gt;we spend an average of 25 minutes commuting&lt;/a&gt;, each way. That&amp;rsquo;s nine hours dedicated to work every day. You probably see your coworkers as much as you see your friends and significant other. That&amp;rsquo;s why finding the right fit is important.&lt;/p&gt;</description></item><item><title>Moving SSRS Reports between servers</title><link>https://am2.co/2016/06/moving-ssrs-reports-servers/</link><pubDate>Wed, 29 Jun 2016 12:30:42 -0400</pubDate><guid>https://am2.co/2016/06/moving-ssrs-reports-servers/</guid><description>&lt;p&gt;Today, my friend Derik Hammer (&lt;a href="http://www.sqlhammer.com" target="_blank"&gt;blog&lt;/a&gt;) asked about moving SSRS reports between (versions and) instances of SSRS:&lt;/p&gt;&#10;&lt;div class="tweet-card" role="group" aria-label="Archived tweet by Derik Hammer"&gt;&#10; &lt;div class="tweet-card__header"&gt;&lt;img class="tweet-card__avatar" src="https://am2.co/images/tweet-profiles/derik-hammer.png" alt="" aria-hidden="true" loading="lazy"&gt;&#10; &lt;div class="tweet-card__identity"&gt;&lt;strong&gt;Derik Hammer&lt;/strong&gt;&lt;span&gt;@SQLHammer&lt;/span&gt;&lt;/div&gt;&#10; &lt;div class="tweet-card__brand" aria-label="Twitter"&gt;&#10; &lt;svg class="tweet-card__bird" width="18" height="18" viewBox="0 0 24 24" aria-hidden="true"&gt;&lt;path d="M23.95 4.57a9.8 9.8 0 0 1-2.82.77 4.93 4.93 0 0 0 2.16-2.72 9.86 9.86 0 0 1-3.12 1.19 4.92 4.92 0 0 0-8.39 4.48A13.98 13.98 0 0 1 1.64 3.16a4.92 4.92 0 0 0 1.52 6.57 4.9 4.9 0 0 1-2.23-.62v.06a4.93 4.93 0 0 0 3.95 4.83 4.93 4.93 0 0 1-2.22.08 4.93 4.93 0 0 0 4.6 3.42A9.88 9.88 0 0 1 0 19.54a13.94 13.94 0 0 0 7.55 2.21c9.05 0 14-7.5 14-14v-.64a10 10 0 0 0 2.46-2.54z"/&gt;&lt;/svg&gt;&#10; &lt;span&gt;twitter&lt;/span&gt;&#10; &lt;/div&gt;&#10; &lt;/div&gt;&lt;div class="tweet-card__text"&gt;What is the best way to move 2008 R2 SSRS reports into an existing 2012 SSRS instance? Catalog move is insufficient here. #sqlhelp&lt;/div&gt;&#10; &lt;div class="tweet-card__footer"&gt;&lt;time datetime="2016-06-29T14:47:59Z"&gt;2:47 PM · Jun 29, 2016&lt;/time&gt;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&#10;&lt;p&gt;This reminded me of a PowerShell script I wrote a few years back, so I&amp;rsquo;m dusting it off for this blog post. I&amp;rsquo;m far from a PowerShell Pro, but I think this will be helpful to other people&lt;/p&gt;</description></item><item><title>T-SQL Tuesday #79 - COMPRESS()ing LOB data</title><link>https://am2.co/2016/06/t-sql-tuesday-79/</link><pubDate>Tue, 14 Jun 2016 09:00:25 -0400</pubDate><guid>https://am2.co/2016/06/t-sql-tuesday-79/</guid><description>&lt;blockquote&gt;It’s T-SQL Tuesday,  the blog party that SQL Server expert &lt;strong&gt;Adam Machanic&lt;/strong&gt; (&lt;a href="http://dataeducation.com/blog/" target="_blank" rel="noopener"&gt;blog&lt;/a&gt;) started. This month’s episode is hosted by &lt;strong&gt;Michael J Swart&lt;/strong&gt; (&lt;a href="http://michaeljswart.com/" target="_blank" rel="noopener"&gt;blog&lt;/a&gt;). The topic: &lt;strong&gt;&lt;a href="http://michaeljswart.com/2016/06/t-sql-tuesday-079-its-2016/" target="_blank" rel="noopener"&gt;SQL Server 2016 is out!&lt;/a&gt;&lt;/strong&gt;&lt;/blockquote&gt;&#10;SQL Server 2016 is hot off the presses, and Michael challenges us to blog about it.&#10;&lt;p&gt;I&amp;rsquo;ve been using SSMS 2016 (I&amp;rsquo;m impressed!), but I haven&amp;rsquo;t spent tons of time using the server-side bits. As I type this intro, the 2016 installer is chugging along getting a fresh instance ready for me to explore so I can write about&amp;hellip;&lt;/p&gt;</description></item><item><title>Add-Equals operator</title><link>https://am2.co/2016/05/add-equals-operator/</link><pubDate>Tue, 24 May 2016 10:00:19 -0400</pubDate><guid>https://am2.co/2016/05/add-equals-operator/</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>SSMS Template Replacement</title><link>https://am2.co/2016/05/shortcuts-tips-12/</link><pubDate>Thu, 19 May 2016 09:00:30 -0400</pubDate><guid>https://am2.co/2016/05/shortcuts-tips-12/</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>Microsoft sql server management studio (SSMS) shortcut for changing size of sql/result panes</title><link>https://am2.co/2016/05/microsoft-sql-server-management-studio-ssms-shortcut-for-changing-size-of-sql-result-panes/</link><pubDate>Mon, 16 May 2016 11:09:17 -0400</pubDate><guid>https://am2.co/2016/05/microsoft-sql-server-management-studio-ssms-shortcut-for-changing-size-of-sql-result-panes/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/138623/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 the good old days there was a shortcut &lt;code&gt;ctrl-B&lt;/code&gt; for changing the size of the Query &amp;amp; Result panes in the Query Analyzer sql editor. &lt;/p&gt;&#10;&lt;p&gt;In Query Analyzer, just press &lt;code&gt;ctrl-B&lt;/code&gt; and the screen splitter handle was in focus. Then repeatedly press up/down arrows until the size was right.&lt;/p&gt;</description></item><item><title>T-SQL Tuesday #78– sys.dm_db_file_space_usage</title><link>https://am2.co/2016/05/tsql-tuesday-78/</link><pubDate>Tue, 10 May 2016 10:00:59 -0400</pubDate><guid>https://am2.co/2016/05/tsql-tuesday-78/</guid><description>&lt;blockquote&gt;It’s T-SQL Tuesday,  the blog party that SQL Server expert &lt;strong&gt;Adam Machanic&lt;/strong&gt; (&lt;a href="http://dataeducation.com/blog/" target="_blank" rel="noopener"&gt;blog&lt;/a&gt;) started. This month’s episode is hosted by &lt;strong&gt;Wendy Pastrick&lt;/strong&gt; (&lt;a href="http://wendyverse.blogspot.com/" target="_blank" rel="noopener"&gt;blog&lt;/a&gt;). The topic: &lt;a href="http://wendyverse.blogspot.com/2016/04/its-time-for-t-sql-tuesday-78-may-2016.html" target="_blank" rel="noopener"&gt;&lt;strong&gt;Learn something new and blog about it&lt;/strong&gt;&lt;/a&gt;&lt;/blockquote&gt;&#10;SQL Server 2016 is coming out next month, and it's chock full of new features that I can learn. &lt;a href="https://msdn.microsoft.com/en-us/library/dn765131.aspx" target="_blank" rel="noopener"&gt;Row-level security&lt;/a&gt; is interesting. &lt;a href="https://msdn.microsoft.com/en-us/library/mt130841.aspx" target="_blank" rel="noopener"&gt;Dynamic data masking&lt;/a&gt; sounds fun.&#10;&lt;p&gt;If you&amp;rsquo;re a regular reader of my blog, you probably know I try to approach questions from a unique angle. Instead of blogging about something cutting edge or sexy, I decided to scroll through the list of system views until I found one I didn&amp;rsquo;t recognize.&lt;/p&gt;</description></item><item><title>My 5th DBAnniversary</title><link>https://am2.co/2016/05/my-5th-dbanniversary/</link><pubDate>Tue, 10 May 2016 09:00:43 -0400</pubDate><guid>https://am2.co/2016/05/my-5th-dbanniversary/</guid><description>&lt;p&gt;Five years ago today, I officially became a DBA:&lt;/p&gt;&#10;&lt;blockquote&gt;Good afternoon.  It is my pleasure to extend to you our &lt;span class="lG"&gt;offer&lt;/span&gt; of employment for the position of &lt;b&gt;Database Administrator&lt;/b&gt;&lt;/blockquote&gt;&#10;&lt;h2&gt;How I got there&lt;/h2&gt;&#10;I got my first job at a software company in 2003. I had no degree, I had no experience, and I had no idea what SQL Server was. The company was in start-up phase, and I was a warm body with low salary requirements and high ambition. It was a match made in heaven.&#10;&lt;p&gt;It didn&amp;rsquo;t take long before I was installing SQL Server 2000 on an NT4 server to test our application on that configuration. I learned how log shipping worked, and configured DR for our clients. I did a lot of DBA work, but I wasn&amp;rsquo;t a DBA.&lt;/p&gt;</description></item><item><title>How to shrink a database in 4 easy steps</title><link>https://am2.co/2016/04/shrink-database-4-easy-steps/</link><pubDate>Thu, 28 Apr 2016 11:00:22 -0400</pubDate><guid>https://am2.co/2016/04/shrink-database-4-easy-steps/</guid><description>&lt;p&gt;It&amp;rsquo;s a really common question: &amp;ldquo;How do I shrink my database?&amp;rdquo;&#10;Luckily, there&amp;rsquo;s also a really common answer: &amp;ldquo;Don&amp;rsquo;t.&amp;rdquo;&lt;/p&gt;&#10;&lt;h2 id="but-what-if-you-really-have-to"&gt;&amp;hellip;but what if you really have to?&lt;/h2&gt;&#10;&lt;p&gt;Perhaps you just implemented &lt;a href="https://am2.co/category/data-compression/"&gt;data compression&lt;/a&gt;, and have 60% free space in your database.&#10;Perhaps you just deleted a bunch of old data, and have significant free space in your database.&#10;There are a handful of scenarios where you have free space in the database, you&amp;rsquo;ll never use it, and you need to shrink. Just don&amp;rsquo;t make a habit of it.&lt;/p&gt;</description></item><item><title>CONVERT() to float using scientific notation</title><link>https://am2.co/2016/04/convert-float-using-scientific-notation/</link><pubDate>Wed, 20 Apr 2016 10:57:01 -0400</pubDate><guid>https://am2.co/2016/04/convert-float-using-scientific-notation/</guid><description>&lt;p&gt;Someone posted to &lt;code&gt;#sqlhelp&lt;/code&gt; on Twitter, asking the following: &amp;ldquo;Wondered if anyone could enlighten me as to why ISNUMERIC(&amp;lsquo;7d8&amp;rsquo;) returns 1?&amp;rdquo;&lt;/p&gt;&#10;&lt;p&gt;Sure enough, &lt;code&gt;SELECT ISNUMERIC('7d8')&lt;/code&gt; returns a 1.&lt;/p&gt;&#10;&lt;h2 id="wtf-d-isnt-numeric"&gt;WTF? d isn&amp;rsquo;t numeric!&lt;/h2&gt;&#10;&lt;p&gt;OK, sure, if you say &amp;ldquo;seven-dee-eight&amp;rdquo; out loud it &lt;em&gt;sounds&lt;/em&gt; like a number, but &amp;ldquo;d&amp;rdquo; is a letter, not a number.&lt;/p&gt;</description></item><item><title>How fast queries hurt performance</title><link>https://am2.co/2016/04/fast-queries-hurt/</link><pubDate>Fri, 15 Apr 2016 12:36:16 -0400</pubDate><guid>https://am2.co/2016/04/fast-queries-hurt/</guid><description>&lt;p&gt;This week at work, I noticed CPU on one server seemed pretty high. I wasn&amp;rsquo;t familiar with this particular server, but based on the applications it supported, I was expecting the server to be under-utilized. I went over to vCenter to look at historical CPU performance, and see if high CPU was normal. When I looked at 30-day CPU usage, what I saw was alarming:&lt;/p&gt;</description></item><item><title>T-SQL Tuesday #77– My favorite SQL Server feature</title><link>https://am2.co/2016/04/tsql-tuesday-77/</link><pubDate>Tue, 12 Apr 2016 22:51:47 -0400</pubDate><guid>https://am2.co/2016/04/tsql-tuesday-77/</guid><description>&lt;blockquote&gt;It’s T-SQL Tuesday,  the blog party that SQL Server expert &lt;strong&gt;Adam Machanic&lt;/strong&gt; (&lt;a href="http://dataeducation.com/blog/" target="_blank" rel="noopener"&gt;blog&lt;/a&gt;) started. This month’s episode is hosted by &lt;strong&gt;Jens Vestergaard&lt;/strong&gt; (&lt;a href="http://t-sql.dk/" target="_blank" rel="noopener"&gt;blog &lt;/a&gt;). The topic: &lt;a href="http://t-sql.dk/?p=1492" target="_blank" rel="noopener"&gt;&lt;strong&gt;Favorite SQL Server Feature&lt;/strong&gt;&lt;/a&gt;.&lt;/blockquote&gt;&#10;When I saw this topic, I was really excited. My mind started racing through all the awesome features in SQL Server. I spend a lot of time dealing with HA and DR--so many features to choose from...but are any of them my **favorite**? No, probably not. &lt;a href="https://www.mssqltips.com/sqlservertip/2445/sql-server-multi-server-administration/" target="_blank" rel="noopener"&gt;MSX&lt;/a&gt; and &lt;a href="https://msdn.microsoft.com/en-us/library/bb895144.aspx" target="_blank" rel="noopener"&gt;CMS&lt;/a&gt; have made my life so much easier, and they are incredibly cool, and I've not blogged about either of them...but...neither is my favorite.&#10;&lt;p&gt; &lt;/p&gt;</description></item><item><title>Users in SQL Server cluster</title><link>https://am2.co/2016/04/users-in-sql-server-cluster/</link><pubDate>Tue, 12 Apr 2016 12:17:30 -0400</pubDate><guid>https://am2.co/2016/04/users-in-sql-server-cluster/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/135057/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 2012 WFC and SQL Server 2014 is clustered on it. The cluster works as expected but have a question on Users:&lt;/p&gt;&#10;&lt;p&gt;I added a windows domain group to the cluster as sysadmin. &lt;/p&gt;&#10;&lt;p&gt;When the user tries to log into SQL on the active server the users rights are not right. They can’t see anything. If the same user logs in from the no active server they have full admin rights, if they log in from their local machine they have the proper sysadmin rights. &lt;/p&gt;</description></item><item><title>ReportServerTempDB in AlwaysOn Availability group</title><link>https://am2.co/2016/04/reportservertempdb-in-alwayson-availability-group/</link><pubDate>Mon, 11 Apr 2016 16:01:57 -0400</pubDate><guid>https://am2.co/2016/04/reportservertempdb-in-alwayson-availability-group/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/134983/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;ReportserverTempdb logfile is 6TB in size and growing and I need help. I am supporting a huge reporting server farm and the client wants reporting services to be in AlawysON Availability group(AAG) and we configured reportserver and reportserverTempDB on in three node Primary replica, synchronize Secondary replica and DR in a different location with manual synchronization.&#10;Microsoft recommends reportservertempdb to be in simple recovery mode but if you add it to AAG that is not an option. Does anyone has reportservertempdb in AAG?&#10;I would like to advise customer to take reporservertempDB out of AAG and we can just keep the copy of the reportservertempdb on each node and that should be fine.&#10;Please advise.&lt;/p&gt;</description></item><item><title>Exclude All Matching Rows</title><link>https://am2.co/2016/04/exclude-all-matching-rows/</link><pubDate>Fri, 08 Apr 2016 17:14:26 -0400</pubDate><guid>https://am2.co/2016/04/exclude-all-matching-rows/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/134791/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 table that has a unique ID, name, email, and some other fields. I want to match this table against another table on email, but sometimes emails are shared. The unique ID is not shared among tables, but I will input the ID into the other table when I have identified them. Name is not unique.&lt;/p&gt;</description></item><item><title>Convert row into concatenated string with column names included</title><link>https://am2.co/2016/04/convert-row-into-concatenated-string-with-column-names-included/</link><pubDate>Wed, 06 Apr 2016 15:53:55 -0400</pubDate><guid>https://am2.co/2016/04/convert-row-into-concatenated-string-with-column-names-included/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/134555/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 table that is several hundred columns wide. Is there a way to convert each row into a single concatenated string with the column title included without having to list each single column in the query? &lt;/p&gt;&#10;&lt;p&gt;I'm doing this because the columns represents fields in an event report. I'm putting them back together so a person can read the report in a logical manner.&lt;/p&gt;</description></item><item><title>SQL Server: How to export database with linked servers</title><link>https://am2.co/2016/04/sql-server-how-to-export-database-with-linked-servers/</link><pubDate>Mon, 04 Apr 2016 10:27:53 -0400</pubDate><guid>https://am2.co/2016/04/sql-server-how-to-export-database-with-linked-servers/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/134279/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 a web developer and I want to export a database to work on it in my local machine.&lt;/p&gt;&#10;&lt;p&gt;I'm using &lt;code&gt;generate script with data&lt;/code&gt;. the script is generated but without the linked servers used by some Views.&lt;/p&gt;&#10;&lt;p&gt;Is their a way to generate a full script with linked servers or do I have to create it manually with &lt;code&gt;sp_addlinkedserver&lt;/code&gt;?&lt;/p&gt;</description></item><item><title>Reduce MDF file size</title><link>https://am2.co/2016/04/reduce-mdf-file-size/</link><pubDate>Fri, 01 Apr 2016 17:26:01 -0400</pubDate><guid>https://am2.co/2016/04/reduce-mdf-file-size/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/134524/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 working with a 500 GB SQL Server database. I need to reduce the size of the database data file after removing a large amount (50%) of the data.&lt;/p&gt;&#10;&lt;p&gt;I tried re indexing, it's good the database has de-fragmented. But the DB size is not reduced.&lt;/p&gt;</description></item><item><title>Using DateTime Variable In Where Clause</title><link>https://am2.co/2016/03/using-datetime-variable-in-where-clause/</link><pubDate>Wed, 30 Mar 2016 15:22:09 -0400</pubDate><guid>https://am2.co/2016/03/using-datetime-variable-in-where-clause/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/133840/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 trying to pull all data where a sale date is &gt;= to a certain datetime. When I execute my query I get an error of:&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 241, Level 16, State 1, Line 15&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Conversion failed when converting date and/or time from character string.&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;What should I alter to get his query operational?&#10;Below is sample DDL&lt;/p&gt;</description></item><item><title>How to efficiently design MongoDB database for Uber-like application?</title><link>https://am2.co/2016/03/how-to-efficiently-design-mongodb-database-for-uber-like-application/</link><pubDate>Wed, 30 Mar 2016 14:01:04 -0400</pubDate><guid>https://am2.co/2016/03/how-to-efficiently-design-mongodb-database-for-uber-like-application/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/133822/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 designing a MongoDB database for an Uber-like application, but since I'm new to NoSQL concept, I have several doubts.&lt;/p&gt;&#10;&lt;p&gt;I have three main collections - users, requests and messages. User can post a ride request, and if other user wants to give him a ride, accepts such a request and now text communication between those two users is started.&lt;/p&gt;</description></item><item><title>How to configure SSIS in SQL Server AlwaysOn</title><link>https://am2.co/2016/03/how-to-configure-ssis-in-sql-server-alwayson/</link><pubDate>Wed, 30 Mar 2016 05:40:07 -0400</pubDate><guid>https://am2.co/2016/03/how-to-configure-ssis-in-sql-server-alwayson/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/133760/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 AlwaysOn Availability Group setup for my SQL Server. Now I would like to configure SSIS. How do I do it? Below link provides some information but since I am not DBA it's difficult to understand this article: &lt;/p&gt;</description></item><item><title>UFT to SQL Server conecction which is located at different domain</title><link>https://am2.co/2016/03/uft-to-sql-server-conecction-which-is-located-at-different-domain/</link><pubDate>Tue, 29 Mar 2016 16:42:56 -0400</pubDate><guid>https://am2.co/2016/03/uft-to-sql-server-conecction-which-is-located-at-different-domain/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/133702/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 connect to a SQL Server through UFT (Unified Functional Testing) but the problem is SQL Server is present at different domain whereas QTP (HP QuickTest Professional) is present in a different domain. &lt;/p&gt;&#10;&lt;p&gt;I am able to connect to SQL Server manually from my domain using &lt;/p&gt;</description></item><item><title>After trying to restart moved database: Unable to open the physical file "D:\Data\MYDBNAME.MDF"</title><link>https://am2.co/2016/03/after-trying-to-restart-moved-database-unable-to-open-the-physical-file-ddatamydbname-mdf/</link><pubDate>Tue, 29 Mar 2016 13:01:56 -0400</pubDate><guid>https://am2.co/2016/03/after-trying-to-restart-moved-database-unable-to-open-the-physical-file-ddatamydbname-mdf/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/133663/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;So the default location for databases on our server is &lt;/p&gt;&#10;&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"&gt;&lt;span class="cl"&gt;c:\program files\microsoft sql server\mssql11.mssqlserver\mssql\DATA&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;but due to space limitations we instead use &lt;/p&gt;&#10;&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"&gt;&lt;span class="cl"&gt;d:\data&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I have now since corrected the default location to be &lt;code&gt;d:\data&lt;/code&gt;&lt;/p&gt;&#10;&lt;p&gt;However I am unable to move a database that was created in the wrong location i.e. from &lt;code&gt;c:\...\data&lt;/code&gt; to &lt;code&gt;d:\data&lt;/code&gt;&lt;/p&gt;</description></item><item><title>Why is the MSDB database TRUSTWORTHY?</title><link>https://am2.co/2016/03/why-is-the-msdb-database-trustworthy/</link><pubDate>Thu, 24 Mar 2016 20:38:35 -0400</pubDate><guid>https://am2.co/2016/03/why-is-the-msdb-database-trustworthy/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/133325/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;The &lt;code&gt;TRUSTWORTHY&lt;/code&gt; setting can be rather dangerous if you aren't careful and except for specific circumstances the recommendation is to keep it turned off. However by default the &lt;code&gt;MSDB&lt;/code&gt; database has &lt;code&gt;TRUSTWORHTY&lt;/code&gt; set &lt;code&gt;ON&lt;/code&gt; by default. I'm curious why?&lt;/p&gt;</description></item><item><title>UnShrunk SQL Server database restore which is larger than available disk space</title><link>https://am2.co/2016/03/unshrunk-sql-server-database-restore-which-is-larger-than-available-disk-space/</link><pubDate>Tue, 22 Mar 2016 19:17:25 -0400</pubDate><guid>https://am2.co/2016/03/unshrunk-sql-server-database-restore-which-is-larger-than-available-disk-space/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/133819/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 cannot restore a Microsoft SQL Server database due to lack of hard drive space. The original database was 1.6TB and approximately &lt;strong&gt;1.4TB&lt;/strong&gt; was deleted from it and a backup was taken without shrinking the database.&lt;/p&gt;&#10;&lt;p&gt;The backup file is only 168GB and was sent to me on a hard drive through a courier. When I try to restore the 168GB backup file it tries to create the original 1.6TB &lt;code&gt;.mdf&lt;/code&gt; data file and errors because all my available servers have less than 1TB of available disk space.&lt;/p&gt;</description></item><item><title>Shortcuts Cheat Sheet - SSMS &amp; Windows</title><link>https://am2.co/2016/03/shortcuts-cheat-sheet/</link><pubDate>Mon, 07 Mar 2016 08:00:29 -0500</pubDate><guid>https://am2.co/2016/03/shortcuts-cheat-sheet/</guid><description>&lt;p&gt;I&amp;rsquo;ve published an updated version of this cheat sheet with additional shortcuts and Azure Data Studio coverage. &lt;a href="https://am2.co/wp-content/uploads/ShortcutsCheatSheet_18.1.pdf"&gt;Download the updated PDF&lt;/a&gt;.&#10;I&amp;rsquo;ve presented my &lt;strong&gt;Shortcuts from an Impatient DBA&lt;/strong&gt; talk a few times now, and I really love it. Everyone learns something, whether you&amp;rsquo;re a Junior Developer, or a multi-decade veteran, or a Data Platform MVP.&lt;/p&gt;</description></item><item><title>What's the deal with transactions in a stored procedure called by an SSRS report?</title><link>https://am2.co/2016/03/whats-the-deal-with-transactions-in-a-stored-procedure-called-by-an-ssrs-report/</link><pubDate>Tue, 01 Mar 2016 23:00:41 -0500</pubDate><guid>https://am2.co/2016/03/whats-the-deal-with-transactions-in-a-stored-procedure-called-by-an-ssrs-report/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/130948/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;Consider the following:&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;PROCEDURE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;dbo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;usp_trantest&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&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;SELECT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;@@&lt;/span&gt;&lt;span class="n"&gt;TRANCOUNT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;trancount&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;GO&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;When I call &lt;code&gt;usp_trantest&lt;/code&gt; manually from within SSMS, the trancount is 0. If I run an SSRS report that contains a dataset that queries the same stored procedure, the trancount is logged as 1.&lt;/p&gt;</description></item><item><title>Decoding sql_handle</title><link>https://am2.co/2016/02/decoding_sql_handle/</link><pubDate>Mon, 29 Feb 2016 10:05:54 -0500</pubDate><guid>https://am2.co/2016/02/decoding_sql_handle/</guid><description>&lt;p&gt;If you&amp;rsquo;ve ever looked at sys.sysprocesses or sys.dm_exec_requests (or a number of other DMVs), you&amp;rsquo;ve noticed there is a column called &amp;ldquo;sql_handle&amp;rdquo; that contains some binary gobbledygook. Books Online gives the (un)helpful definition as &amp;ldquo;Hash map of the SQL text of the request.&amp;rdquo;&lt;/p&gt;&#10;&lt;h2 id="sp_whoisactive"&gt;sp_WhoIsActive&lt;/h2&gt;&#10;&lt;p&gt;In the context of currently-running processes, most people decode sql_handle with Adam Machanic&amp;rsquo;s (&lt;a href="http://dataeducation.com/blog/" target="_blank" rel="noopener"&gt;blog&lt;/a&gt;) &lt;a href="http://whoisactive.com/" target="_blank" rel="noopener"&gt;sp_WhoIsActive&lt;/a&gt;. It&amp;rsquo;s really easy &amp;amp; straightforward&amp;ndash;if you&amp;rsquo;re not familiar with Adam&amp;rsquo;s utility, download it and check it out. My friend Mike Kane (&lt;a href="http://www.michaelkane.me/" target="_blank" rel="noopener"&gt;blog&lt;/a&gt;) has an &lt;a href="http://www.michaelkane.me/2016/03/how-i-use-sp_whoisactive/" target="_blank" rel="noopener"&gt;interesting post&lt;/a&gt; on parameter combinations he regularly uses when using sp_WhoIsActive.&lt;/p&gt;</description></item><item><title>Data Compression: How page compression works</title><link>https://am2.co/2016/02/data-compression-how-page-works/</link><pubDate>Mon, 22 Feb 2016 10:00:59 -0500</pubDate><guid>https://am2.co/2016/02/data-compression-how-page-works/</guid><description>&lt;p&gt;SQL Server supports two kinds of data compression on rowstore data. Columnstore compression is for a different day. You can compress heaps, clustered indexes (on both tables and views), and nonclustered indexes (on both tables and views).&lt;/p&gt;&#10;&lt;h2 id="compression-requirements"&gt;Compression requirements&lt;/h2&gt;&#10;&lt;p&gt;Data compression is available in SQL Server 2008 &amp;amp; newer. It was introduced as an Enterprise Edition feature&amp;ndash;if you were using Standard Edition or Express, then you were out of luck. Starting with SQL Server 2016 SP1 (thus all currently-supported versions), data compression is available across all Editions. There are &lt;a href="https://am2.co/2015/12/29/data-compression-costs-benefits/"&gt;benefits &amp;amp; costs to using data compression&lt;/a&gt;&amp;ndash;as with anything, make sure you understand it before you implement it.&lt;/p&gt;</description></item><item><title>xp_sqlagent_enum_jobs alternative</title><link>https://am2.co/2016/02/xp_sqlagent_enum_jobs_alt/</link><pubDate>Thu, 18 Feb 2016 10:00:21 -0500</pubDate><guid>https://am2.co/2016/02/xp_sqlagent_enum_jobs_alt/</guid><description>&lt;h2&gt;What's &lt;code&gt;xp_sqlagent_enum_jobs&lt;/code&gt;?&lt;/h2&gt;&#10;If you landed on this post, I'm guessing you know the answer to this, so I'll be quick. `xp_sqlagent_enum_jobs` is an undocumented (and thus, unsupported) extended procedure that gives information on whether a job is currently running, when it last ran, when it runs next, etc.&#10;&lt;p&gt;The supported alternative is to use &lt;code&gt;sp_help_job&lt;/code&gt; (which calls &lt;code&gt;xp_sqlagent_enum_jobs&lt;/code&gt;), but &lt;code&gt;sp_help_job&lt;/code&gt; is difficult to use in automation because trying to do &lt;code&gt;INSERT #temp EXEC sp_help_job;&lt;/code&gt; will result in an error due to nested &lt;code&gt;INSERT...EXEC&lt;/code&gt; statements (Error 8164: &amp;ldquo;An INSERT EXEC statement cannot be nested.&amp;rdquo;). As a result, people often turn to calling the unsupported xp directly.&lt;/p&gt;</description></item><item><title>Data Compression: How row compression works</title><link>https://am2.co/2016/02/data-compression-how-row-works/</link><pubDate>Mon, 15 Feb 2016 10:07:29 -0500</pubDate><guid>https://am2.co/2016/02/data-compression-how-row-works/</guid><description>&lt;p&gt;SQL Server supports two kinds of data compression on rowstore data. Columnstore compression is for a different day. You can compress heaps, clustered indexes (on both tables and views), and nonclustered indexes (on both tables and views).&lt;/p&gt;&#10;&lt;h2 id="compression-requirements"&gt;Compression requirements&lt;/h2&gt;&#10;&lt;p&gt;Data compression is available in SQL Server 2008 &amp;amp; newer. It is an Enterprise Edition feature&amp;ndash;if you&amp;rsquo;re using Standard Edition or Express, then you&amp;rsquo;re out of luck. There are &lt;a href="https://am2.co/2015/12/29/data-compression-costs-benefits/"&gt;benefits &amp;amp; costs to using data compression&lt;/a&gt;&amp;ndash;as with anything, make sure you understand it before you implement it.&lt;/p&gt;</description></item><item><title>Speaking at #SqlSatChi - SQL Saturday #484 in Chicago</title><link>https://am2.co/2016/01/speaking-at-sqlsatchi-sql-saturday-484-in-chicago/</link><pubDate>Sat, 23 Jan 2016 09:41:45 -0500</pubDate><guid>https://am2.co/2016/01/speaking-at-sqlsatchi-sql-saturday-484-in-chicago/</guid><description>&lt;p&gt;I&amp;rsquo;m really excited to be speaking in Chicago this year. I&amp;rsquo;m going to be giving my &amp;ldquo;Shortcuts From an Impatient DBA&amp;rdquo; session. I love this presentation, and I&amp;rsquo;m excited to share it in Chicago.&lt;/p&gt;&#10;&lt;h2 id="howd-you-do-that"&gt;How&amp;rsquo;d you do that?!?&lt;/h2&gt;&#10;&lt;p&gt;This presentation is a series of keyboard shortcuts, lesser-known SSMS features, code tricks, Windows tips, etc. Most of these are tips I picked up by watching other people and asking &amp;ldquo;How&amp;rsquo;d you do that?&amp;rdquo; Those are some of the most powerful learning moments we have&amp;ndash;when we see something cool and learn to do it for ourselves. I&amp;rsquo;ll say it again: &lt;strong&gt;I love this presentation&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>Windows cluster failed over, but SQL instances didn't move</title><link>https://am2.co/2016/01/windows-cluster-failed-over-but-sql-instances-didnt-move/</link><pubDate>Mon, 04 Jan 2016 13:48:24 -0500</pubDate><guid>https://am2.co/2016/01/windows-cluster-failed-over-but-sql-instances-didnt-move/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/134093/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 recently inherited a SQL Cluster (2008R2) which for the most part behaves itself impeccably. &lt;/p&gt;&#10;&lt;p&gt;The windows cluster is made up of two nodes running Active/Passive, Node1 and Node2 are dedicated blades in two different data centers. There are 3 SQL instances all running on Node1. Quorum is established by a File Share Witness and we have a heartbeat between the two nodes.&lt;/p&gt;</description></item></channel></rss>