SQL Server http://sqlmag.com/taxonomy/term/9189/more en Identifying High-Impact Queries and Stored Procedures with Dynamic Management Views http://sqlmag.com/database-performance-tuning/identifying-high-impact-queries-and-stored-procedures-dynamic-management <div class="node-body article-body">Are you looking for a comprehensive set of scripts to identify queries or stored procedures with highest reads or writes, most CPU consumption, or are the longest running on your SQL Server instances? Then go no further than here where Tim Ford, who truly "wrote the book" on Dynamic Management Views provides two new toolbelt queries for doing just that.</div> <div class="og_rss_groups"></div><p><a href="http://sqlmag.com/database-performance-tuning/identifying-high-impact-queries-and-stored-procedures-dynamic-management" target="_blank">read more</a></p> http://sqlmag.com/database-performance-tuning/identifying-high-impact-queries-and-stored-procedures-dynamic-management#comments Database Performance Tuning SQL Server DMV dm_exec_procedure_stats dm_exec_query_stats dynamic management objects queries stored procedures Tue, 29 Sep 2015 14:21:00 +0000 26111 at http://sqlmag.com Data Tales #3: The Case of the Stubborn Log File http://sqlmag.com/sql-server/data-tales-3-case-stubborn-log-file <div class="node-body article-body">The transaction log continues to grow despite regular backups. Diagnosing the issue and preventing it from happening again is what this case is all about.</div> <div class="og_rss_groups"></div><p><a href="http://sqlmag.com/sql-server/data-tales-3-case-stubborn-log-file" target="_blank">read more</a></p> http://sqlmag.com/sql-server/data-tales-3-case-stubborn-log-file#comments SQL Server active transaction page lock SQL Server transaction log Truncate Mon, 28 Sep 2015 12:00:00 +0000 26101 at http://sqlmag.com Setting Up Additional Checks to Ensure Regular Transaction Log Backups http://sqlmag.com/blog/setting-additional-checks-ensure-regular-transaction-log-backups <div class="node-body blog-body"><p>There&rsquo;s simply no way to overstate the importance of regular Transaction Log Backups. Not only do they help protect from disaster, but regular execution of T-Log backups on Full (and Bulk-Logged) Recovery databases helps keep thing &ldquo;fit and trim&rdquo;. Most of the time, setting up a Notification for when T-Log Backup Jobs fail is enough to let you know when something goes wrong.</p> <p><img alt="" src="/site-files/sqlmag.com/files/uploads/2015/03/TLogNotifications.gif" style="width: 600px; height: 286px;" /></p></div> <div class="og_rss_groups"><ul class="links"><li class="og_links first last"><a href="/blog/practical-sql-server">Practical SQL Server</a></li> </ul></div><p><a href="http://sqlmag.com/blog/setting-additional-checks-ensure-regular-transaction-log-backups" target="_blank">read more</a></p> http://sqlmag.com/blog/setting-additional-checks-ensure-regular-transaction-log-backups#comments SQL Server backups backups SQL Server SQL Server sql server agent sql server agent transaction log transaction log Practical SQL Server Tue, 15 Sep 2015 16:33:00 +0000 26011 at http://sqlmag.com Seek and You Shall Scan Part II: Ascending Keys http://sqlmag.com/sql-server/seek-and-you-shall-scan-part-ii-ascending-keys <div class="node-body article-body">In another column I cover cases in which the optimizer uses table or index scans versus ones in which it uses index seeks. I explained when the optimizer’s choices were efficient by default and when they weren’t (and provided solutions for when they weren’t). In this column I continue the discussion by covering a problem known as the ascending key problem.</div> <div class="og_rss_groups"></div><p><a href="http://sqlmag.com/sql-server/seek-and-you-shall-scan-part-ii-ascending-keys" target="_blank">read more</a></p> http://sqlmag.com/sql-server/seek-and-you-shall-scan-part-ii-ascending-keys#comments SQL Server ascending key ascending key problem cardinality estimate cardinality estimation formula database san database seek index creation primary key restraint SQL Server SQL Server 2014 Mon, 14 Sep 2015 12:30:00 +0000 26001 at http://sqlmag.com Seek and You Shall Scan Part I: When the Optimizer Doesn't Optimize http://sqlmag.com/sql-server/seek-and-you-shall-scan-part-i-when-optimizer-doesnt-optimize <div class="node-body article-body">Index Seek and Index (or Table) Scan are two of the most common operators that you see in query execution plans. A common misconception is that a scan is bad and a seek is good. The reality is that each is optimal under different circumstances. In some cases the optimizer chooses between the two based on which is indeed more optimal in the given situation. In those cases, other than appreciating the optimizer's ability to come up with the truly optimal plan, there's nothing special that we need to do. However, what’s interesting to us as people who tune queries is to identify cases, or patterns, in which the optimizer doesn’t make the optimal choice and act to fix them.</div> <div class="og_rss_groups"></div><p><a href="http://sqlmag.com/sql-server/seek-and-you-shall-scan-part-i-when-optimizer-doesnt-optimize" target="_blank">read more</a></p> http://sqlmag.com/sql-server/seek-and-you-shall-scan-part-i-when-optimizer-doesnt-optimize#comments SQL Server data characteristics index availability index scan index seek optimizer query execution plans SQL Server SQL Server 2014 table scan Mon, 14 Sep 2015 12:30:00 +0000 25991 at http://sqlmag.com Stop Using INFORMATION_SCHEMA and SysObjects for Exists Checks http://sqlmag.com/blog/stop-using-informationschema-and-sysobjects-exists-checks <div class="node-body blog-body"><p>Code like this isn&rsquo;t optimal:</p> <pre> <div class="geshifilter" style="white-space: nowrap;"><div class="text geshifilter-text" style="font-family:monospace;">IF EXISTS(SELECT * FROM sys.objects WHERE name = N'TableToDrop' AND type = 'U')<br /> &nbsp; &nbsp; &nbsp; &nbsp; DROP TABLE TableToDrop;<br /> GO</div></div></pre> <p>Neither is this:</p> <pre> <div class="geshifilter" style="white-space: nowrap;"><div class="text geshifilter-text" style="font-family:monospace;">IF EXISTS(SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'TableToDrop')<br /> &nbsp; &nbsp; &nbsp; &nbsp; DROP TABLE TableToDrop;<br /> GO</div></div></pre> <p>Yet, I see both of those used all of the time &ndash; over and over again. Even though it&rsquo;s 2015. &nbsp;</p></div> <div class="og_rss_groups"><ul class="links"><li class="og_links first last"><a href="/blog/practical-sql-server">Practical SQL Server</a></li> </ul></div><p><a href="http://sqlmag.com/blog/stop-using-informationschema-and-sysobjects-exists-checks" target="_blank">read more</a></p> http://sqlmag.com/blog/stop-using-informationschema-and-sysobjects-exists-checks#comments SQL Server ALTER ALTER CREATE CREATE DROP DROP EXISTS EXISTS INFORMATION_SCHEMA INFORMATION_SCHEMA sys.objects sys.objects Practical SQL Server Tue, 01 Sep 2015 18:50:00 +0000 25811 at http://sqlmag.com The Essential Guide the SQL Server 2014: Clustered Columnstore Index http://sqlmag.com/sql-server-2014/essential-guide-sql-server-2014-clustered-columnstore-index <div class="field-deck"> Learn about SQL Server 2014's enhanced columnstore index </div> <div class="node-body article-body"><p>In this Essential Guide to SQL Server 2014 series I&rsquo;ve been covering the most important new features and enhancements that Microsoft added to SQL Server 2014. In the last column I covered the <a href="http://sqlmag.com/sql-server-2014/essential-guide-sql-server-2014-backup-enhancements"><u>SQL Server 2014&rsquo;s Backup Enhancements</u></a>. In this column I&rsquo;m going to cover the important enhancements to the columnstore Index. Microsoft introduced the columnstore index in SQL Server 2012 and it provided significantly improved performance for data warehousing types of queries.</p></div> <div class="og_rss_groups"></div><p><a href="http://sqlmag.com/sql-server-2014/essential-guide-sql-server-2014-clustered-columnstore-index" target="_blank">read more</a></p> http://sqlmag.com/sql-server-2014/essential-guide-sql-server-2014-clustered-columnstore-index#comments SQL Server 2014 clustered colmnstore index non-clustered columnstore index Sat, 29 Aug 2015 02:07:00 +0000 25801 at http://sqlmag.com Writing Perfmon data to SQL Server http://sqlmag.com/sql-server/writing-perfmon-data-sql-server <div class="field-deck"> Learn the tricks to get Perfmon to write performance counter data to SQL Server </div> <div class="node-body article-body"><p><strong>Q:</strong> I&rsquo;m trying to get Perfmon to write performance counter data to SQL Server. In Perfmon I&rsquo;ve created a Data Collector and I set the Log format to SQL. I have also created a data source using the SQL Server Native driver but when I try to start Perfmon I get the error Call to SQLAllocConnect failed with %1.</p> <p><strong>A:</strong> I&rsquo;ve found that you cannot use the SQL Server Native Client to log data to SQL Server from Perfmon. I have only had success when the data source that I created used the ODBC driver like you can see in Figure 1.</p></div> <div class="og_rss_groups"></div><p><a href="http://sqlmag.com/sql-server/writing-perfmon-data-sql-server" target="_blank">read more</a></p> http://sqlmag.com/sql-server/writing-perfmon-data-sql-server#comments SQL Server CounterData CounterDetails data source DisplayToID perfmon Perfromance Monitor run as SQL Server Fri, 28 Aug 2015 00:17:00 +0000 25791 at http://sqlmag.com A Replacement for Maintenance Plan Backups http://sqlmag.com/blog/replacement-maintenance-plan-backups <div class="node-body blog-body"><p>This blog post is a bit of a &lsquo;repeat&rsquo; &ndash; since I already covered much of the rationale behind this post in <a href="http://sqlmag.com/blog/alwayson-availability-groups-and-sql-server-jobs-part-23-maintenance-plan-backups-and-ssis-pack">Part 23 of my multi-part series on AlwaysOn Availability Groups and SQL Server Agent Jobs</a>. But, I also figured that this is enough of an important topic to merit its own blog post.</p></div> <div class="og_rss_groups"><ul class="links"><li class="og_links first last"><a href="/blog/practical-sql-server">Practical SQL Server</a></li> </ul></div><p><a href="http://sqlmag.com/blog/replacement-maintenance-plan-backups" target="_blank">read more</a></p> http://sqlmag.com/blog/replacement-maintenance-plan-backups#comments SQL Server Maintenance Plans Maintenance Plans SQL Express Backups SQL Express Backups SQL Server Backups SQL Server Backups Practical SQL Server Thu, 27 Aug 2015 17:45:00 +0000 25781 at http://sqlmag.com The Myth About Estimated Execution Plans http://sqlmag.com/sql-server/myth-about-estimated-execution-plans <div class="node-body article-body"><p style="margin: 0in 0in 8pt;"><font face="Calibri" size="3">How you name things matters. As Buck Woody said about the original SQL Server documentation, Books Online, &ldquo;They weren&rsquo;t books and they weren&rsquo;t online.&rdquo; There are even </font><a href="http://www.cnet.com/pictures/25-worst-named-tech-products-pictures/24/"><u><font color="#0563c1" face="Calibri" size="3">more horrific</font></u></a><font face="Calibri" size="3"> examples. As was pointed out to me by Mike Dimmick on my blog, the name for Estimated Execution Plans puts people off.</font></p></div> <div class="og_rss_groups"></div><p><a href="http://sqlmag.com/sql-server/myth-about-estimated-execution-plans" target="_blank">read more</a></p> http://sqlmag.com/sql-server/myth-about-estimated-execution-plans#comments SQL Server actual estimated Execution plans Microsoft SQL Server Thu, 27 Aug 2015 13:30:00 +0000 25771 at http://sqlmag.com