<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>2014 on Andy M Mallon - AM²</title><link>https://am2.co/2014/</link><description>Recent content in 2014 on Andy M Mallon - AM²</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Wed, 26 Nov 2014 15:34:00 -0500</lastBuildDate><atom:link href="https://am2.co/2014/index.xml" rel="self" type="application/rss+xml"/><item><title>Formatting HTML emails in SQL</title><link>https://am2.co/2014/11/formatting-html-emails-in-sql/</link><pubDate>Wed, 26 Nov 2014 15:34:00 -0500</pubDate><guid>https://am2.co/2014/11/formatting-html-emails-in-sql/</guid><description>&lt;p&gt;When I am writing monitoring/alerting stored procedures for my SQL Servers, its important to have those alerts be well-formatted. I like to minimize the amount of time I spend sorting through emails &amp;amp; alerts, and part of that is making sure that I can determine the urgency &amp;amp; priority of an email alert at a mere glance. More importantly, it has to be equally useful to me at my desk &amp;amp; on my mobile.&lt;/p&gt;</description></item><item><title>Restoring a SQL Server 2012 database in high availability</title><link>https://am2.co/2014/11/restoring-a-sql-server-2012-database-in-high-availability/</link><pubDate>Wed, 12 Nov 2014 14:42:35 -0500</pubDate><guid>https://am2.co/2014/11/restoring-a-sql-server-2012-database-in-high-availability/</guid><description>&lt;p&gt;&lt;a href="https://stackoverflow.com/q/26889631/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 a database which is in always-on high availability mode synchronized with another database on a different instance. How can I restore from a &lt;code&gt;.bak&lt;/code&gt; file into the primary database using T-SQL?&lt;/p&gt;&#10;&lt;p&gt;I&amp;rsquo;m new to high availability and I&amp;rsquo;ve been advised that I need to take the database out of high availability before I can do a restore and then put it back in high availability again but I&amp;rsquo;m not sure.&lt;/p&gt;</description></item><item><title>Moving Replication to a new server (without re-snapshotting)</title><link>https://am2.co/2014/07/moving-replication-to-a-new-server-without-re-snapshotting/</link><pubDate>Tue, 08 Jul 2014 19:57:00 -0400</pubDate><guid>https://am2.co/2014/07/moving-replication-to-a-new-server-without-re-snapshotting/</guid><description>&lt;h2 id="background"&gt;Background&lt;/h2&gt;&#10;&lt;p&gt;At work, we make very extensive use of transactional replication. We have dozens of publications. Most publications have two or three subscribers. We replicate across domains, across subnets, across geographies. We use both push &amp;amp; pull replication (we&amp;rsquo;ve found pull works best when crossing the globe).&lt;/p&gt;</description></item><item><title>sp_get_basetable_list</title><link>https://am2.co/2014/05/sp_get_basetable_list/</link><pubDate>Thu, 22 May 2014 15:18:00 -0400</pubDate><guid>https://am2.co/2014/05/sp_get_basetable_list/</guid><description>&lt;p&gt;At work, we make extensive use of views &amp;amp; synonyms. The reasons are complex (and fodder for another post), but here&amp;rsquo;s a simplified example:&lt;/p&gt;&#10;&lt;blockquote&gt;Pricing data is updated multiple times per day, and we want to keep multiple generations of the pricing table online. By pointing the synonym to the latest pricing table, we can redirect users to the current/correct data. If there's a problem, we can "roll back" the latest pricing updates by simply pointing the synonym back to the prior generation of pricing data.&lt;/blockquote&gt;&#10;&lt;p&gt;Obviously, this can create some confusion when you do need to find the actual table (eg, to see indexes, or to update data). What pricing table is the real pricing table?&#10;Sure&amp;ndash; you can query system views to find out the real table(s) referenced by the synonym or view.&#10;When you do this hundreds (or thousands) of times, &lt;a href="http://xkcd.com/1205/"&gt;it can really add up.&lt;/a&gt; Time to automate.&lt;/p&gt;</description></item><item><title>SQL Server 2012 always-on backup, full vs copy-only</title><link>https://am2.co/2014/04/sql-server-2012-always-on-backup-full-vs-copy-only/</link><pubDate>Fri, 25 Apr 2014 19:19:45 -0400</pubDate><guid>https://am2.co/2014/04/sql-server-2012-always-on-backup-full-vs-copy-only/</guid><description>&lt;p&gt;&lt;a href="https://dba.stackexchange.com/q/63946/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 a quick clarification on copy-only backup vs full backup as it pertains to transaction log numbering and restore if required.&lt;/p&gt;&#10;&lt;p&gt;I have SQL Server 2012 setup with always on for multiple databases. The availability groups are setup with preferred backup on replica.&lt;/p&gt;</description></item></channel></rss>