<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>#SQLserver2012 Archives | SQL Solutions Group</title>
	<atom:link href="https://sqlsolutionsgroup.com/tag/sqlserver2012/feed/" rel="self" type="application/rss+xml" />
	<link>https://sqlsolutionsgroup.com/tag/sqlserver2012/</link>
	<description></description>
	<lastBuildDate>Mon, 02 Mar 2026 06:30:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://sqlsolutionsgroup.com/wp-content/uploads/2021/01/cropped-SSG_FAVICON0002-32x32.png</url>
	<title>#SQLserver2012 Archives | SQL Solutions Group</title>
	<link>https://sqlsolutionsgroup.com/tag/sqlserver2012/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Backup Just Got Smarter: What’s New in Microsoft SQL Server 2025</title>
		<link>https://sqlsolutionsgroup.com/backup-just-got-smarter-whats-new-in-microsoft-sql-server-2025/</link>
					<comments>https://sqlsolutionsgroup.com/backup-just-got-smarter-whats-new-in-microsoft-sql-server-2025/#respond</comments>
		
		<dc:creator><![CDATA[A.K. Gonzalez]]></dc:creator>
		<pubDate>Mon, 02 Mar 2026 06:29:59 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[#microsftcertifedmaster]]></category>
		<category><![CDATA[#microsftpartner]]></category>
		<category><![CDATA[#SQLAB]]></category>
		<category><![CDATA[#SQlatino]]></category>
		<category><![CDATA[#SQlatinoamerica]]></category>
		<category><![CDATA[#sqldatabase]]></category>
		<category><![CDATA[#sqldeveloper]]></category>
		<category><![CDATA[#SQLgroupie]]></category>
		<category><![CDATA[#sqlimer]]></category>
		<category><![CDATA[#sqlimerbymay]]></category>
		<category><![CDATA[#sqlinjection]]></category>
		<category><![CDATA[#sqlinternals]]></category>
		<category><![CDATA[#sqlite]]></category>
		<category><![CDATA[#sqlite3]]></category>
		<category><![CDATA[#SQLLearning]]></category>
		<category><![CDATA[#SQLMagazine]]></category>
		<category><![CDATA[#sqlmanagementstudio]]></category>
		<category><![CDATA[#sqlmanager]]></category>
		<category><![CDATA[#Sqlmap]]></category>
		<category><![CDATA[#sqlrun]]></category>
		<category><![CDATA[#sqlsaturday2017]]></category>
		<category><![CDATA[#sqlsatvienna]]></category>
		<category><![CDATA[#sqlserver]]></category>
		<category><![CDATA[#SQLserver2012]]></category>
		<category><![CDATA[#sqlserver2014]]></category>
		<category><![CDATA[#sqlserver2017]]></category>
		<category><![CDATA[#sqlserver2022]]></category>
		<category><![CDATA[#SQLServeronLinux]]></category>
		<category><![CDATA[#SQLsolutionsgroup]]></category>
		<category><![CDATA[#SQLTraining]]></category>
		<category><![CDATA[#SQLYog]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQLPASS]]></category>
		<category><![CDATA[SQLSaturday]]></category>
		<category><![CDATA[SSG]]></category>
		<guid isPermaLink="false">https://sqlsolutionsgroup.com/?p=7438</guid>

					<description><![CDATA[<p>In a recent webinar, Randy Knight walked through the backup enhancements in SQL Server 2025—and one update in particular changes everything for Availability Groups. True Full and Differential Backups on Secondary Replicas For years, database professionals faced a frustrating limitation. With Availability Groups, you could offload some workloads to secondary replicas—but not your real backup [&#8230;]</p>
<p>The post <a href="https://sqlsolutionsgroup.com/backup-just-got-smarter-whats-new-in-microsoft-sql-server-2025/">Backup Just Got Smarter: What’s New in Microsoft SQL Server 2025</a> appeared first on <a href="https://sqlsolutionsgroup.com">SQL Solutions Group</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="p1"><em><strong><span class="s1">In a recent webinar, <a href="chatgpt://generic-entity?number=0"><span class="s2">Randy Knight</span></a> walked through the backup enhancements in <a href="chatgpt://generic-entity?number=1"><span class="s2">SQL Server 2025</span></a>—and one update in particular changes everything for Availability Groups.</span></strong></em></p>

<h3><span class="s1">True Full and Differential Backups on Secondary Replicas</span></h3>
<p class="p1"><span class="s1">For years, database professionals faced a frustrating limitation. With Availability Groups, you could offload some workloads to secondary replicas—but not your real backup strategy.</span><span class="s1">Yes, you could run copy-only backups on a secondary. But true full backups? Differential backups that maintain the LSN chain? Those had to run on the primary replica, u</span><span class="s1">ntil now. </span><span class="s1">SQL Server 2025 introduces the ability to run </span><span class="s4">true full backups and true differential backups on secondary replicas</span><span class="s1">.</span></p>
<p class="p1"><span class="s1">That means:</span></p>

<ul>
 	<li>
<p class="p1"><span class="s1">You can move your entire backup workload off the primary.</span></p>
</li>
 	<li>
<p class="p1"><span class="s1">Your backup plan behaves exactly the same as if it were running on the primary.</span></p>
</li>
 	<li>
<p class="p1"><span class="s1">You potentially reduce your RPO by running backups more frequently.</span></p>
</li>
</ul>
<p class="p1"><span class="s1">This isn’t just a convenience feature—it’s a performance and resilience upgrade.</span></p>


<hr />

<h3><span class="s1">ZSTD Backup Compression</span></h3>
<p class="p1"><span class="s1">Another enhancement is the introduction of </span><span class="s4">ZSTD backup compression</span><span class="s1">, an algorithm originally developed at Facebook. </span><span class="s1">Until now, SQL Server used MSXpress as the default compression method. ZSTD brings:</span></p>

<ul>
 	<li>
<p class="p1"><span class="s1">Slightly better compression ratios</span></p>
</li>
 	<li>
<p class="p1"><span class="s1">Faster compression in many cases</span></p>
</li>
 	<li>
<p class="p1"><span class="s1">Less CPU overhead during decompression</span></p>
</li>
 	<li>
<p class="p1"><span class="s1">Potentially faster restores</span></p>
</li>
</ul>
<p class="p1"><span class="s1">In Randy’s testing—and in benchmarking done by <a href="chatgpt://generic-entity?number=2"><span class="s2">Aaron Bertrand</span></a> on an 8TB Stack Overflow database—backup sizes weren’t dramatically smaller. A 50GB database might shrink from 15GB to 14.5GB. </span><span class="s1">That doesn’t sound revolutionary, b</span><span class="s1">ut at scale it really adds up!</span></p>
<p class="p1"><span class="s1">If you’re backing up multi-terabyte databases with long retention periods, even small savings compound quickly. Smaller backups also mean improved storage efficiency and potential restore performance gains. </span><span class="s1">It’s not flashy—but it’s practical, which matters. </span></p>


<hr />

<h3><span class="s1">Immutable Backups in Azure Blob Storage</span></h3>
<p class="p1"><span class="s1">Backing up directly to Azure Blob Storage isn’t new. But SQL Server 2025 now supports backups to </span><span class="s4">immutable Azure Blob storage accounts</span><span class="s1">.</span><span class="s1">This enhancement strengthens ransomware protection. </span><span class="s1">Immutable storage ensures that once a backup is written, it cannot be modified. The only permitted action is deletion under defined rules. While not truly air-gapped, this approach creates a powerful safeguard against backup tampering. </span><span class="s1">In a world where ransomware targets backups first, this feature significantly improves recovery confidence.</span></p>


<hr />

<h3><span class="s1">Why These Enhancements Matter</span></h3>
<p class="p1"><span class="s1">SQL Server 2025 doesn’t reinvent backup strategy—it strengthens it.</span></p>

<ul>
 	<li>
<p class="p1"><span class="s1">Offload backup workloads to secondary replicas</span></p>
</li>
 	<li>
<p class="p1"><span class="s1">Improve compression efficiency at scale</span></p>
</li>
 	<li>
<p class="p1"><span class="s1">Harden backup security against ransomware</span></p>
</li>
</ul>
<p class="p1"><span class="s1">Individually, these updates are incremental. Together, they represent a meaningful evolution in database resilience and performance. F</span><span class="s1">or organizations running mission-critical systems, that’s an especially big deal.</span></p>
<!-- /wp:post-content --><p>The post <a href="https://sqlsolutionsgroup.com/backup-just-got-smarter-whats-new-in-microsoft-sql-server-2025/">Backup Just Got Smarter: What’s New in Microsoft SQL Server 2025</a> appeared first on <a href="https://sqlsolutionsgroup.com">SQL Solutions Group</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sqlsolutionsgroup.com/backup-just-got-smarter-whats-new-in-microsoft-sql-server-2025/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Server 2025 Performance Enhancements: What Developers and DBAs Need to Know</title>
		<link>https://sqlsolutionsgroup.com/sql-server-2025-performance-enhancements-what-developers-and-dbas-need-to-know/</link>
					<comments>https://sqlsolutionsgroup.com/sql-server-2025-performance-enhancements-what-developers-and-dbas-need-to-know/#respond</comments>
		
		<dc:creator><![CDATA[A.K. Gonzalez]]></dc:creator>
		<pubDate>Wed, 21 Jan 2026 19:01:28 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[#microsftcertifedmaster]]></category>
		<category><![CDATA[#microsftpartner]]></category>
		<category><![CDATA[#SQLAB]]></category>
		<category><![CDATA[#SQlatino]]></category>
		<category><![CDATA[#SQlatinoamerica]]></category>
		<category><![CDATA[#sqldatabase]]></category>
		<category><![CDATA[#sqldeveloper]]></category>
		<category><![CDATA[#SQLgroupie]]></category>
		<category><![CDATA[#sqlimer]]></category>
		<category><![CDATA[#sqlimerbymay]]></category>
		<category><![CDATA[#sqlinjection]]></category>
		<category><![CDATA[#sqlinternals]]></category>
		<category><![CDATA[#sqlite]]></category>
		<category><![CDATA[#sqlite3]]></category>
		<category><![CDATA[#SQLLearning]]></category>
		<category><![CDATA[#SQLMagazine]]></category>
		<category><![CDATA[#sqlmanagementstudio]]></category>
		<category><![CDATA[#sqlmanager]]></category>
		<category><![CDATA[#Sqlmap]]></category>
		<category><![CDATA[#sqlrun]]></category>
		<category><![CDATA[#sqlsaturday2017]]></category>
		<category><![CDATA[#sqlsatvienna]]></category>
		<category><![CDATA[#sqlserver]]></category>
		<category><![CDATA[#SQLserver2012]]></category>
		<category><![CDATA[#sqlserver2014]]></category>
		<category><![CDATA[#sqlserver2017]]></category>
		<category><![CDATA[#sqlserver2022]]></category>
		<category><![CDATA[#SQLServeronLinux]]></category>
		<category><![CDATA[#SQLsolutionsgroup]]></category>
		<category><![CDATA[#SQLTraining]]></category>
		<category><![CDATA[#SQLYog]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQLPASS]]></category>
		<category><![CDATA[SQLSaturday]]></category>
		<category><![CDATA[SSG]]></category>
		<guid isPermaLink="false">https://sqlsolutionsgroup.com/?p=7391</guid>

					<description><![CDATA[<p>SQL Server 2025 continues Microsoft’s steady focus on performance, reliability, and intelligent automation. Rather than introducing one dramatic overhaul, this release delivers a collection of meaningful, incremental improvements that—when combined—can result in noticeable gains for many workloads. During a recent discussion, Rich and Kyle walked through several of the most impactful enhancements, focusing on Intelligent [&#8230;]</p>
<p>The post <a href="https://sqlsolutionsgroup.com/sql-server-2025-performance-enhancements-what-developers-and-dbas-need-to-know/">SQL Server 2025 Performance Enhancements: What Developers and DBAs Need to Know</a> appeared first on <a href="https://sqlsolutionsgroup.com">SQL Solutions Group</a>.</p>
]]></description>
										<content:encoded><![CDATA[<blockquote>
<p><em><strong>SQL Server 2025 continues Microsoft’s steady focus on performance, reliability, and intelligent automation. Rather than introducing one dramatic overhaul, this release delivers a collection of meaningful, incremental improvements that—when combined—can result in noticeable gains for many workloads.</strong></em></p>
</blockquote>
<p><span style="font-weight: 400;">During a recent discussion, Rich and Kyle walked through several of the most impactful enhancements, focusing on Intelligent Query Processing, concurrency improvements, columnstore indexes, and long-awaited TempDB upgrades.</span></p>
<h3><b>Smarter Query Performance with Intelligent Query Processing (IQP)</b></h3>
<p><span style="font-weight: 400;">Intelligent Query Processing isn’t new, but SQL Server 2025 refines it further. IQP is an umbrella term covering a set of features designed to make the query optimizer more adaptive and accurate over time.</span></p>
<p><span style="font-weight: 400;">One key area of improvement is cardinality estimation—the process SQL Server uses to estimate how many rows will flow through each step of a query plan. Anyone who has tuned performance knows how damaging a mismatch between estimated and actual rows can be. SQL Server 2025 introduces incremental enhancements to these estimations, which, in most cases, translate to better execution plans and improved default performance without any code changes.</span></p>
<p><span style="font-weight: 400;">As with any optimizer change, edge cases still exist. Large jumps in behavior—such as the one between SQL Server 2014 and 2016—sometimes caused regressions in specific workloads. While the changes in 2025 are far less dramatic, testing remains essential when upgrading.</span></p>
<p><span style="font-weight: 400;">Another IQP enhancement is parameter-sensitive optimization, which addresses long-standing issues related to parameter sniffing. When query parameters vary significantly between executions, SQL Server can now better recognize those differences and adjust execution strategies accordingly, reducing performance instability.</span></p>
<p><span style="font-weight: 400;">Degree of parallelism (DOP) feedback also continues to evolve. Rather than making a one-time decision based solely on cost thresholds and configuration values, SQL Server now evaluates how well a query performs when running in parallel and adjusts its behavior over time. This allows the engine to fine-tune parallelism instead of blindly running at maximum settings. While powerful, it does require familiarity with execution plans to fully understand how SQL Server is adapting behind the scenes.</span></p>
<h3><b>Adaptive Joins That Adjust on the Fly</b></h3>
<p><span style="font-weight: 400;">Adaptive joins build on SQL Server’s ability to recover from imperfect statistics. Traditionally, SQL Server commits to a join strategy—such as nested loops or hash joins—based on cardinality estimates. If those estimates are wrong, the query can suffer dramatically.</span></p>
<p><span style="font-weight: 400;">With adaptive joins, SQL Server can change its mind mid-execution. If a join starts as a loop join but processes far more rows than expected, the engine can switch to a more appropriate join type, such as a hash join, while the query is still running.</span></p>
<p><span style="font-weight: 400;">SQL Server 2025 improves adaptive joins further, especially in complex scenarios involving multiple joins. This makes the engine more resilient in real-world environments where statistics are rarely perfect.</span></p>
<h3><b>Improved Concurrency Through Smarter Locking</b></h3>
<p><span style="font-weight: 400;">Concurrency is another area receiving meaningful attention. SQL Server has long relied on various lock types—row, key, page, range, and table locks—with relatively rigid thresholds for escalation.</span></p>
<p><span style="font-weight: 400;">Historically, modifying a few thousand rows could trigger escalation to a full table lock, leading many teams to design batch operations around that behavior. SQL Server 2025 is more nuanced. It can now hold thousands of locks without immediately escalating to a table lock when doing so would be unnecessary or harmful.</span></p>
<p><span style="font-weight: 400;">These optimized locking improvements, especially when combined with accelerated database recovery, have already shown dramatic reductions in blocking in real-world workloads. The engine is simply making better decisions about how much data truly needs to be locked.</span></p>
<h3><b>Faster and More Efficient Columnstore Indexes</b></h3>
<p><span style="font-weight: 400;">For organizations using columnstore indexes—particularly in data warehouse and analytics workloads—SQL Server 2025 brings performance gains across the board.</span></p>
<p><span style="font-weight: 400;">Compression is faster, index rebuilds complete more quickly, and the engine handles delta stores more efficiently. Delta stores, which temporarily hold newly inserted uncompressed data before it’s merged into compressed columnstore segments, are now managed more intelligently. This improves both data ingestion and query performance.</span></p>
<p><span style="font-weight: 400;">Reading from columnstore indexes has also been optimized, meaning analytics queries can run faster with no changes required at the application level.</span></p>
<h3><b>TempDB Enhancements That DBAs Will Appreciate</b></h3>
<p><span style="font-weight: 400;">TempDB has long been one of SQL Server’s most critical—and fragile—components. SQL Server 2025 introduces several enhancements that directly address common pain points.</span></p>
<p><span style="font-weight: 400;">One of the most significant changes is the ability to govern TempDB usage using Resource Governor. DBAs can now set quotas that prevent individual queries or workloads from consuming excessive TempDB space. When a query exceeds its limit, SQL Server cancels it before TempDB fills up, preventing server-wide outages.</span></p>
<p><span style="font-weight: 400;">This is especially valuable in environments where large reports or unfiltered queries can consume hundreds of gigabytes and bring systems to a halt—often in the middle of the night.</span></p>
<p><span style="font-weight: 400;">SQL Server 2025 also brings accelerated database recovery (ADR) to TempDB. Large rollbacks that previously took minutes can now complete almost instantly, reducing downtime and improving system responsiveness during heavy workloads.</span></p>
<p><span style="font-weight: 400;">To support monitoring and alerting, new DMV columns expose detailed TempDB usage metrics, including current usage, peak usage, and the number of TempDB limit violations. These additions make it far easier for DBAs and monitoring tools to detect issues before they escalate into outages.</span></p>
<h3><b>A Practical Step Forward</b></h3>
<p><span style="font-weight: 400;">Rather than reinventing SQL Server, the 2025 release refines the engine’s intelligence. Query plans adapt more effectively, locking decisions are smarter, analytics workloads run faster, and TempDB becomes far more manageable.</span></p>
<p><span style="font-weight: 400;">For teams considering an upgrade, SQL Server 2025 offers tangible performance and reliability improvements—especially for environments that struggle with concurrency, large analytical workloads, or TempDB pressure. As always, thorough testing is key, but for many workloads, the benefits will be felt immediately.</span></p>
<p class="p1"> </p>

<p>&nbsp;</p>
<p>The post <a href="https://sqlsolutionsgroup.com/sql-server-2025-performance-enhancements-what-developers-and-dbas-need-to-know/">SQL Server 2025 Performance Enhancements: What Developers and DBAs Need to Know</a> appeared first on <a href="https://sqlsolutionsgroup.com">SQL Solutions Group</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sqlsolutionsgroup.com/sql-server-2025-performance-enhancements-what-developers-and-dbas-need-to-know/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Contained Availability Groups in SQL Server 2022: What You Need to Know</title>
		<link>https://sqlsolutionsgroup.com/contained-availability-groups-in-sql-server-2022-what-you-need-to-know/</link>
					<comments>https://sqlsolutionsgroup.com/contained-availability-groups-in-sql-server-2022-what-you-need-to-know/#respond</comments>
		
		<dc:creator><![CDATA[A.K. Gonzalez]]></dc:creator>
		<pubDate>Sat, 22 Nov 2025 19:40:40 +0000</pubDate>
				<category><![CDATA[Contained AG's]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server 2022]]></category>
		<category><![CDATA[#microsftcertifedmaster]]></category>
		<category><![CDATA[#microsftpartner]]></category>
		<category><![CDATA[#parallelism #azure]]></category>
		<category><![CDATA[#SQLAB]]></category>
		<category><![CDATA[#SQlatino]]></category>
		<category><![CDATA[#SQlatinoamerica]]></category>
		<category><![CDATA[#sqldatabase]]></category>
		<category><![CDATA[#sqldeveloper]]></category>
		<category><![CDATA[#SQLgroupie]]></category>
		<category><![CDATA[#sqlimer]]></category>
		<category><![CDATA[#sqlimerbymay]]></category>
		<category><![CDATA[#sqlinjection]]></category>
		<category><![CDATA[#sqlinternals]]></category>
		<category><![CDATA[#sqlite]]></category>
		<category><![CDATA[#sqlite3]]></category>
		<category><![CDATA[#SQLLearning]]></category>
		<category><![CDATA[#SQLMagazine]]></category>
		<category><![CDATA[#sqlmanagementstudio]]></category>
		<category><![CDATA[#sqlmanager]]></category>
		<category><![CDATA[#Sqlmap]]></category>
		<category><![CDATA[#sqlrun]]></category>
		<category><![CDATA[#sqlsaturday2017]]></category>
		<category><![CDATA[#sqlsatvienna]]></category>
		<category><![CDATA[#sqlserver]]></category>
		<category><![CDATA[#SQLserver2012]]></category>
		<category><![CDATA[#sqlserver2014]]></category>
		<category><![CDATA[#sqlserver2017]]></category>
		<category><![CDATA[#sqlserver2022]]></category>
		<category><![CDATA[#SQLServeronLinux]]></category>
		<category><![CDATA[#SQLsolutionsgroup]]></category>
		<category><![CDATA[#SQLTraining]]></category>
		<category><![CDATA[#SQLYog]]></category>
		<category><![CDATA[availability groups]]></category>
		<category><![CDATA[contained ag]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQLPASS]]></category>
		<category><![CDATA[SQLSaturday]]></category>
		<category><![CDATA[SSG]]></category>
		<guid isPermaLink="false">https://sqlsolutionsgroup.com/?p=7298</guid>

					<description><![CDATA[<p>Overview One of the more intriguing features introduced in SQL Server 2022 is Contained Availability Groups (AGs). At first glance, they look very similar to traditional AGs — but there are some key differences that can trip you up if you’re not prepared. In this post, we’ll walk through: What a normal AG looks like [&#8230;]</p>
<p>The post <a href="https://sqlsolutionsgroup.com/contained-availability-groups-in-sql-server-2022-what-you-need-to-know/">Contained Availability Groups in SQL Server 2022: What You Need to Know</a> appeared first on <a href="https://sqlsolutionsgroup.com">SQL Solutions Group</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1><em><span class="s1">Overview</span></em></h1>
<p class="p3"><em><strong><span class="s2">One of the more intriguing features introduced in SQL Server 2022 is </span><span class="s3">Contained Availability Groups (AGs)</span><span class="s2">. At first glance, they look very similar to traditional AGs — but there are some key differences that can trip you up if you’re not prepared.</span></strong></em></p>
<p class="p1"><span class="s1">In this post, we’ll walk through:</span></p>
<ul>
<li>
<p class="p1"><span class="s1">What a normal AG looks like (and its limitations)</span></p>
</li>
<li>
<p class="p1"><span class="s1">How Contained AGs change the game</span></p>
</li>
<li>
<p class="p1"><span class="s1">The pitfalls we’ve seen in real-world use</span></p>
</li>
<li>
<p class="p1"><span class="s1">Practical solutions if you run into these issues</span></p>
</li>
</ul>
<h2><em><span class="s1">A Quick Refresher: Always On Availability Groups</span></em></h2>
<p class="p3"><span class="s2">Availability Groups, introduced back in SQL Server 2012, are Microsoft’s built-in solution for </span><span class="s3">high availability and disaster recovery</span><span class="s2">. They let you replicate databases across multiple instances, managed by a Windows Server Failover Cluster (WSFC).</span></p>
<p class="p1"><span class="s1">Key benefits:</span></p>
<ul>
<li>
<p class="p1"><span class="s1">Seamless failover between primary and secondary nodes</span></p>
</li>
<li>
<p class="p1"><span class="s1">Read-only replicas to offload workloads</span></p>
</li>
<li>
<p class="p1"><span class="s1">The ability to perform backups and DBCC checks on secondaries, easing the load on your primary</span></p>
</li>
</ul>
<p class="p1"><span class="s1">But AGs have always had one big limitation: </span><span class="s2">only user databases are replicated.</span><span class="s1"> System databases like </span><span class="s3">msdb</span><span class="s1"> and </span><span class="s3">master</span><span class="s1"> stay local to each node.</span></p>
<p class="p1"><span class="s1">Why does that matter? Think about Agent jobs:</span></p>
<ul>
<li>
<p class="p1"><span class="s1">You have to manually install jobs on every node (and keep them in sync).</span></p>
</li>
<li>
<p class="p1"><span class="s1">Jobs need to be AG-aware — otherwise they might try to run against a read-only secondary.</span></p>
</li>
<li>
<p class="p1"><span class="s1">Job history lives only on the current primary, which makes tracking a little messy.</span></p>
</li>
</ul>
<p class="p1"><span class="s1">For years, DBAs have worked around these issues, but it’s always been a pain point.</span></p>
<h2><em><span class="s1">*Enter Contained Availability Groups*</span></em></h2>
<p class="p3"><span class="s2">Contained AGs look and act like traditional AGs, but with one important twist: they include their own </span><span class="s3">contained system databases.</span></p>
<p class="p3"><span class="s2">For example, if you create a Contained AG called </span><span class="s4">MyAg</span><span class="s2">, you’ll see:</span></p>
<ul>
<li>
<p class="p1"><span class="s1">MyAg_master</span></p>
</li>
<li>
<p class="p1"><span class="s1">MyAg_msdb</span></p>
</li>
</ul>
<p class="p3"><span class="s2">These are replicated to all nodes in the AG, just like user databases.</span></p>
<h3><span class="s1">Why this matters</span></h3>
<ul>
<li>
<p class="p1"><span class="s1">Agent jobs now live inside the contained msdb.</span><span class="s2"> No more duplicating jobs on every node.</span></p>
</li>
<li>
<p class="p1"><span class="s1">Job history is replicated.</span><span class="s2"> After failover, you don’t lose tracking.</span></p>
</li>
<li>
<p class="p1"><span class="s1">System tables travel with the AG.</span><span class="s2"> Everything stays consistent across nodes.</span></p>
</li>
</ul>
<p class="p3"><span class="s2">That’s a big win for manageability and one of the headline features of SQL Server 2022.</span></p>
<h2><em><span class="s1">Gotchas Seen in the Wild</span></em></h2>
<p class="p3"><span class="s2">As with most “new shiny” features, Contained AGs aren’t a silver bullet. There&#8217;s a few things to watch out for:</span></p>
<ol start="1">
<li>
<p class="p1"><span class="s1">No more job offloading to secondaries.</span><span class="s2"> Jobs inside the contained msdb only run on the primary. If you used secondaries to handle CHECKDB or backups, you’ll need to rethink.</span></p>
</li>
<li>
<p class="p1"><span class="s1">Replication is not supported.</span><span class="s2"> If transactional replication is part of your design, contained AGs may not be an option.</span></p>
</li>
<li>
<p class="p1"><span class="s1">Seeding is clunky.</span><span class="s2"> The GUI doesn’t support manual seeding yet. You’ll need to fall back to T-SQL.</span></p>
</li>
<li>
<p class="p1"><span class="s1">No distributed AG support.</span><span class="s2"> If you rely on DAGs for hybrid or geo-distributed HA, contained AGs won’t help.</span></p>
</li>
<li>
<p class="p1"><span class="s1">Confusion with system databases.</span><span class="s2"> When you connect to the listener, the </span><span class="s3">msdb</span><span class="s2"> and </span><span class="s3">master</span><span class="s2"> you see belong to the contained AG — not the local system copies.</span></p>
</li>
</ol>
<p>&nbsp;</p>
<h2><em><span class="s1">Workarounds &amp; Solutions</span></em></h2>
<h3><span class="s1">For Agent Jobs</span></h3>
<p class="p3"><span class="s2">If you truly need jobs to run on a secondary node, you still can — but you’ll have to install them in the </span><span class="s3">local msdb</span><span class="s2"> outside the contained AG. That means:</span></p>
<ul>
<li>
<p class="p1"><span class="s1">Jobs must be AG-aware again</span></p>
</li>
<li>
<p class="p1"><span class="s1">You’ll have to maintain them separately</span></p>
</li>
</ul>
<p class="p3"><span class="s2">It’s not elegant, but it gets the job done.</span></p>
<h3><span class="s1">For System Databases</span></h3>
<p class="p3"><span class="s2">This is case-by-case. If your code doesn’t touch </span><span class="s4">master</span><span class="s2"> or </span><span class="s4">msdb</span><span class="s2">, you’re fine. But if you do, you’ll need to carefully evaluate whether those objects belong in the contained copies or the traditional system DBs.</span></p>
<p class="p3"><span class="s2">Remember: you can query both contained and local msdbs — just make sure your scripts account for both.</span></p>
<p>&nbsp;</p>
<h2><em><span class="s1">Final Word</span></em></h2>
<p class="p3"><span class="s2">Contained Availability Groups solve one of the long-standing headaches of AGs — managing Agent jobs across nodes. But they come with trade-offs that every DBA needs to be aware of.</span></p>
<p class="p3"><span class="s2">Test carefully. Know where your jobs live. And make sure your disaster recovery plan accounts for these differences.</span></p>
<p class="p3"><span class="s2">If you want to see them in action, check out our webinar on SQL Server 2022 features, where we demo Contained AGs in detail.</span></p>
<p>The post <a href="https://sqlsolutionsgroup.com/contained-availability-groups-in-sql-server-2022-what-you-need-to-know/">Contained Availability Groups in SQL Server 2022: What You Need to Know</a> appeared first on <a href="https://sqlsolutionsgroup.com">SQL Solutions Group</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sqlsolutionsgroup.com/contained-availability-groups-in-sql-server-2022-what-you-need-to-know/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Understanding Wait Stats in SQL Server: A Practical Guide</title>
		<link>https://sqlsolutionsgroup.com/understanding-wait-stats-in-sql-server-a-practical-guide/</link>
					<comments>https://sqlsolutionsgroup.com/understanding-wait-stats-in-sql-server-a-practical-guide/#respond</comments>
		
		<dc:creator><![CDATA[A.K. Gonzalez]]></dc:creator>
		<pubDate>Thu, 14 Aug 2025 20:47:34 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[#microsftcertifedmaster]]></category>
		<category><![CDATA[#microsftpartner]]></category>
		<category><![CDATA[#parallelism #azure]]></category>
		<category><![CDATA[#SQLAB]]></category>
		<category><![CDATA[#SQlatino]]></category>
		<category><![CDATA[#SQlatinoamerica]]></category>
		<category><![CDATA[#sqldatabase]]></category>
		<category><![CDATA[#sqldeveloper]]></category>
		<category><![CDATA[#SQLgroupie]]></category>
		<category><![CDATA[#sqlimer]]></category>
		<category><![CDATA[#sqlimerbymay]]></category>
		<category><![CDATA[#sqlinjection]]></category>
		<category><![CDATA[#sqlinternals]]></category>
		<category><![CDATA[#sqlite]]></category>
		<category><![CDATA[#sqlite3]]></category>
		<category><![CDATA[#SQLLearning]]></category>
		<category><![CDATA[#SQLMagazine]]></category>
		<category><![CDATA[#sqlmanagementstudio]]></category>
		<category><![CDATA[#sqlmanager]]></category>
		<category><![CDATA[#Sqlmap]]></category>
		<category><![CDATA[#sqlrun]]></category>
		<category><![CDATA[#sqlsaturday2017]]></category>
		<category><![CDATA[#sqlsatvienna]]></category>
		<category><![CDATA[#sqlserver]]></category>
		<category><![CDATA[#SQLserver2012]]></category>
		<category><![CDATA[#sqlserver2014]]></category>
		<category><![CDATA[#sqlserver2017]]></category>
		<category><![CDATA[#sqlserver2022]]></category>
		<category><![CDATA[#SQLServeronLinux]]></category>
		<category><![CDATA[#SQLsolutionsgroup]]></category>
		<category><![CDATA[#SQLTraining]]></category>
		<category><![CDATA[#SQLYog]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQLPASS]]></category>
		<category><![CDATA[SQLSaturday]]></category>
		<category><![CDATA[SSG]]></category>
		<guid isPermaLink="false">https://sqlsolutionsgroup.com/?p=7293</guid>

					<description><![CDATA[<p>When working with SQL Server, one of the best tools DBA&#8217;s can use for diagnosing performance issues is wait statistics (or wait stats for short). But what exactly are they, and how are you supposed to interpret them? In this guide, I’ll break down what wait stats are, why they matter, and how to use [&#8230;]</p>
<p>The post <a href="https://sqlsolutionsgroup.com/understanding-wait-stats-in-sql-server-a-practical-guide/">Understanding Wait Stats in SQL Server: A Practical Guide</a> appeared first on <a href="https://sqlsolutionsgroup.com">SQL Solutions Group</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="p1" style="text-align: left;"><strong><em><span class="s1">When working with SQL Server, one of the best tools DBA&#8217;s can use for diagnosing performance issues is </span><span class="s2">wait statistics</span><span class="s1"> (or </span><span class="s3">wait stats</span><span class="s1"> for short). </span></em></strong><strong><em><span class="s1">But what exactly are they, and how are you supposed to interpret them? </span></em></strong><strong><em><span class="s1">In this guide, I’ll break down what wait stats are, why they matter, and how to use them to troubleshoot performance problems. </span></em></strong></p>
<p>Thank you to our SQL Server Expert and Senior DBA, Rich Benner for providing the valuable Technical info behind this blog. To learn more about Wait Statistics from Rich, check out his recent <a href="https://www.youtube.com/watch?v=rw9il1pJtdI&amp;t=1s">webinar</a> and two new YouTube videos- an <a href="https://www.youtube.com/watch?v=IwXcIoEnauE&amp;t=518s">explainer</a> and a <a href="https://www.youtube.com/watch?v=6BBhQyKxMSQ">demo</a>, on our channel.</p>
<h2><span class="s1">What Are Wait Stats?</span></h2>
<p class="p3"><span class="s2">Anytime something inside Microsoft SQL Server is </span><span class="s3">waiting</span><span class="s2"> for a resource, it’s assigned a wait stat. For </span><span class="s2">example: </span></p>
<ul>
<li>
<p class="p1"><span class="s1">A query waiting for CPU or memory resources</span></p>
</li>
<li>
<p class="p1"><span class="s1">A query waiting to access a data object like a data page or table</span></p>
</li>
<li>
<p class="p1"><span class="s1">An internal SQL Server process waiting to complete a task</span></p>
</li>
</ul>
<p class="p3"><span class="s2">Some waits are completely normal. For example, in </span><span class="s3">Availability Groups</span><span class="s2">, certain threads simply wait to synchronize data with secondary nodes. That’s expected behavior and not necessarily a sign of trouble.</span></p>
<h3><span class="s1">Key Things to Know About Wait Stats</span></h3>
<ol start="1">
<li>
<p class="p1"><span class="s1">They’re cumulative</span><span class="s2"> – Wait times are aggregated since the last time the data was cleared, usually at the last server restart (though other events can reset them).</span></p>
</li>
<li>
<p class="p1"><span class="s1">They measure time in seconds or milliseconds</span><span class="s2"> – depending on the stat you’re viewing.</span></p>
</li>
<li>
<p class="p1"><span class="s1">They’re invaluable for troubleshooting</span><span class="s2"> – By looking at wait stats, you can quickly zero in on what’s slowing down your system.</span></p>
</li>
</ol>
<h3><span class="s1">How to Find Wait Stats</span></h3>
<p class="p3"><span class="s2">The primary DMV for retrieving wait stats is:</span></p>
<p><strong>SELECT * FROM sys.dm_os_wait_stats;</strong></p>
<p class="p1"><span class="s1">On a SQL Server 2022 instance, you might see over </span><span class="s2">1,300 different wait types</span><span class="s1">. Even seasoned DBAs only know a fraction of them by heart. </span><span class="s1">That’s where resources like the </span><span class="s2">SQLskills Wait Types Library</span><span class="s1"> come in handy. This community-maintained list covers around 95% of known waits, detailing whether they’re benign or problematic and suggesting possible resolutions.</span></p>
<h3><span class="s1">Useful Tools for Analyzing Wait Stats</span></h3>
<ul>
<li>
<p class="p1"><span class="s1"><a href="https://whoisactive.com/">sp_WhoIsActive</a></span><span class="s2"> – An enhanced version of </span><span class="s3">sp_who2</span><span class="s2"> that shows what queries are running, their process IDs, and any current waitss.</span></p>
</li>
<li>
<p class="p1"><span class="s1"><a href="https://www.brentozar.com/blitz/">sp_BlitzFirst</a></span><span class="s2"> – A free tool that captures your current wait stats along with other diagnostic information.</span></p>
</li>
<li>
<p class="p1"><span class="s1">Custom Queries</span><span class="s2"> – Many DBAs have their own scripts for retrieving &amp; formatting wait stats. A quick search for “Wait Stats query” will yield plenty of examples.</span></p>
</li>
</ul>
<h3><span class="s1">The Top 5 Most Common Wait Types </span></h3>
<h3><span class="s1">1. </span><span class="s1">LCK_</span><span class="s1">* – Lock Waits</span></h3>
<p class="p3"><span class="s2">Occurs when one query locks a resource (e.g., a data page) and another query has to wait for it to be released. </span><span class="s2">Example: An </span><span class="s3">UPDATE</span><span class="s2"> query locks a row, preventing a </span><span class="s3">SELECT</span><span class="s2"> query from reading it until the update completes.</span></p>
<h3><span class="s1">2. </span></h3>
<h3><span class="s1">CXPACKET / CXCONSUMER</span></h3>
<h3><span class="s1"> – Parallelism Waits</span></h3>
<p class="p3"><span class="s2">Happens when a query is split across multiple CPU cores. If one thread finishes before the others, it waits for the slowest one to catch up. </span><span class="s2">Normal in moderation, but excessive CX waits can indicate an inefficient parallelism setup.</span></p>
<h3><span class="s1">3. </span></h3>
<h3><span class="s1">ASYNC_NETWORK_IO </span></h3>
<h3><span style="font-size: 16px;">– Application Processing Delays</span></h3>
<p class="p3"><span class="s2">Indicates SQL Server has finished processing results but is waiting for the application to consume them. </span><span class="s2">Often caused by applications retrieving rows one at a time instead of in batches.</span></p>
<h3><span class="s1">4. </span></h3>
<h3><span class="s1">LATCH_</span><span class="s1">* and </span><span class="s1">PAGE_LATCH_</span><span class="s1">* – Structure &amp; Page Locks</span></h3>
<ul>
<li>
<p class="p1"><span class="s1">LATCH_</span><span class="s2">*: Locks on internal structures (not data pages)</span></p>
</li>
<li>
<p class="p1"><span class="s1">PAGE_LATCH_</span><span class="s2">*: Locks on data pages themselves. </span><span class="s2">These can signal contention in memory structures or data access patterns.</span></p>
</li>
</ul>
<h3><span class="s1">5. </span></h3>
<h3><span class="s1">WRITELOG</span></h3>
<h3><span class="s1"> – Transaction Log Bottlenecks</span></h3>
<p class="p3"><span class="s2">This occurs when SQL Server is waiting to write to the transaction log. </span><span class="s2">Common causes include slow disk performance, excessive write activity, or log file contention.</span></p>
<p>&nbsp;</p>
<h2><span class="s1">Why Wait Stats Matter</span></h2>
<p class="p3"><span class="s2">Wait stats provide a </span><span class="s3">high-level overview</span><span class="s2"> of where SQL Server is spending its time waiting.</span></p>
<p class="p3"><span class="s2">They help you answer questions like:</span></p>
<ul>
<li>
<p class="p1"><span class="s1">Is my performance issue due to locking, disk speed, or parallelism?</span></p>
</li>
<li>
<p class="p1"><span class="s1">Is the problem in SQL Server or in the application consuming data?</span></p>
</li>
<li>
<p class="p1"><span class="s1">Are my hardware resources (CPU, memory, storage) configured optimally?</span></p>
</li>
</ul>
<p class="p3"><span class="s2">By combining wait stats with tools like </span><span class="s4">sp_WhoIsActive</span><span class="s2"> and </span><span class="s4">sp_BlitzFirst</span><span class="s2">, you can pinpoint bottlenecks faster and focus your tuning efforts where they’ll make the biggest impact. </span><span class="s1">Not all waits are bad — many are just part of normal SQL Server operations. The key is knowing </span><span class="s2">which waits are worth investigating</span><span class="s1"> and which you can safely ignore. </span><span class="s1">With a solid understanding of wait stats, you’ll be better equipped to diagnose issues, improve query performance, and keep your SQL Server running smoothly.</span></p>
<p class="p1"><strong><em><span class="s1">Need help interpreting your wait stats?</span></em></strong></p>
<p class="p1"><span class="s2">At SQL Solutions Group, we work with clients every day to identify and fix performance issues. <a href="https://sqlsolutionsgroup.com/contact/">Contact us</a> for a health check and start optimizing your environment today.</span></p>
<p>The post <a href="https://sqlsolutionsgroup.com/understanding-wait-stats-in-sql-server-a-practical-guide/">Understanding Wait Stats in SQL Server: A Practical Guide</a> appeared first on <a href="https://sqlsolutionsgroup.com">SQL Solutions Group</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sqlsolutionsgroup.com/understanding-wait-stats-in-sql-server-a-practical-guide/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Working with Customer Requirements: Is the Customer Always Right?</title>
		<link>https://sqlsolutionsgroup.com/working-with-customer-requirements-is-the-customer-always-right/</link>
					<comments>https://sqlsolutionsgroup.com/working-with-customer-requirements-is-the-customer-always-right/#respond</comments>
		
		<dc:creator><![CDATA[Jason Russell]]></dc:creator>
		<pubDate>Tue, 17 Jun 2025 09:33:00 +0000</pubDate>
				<category><![CDATA[SQL Group]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[#microsftcertifedmaster]]></category>
		<category><![CDATA[#microsftpartner]]></category>
		<category><![CDATA[#SQLAB]]></category>
		<category><![CDATA[#SQlatino]]></category>
		<category><![CDATA[#SQlatinoamerica]]></category>
		<category><![CDATA[#sqldatabase]]></category>
		<category><![CDATA[#sqldeveloper]]></category>
		<category><![CDATA[#SQLgroupie]]></category>
		<category><![CDATA[#sqlimer]]></category>
		<category><![CDATA[#sqlimerbymay]]></category>
		<category><![CDATA[#sqlinjection]]></category>
		<category><![CDATA[#sqlinternals]]></category>
		<category><![CDATA[#sqlite]]></category>
		<category><![CDATA[#sqlite3]]></category>
		<category><![CDATA[#SQLLearning]]></category>
		<category><![CDATA[#SQLMagazine]]></category>
		<category><![CDATA[#sqlmanagementstudio]]></category>
		<category><![CDATA[#sqlmanager]]></category>
		<category><![CDATA[#Sqlmap]]></category>
		<category><![CDATA[#sqlrun]]></category>
		<category><![CDATA[#sqlsaturday2017]]></category>
		<category><![CDATA[#sqlsatvienna]]></category>
		<category><![CDATA[#sqlserver]]></category>
		<category><![CDATA[#SQLserver2012]]></category>
		<category><![CDATA[#sqlserver2014]]></category>
		<category><![CDATA[#sqlserver2017]]></category>
		<category><![CDATA[#sqlserver2022]]></category>
		<category><![CDATA[#SQLServeronLinux]]></category>
		<category><![CDATA[#SQLsolutionsgroup]]></category>
		<category><![CDATA[#SQLTraining]]></category>
		<category><![CDATA[#SQLYog]]></category>
		<category><![CDATA[consulting]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQLPASS]]></category>
		<category><![CDATA[SQLSaturday]]></category>
		<category><![CDATA[SSG]]></category>
		<guid isPermaLink="false">https://sqlsolutionsgroup.com/?p=5232</guid>

					<description><![CDATA[<p>As SQL Server consultants, we’re always working with customer requirements and tackling diverse database needs, from the mundane to the critical. Clients turn to us for various reasons—maybe they don’t have the personnel, maybe the challenge is beyond their skill—but regardless of the circumstance, without question we have more SQL Server knowledge than they do. [&#8230;]</p>
<p>The post <a href="https://sqlsolutionsgroup.com/working-with-customer-requirements-is-the-customer-always-right/">Working with Customer Requirements: Is the Customer Always Right?</a> appeared first on <a href="https://sqlsolutionsgroup.com">SQL Solutions Group</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="356" class="wp-image-5230" src="https://sqlsolutionsgroup.com/wp-content/uploads/2020/09/Define_problem-1024x356.png" alt="Working with Customer Requirements" srcset="https://sqlsolutionsgroup.com/wp-content/uploads/2020/09/Define_problem-1024x356.png 1024w, https://sqlsolutionsgroup.com/wp-content/uploads/2020/09/Define_problem-300x104.png 300w, https://sqlsolutionsgroup.com/wp-content/uploads/2020/09/Define_problem-768x267.png 768w, https://sqlsolutionsgroup.com/wp-content/uploads/2020/09/Define_problem.png 1207w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>

<p>As SQL Server consultants, we’re always working with customer requirements and tackling diverse database needs, from the mundane to the critical. Clients turn to us for various reasons—maybe they don’t have the personnel, maybe the challenge is beyond their skill—but regardless of the circumstance, without question we have more SQL Server knowledge than they do.</p>
<p>That probably doesn’t read very well, and it’s not meant as a knock on our clients. But, if it weren’t true, they wouldn’t hire us, right?</p>
<p>Back to working with customer requirements. I <a href="https://sqlsolutionsgroup.com/fixing-sql-problems-do-you-know-too-much/">recently blogged</a> about times when too much knowledge could impede problem solving. This sparked further internal discussions about potentially uncomfortable situations where the customer provide solutions, especially when the problem is ill-defined. (This is a plate of spaghetti&#8230;let&#8217;s see if it will stick to the wall). This invariably leads to lots of wheel spinning. Here&#8217;s <a href="https://theoatmeal.com/comics/design_hell">a comical look</a> at how this might go.</p>
<p>In contrast, when the client provides <strong>accurate business requirements</strong>, we can get right down to brass tacks. </p>
<h3>Acting like a Consultant</h3>
<p>This is where soft skills are so important. You clearly don’t want to alienate or offend a client. And, after all, you’re working with their data and their systems. On the other hand, if they could have solved it, they wouldn’t have called you. The challenge of the client presenting consultants—a team of experts—with a solution to an urgent problem is that the identified problem may very well <strong>not be the root cause</strong> of the issue and even if it is, the proposed solutions may not be the best way to solve the problem. </p>
<p>So how do we, at SSG, handle “solutions” that are brought to us when a customer has an urgent crisis or emergency? First, we hope that our customers realize that SQL Server is what we do day in and day out. That, collectively, there is more than <span style="color: #000000;"><b>95 </b></span>years of SQL Server experience at SSG. We’ve seen it all and done it all, which is why our clients trust us to fix their problems.  </p>
<p>Secondly, we take the time to talk to our customers and listen to their experiences so we can get to the highly useful accurate business requirements. What problem do they perceive, and what are the symptoms? What is the pain that motivated them to seek out a team with more knowledge and experience with SQL? Did they develop a solution? </p>
<p>When a customer comes to us with a requirement for solving a problem, we have to step back and evaluate if the customer even wants us to make sure they have identified the real problem. Sometimes, customers really do just want us to quickly throw together their solution and worry about the next problem later. Honestly, we do that sometimes. We let customers know that there may be a bigger issue, that there may be other things that arise later. Or, that ultimately down the road they will run into more problems. If that is the path they choose, that’s OK as well. </p>
<h3>Getting to the Solution</h3>
<blockquote>
<p>Well I tell them there&#8217;s no problems&#8230;only solutions.</p>
<p>— John Lennon</p>
</blockquote>
<p>Ultimately, if you want to get your problem solved quickly, correctly, and efficiently, you don’t need to spend a ton of time creating a list of requirements. Bring us the problem, and let us work with you as we make sure the real problem has been identified and then develop a robust solution. In this sense, it doesn’t really matter if the customer is always right. It only matters if we can come to grips with the problem and find the appropriate solution in short order.</p>
<p>We&#8217;ll come back to this issue again in the near future to address proper collection of requirements. </p><p>The post <a href="https://sqlsolutionsgroup.com/working-with-customer-requirements-is-the-customer-always-right/">Working with Customer Requirements: Is the Customer Always Right?</a> appeared first on <a href="https://sqlsolutionsgroup.com">SQL Solutions Group</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sqlsolutionsgroup.com/working-with-customer-requirements-is-the-customer-always-right/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Safeguarding Your Data: Navigating SQL Backup, Compliance, Maintenance, and Support Challenges</title>
		<link>https://sqlsolutionsgroup.com/safeguarding-your-data-navigating-sql-backup-compliance-maintenance-and-support-challenges/</link>
					<comments>https://sqlsolutionsgroup.com/safeguarding-your-data-navigating-sql-backup-compliance-maintenance-and-support-challenges/#respond</comments>
		
		<dc:creator><![CDATA[A.K. Gonzalez]]></dc:creator>
		<pubDate>Fri, 30 May 2025 19:36:51 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[#microsftcertifedmaster]]></category>
		<category><![CDATA[#microsftpartner]]></category>
		<category><![CDATA[#parallelism #azure]]></category>
		<category><![CDATA[#SQLAB]]></category>
		<category><![CDATA[#SQlatino]]></category>
		<category><![CDATA[#SQlatinoamerica]]></category>
		<category><![CDATA[#sqldatabase]]></category>
		<category><![CDATA[#sqldeveloper]]></category>
		<category><![CDATA[#SQLgroupie]]></category>
		<category><![CDATA[#sqlimer]]></category>
		<category><![CDATA[#sqlimerbymay]]></category>
		<category><![CDATA[#sqlinjection]]></category>
		<category><![CDATA[#sqlinternals]]></category>
		<category><![CDATA[#sqlite]]></category>
		<category><![CDATA[#sqlite3]]></category>
		<category><![CDATA[#SQLLearning]]></category>
		<category><![CDATA[#SQLMagazine]]></category>
		<category><![CDATA[#sqlmanagementstudio]]></category>
		<category><![CDATA[#sqlmanager]]></category>
		<category><![CDATA[#Sqlmap]]></category>
		<category><![CDATA[#sqlrun]]></category>
		<category><![CDATA[#sqlsaturday2017]]></category>
		<category><![CDATA[#sqlsatvienna]]></category>
		<category><![CDATA[#sqlserver]]></category>
		<category><![CDATA[#SQLserver2012]]></category>
		<category><![CDATA[#sqlserver2014]]></category>
		<category><![CDATA[#sqlserver2017]]></category>
		<category><![CDATA[#sqlserver2022]]></category>
		<category><![CDATA[#SQLServeronLinux]]></category>
		<category><![CDATA[#SQLsolutionsgroup]]></category>
		<category><![CDATA[#SQLTraining]]></category>
		<category><![CDATA[#SQLYog]]></category>
		<category><![CDATA[Christmas]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQLPASS]]></category>
		<category><![CDATA[SQLSaturday]]></category>
		<category><![CDATA[SSG]]></category>
		<guid isPermaLink="false">https://sqlsolutionsgroup.com/?p=7257</guid>

					<description><![CDATA[<p>As businesses become increasingly data-driven, the role of SQL databases has become critical to day-to-day operations. Yet, many organizations underestimate the ongoing demands of managing these systems securely and efficiently. In this article, we dive into four often overlooked—but vital—areas of SQL database management: backup and recovery, compliance and governance, maintenance and upgrades, and the [&#8230;]</p>
<p>The post <a href="https://sqlsolutionsgroup.com/safeguarding-your-data-navigating-sql-backup-compliance-maintenance-and-support-challenges/">Safeguarding Your Data: Navigating SQL Backup, Compliance, Maintenance, and Support Challenges</a> appeared first on <a href="https://sqlsolutionsgroup.com">SQL Solutions Group</a>.</p>
]]></description>
										<content:encoded><![CDATA[		<div data-elementor-type="wp-post" data-elementor-id="7257" class="elementor elementor-7257" data-elementor-post-type="post">
						<section class="elementor-section elementor-top-section elementor-element elementor-element-33a15772 elementor-section-boxed elementor-section-height-default elementor-section-height-default" data-id="33a15772" data-element_type="section" data-e-type="section">
						<div class="elementor-container elementor-column-gap-default">
					<div class="elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-28a67839" data-id="28a67839" data-element_type="column" data-e-type="column">
			<div class="elementor-widget-wrap elementor-element-populated">
						<div class="elementor-element elementor-element-39cc616 elementor-widget elementor-widget-text-editor" data-id="39cc616" data-element_type="widget" data-e-type="widget" data-widget_type="text-editor.default">
				<div class="elementor-widget-container">
									<p data-start="191" data-end="633">As businesses become increasingly data-driven, the role of SQL databases has become critical to day-to-day operations. Yet, many organizations underestimate the ongoing demands of managing these systems securely and efficiently. In this article, we dive into four often overlooked—but vital—areas of SQL database management: backup and recovery, compliance and governance, maintenance and upgrades, and the need for skilled technical support.</p>
<h3 data-start="635" data-end="691">1. Backup and Recovery: Preparing for the Unexpected</h3>
<p data-start="693" data-end="767">Every company <em data-start="707" data-end="715">thinks</em> they have a backup plan—until something goes wrong.</p>
<p data-start="769" data-end="963">Backups are your first line of defense against data loss caused by system failures, human error, cyberattacks, or natural disasters. But it’s not enough to just schedule backups and forget them.</p>
<p data-start="965" data-end="984"><strong data-start="965" data-end="983">Key challenges</strong>:</p>
<ul data-start="985" data-end="1202">
<li data-start="985" data-end="1070">
<p data-start="987" data-end="1070"><strong data-start="987" data-end="1019">Incomplete backup strategies</strong> (e.g., only full backups with no transaction logs)</p>
</li>
<li data-start="1071" data-end="1121">
<p data-start="1073" data-end="1121"><strong data-start="1073" data-end="1110">Backups stored on the same server</strong> that fails</p>
</li>
<li data-start="1122" data-end="1202">
<p data-start="1124" data-end="1202"><strong data-start="1124" data-end="1147">Unverified restores</strong>—you don’t know if the backups work until you need them</p>
</li>
</ul>
<p data-start="1204" data-end="1223"><strong data-start="1204" data-end="1222">Best practices</strong>:</p>
<ul data-start="1224" data-end="1439">
<li data-start="1224" data-end="1297">
<p data-start="1226" data-end="1297">Use a layered approach: full, differential, and transaction log backups</p>
</li>
<li data-start="1298" data-end="1372">
<p data-start="1300" data-end="1372">Store backups in geographically redundant locations, including the cloud</p>
</li>
<li data-start="1373" data-end="1439">
<p data-start="1375" data-end="1439">Regularly test restores—don’t assume your backups are functional</p>
</li>
</ul>
<p data-start="1441" data-end="1575">A tested, well-architected backup and recovery plan ensures business continuity and protects your company from catastrophic data loss.</p>
<h3 data-start="1577" data-end="1637">2. Compliance and Governance: Meeting Industry Standards</h3>
<p data-start="1639" data-end="1756">With growing scrutiny around data privacy and security, compliance isn’t optional—it’s a legal and ethical necessity.</p>
<p data-start="1758" data-end="1780"><strong data-start="1758" data-end="1779">Common challenges</strong>:</p>
<ul data-start="1781" data-end="1947">
<li data-start="1781" data-end="1860">
<p data-start="1783" data-end="1860">Navigating complex regulations like <strong data-start="1819" data-end="1827">GDPR</strong>, <strong data-start="1829" data-end="1838">HIPAA</strong>, <strong data-start="1840" data-end="1847">SOX</strong>, or <strong data-start="1852" data-end="1860">CCPA</strong></p>
</li>
<li data-start="1861" data-end="1909">
<p data-start="1863" data-end="1909">Inadequate <strong data-start="1874" data-end="1890">audit trails</strong> or change tracking</p>
</li>
<li data-start="1910" data-end="1947">
<p data-start="1912" data-end="1947">Poor <strong data-start="1917" data-end="1947">role-based access controls</strong></p>
</li>
</ul>
<p data-start="1949" data-end="1976"><strong data-start="1949" data-end="1975">Why governance matters</strong>:</p>
<ul data-start="1977" data-end="2138">
<li data-start="1977" data-end="2034">
<p data-start="1979" data-end="2034">It builds customer trust and safeguards your reputation</p>
</li>
<li data-start="2035" data-end="2083">
<p data-start="2037" data-end="2083">It protects you from legal penalties and fines</p>
</li>
<li data-start="2084" data-end="2138">
<p data-start="2086" data-end="2138">It supports internal transparency and accountability</p>
</li>
</ul>
<p data-start="2140" data-end="2307">A mature SQL environment includes automated audit logs, encryption protocols, clearly defined user roles, and documented policies to handle sensitive data responsibly.</p>
<h3 data-start="2309" data-end="2365">3. Maintenance and Upgrades: Avoiding Technical Debt</h3>
<p data-start="2367" data-end="2514">SQL Server isn’t a “set it and forget it” system. Ongoing maintenance is essential to keeping your environment secure, efficient, and future-ready.</p>
<p data-start="2516" data-end="2546"><strong data-start="2516" data-end="2545">Risks of poor maintenance</strong>:</p>
<ul data-start="2547" data-end="2772">
<li data-start="2547" data-end="2639">
<p data-start="2549" data-end="2639">Performance degradation over time due to bloated indexes, fragmentation, or outdated stats</p>
</li>
<li data-start="2640" data-end="2701">
<p data-start="2642" data-end="2701">Missed patches that leave you open to known vulnerabilities</p>
</li>
<li data-start="2702" data-end="2772">
<p data-start="2704" data-end="2772">Falling behind on SQL Server versions, creating compatibility issues</p>
</li>
</ul>
<p data-start="2774" data-end="2805"><strong data-start="2774" data-end="2804">Smart maintenance includes</strong>:</p>
<ul data-start="2806" data-end="3012">
<li data-start="2806" data-end="2848">
<p data-start="2808" data-end="2848">Regular index and statistics maintenance</p>
</li>
<li data-start="2849" data-end="2899">
<p data-start="2851" data-end="2899">Applying critical patches and cumulative updates</p>
</li>
<li data-start="2900" data-end="2953">
<p data-start="2902" data-end="2953">Scheduled downtime for proactive performance tuning</p>
</li>
<li data-start="2954" data-end="3012">
<p data-start="2956" data-end="3012">Planning for version upgrades before end-of-life support</p>
</li>
</ul>
<p data-start="3014" data-end="3121">Ignoring maintenance is like skipping oil changes—eventually, your engine (or server) will grind to a halt.</p>
<h3 data-start="3123" data-end="3191">4. Technical Support and Expertise: When You Need a Second Brain</h3>
<p data-start="3193" data-end="3317">Even with strong internal IT teams, SQL Server can throw curveballs. That’s where expert-level support makes the difference.</p>
<p data-start="3319" data-end="3346"><strong data-start="3319" data-end="3345">Why companies struggle</strong>:</p>
<ul data-start="3347" data-end="3530">
<li data-start="3347" data-end="3417">
<p data-start="3349" data-end="3417">DBAs wear too many hats and don’t have time for deep problem-solving</p>
</li>
<li data-start="3418" data-end="3475">
<p data-start="3420" data-end="3475">Complex issues require years of SQL-specific experience</p>
</li>
<li data-start="3476" data-end="3530">
<p data-start="3478" data-end="3530">Emergency situations demand fast, accurate solutions</p>
</li>
</ul>
<p data-start="3532" data-end="3567"><strong data-start="3532" data-end="3566">Benefits of expert SQL support</strong>:</p>
<ul data-start="3568" data-end="3757">
<li data-start="3568" data-end="3624">
<p data-start="3570" data-end="3624">Quick diagnosis of performance or configuration issues</p>
</li>
<li data-start="3625" data-end="3692">
<p data-start="3627" data-end="3692">Help with high-availability setups and disaster recovery planning</p>
</li>
<li data-start="3693" data-end="3757">
<p data-start="3695" data-end="3757">Optimization strategies tailored to your business and workload</p>
</li>
</ul>
<p data-start="3759" data-end="3882">Partnering with seasoned SQL professionals gives your team the support it needs—without the cost of a full-time specialist.</p>
<hr data-start="3884" data-end="3887" />
<h2 data-start="3889" data-end="3906">Final Thoughts</h2>
<p data-start="3908" data-end="4224">SQL Server is a powerful engine, but like any high-performance machine, it requires care, precision, and expertise to run at its best. By prioritizing backup and recovery, ensuring compliance and governance, staying on top of maintenance, and investing in expert support, you can protect your data—and your business.</p>
<p data-start="3908" data-end="4224"> </p>
<p data-start="3908" data-end="4224">SQL Backup and Recovery, Database Compliance, SQL Governance, SQL Server Maintenance, SQL Upgrades, SQL Technical Support, SQL DBA Services, SQL Performance, SQL Disaster Recovery, Enterprise Database Management</p>


<p></p>
								</div>
				</div>
					</div>
		</div>
					</div>
		</section>
				</div>
		<p>The post <a href="https://sqlsolutionsgroup.com/safeguarding-your-data-navigating-sql-backup-compliance-maintenance-and-support-challenges/">Safeguarding Your Data: Navigating SQL Backup, Compliance, Maintenance, and Support Challenges</a> appeared first on <a href="https://sqlsolutionsgroup.com">SQL Solutions Group</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sqlsolutionsgroup.com/safeguarding-your-data-navigating-sql-backup-compliance-maintenance-and-support-challenges/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SSMS 21 Gets a Fresh New Look:  What&#8217;s Changed?</title>
		<link>https://sqlsolutionsgroup.com/ssms-21-gets-a-fresh-new-look-whats-changed/</link>
					<comments>https://sqlsolutionsgroup.com/ssms-21-gets-a-fresh-new-look-whats-changed/#respond</comments>
		
		<dc:creator><![CDATA[A.K. Gonzalez]]></dc:creator>
		<pubDate>Fri, 14 Mar 2025 19:24:14 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[#microsftcertifedmaster]]></category>
		<category><![CDATA[#microsftpartner]]></category>
		<category><![CDATA[#SQLAB]]></category>
		<category><![CDATA[#SQlatino]]></category>
		<category><![CDATA[#SQlatinoamerica]]></category>
		<category><![CDATA[#sqldatabase]]></category>
		<category><![CDATA[#sqldeveloper]]></category>
		<category><![CDATA[#SQLgroupie]]></category>
		<category><![CDATA[#sqlimer]]></category>
		<category><![CDATA[#sqlimerbymay]]></category>
		<category><![CDATA[#sqlinjection]]></category>
		<category><![CDATA[#sqlinternals]]></category>
		<category><![CDATA[#sqlite]]></category>
		<category><![CDATA[#sqlite3]]></category>
		<category><![CDATA[#SQLLearning]]></category>
		<category><![CDATA[#SQLMagazine]]></category>
		<category><![CDATA[#sqlmanagementstudio]]></category>
		<category><![CDATA[#sqlmanager]]></category>
		<category><![CDATA[#Sqlmap]]></category>
		<category><![CDATA[#sqlrun]]></category>
		<category><![CDATA[#sqlsaturday2017]]></category>
		<category><![CDATA[#sqlsatvienna]]></category>
		<category><![CDATA[#sqlserver]]></category>
		<category><![CDATA[#SQLserver2012]]></category>
		<category><![CDATA[#sqlserver2014]]></category>
		<category><![CDATA[#sqlserver2017]]></category>
		<category><![CDATA[#sqlserver2022]]></category>
		<category><![CDATA[#SQLServeronLinux]]></category>
		<category><![CDATA[#SQLsolutionsgroup]]></category>
		<category><![CDATA[#SQLTraining]]></category>
		<category><![CDATA[#SQLYog]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQLPASS]]></category>
		<category><![CDATA[SQLSaturday]]></category>
		<category><![CDATA[SSG]]></category>
		<guid isPermaLink="false">https://sqlsolutionsgroup.com/?p=7197</guid>

					<description><![CDATA[<p>Microsoft just unveiled preview #5 of SQL Server Management Studio (SSMS) 21, and one of the most exciting updates is its sleek, modernized interface. For developers and database administrators, SSMS is an essential tool, and any improvement to its usability can make a huge difference in workflow efficiency. Let’s take a closer look at what’s [&#8230;]</p>
<p>The post <a href="https://sqlsolutionsgroup.com/ssms-21-gets-a-fresh-new-look-whats-changed/">SSMS 21 Gets a Fresh New Look:  What&#8217;s Changed?</a> appeared first on <a href="https://sqlsolutionsgroup.com">SQL Solutions Group</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p class="p1"><span class="s1">Microsoft just unveiled preview #5 of </span><span class="s2">SQL Server Management Studio (SSMS) 21</span><span class="s1">, and one of the most exciting updates is its sleek, modernized interface. For developers and database administrators, SSMS is an essential tool, and any improvement to its usability can make a huge difference in workflow efficiency. <strong>Let’s take a closer look at what’s new in the UI and how it enhances the overall experience.</strong></span></p>
<h4 class="p1"><em><strong><span class="s1">A Refreshed Look for Better Navigation</span></strong></em></h4>
<p class="p1"><span class="s1">SSMS 21 introduces a </span><span class="s2">cleaner, more intuitive design</span><span class="s1">, making it easier to navigate large databases and complex queries. Microsoft has streamlined menus, improved font rendering, and optimized color schemes to reduce eye strain during long working sessions.</span></p>
<p class="p1"><span class="s1">Key UI improvements include:</span></p>
<p class="p1"><span class="s1">✔ </span><em><span class="s2">Refined toolbar and menu layout</span></em><span class="s1"> – More logical grouping of frequently used functions for faster access.</span></p>
<p class="p1"><span class="s1">✔ </span><em><span class="s2">Improved tab management</span></em><span class="s1"> – A more organized way to handle multiple query windows efficiently.</span></p>
<p class="p1"><span class="s1">✔ </span><em><span class="s2">Customizable themes</span></em><span class="s1"> – Dark mode and high-contrast options for a more personalized experience.</span></p>
<h4><em>Enhanced Query Editing Experience</em></h4>
<p>The Query editor in SSMS 21 now feels smoother and more responsive, thanks to performance optimization under the hood. Users will notice faster syntax highlighting, better IntelliSense suggestions, and an upgraded results pane for easier data analysis.</p>
<p>Notable Enhancements:</p>
<p class="p1"><span class="s1">✔ </span><em><span class="s2">Auto-complete improvements</span></em><span class="s1"> – More accurate and context-aware suggestions for writing queries faster.</span></p>
<p class="p1"><span class="s1">✔ <em>Resizable panels </em></span><span class="s1">– Adjust the layout effortlessly to fit your workflow.</span></p>
<p class="p1"><span class="s1">✔ <em>Improved error highlighting</em></span><span class="s1"> – Making debugging SQL scripts quicker and more intuitive. </span></p>
<h4><em>A Step Toward a More Modern SQL Experience</em></h4>
<p class="p1"><span class="s1">Microsoft is clearly prioritizing </span><span class="s2">usability and productivity</span><span class="s1"> with SSMS 21. While the core functionality remains unchanged, these visual and functional updates make daily SQL tasks smoother and more enjoyable.</span></p>
<p class="p1"><span class="s1">If you rely on SSMS for database management, this upgrade is definitely worth exploring. </span><span class="s2">What do you think about the new look? Are there any features you’re hoping to see in future updates?</span><span class="s1"> Let us know in the comments!</span></p>
<p>The post <a href="https://sqlsolutionsgroup.com/ssms-21-gets-a-fresh-new-look-whats-changed/">SSMS 21 Gets a Fresh New Look:  What&#8217;s Changed?</a> appeared first on <a href="https://sqlsolutionsgroup.com">SQL Solutions Group</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sqlsolutionsgroup.com/ssms-21-gets-a-fresh-new-look-whats-changed/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Copying Databases Across SQL Managed Instances</title>
		<link>https://sqlsolutionsgroup.com/copying-databases-across-sql-managed-instances/</link>
					<comments>https://sqlsolutionsgroup.com/copying-databases-across-sql-managed-instances/#comments</comments>
		
		<dc:creator><![CDATA[Scott Klein]]></dc:creator>
		<pubDate>Tue, 23 Apr 2024 11:38:47 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[#microsftcertifedmaster]]></category>
		<category><![CDATA[#microsftpartner]]></category>
		<category><![CDATA[#parallelism #azure]]></category>
		<category><![CDATA[#SQLAB]]></category>
		<category><![CDATA[#SQlatino]]></category>
		<category><![CDATA[#SQlatinoamerica]]></category>
		<category><![CDATA[#sqldatabase]]></category>
		<category><![CDATA[#sqldeveloper]]></category>
		<category><![CDATA[#SQLgroupie]]></category>
		<category><![CDATA[#sqlimer]]></category>
		<category><![CDATA[#sqlimerbymay]]></category>
		<category><![CDATA[#sqlinjection]]></category>
		<category><![CDATA[#sqlinternals]]></category>
		<category><![CDATA[#sqlite]]></category>
		<category><![CDATA[#sqlite3]]></category>
		<category><![CDATA[#SQLLearning]]></category>
		<category><![CDATA[#SQLMagazine]]></category>
		<category><![CDATA[#sqlmanagementstudio]]></category>
		<category><![CDATA[#sqlmanager]]></category>
		<category><![CDATA[#Sqlmap]]></category>
		<category><![CDATA[#sqlrun]]></category>
		<category><![CDATA[#sqlsaturday2017]]></category>
		<category><![CDATA[#sqlsatvienna]]></category>
		<category><![CDATA[#sqlserver]]></category>
		<category><![CDATA[#SQLserver2012]]></category>
		<category><![CDATA[#sqlserver2014]]></category>
		<category><![CDATA[#sqlserver2017]]></category>
		<category><![CDATA[#sqlserver2022]]></category>
		<category><![CDATA[#SQLServeronLinux]]></category>
		<category><![CDATA[#SQLsolutionsgroup]]></category>
		<category><![CDATA[#SQLTraining]]></category>
		<category><![CDATA[#SQLYog]]></category>
		<category><![CDATA[Christmas]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQLPASS]]></category>
		<category><![CDATA[SQLSaturday]]></category>
		<category><![CDATA[SSG]]></category>
		<guid isPermaLink="false">https://sqlsolutionsgroup.com/?p=7024</guid>

					<description><![CDATA[<p>It only seems like yesterday since it was my turn to write a blog. And yet, here we are again, still staring at the M&#38;M dispenser full of dark chocolate peanut M&#38;Ms. (In my last blog I called it a carousel, when in reality, it is more like a Ferris wheel.) Anyway, in this blog [&#8230;]</p>
<p>The post <a href="https://sqlsolutionsgroup.com/copying-databases-across-sql-managed-instances/">Copying Databases Across SQL Managed Instances</a> appeared first on <a href="https://sqlsolutionsgroup.com">SQL Solutions Group</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>It only seems like yesterday <a href="https://sqlsolutionsgroup.com/the-right-tool-for-the-right-job/">since it was my turn</a> to write a blog. And yet, here we are again, still staring at the M&amp;M dispenser full of dark chocolate peanut M&amp;Ms. (In my last blog I called it a carousel, when in reality, it is more like a Ferris wheel.)</p>



<p>Anyway, in this blog post I want to cover a technology for copying databases across SQL Managed Instances that saved my posterior recently. Well, it didn’t really save it, but it sure made my life easier. We have a client who uses Azure SQL Managed Instance for both their production and test environments. I think this is awesome.</p>



<p>As a quick background, Azure SQL Managed Instance is a full SQL Server instance served up as a PaaS service. Unlike Azure SQL Database where you are only working at the database level, Managed Instance gives you near 100% instance compatibility level capabilities with the latest version of SQL Server Enterprise Edition SQL Server database engine. SQL Managed Instance provides the lift and shift capabilities of on-premises databases with minimal database changes.</p>



<p>So, back to our customer. They essentially lifted and shifted their on-premises databases to Azure SQL Managed Instance and have been using it successfully for nearly two years. Again, this is awesome.</p>



<p>Last week they came to us and asked about reporting with Managed Instance. They were looking at data marts and data warehouses, but we needed more information. It turns out they have some people that just want the ability to query the databases, and potentially hook up Excel to these databases for data analysis.</p>



<p>The caveat is that the people I was talking to didn’t want to give the other group direct access to the production environment. <em>Toootally</em> get that. Yeah, like 100% get it. So, what are the options?</p>



<p>After some discussion we decided to give the group wanting to run reports access to the test Managed Instance environment. We’ll just refresh the test environment data with the production environment data on a schedule. For them, refreshing data nightly is OK for now.</p>



<p>So, the question then becomes, how do you get data, or copy a database, from one SQL Managed Instance to another SQL Managed Instance? There are two ways, and I’ll discuss both here.</p>



<h3 class="wp-block-heading">PowerShell cmdlets</h3>



<p>Microsoft released some Powershell cmdlets that make copying data across SQL Managed Instances simple.</p>



<p>There are essentially 3 cmdlets:</p>



<ul class="wp-block-list">
<li><strong>Copy-AzSqlInstanceDatabase</strong> – Starts an online copy operation.</li>



<li><strong>Get-AzSqlInstanceDatabaseCopyOperation</strong> – Returns copy operation details.</li>



<li><strong>Complete-AzSqlInstanceDatabaseCopy</strong> – Completes the copy operation.</li>
</ul>



<p>The <em>Copy-AzSqlInstancesDatabase</em> cmdlet starts an online copy operation of a database across managed instances using Always On availability group technology. <a href="https://learn.microsoft.com/en-us/powershell/module/az.sql/copy-azsqlinstancedatabase?view=azps-11.4.0">Copy-AzSqlInstanceDatabase (Az.Sql) | Microsoft Learn</a></p>



<p>The <em>Get-AzSqlInstanceDatabaseCopyOperation</em> cmdlet returns database copy operation details. You can call this cmdlet in a loop so you can track the status of the copy. <a href="https://learn.microsoft.com/en-us/powershell/module/az.sql/get-azsqlinstancedatabasecopyoperation?view=azps-11.4.0">Get-AzSqlInstanceDatabaseCopyOperation (Az.Sql) | Microsoft Learn</a></p>



<p>The <em>Complete-AzSqlInstanceDAtabaseCopy</em> cmdlet completes the copy operation of the database and makes it available for read/write workloads. <a href="https://learn.microsoft.com/en-us/powershell/module/az.sql/complete-azsqlinstancedatabasecopy?view=azps-11.4.0">Complete-AzSqlInstanceDatabaseCopy (Az.Sql) | Microsoft Learn</a></p>



<p>You don’t have to call the <em>Get-AzSqlInstanceDatabaseCopyOperation</em> cmdlet as you could just call the Copy and Complete, but it is HIGHLY recommended you call it so you know when to call the complete.</p>



<p>The way this works is you start by calling the <em>Copy-AzSqlInstancesDatabase</em> cmdlet. This starts an online copy operation of one or more databases. Once the copy option starts, data is being seeded from the source to the target. During the process, you can call the <em>Get-AzSqlInstanceDatabaseCopyOperation</em> cmdlet to check the copy operation status, either in-progress or completed.</p>



<p>Once the copy operation has completed, the status will be copy ready for completion. Within the next 24 hours the user can complete the database copy operation by calling the <em>Get-AzSqlInstanceDatabaseCopyOperation</em> cmdlet. Note that until the <em>Get-AzSqlInstanceDatabaseCopyOperation</em> cmdlet is called, all the changes from the source are being replicated to the target database.</p>



<p>When <em>Get-AzSqlInstanceDatabaseCopyOperation</em> is called, the link between the source and target databases is broken, the target database becomes online and ready.</p>



<p>A very simple example would be something like this:</p>



<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img decoding="async" border="0" style="border: 0 none" src="https://sqlsolutionsgroup.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img decoding="async" border="0" style="border: 0 none" src="https://sqlsolutionsgroup.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="https://sqlsolutionsgroup.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img decoding="async" border="0" style="border: 0 none" src="https://sqlsolutionsgroup.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="powershell" style="font-family:monospace;"><span class="re0">$dbname</span> <span class="sy0">=</span> <span class="st0">&quot;db1&quot;</span>
<span class="re0">$sourceMI</span> <span class="sy0">=</span> <span class="st0">&quot;sqlmi1&quot;</span>
<span class="re0">$targetMI</span> <span class="sy0">=</span> <span class="st0">&quot;sqlmi2&quot;</span>
<span class="re0">$sourceRG</span> <span class="sy0">=</span> <span class="st0">&quot;rg1&quot;</span>
<span class="re0">$targetMI</span> <span class="sy0">=</span> <span class="st0">&quot;rg2&quot;</span>
&nbsp;
Copy<span class="sy0">-</span>AzSqlInstanceDatabase `
    <span class="sy0">-</span>DatabaseName <span class="re0">$dbName</span> `
    <span class="sy0">-</span>InstanceName <span class="re0">$sourceMi</span> `
    <span class="sy0">-</span>ResourceGroupName <span class="re0">$sourceRg</span> `
    <span class="sy0">-</span>TargetInstanceName <span class="re0">$targetMi</span> `
    <span class="sy0">-</span>TargetResourceGroupName <span class="re0">$targetRg</span> 
&nbsp;
<span class="kw3">While</span><span class="br0">&#40;</span>true$<span class="br0">&#41;</span>
<span class="br0">&#123;</span>
&nbsp;
    <span class="kw1">Start-Sleep</span> <span class="kw5">-Seconds</span> 10
    <span class="re0">$operation</span> <span class="sy0">=</span> Get<span class="sy0">-</span>AzSqlInstanceDatabaseCopyOperation `
    <span class="sy0">-</span>DatabaseName <span class="re0">$dbname</span> `
    <span class="sy0">-</span>InstanceName <span class="re0">$sourceMI</span> `
    <span class="sy0">-</span>ResourceGroupName <span class="re0">$sourceRG</span> `
    <span class="sy0">-</span>TargetInstanceName <span class="re0">$targetMI</span> `
    <span class="sy0">-</span>TargetResourceGroupName <span class="re0">$targetRG</span>
&nbsp;
    try
    <span class="br0">&#123;</span>
        <span class="re0">$copysucceeded</span> <span class="sy0">=</span> <span class="re0">$true</span>
        <span class="kw1">Write-Host</span> <span class="st0">&quot;Status of copy for &quot;</span> <span class="re0">$dbname</span> <span class="st0">&quot; is &quot;</span> <span class="re0">$operation</span>.State
        <span class="kw3">if</span> <span class="br0">&#40;</span><span class="sy0">!</span><span class="br0">&#40;</span><span class="re0">$operation</span>.State <span class="kw4">-eq</span> <span class="st0">&quot;Succeeded&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><span class="re0">$copysucceeded</span> <span class="sy0">=</span> <span class="re0">$false</span>;<span class="br0">&#125;</span>
    <span class="br0">&#125;</span>
    catch <span class="br0">&#123;</span> <span class="re0">$copysucceeded</span> <span class="sy0">=</span> <span class="re0">$false</span>; <span class="kw1">Write-Host</span> <span class="st0">&quot;Didn't work&quot;</span> <span class="br0">&#125;</span>
&nbsp;
    <span class="kw3">if</span> <span class="br0">&#40;</span><span class="re0">$copysucceeded</span><span class="br0">&#41;</span>
    <span class="br0">&#123;</span>
        <span class="kw1">Write-Host</span> <span class="st0">&quot;Copy completed&quot;</span>
        <span class="kw3">break</span>
    <span class="br0">&#125;</span>
    <span class="kw3">else</span> <span class="br0">&#123;</span> <span class="kw1">Write-Host</span> <span class="st0">&quot;Still copying...&quot;</span> <span class="br0">&#125;</span>
&nbsp;
<span class="br0">&#125;</span>
&nbsp;
Complete<span class="sy0">-</span>AzSqlInstanceDatabaseCopy `
    <span class="sy0">-</span>DatabaseName <span class="re0">$dbName</span> `
    <span class="sy0">-</span>InstanceName <span class="re0">$sourceMI</span> `
    <span class="sy0">-</span>ResourceGroupName <span class="re0">$sourceRG</span> `
    <span class="sy0">-</span>TargetInstanceName <span class="re0">$targetMI</span> `
    <span class="sy0">-</span>TargetResourceGroupName $targetRG</pre></div></div>



<p>There is a GREAT example here: <a href="https://techcommunity.microsoft.com/t5/azure-sql-blog/how-to-automate-azure-sql-managed-instance-database-copy-and/ba-p/3874505">Using and automating Azure SQL Managed Instance database copy and database move operations with Azure PowerShell (microsoft.com)</a></p>



<p>The example copies multiple databases, but if you are needing to copy only one, you can tweak it.</p>



<p>Oh, by the way, you can also do the copy via the Azure portal.</p>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="450" height="228" class="wp-image-7038" style="width: 450px;" src="https://sqlsolutionsgroup.com/wp-content/uploads/2024/04/image.png" alt="" srcset="https://sqlsolutionsgroup.com/wp-content/uploads/2024/04/image.png 535w, https://sqlsolutionsgroup.com/wp-content/uploads/2024/04/image-300x152.png 300w" sizes="(max-width: 450px) 100vw, 450px" /></figure>



<h3 class="wp-block-heading">Backup / Restore</h3>



<p>The other option is backup and restore, meaning, back up to Azure blob storage then restore from there. Since Managed Instance provides access to the SQL Agent, a job is created on both managed instances; one to back up, and one to restore.</p>



<p>This option gets a bit tricky because in the scenario for our client, and I would think in most environments, you want to restore the database in the target managed instance with the same name, and have the backup file the same as well, just to make it easy.</p>



<p>The backup job is simple: back up the database to Azure, ensuring the backup file name is always the same name. The restore job is just as simple: delete the database and then restore the database with the same name.</p>



<p>However, the issue in this scenario is that when you back up to the same file name, it will error because the file already exists. When we tested we thought, “no problem, we’ll just use PowerShell (Remove-AzureStorageBlob) to remove the file as the first step in the job, then the second step in the job will be to back up the database!”</p>



<p>Unfortunately, Managed Instance does not support PowerShell job steps. Sigh. So, we have an on-premises job (or it can even be a Windows Task Scheduler job) that runs the delete. At this point it is just a timing thing. Since the client only wants to back up and restore a single database, we run the backup job at 1 a.m., for example. Then 30 minutes later we run the restore, then another 30 minutes later, we run the delete blob job.</p>
<p>For this solution you’ll need to create a storage account in Azure, then create a CREDENTIAL in SQL Server on both Managed Instances:</p>
<div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img decoding="async" border="0" style="border: 0 none" src="https://sqlsolutionsgroup.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img decoding="async" border="0" style="border: 0 none" src="https://sqlsolutionsgroup.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="https://sqlsolutionsgroup.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img decoding="async" border="0" style="border: 0 none" src="https://sqlsolutionsgroup.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="powershell" style="font-family:monospace;">CREATE CREDENTIAL <span class="br0">[</span>https:<span class="sy0">//</span>mystorageaccount.blob.core.windows.net<span class="sy0">/</span>mycontainer<span class="br0">]</span>
WITH IDENTITY N<span class="st0">'SHARED ACCESS SIGNATURE'</span><span class="sy0">,</span>
SECRET <span class="sy0">=</span> N<span class="st0">'&lt;storageaccountkey&gt;'</span></pre></div></div>



<p>Once that is created, simply back up the database.</p>
<div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img decoding="async" border="0" style="border: 0 none" src="https://sqlsolutionsgroup.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img decoding="async" border="0" style="border: 0 none" src="https://sqlsolutionsgroup.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="https://sqlsolutionsgroup.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img decoding="async" border="0" style="border: 0 none" src="https://sqlsolutionsgroup.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="powershell" style="font-family:monospace;">BACKUP DATABASE <span class="br0">[</span>MyDB<span class="br0">]</span> TO URL <span class="sy0">=</span> N<span class="st0">'https://mystorageaccount.blob.core.windows.net/mycontainer/MyDB.bak'</span>
	WITH BLOCKSIZE <span class="sy0">=</span> <span class="nu0">65535</span><span class="sy0">,</span> COPY_ONLY<span class="sy0">,</span> NOFORMAT<span class="sy0">,</span> NOINIT<span class="sy0">,</span> 
	NAME <span class="sy0">=</span> N<span class="st0">'MyDB-Full Database Backup'</span><span class="sy0">,</span> NOSKIP<span class="sy0">,</span> NOREWIND<span class="sy0">,</span> NOUNLOAD<span class="sy0">,</span> STATS <span class="sy0">=</span> <span class="nu0">10</span></pre></div></div>
<p>Or, if you are using Ola Hallengren’s solution (which we are a major fan of):</p>
<div id="wpshdo_4" class="wp-synhighlighter-outer"><div id="wpshdt_4" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_4"></a><a id="wpshat_4" class="wp-synhighlighter-title" href="#codesyntax_4"  onClick="javascript:wpsh_toggleBlock(4)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_4" onClick="javascript:wpsh_code(4)" title="Show code only"><img decoding="async" border="0" style="border: 0 none" src="https://sqlsolutionsgroup.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_4" onClick="javascript:wpsh_print(4)" title="Print code"><img decoding="async" border="0" style="border: 0 none" src="https://sqlsolutionsgroup.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="https://sqlsolutionsgroup.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img decoding="async" border="0" style="border: 0 none" src="https://sqlsolutionsgroup.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_4" class="wp-synhighlighter-inner" style="display: block;"><pre class="powershell" style="font-family:monospace;">EXECUTE <span class="br0">[</span>dbo<span class="br0">]</span>.<span class="br0">[</span>DatabaseBackup<span class="br0">]</span>
<span class="sy0">@</span>Databases <span class="sy0">=</span> <span class="st0">'SentryOne'</span><span class="sy0">,</span>
<span class="sy0">@</span>URL <span class="sy0">=</span> <span class="st0">'https://mystorageaccount.blob.core.windows.net/mycontainer'</span><span class="sy0">,</span>
<span class="sy0">@</span>Credential <span class="sy0">=</span> <span class="st0">'https://mystorageaccount.blob.core.windows.net/mycontainer'</span><span class="sy0">,</span>
<span class="sy0">@</span>BackupType <span class="sy0">=</span> <span class="st0">'FULL'</span><span class="sy0">,</span>
<span class="sy0">@</span>Verify <span class="sy0">=</span> <span class="st0">'N'</span><span class="sy0">,</span>
<span class="sy0">@</span>CheckSum <span class="sy0">=</span> <span class="st0">'Y'</span><span class="sy0">,</span>
<span class="sy0">@</span>LogToTable <span class="sy0">=</span> <span class="st0">'Y'</span><span class="sy0">,</span>
<span class="sy0">@</span>Compress <span class="sy0">=</span> <span class="st0">'Y'</span><span class="sy0">,</span>
<span class="sy0">@</span>CopyOnly <span class="sy0">=</span> <span class="st0">'Y'</span></pre></div></div>
<p>Then restore onto the other Managed Instance:</p>
<div id="wpshdo_5" class="wp-synhighlighter-outer"><div id="wpshdt_5" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_5"></a><a id="wpshat_5" class="wp-synhighlighter-title" href="#codesyntax_5"  onClick="javascript:wpsh_toggleBlock(5)" title="Click to show/hide code block">Source code</a></td><td align="right"><a href="#codesyntax_5" onClick="javascript:wpsh_code(5)" title="Show code only"><img decoding="async" border="0" style="border: 0 none" src="https://sqlsolutionsgroup.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_5" onClick="javascript:wpsh_print(5)" title="Print code"><img decoding="async" border="0" style="border: 0 none" src="https://sqlsolutionsgroup.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="https://sqlsolutionsgroup.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img decoding="async" border="0" style="border: 0 none" src="https://sqlsolutionsgroup.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_5" class="wp-synhighlighter-inner" style="display: block;"><pre class="powershell" style="font-family:monospace;">RESTORE DATABASE <span class="br0">[</span>MyDB<span class="br0">]</span> FROM URL <span class="sy0">=</span> N<span class="st0">'https://mystorageaccount.blob.core.windows.net/mycontainer/MyDB.bak'</span></pre></div></div>
<p>Yeah, a bit cumbersome, but it works and runs, and solves the client’s problem.</p>



<h3 class="wp-block-heading">Which?</h3>



<p>As in all things SQL, it depends. For our client, the simple backup and restore was the solution. They were OK with data being up to 24 hours old for their reporting in this scenario.</p>



<p>If using the PowerShell cmdlets, the target database is unavailable for connections until you issue the Complete cmdlet. But it lets you copy multiple databases, not just one.</p>



<p>It really just comes down to what you are attempting to do. Honestly, for the customer, we could have easily used the PowerShell cmdlets to copy the database each night (deleting the database on the target Managed Instance before starting the copy) and that would eliminate the need to delete the file from blob storage.</p>



<p>So if you looking for ways of copying databases across SQL Managed Instances, you have several options.</p>



<p>&nbsp;</p>
<p>The post <a href="https://sqlsolutionsgroup.com/copying-databases-across-sql-managed-instances/">Copying Databases Across SQL Managed Instances</a> appeared first on <a href="https://sqlsolutionsgroup.com">SQL Solutions Group</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sqlsolutionsgroup.com/copying-databases-across-sql-managed-instances/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Chirospring: &#8220;We’ve gotten more than our money’s worth with SQL Solutions Group.&#8221;</title>
		<link>https://sqlsolutionsgroup.com/chirospring-case-study/</link>
					<comments>https://sqlsolutionsgroup.com/chirospring-case-study/#respond</comments>
		
		<dc:creator><![CDATA[Jason Russell]]></dc:creator>
		<pubDate>Thu, 21 Mar 2024 18:28:45 +0000</pubDate>
				<category><![CDATA[Case Studies]]></category>
		<category><![CDATA[SQL Group]]></category>
		<category><![CDATA[#microsftcertifedmaster]]></category>
		<category><![CDATA[#microsftpartner]]></category>
		<category><![CDATA[#SQLAB]]></category>
		<category><![CDATA[#SQlatino]]></category>
		<category><![CDATA[#SQlatinoamerica]]></category>
		<category><![CDATA[#sqldatabase]]></category>
		<category><![CDATA[#sqldeveloper]]></category>
		<category><![CDATA[#SQLgroupie]]></category>
		<category><![CDATA[#sqlimer]]></category>
		<category><![CDATA[#sqlimerbymay]]></category>
		<category><![CDATA[#sqlinjection]]></category>
		<category><![CDATA[#sqlinternals]]></category>
		<category><![CDATA[#sqlite]]></category>
		<category><![CDATA[#sqlite3]]></category>
		<category><![CDATA[#SQLLearning]]></category>
		<category><![CDATA[#SQLMagazine]]></category>
		<category><![CDATA[#sqlmanagementstudio]]></category>
		<category><![CDATA[#sqlmanager]]></category>
		<category><![CDATA[#Sqlmap]]></category>
		<category><![CDATA[#sqlrun]]></category>
		<category><![CDATA[#sqlsaturday2017]]></category>
		<category><![CDATA[#sqlsatvienna]]></category>
		<category><![CDATA[#sqlserver]]></category>
		<category><![CDATA[#SQLserver2012]]></category>
		<category><![CDATA[#sqlserver2014]]></category>
		<category><![CDATA[#sqlserver2017]]></category>
		<category><![CDATA[#sqlserver2022]]></category>
		<category><![CDATA[#SQLServeronLinux]]></category>
		<category><![CDATA[#SQLsolutionsgroup]]></category>
		<category><![CDATA[#SQLTraining]]></category>
		<category><![CDATA[#SQLYog]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQLPASS]]></category>
		<category><![CDATA[SQLSaturday]]></category>
		<category><![CDATA[SSG]]></category>
		<guid isPermaLink="false">https://sqlsolutionsgroup.com/?p=6598</guid>

					<description><![CDATA[<p>Introduce your business and what you do there.I’m the CEO of a cloud-based practice management software. What challenge were you trying to address with SQL Solutions Group?We needed help improving the speed of our software. What was the scope of the project?SQL Solutions Group is helping us optimize our software’s speed. First, they conducted a [&#8230;]</p>
<p>The post <a href="https://sqlsolutionsgroup.com/chirospring-case-study/">Chirospring: &#8220;We’ve gotten more than our money’s worth with SQL Solutions Group.&#8221;</a> appeared first on <a href="https://sqlsolutionsgroup.com">SQL Solutions Group</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="217" src="https://sqlsolutionsgroup.com/wp-content/uploads/2022/05/chriospringFullLogo-1024x217.png" alt="Chirospring logo" class="wp-image-6599" srcset="https://sqlsolutionsgroup.com/wp-content/uploads/2022/05/chriospringFullLogo-1024x217.png 1024w, https://sqlsolutionsgroup.com/wp-content/uploads/2022/05/chriospringFullLogo-300x64.png 300w, https://sqlsolutionsgroup.com/wp-content/uploads/2022/05/chriospringFullLogo-768x163.png 768w, https://sqlsolutionsgroup.com/wp-content/uploads/2022/05/chriospringFullLogo-1536x326.png 1536w, https://sqlsolutionsgroup.com/wp-content/uploads/2022/05/chriospringFullLogo-2048x434.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p><strong>Introduce your business and what you do there.<br></strong>I’m the CEO of a cloud-based practice management software.</p>



<p><strong>What challenge were you trying to address with SQL Solutions Group?<br></strong>We needed help improving the speed of our software.</p>



<p><strong>What was the scope of the project?<br></strong>SQL Solutions Group is helping us optimize our software’s speed. First, they conducted a health check for our SQL server. After that, they had a full presentation detailing areas for improvement. They’ve then made a plan where easier fixes are prioritized over more complicated ones. SQL Solutions Group has installed a tool on our server that tells us a query’s speed. Their team advises us on what improvements we can make to increase our system’s performance.</p>



<p><strong>How did you come to work with SSG?<br></strong>We found them through a Google search for SQL server consulting providers.</p>



<p><strong>What is the status of this engagement?<br></strong>We’ve started working together in January 2021, and it’s ongoing.</p>



<p><strong>What evidence can you share that demonstrates the impact of the engagement?<br></strong>We’ve gotten more than our money’s worth with SQL Solutions Group.</p>



<p><strong>How did SSG perform from a project management standpoint?<br></strong>SQL Solutions Group is always available whenever we need them. We communicate through Zoom calls.</p>



<p><strong>What did you find most impressive about this engagement?<br></strong>SQL Solutions Group’s high level of expertise with SQL is impressive. SQL is a complicated product to work with, and their more than 25 years of experience in SQL is what we need for our business.</p>



<p><strong>Are there any areas where SSG could improve?<br></strong>I can’t think of anything. We’ve been pleased with their services.</p>



<p><strong>Do you have any advice for potential customers?<br></strong>The larger your application and database, the more necessary SQL Solutions Group’s services are. Work with them if you want to scale your business and grow your software company.</p>
<p>The post <a href="https://sqlsolutionsgroup.com/chirospring-case-study/">Chirospring: &#8220;We’ve gotten more than our money’s worth with SQL Solutions Group.&#8221;</a> appeared first on <a href="https://sqlsolutionsgroup.com">SQL Solutions Group</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sqlsolutionsgroup.com/chirospring-case-study/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Server Antipatterns: Common Mistakes with SQL Code</title>
		<link>https://sqlsolutionsgroup.com/common-mistakes-with-sql-code/</link>
					<comments>https://sqlsolutionsgroup.com/common-mistakes-with-sql-code/#comments</comments>
		
		<dc:creator><![CDATA[Rich Benner]]></dc:creator>
		<pubDate>Wed, 21 Feb 2024 08:53:14 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[#microsftcertifedmaster]]></category>
		<category><![CDATA[#microsftpartner]]></category>
		<category><![CDATA[#parallelism #azure]]></category>
		<category><![CDATA[#SQLAB]]></category>
		<category><![CDATA[#SQlatino]]></category>
		<category><![CDATA[#SQlatinoamerica]]></category>
		<category><![CDATA[#sqldatabase]]></category>
		<category><![CDATA[#sqldeveloper]]></category>
		<category><![CDATA[#SQLgroupie]]></category>
		<category><![CDATA[#sqlimer]]></category>
		<category><![CDATA[#sqlimerbymay]]></category>
		<category><![CDATA[#sqlinjection]]></category>
		<category><![CDATA[#sqlinternals]]></category>
		<category><![CDATA[#sqlite]]></category>
		<category><![CDATA[#sqlite3]]></category>
		<category><![CDATA[#SQLLearning]]></category>
		<category><![CDATA[#SQLMagazine]]></category>
		<category><![CDATA[#sqlmanagementstudio]]></category>
		<category><![CDATA[#sqlmanager]]></category>
		<category><![CDATA[#Sqlmap]]></category>
		<category><![CDATA[#sqlrun]]></category>
		<category><![CDATA[#sqlsaturday2017]]></category>
		<category><![CDATA[#sqlsatvienna]]></category>
		<category><![CDATA[#sqlserver]]></category>
		<category><![CDATA[#SQLserver2012]]></category>
		<category><![CDATA[#sqlserver2014]]></category>
		<category><![CDATA[#sqlserver2017]]></category>
		<category><![CDATA[#sqlserver2022]]></category>
		<category><![CDATA[#SQLServeronLinux]]></category>
		<category><![CDATA[#SQLsolutionsgroup]]></category>
		<category><![CDATA[#SQLTraining]]></category>
		<category><![CDATA[#SQLYog]]></category>
		<category><![CDATA[Christmas]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQLPASS]]></category>
		<category><![CDATA[SQLSaturday]]></category>
		<category><![CDATA[SSG]]></category>
		<guid isPermaLink="false">https://sqlsolutionsgroup.com/?p=7015</guid>

					<description><![CDATA[<p>In today’s tech-saturated world, we expect developers to have a broad range of skills and programming languages at their disposal, SQL usually being one of those. This ensures the whole team can help and support one another in their daily lives, but it also leads to mistakes with SQL code. One potential issue here is [&#8230;]</p>
<p>The post <a href="https://sqlsolutionsgroup.com/common-mistakes-with-sql-code/">SQL Server Antipatterns: Common Mistakes with SQL Code</a> appeared first on <a href="https://sqlsolutionsgroup.com">SQL Solutions Group</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>In today’s tech-saturated world, we expect developers to have a broad range of skills and programming languages at their disposal, SQL usually being one of those. This ensures the whole team can help and support one another in their daily lives, but it also leads to mistakes with SQL code.</p>
<p>One potential issue here is the lack of time to delve really deeply into each programming language at one’s disposal. The thing about SQL Server is that it is a language that performs very differently than, say, C#. Those languages are row based, which means it&#8217;s common to iterate through a data set and process each row individually. This works quite well in those languages, but quite terribly in SQL Server. Being a set-based language, SQL Server prefers to deal with the whole data set at once.</p>
<p>Because of these nuances, it&#8217;s easy for developers to make mistakes when creating SQL server code. Let’s go through some common errors that we see.</p>
<h3><strong>T-SQL</strong></h3>
<p>Let’s start with basic T-SQL code that we commonly see, which are either not great for performance or have other considerations that are often overlooked.</p>
<h4><strong>Select *</strong></h4>
<p>You&#8217;re probably not surprised that we see this a lot. This is often used because the person writing the code isn’t sure exactly what they’ll need to return from the object they’re querying. Using Select * is not a great idea for a several reasons. Here are things to consider:</p>
<ul>
<li>Do you really need all of the data returned? Supporting indexes for queries like this are likely to be wider than necessary in order to cover all of the columns in the table. Wouldn’t it be nice if your indexes were smaller? They’d take less disk space but more importantly would require less I/O to retrieve and occupy less space in memory.</li>
<li>Do you need to return that nvarchar(max) field that you’re got in your table? Not sure if you’ve got one?</li>
<li>What if the underlying structure changes and somebody adds in a (max) field? Do they have to check with you first or will your query suddenly tank and cause you and your users a headache? Wouldn’t happen if we were selecting what is strictly necessary for our query.</li>
</ul>
<p>One of the valid uses of SELECT * is when using something like WHERE EXISTS, where you don’t actually need to return any of the data in the query, something like this:</p>
<p><img loading="lazy" decoding="async" width="455" height="88" class="wp-image-7016" src="https://sqlsolutionsgroup.com/wp-content/uploads/2024/02/word-image-7015-1.png" srcset="https://sqlsolutionsgroup.com/wp-content/uploads/2024/02/word-image-7015-1.png 455w, https://sqlsolutionsgroup.com/wp-content/uploads/2024/02/word-image-7015-1-300x58.png 300w" sizes="(max-width: 455px) 100vw, 455px" /></p>
<p>You could even replace that with a SELECT 1 to be more explicit what you’re doing. This is very much personal preference though.</p>
<h4><strong>Select Into</strong></h4>
<p>Using SELECT..INTO seems like a really easy way of creating tables (whether temporary or permanent), as it takes out a lot of the leg work in defining the structure. An obvious issue here is that your object is created with no constraints (should it be a unique primary key?) and no indexes (do you really want this object to be a heap table?). It also makes troubleshooting more difficult, as if you have something like a truncation issue then you can’t easily see the definition of your object without creating it and going to look for it (do you really want to have to run this code before you can complete the code review?).</p>
<p>Overall, it’s much more controlled if you spend the small amount of time required to declare your object explicitly. You can then make sure it’s exactly what you need and it’s much easier to maintain for those that follow.</p>
<h4><strong>Implicit Conversions</strong></h4>
<p>We often come across implicit conversions when analysing a server’s most poorly performing queries. This happens when you are comparing two pieces of data that are not the same data type. This could be comparing a column to a variable, or it could equally be joining two tables together. If these fields are not the exact same data type, then SQL Server is going to have to perform an implicit convert and convert one to match the other.</p>
<p>This can cause a couple of separate issues:</p>
<ol>
<li>If the server has to convert a column in a table to a different data type then it is not going to be able to use any statistics on the table. These statistics are used when creating the execution plan and will inform how the query is actually run. Without these stats SQL Server can easily make a bad estimate and cause the execution of this query to run very poorly.</li>
<li>The other reason that this will be slow is that SQL Server will have to scan one of the tables in its entirety and convert this field before it can even consider joining the tables together. The larger the underlying tables get, the worse performance becomes.</li>
</ol>
<p>The best way to avoid this issue is to ensure that your data types match. Whether that be making sure your variables match the field or if you are joining two tables on a certain field then making sure that the data types match. Also, remember, varchar(10) is <strong>not</strong> the same as nvarchar(10); they need to be the <strong>exact</strong> same data type.</p>
<h3><strong>Obfuscation</strong></h3>
<p>One of the most common issues we see is code obfuscation. What we mean by this is abstracting some code out of what we’re doing and storing it elsewhere. Doing this makes sense to a certain extent. Why write the same code more than once? If we’re going to use it more than once, why not create an object that we can use everywhere to do this? While this sounds like an excellent idea, let’s discuss why it might not be as great as it first appears</p>
<h4><strong>Nested Objects</strong></h4>
<h4><strong>Views</strong></h4>
<p>We see so many times that people will write a view to perform some logic and then use it everywhere. Simple right? Well, this grows over time. It may be that this is fine for now, but for a certain subset of queries you want to tweak that a little, so a view is created over the top of this view. This can very easily snowball and then you have views relying on views &#8230; relying on views &#8230; relying on views (you get the idea).</p>
<p>Primary issues:</p>
<ol>
<li>Changing logic can be fraught with danger. What if we have to tweak one of these nested views? Do we have the ability to test every single place where this view is used? Do we even know everywhere it’s used?</li>
<li>Troubleshooting can be an absolute nightmare. You’ve got some incorrect data in the final query, but which of the sub views is it coming from? It makes a spider’s web of dependencies that are very time consuming and difficult to track. How much time can you invest in resolving this?</li>
<li>When creating execution plans, SQL Server will only spend so much time investigating these sub views before simply giving up and just running the query however it guesses with no available data. Any ideas how well that’s going to go and how our query is going to perform? Not well.</li>
</ol>
<p>While views make a lot of sense <strong>when used properly</strong>, being aware of the nested views issue is something that could save you some major headaches in the future.</p>
<h4><strong>Scalar Functions</strong></h4>
<p>We see so many functions being used in the wild. Some work well, some not so much. By far the largest problem we come across is the (miss)use of scalar functions. Using a function is extremely common in other languages and they work very well. But there are a couple of very large &#8220;gotchas&#8221; in SQL Server:</p>
<ol>
<li>As soon as you use a scalar function in SQL Server, it forces the transaction to run serially. This means you’re removing any ability for the query to run in parallel, and it therefore will likely dramatically impact the performance of your query. There are some advances here in SQL Server 2022 with <a href="https://learn.microsoft.com/en-us/sql/relational-databases/user-defined-functions/scalar-udf-inlining">Scalar UDF Inlining</a>, but this is a relatively new feature and is not available for everybody.</li>
<li>Functions are also effectively treated as separate transactions, once called. You won’t see them in execution plans and this makes them extremely difficult to locate, investigate and troubleshoot. It’s super easy to miss them all together.</li>
<li>Scalar functions are also executed once per row of the data set. Remember how SQL Server is a set-based language and likes dealing with a large data set all at once? Well, scalar functions will pull that particular rug out from under you and turn it into a row-based calculation which will have those very same performance issues.</li>
<li>You also have the recurring issue of knowing exactly what the function is doing. What parameters are being passed? What’s the actual code that the function is executing? These questions can often be tricky to answer.</li>
</ol>
<p>In our experience, scalar functions are fine when used correctly (sparingly and not in set-based operations. Think setting a local variable using a function, but it’s extremely easy to use them incorrectly and shoot yourself in the foot using them.</p>
<h4><strong>IN (Subqueries) </strong></h4>
<p>Something that is very easy to do is to run a query.</p>
<p>Using the Stack Overflow database, let’s say I wanted to see all posts for all users with more than 10,000 reputation points. I could write something like this;</p>
<p><img loading="lazy" decoding="async" width="405" height="104" class="wp-image-7017" src="https://sqlsolutionsgroup.com/wp-content/uploads/2024/02/word-image-7015-2.png" srcset="https://sqlsolutionsgroup.com/wp-content/uploads/2024/02/word-image-7015-2.png 405w, https://sqlsolutionsgroup.com/wp-content/uploads/2024/02/word-image-7015-2-300x77.png 300w" sizes="(max-width: 405px) 100vw, 405px" /></p>
<p>Seems pretty simple, right? Well, the issue here is what goes on behind the scenes. That IN statement gets parsed out to something like this;</p>
<p><img loading="lazy" decoding="async" width="544" height="49" class="wp-image-7018" src="https://sqlsolutionsgroup.com/wp-content/uploads/2024/02/word-image-7015-3.png" srcset="https://sqlsolutionsgroup.com/wp-content/uploads/2024/02/word-image-7015-3.png 544w, https://sqlsolutionsgroup.com/wp-content/uploads/2024/02/word-image-7015-3-300x27.png 300w" sizes="(max-width: 544px) 100vw, 544px" /></p>
<p>In the example query here, there would be 25,334 clauses in this statement. That’s a lot of data to parse through and that just won’t scale well within SQL Server. Joins would be the correct way of doing this. Whether a direct join is possible or whether the subquery is better to be separated and the result put into a temp table, that will all depend on the logic of your particular query.</p>
<h4><strong>Triggers</strong></h4>
<p>Aah, triggers, the silent killers. Sometimes necessary, always costly. The amount of times that we’ve seen poorly performing servers and there are triggers firing all over the place is definitely a non-zero number. They have the same issue as scalar functions, in which they are treated as a separate transaction and won’t be found in execution plans and the like.</p>
<p>Sometimes triggers are necessary, but it’s so easy to introduce them unnecessarily and then suffer the performance impact that follows. Need to do something upon or after insert? There are other ways of resolving those requirements without resorting to Triggers.</p>
<h4><strong>Synonyms</strong></h4>
<p>We’re glad that a lot of people don’t even know that <a href="https://sqlsolutionsgroup.com/synonyms-sql-server-good-bad/">synonyms are a thing</a> in SQL Server, but when we do find them they can cause major confusion. While we totally understand that the business will often push for the simplest (cheapest) solution to resolve the issue of object renaming, it’ll definitely cause confusion when troubleshooting and ultimately become a maintenance issue.</p>
<h3><strong>Linked Servers used Incorrectly</strong></h3>
<p>Linked servers can be highly effective <a href="https://sqlsolutionsgroup.com/using-linked-servers-the-right-way/">when used correctly</a>. The issues that occur are with understanding how linked servers execute queries locally and remotely. If we just include a linked server using four part naming convention ([RemoteServerName].[Database].[Schema].[Object]), then our local server retrieves all data from the remote server and processes data locally. This may be fine if we’re doing a simple query, where we’re selecting all data in a single table. But once we get to adding in filtering and/or manipulating the data in any way (joining for example), then this can get inefficient very quickly.</p>
<p>There has been some change in recent versions of SQL Server on how it deals with these types of connections. Ultimately the better way of processing this data is to either push your results from the remote server and then deal with these results, or to use OPENROWSET. This avoids the issues above and represents best practice for querying linked servers.</p>
<h3><strong>Many Database Problem</strong></h3>
<p>For companies who are vendors or provide a service to multiple clients, it is not unusual to see a database created for each customer. The thinking here is that it silos each customer’s data into a separate database to ensure there is no risk of data being accessed by the wrong user. This makes sense, right? Sure, but there are definitely some issues that can arise from this:</p>
<ol>
<li>Standardisation is a big one. Can you guarantee that your databases are identical to each other? Are they even meant to be? If not, you will have issues performing operations that have to update all databases. Do you need to push a maintenance patch or hotfix? What if some databases have incompatible schemas? You’re going to run into a big headache here really quick.</li>
<li>Context switching is absolutely an issue you should be considering in this scenario. Because the engine has to switch between databases constantly, it can put a hidden workload onto the server and cause some big issues if not monitored very closely.</li>
<li>Maintenance is also another thing to consider. Many databases will require many backups, will contain many indexes, and statistics that require maintenance (<strong>you’re doing this, right?</strong>). Everything becomes a list that needs sorting through before any potential issues can be resolved.</li>
</ol>
<p>The two main options we have here are to consolidate your customers into fewer databases (we’re aware of how much work this can be to implement) or to simply split your server into smaller servers and host fewer customers on each. In today’s world of virtualisation, this is a lot simpler than it used to be. You just need to monitor them to ensure you don’t have all of your most busy customers on the same server.</p>
<p><strong>Many Tenants on a Host</strong></p>
<p>This one is tricky without having access to the virtualisation layer. We have absolutely seen issues with over provisioning hardware between multiple tenants. It seems obvious that you should consider doing this. Each server is not going to be using 100% of the resources allocated to it, so why not allow them all to have a bit more so you can utilise your hardware?</p>
<p>Let’s say we have 20 CPU cores and 1TB of ram on a server and we have 10 tenants on this host. If we were hard provisioning, we would allocate two CPU cores and 100GB of ram to each of these tenants. That way, everybody always has everything they want. But then we notice that the resources are not often used — we sit around with spare CPU going idle. Why not put a few more servers on this box so we can save money? Makes sense, right? The directors would love if we can provide a cost saving.</p>
<p>The issue comes when you have your busy periods, whether that be the holidays, or whether that’s Monday mornings when your customers come online. What then? Well, the tenants are going to fight for those resources. Your servers are going to think they each have two cores and can use them. But because we’ve now got 20 tenants on this host, they can not necessarily have that many resources at any time.</p>
<p>Seeing this inside SQL Server is extremely difficult and even experienced troubleshooters would find it hard to find that this was the problem.</p>
<p>A similar issue is that of &#8220;noisy neighbours&#8221;. What if one particular tenant on the host uses most of the resources? There’s not much the other tenants can do about it. They’re going to struggle to do what they need to and there’s nothing they can do about it.</p>
<h3><strong>Keeping Connections Open</strong></h3>
<p>When connecting to SQL Server, you’ll likely do multiple things, so it makes sense to keep the connection open until you finish the entire workload, right? That can come with some very expensive lessons to learn if this becomes commonplace in your environment.</p>
<p>There are a total of <a href="https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-user-connections-server-configuration-option">32,767 user connections</a> available in SQL Server. What happens when these are all used up? You simply cannot make new connections to the server. I will leave the consequences of that to your own imagination.</p>
<p>It’s very much best practice to only keep a connection open for as long as you absolutely require it. The resources required to open a new connection are negligible, true. But the long term consequences of keeping them open can be drastic. It’s also worth noting that you may not have an issue with this right now, but as databases and user counts grow, do you want to risk this or get it right from the beginning?</p>
<h3><strong>Debug Mode</strong></h3>
<p>It’s rare that a company will add the option to be able to debug SQL code. You may have the error message that something’s throwing, but where specifically is that error coming from? Most of the time somebody will need to extract the T-SQL code piece by piece and run it until you get to the problem code. This can be extremely time consuming and is luckily something that is absolutely avoidable.</p>
<p>By adding a @debug variable and the related code, it will save you so much time. The idea of @debug is that when you enable the flag, it will log relevant information into a logging table so you can analyse it separately.</p>
<p>Adding the variable and related logging isn’t free. It’ll take a little time to ensure it works, but by getting to the standard where code has a debug option, you will make the long-term viability and maintenance so much easier.</p>
<p>The post <a href="https://sqlsolutionsgroup.com/common-mistakes-with-sql-code/">SQL Server Antipatterns: Common Mistakes with SQL Code</a> appeared first on <a href="https://sqlsolutionsgroup.com">SQL Solutions Group</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sqlsolutionsgroup.com/common-mistakes-with-sql-code/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
