diff --git a/.gitattributes b/.gitattributes index 130dab4a..4429a7bf 100644 --- a/.gitattributes +++ b/.gitattributes @@ -64,3 +64,12 @@ *.sql eol=crlf merge=union /*.sql diff *.sql diff + +# linguist overrides +*.cs linguist-language=C# +*.ps1 linguist-language=Powershell +*.psd1 linguist-language=Powershell +*.psm1 linguist-language=Powershell +*.R linguist-language=R +*.sql linguist-language=TSQL + diff --git a/ADS/README.md b/ADS/README.md new file mode 100644 index 00000000..fc138499 --- /dev/null +++ b/ADS/README.md @@ -0,0 +1,76 @@ +# Azure Data Studio (ADS) +[Azure Data Studio](https://github.com/microsoft/azuredatastudio) is a open source cross-platform database tool for data professionals using the Microsoft family of on-premises and cloud data platforms on Windows, MacOS, and Linux. + + +## Useful Links + +- [Official ADS List of Extensions](https://github.com/microsoft/azuredatastudio/wiki/List-of-Extensions) +- [Latest Release](https://github.com/microsoft/azuredatastudio/releases/latest) + +## Download the latest Azure Data Studio release + +| Platform | Download Link | +|--------------------------|-------------------------------------------------| +| Windows User Installer | https://go.microsoft.com/fwlink/?linkid=2132348 | +| Windows System Installer | https://go.microsoft.com/fwlink/?linkid=2132347 | +| Windows ZIP | https://go.microsoft.com/fwlink/?linkid=2132518| +| macOS ZIP | https://go.microsoft.com/fwlink/?linkid=2132519 | +| Linux TAR.GZ | https://go.microsoft.com/fwlink/?linkid=2132349 | +| Linux RPM | https://go.microsoft.com/fwlink/?linkid=2132351 | +| Linux DEB | https://go.microsoft.com/fwlink/?linkid=2132350 | + + +## Azure Data Studio extensions + +| Extension | Repository Link | Release Date | Version | .vsix download link | Description | +|---------------------------------------|-----------------|--------------|----------|---------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------| +| [SQL Server Import] | [Github][1] | 2020-05-15 | 0.15.0 | [GO](https://go.microsoft.com/fwlink/?linkid=2131183) | Streamlines the data import process by providing a wizard that simplifies copying flat files (`.csv`, `.txt`, `.json`) into a SQL Server table | +| [PostgreSQL extension (preview)] | [Github][2] | 2020-03-26 | 0.2.6 | [GO](https://go.microsoft.com/fwlink/?linkid=2099772) | Enables users to connect, query, and manage Postgres databases with Azure Data Studio | +| [Query Editor Boost][3] | [Github][3] | 2020-02-17 | 0.4.1 | [Github][https://github.com/dzsquared/query-editor-boost/releases/] | This extension adds several features helpful with query writing in Azure Data Studio | +| [SQL Server Dacpac] | [Github][1] | 2020-06-04 | 1.5.0 | [GO](https://go.microsoft.com/fwlink/?linkid=2099885) | Provides an easy-to-use wizarding experience to deploy and extract [`.dacpac`] files and import and export `.bacpac` files | +| [SQL Server Profiler] | [Github][1] | 2019-12-18 | 0.11.0 | [GO](https://go.microsoft.com/fwlink/?linkid=2099574) | Provides a simple SQL Server tracing solution similar to SSMS Profiler, allowing users to create and manage traces and analyze and replay trace results | +| [SQL Server Agent] | [Github][1] | 2020-04-16 | 0.47.0 | [GO](https://go.microsoft.com/fwlink/?linkid=2099884) | Helps manage and troubleshoot SQL Server Agent jobs and configuration (early preview) | +| SQL Server Admin Pack | [Github][1] | 2019-03-14 | 0.0.2 | [GO](https://go.microsoft.com/fwlink/?linkid=2099889) | A collection of popular database administration extensions to help manage SQL Server | +| [SQL Server Schema Compare] | [Github][1] | 2020-06-17 | 1.5.0 | [GO](https://go.microsoft.com/fwlink/?linkid=2099886) | Provides an easy-to-use experience to compare the schemas from [`.dacpac`] files and databases and apply the changes from source to target | +| [PowerShell Extension] | [Github][6] | 2020-04-15 | 2020.4.0 | [GO](https://go.microsoft.com/fwlink/?linkid=2099773) | Provides rich PowerShell language support for Azure Data Studio | +| [SandDance for Azure Data Studio] | [Github][7] | 2020-06-24 | 3.0.0 | [Vsix](https://github.com/microsoft/SandDance/releases/latest) | Provides interactive visualizations that help users explore, understand, and present their data | +| [SandDance for VSCode][8] | [Github][7] | 2020-06-24 | 3.0.0 | [Vsix][8] | Provides interactive visualizations that help users explore, understand, and present their data for `.csv` or `.tsv` files | +| [Server Reports][1] | [Github][1] | 2020-04-27 | 0.2.2 | [GO][https://go.microsoft.com/fwlink/?linkid=2099768] | Provides useful information about the server's performance, such as: DB Space Usage, DB Buffer Usage, CPU Utilization, Backup Growth Trend | +| [whoisactive][1] | [Github][1] | 2020-04-27 | 0.1.4 | [GO][https://go.microsoft.com/fwlink/?linkid=2099774] | Displays insights from sp_whoisactive, a useful tool for activity monitoring and troubleshooting, as graphs and tasks inside an Azure Data Studio | +| [SQL Database Projects extension] | [Github][1] | 2020-04-27 | 0.3.0 | [GO][https://go.microsoft.com/fwlink/?linkid=2143820] | Extension for developing SQL databases in a project-based development environment | + + +## Azure Data Studio Articles + +| Title | Author | Modified | +|------------------------------------------------------------|------------------------------------------|------------| +| [Integrating Azure Data Studio with Git and GitHub] | Rajendra Gupta | 2020-07-03 | +| [Working with Git components in Azure Data Studio] | Rajendra Gupta | 2020-07-09 | + +[1]:https://github.com/Microsoft/azuredatastudio +[2]:https://github.com/microsoft/azuredatastudio-postgresql +[3]:https://github.com/dzsquared/query-editor-boost/ +[4]:https://github.com/dzsquared/query-editor-boost/releases/latest +[5]:https://github.com/microsoft/azuredatastudio-postgresql +[6]:https://github.com/PowerShell/vscode-powershell/ +[7]:https://github.com/Microsoft/SandDance +[8]:https://marketplace.visualstudio.com/items?itemName=msrvida.vscode-sanddance +[`.dacpac`]:https://docs.microsoft.com/en-us/sql/relational-databases/data-tier-applications/data-tier-applications + +[SQL Server Import]:https://docs.microsoft.com/en-us/sql/azure-data-studio/sql-server-import-extension +[PostgreSQL extension (preview)]:https://docs.microsoft.com/en-us/sql/azure-data-studio/postgres-extension +[SQL Server Dacpac]:https://docs.microsoft.com/en-us/sql/azure-data-studio/sql-server-dacpac-extension +[SQL Server Profiler]:https://docs.microsoft.com/en-us/sql/azure-data-studio/sql-server-profiler-extension +[SQL Server Agent]:https://docs.microsoft.com/en-us/sql/azure-data-studio/sql-server-agent-extension +[SQL Server Compare]:https://docs.microsoft.com/en-us/sql/azure-data-studio/schema-compare-extension +[PowerShell Extension]:https://docs.microsoft.com/en-us/sql/azure-data-studio/powershell-extension +[SandDance for Azure Data Studio]:https://docs.microsoft.com/en-us/sql/azure-data-studio/sanddance-extension +[SQL Database Projects extension]:https://docs.microsoft.com/en-gb/sql/azure-data-studio/extensions/sql-database-project-extension + +[Integrating Azure Data Studio with Git and GitHub]:https://www.sqlshack.com/integrating-azure-data-studio-with-git-and-github/ +[Working with Git components in Azure Data Studio]:https://www.sqlshack.com/working-with-git-components-in-azure-data-studio/ + + +### TODO Links + +- https://github.com/microsoft/azuredatastudio/issues/2752#issuecomment-487315692 diff --git a/Articles/README.md b/Articles/README.md index c9f29596..b9f58c6e 100644 --- a/Articles/README.md +++ b/Articles/README.md @@ -2,10 +2,12 @@ Articles types: - **[AZ]** Azure Articles + - **[AMZ]** Amazon AWS Articles - **[B]** Backup Articles - **[BENCH]** Benchmarking Articles - **[IDX]** Index Articles - **[CLR]** [SQL Server Common Language Runtime Integration](https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql/sql-server-common-language-runtime-integration) Articles + - **[CHP]** Checkpont Articles - **[COR]** Corruption Articles - **[DAX]** Data Analysis Expressions Articles - **[DBA]** DBA Articles @@ -19,6 +21,7 @@ Articles types: - **[PS]** Powershell Articles - **[QS]** Query Store Articles - **[R]** R Language + - **[SEC]** SQL Server Security Articles - **[SSIS]** [SQL Server Integration Services](https://docs.microsoft.com/en-us/sql/integration-services/sql-server-integration-services) - **[V]** Visualization Articles - **[X]** XML, JSON, YAML, HTML Articles @@ -26,10 +29,10 @@ Articles types: | Title | Author | Modified | Type | |-------------------------------------------------------------------------------------------------------------------------|------------------------------------------|------------|-------------| -| [SQL Server Index Design Guide] | Microsoft | ? | [IDX] | -| [SQL Server 2012 Security Best Practices - Microsoft] | Bob Beauchemin | 2012-01-15 | | -| [Help, my database is corrupt. Now what?] | Gail Shaw | 2010-04-23 | [COR] | | [Understanding how SQL Server executes a query] | Remus Rusanu | 2016-04-15 | | +| [SQL Server Index Design Guide] | Microsoft | 1753-01-01 | [IDX] | +| [SQL Server 2012 Security Best Practices - Microsoft] | Bob Beauchemin | 2012-01-15 | [SEC] | +| [Help, my database is corrupt. Now what?] | Gail Shaw | 2010-04-23 | [COR] | | [What to Do When DBCC CHECKDB Reports Corruption] | Brent Ozar | 2016-05-19 | [COR] | | [Troubleshooting SQL Server CPU Performance Issues] | Joe Sack | 2013-05-28 | [P] | | [Knee-Jerk Performance Tuning : Incorrect Use of Temporary Tables] | Paul Randal | 2016-04-06 | [P] | @@ -41,14 +44,15 @@ Articles types: | [Slow in the Application, Fast in SSMS] | Erland Sommarskog | 2013-12-18 | | | [How to share data between stored procedures] | Erland Sommarskog | 2013-11-02 | | | [Arrays and Lists in SQL Server 2008] | Erland Sommarskog | 2016-08-21 | | -| [Giving Permissions through Stored Procedures] | Erland Sommarskog | 2011-12-31 | | -| [Error and Transaction Handling in SQL Server] | Erland Sommarskog | 2015-05-03 | | +| [Packaging Permissions in Stored Procedures] | Erland Sommarskog | 2011-12-31 | | +| [Error and Transaction Handling in SQL Server Part One – Jumpstart Error Handling] | Erland Sommarskog | 2015-05-03 | [DBA][DEV] | +| [Error and Transaction Handling in SQL Server Part Two – Commands and Mechanisms] | Erland Sommarskog | 2019-09-03 | [DBA][DEV] | +| [Error and Transaction Handling in SQL Server Part Three – Implementation] | Erland Sommarskog | 2017-05-03 | [DBA][DEV] | | [Using the Bulk-Load Tools in SQL Server] | Erland Sommarskog | 2016-12-08 | | | [Using Table-Valued Parameters in SQL Server and .NET] | Erland Sommarskog | 2016-12-08 | | | [SQL Server Columnstore Articles] | Niko Neugebauer | 2016-05-09 | | | [Documentation: It Does not Suck!] | Jes Schultz Borland | 2013-01-15 | | | [The Data Loading Performance Guide] | Thomas Kejser, Peter Carlin, Stuart Ozer | 2009-01-15 | | -| [Required Testing for Installing SQL Server Cumulative Updates and Service Packs] | Kendra Little | 2016-04-28 | | | [Stop Shrinking Your Database Files. Seriously. Now.] | Brent Ozar | 2009-08-19 | | | [How to shrink a database in 4 easy steps] | Andy Mallon | 2016-04-28 | | | [Introduction to the Index Operational Statistics Dynamic Management Function] | Tim Ford | 2016-04-26 | [IDX] | @@ -60,9 +64,7 @@ Articles types: | [Understanding GRANT, DENY, and REVOKE in SQL Server] | K. Brian Kelley | 2013-02-27 | | | [Monitor SQL Server Transaction Log File Free Space] | Mike Eastland | 2015-05-12 | | | [Dynamically Query a 100 Million Row Table-Efficiently] | Gary Strange | 2016-05-27 | | -| [Understanding and Using Parallelism in SQL Server] | Paul White | 2011-03-03 | | -| [Diagnosing and Resolving Latch Contention on SQL Server] | Microsoft | 2014-02-28 | | -| [Parallel Execution Plans – Branches and Threads] | Paul White | 2013-10-07 | | +| [Parallel Execution Plans – Branches and Threads] | Paul White | 2013-10-07 | [DBA][DEV] | | [Nasty Fast PERCENT_RANK] | Alan Burstein | 2016-06-07 | | | [Looking at VIEWs, Close Up] | Joe Celko | 2016-05-10 | | | [SQL Server 2016: It Just Runs Faster] | Thomas LaRock | 2016-06-01 | | @@ -75,13 +77,13 @@ Articles types: | [Triage Quiz: Is Your SQL Server Safe?] | Angie Rudduck | 2016-06-15 | | | [Why Not Just Create Statistics?] | Erik Darling | 2016-07-14 | | | [Understanding the SQL Server NOLOCK hint] | Greg Robidoux | 2011-08-16 | | -| [Recover access to a SQL Server instance] | Aaron Bertrand | 2012-08-30 | | +| [Recover access to a SQL Server instance] | Aaron Bertrand | 2012-08-30 | [SEC] | | [SQL Server 2016 Upgrade Planning] | Jen Underwood | 2016-06-28 | | | [Graphs and Graph Algorithms in T-SQL] | Hans Olav Norheim | 2010-05-22 | | -| [Episode 4: SQL Server R Services makes you a smarter T-SQL Developer] | Sanjay Mishra | 2016-07-12 | [DEV],[R] | +| [Episode 4: SQL Server R Services makes you a smarter T-SQL Developer] | Sanjay Mishra | 2016-07-12 | [DEV][R] | | [How to Set Max Degree of Parallelism in SQL Server] | Kendra Little | 2016-07-14 | | | [Undocumented Query Plans: Equality Comparisons] | Paul White | 2016-06-22 | | -| [Simplified Order Of Operations] | Michael J. Swart | 2016-07-20 | | +| [Simplified Order Of Operations] | Michael J Swart | 2016-07-20 | | | [SQL Server Statistics Basics] | Robert Sheldon | 2016-07-22 | | | [Learn to Use sp_Blitz, sp_BlitzCache, sp_BlitzFirst, and sp_BlitzIndex with These Tutorial Videos] | Brent Ozar | 2016-09-12 | | | [Where is a record really located?] | Tim Chapman | 2016-09-15 | | @@ -96,7 +98,7 @@ Articles types: | [#BackToBasics : An Updated "Kitchen Sink" Example] | Aaron Bertrand | 2016-06-01 | | | [Locking and Blocking in SQL Server] | Brent OZar | 2016-01-01 | | | [Nested Loops Prefetching] | Paul White | 2013-08-31 | | -| [Performance tuning backup and restore operations] | Derik Hammer | 2015-12-21 | [B],[P] | +| [Performance tuning backup and restore operations] | Derik Hammer | 2015-12-21 | [B][P] | | [Execution Plan Analysis: The Mystery Work Table] | Paul White | 2013-03-08 | | | [How to move data between File Groups in SQL Server] | Klaus Aschenbrenner | 2016-09-26 | | | [Optimizing Your Query Plans with the SQL Server 2014 Cardinality Estimator] | Joseph Sack | 2014-06-24 | | @@ -116,10 +118,8 @@ Articles types: | [Introduction to Latches in SQL Server] | Klaus Aschenbrenner | 2014-06-23 | | | [Latch Coupling in SQL Server] | Klaus Aschenbrenner | 2016-10-24 | | | [Partitioned Views? A How-To Guide] | Erik Darling | 2016-09-22 | | -| [How to Choose Between RCSI and Snapshot Isolation Levels] | Kendra Little | 2016-02-18 | | | [TroubleShooting SQL Server Memory Consumption] | Satnam Singh | 2012-09-28 | | | [Time Series Algorithms in SQL Server] | Dinesh Asanka | 2015-06-01 | | -| [Heap Tables in SQL Server] | Klaus Aschenbrenner | 2015-10-19 | | | [Internals of the Seven SQL Server Sorts – Part 1] | Paul White | 2015-04-29 | | | [Internals of the Seven SQL Server Sorts – Part 2] | Paul White | 2015-05-07 | | | [The 9 Letters That Get DBAs Fired] | Brent Ozar | 2011-12-22 | | @@ -131,12 +131,11 @@ Articles types: | [Successful Anti-Patterns, Storage Requirements] | Raul Gonzalez | 2016-10-19 | | | [SQL Server table columns under the hood] | Remus Rusanu | 2011-10-20 | | | [How to analyse SQL Server performance] | Remus Rusanu | 2014-02-24 | | -| [To BLOB or Not To BLOB: Large Object Storage in a Database or a Filesystem?] | Jim Gray | 2006-04-01 | | | [Asynchronous procedure execution] | Remus Rusanu | 2009-08-05 | | | [What is the CXPACKET Wait Type, and How Do You Reduce It?] | Brent Ozar | 2013-08-27 | | | [New indexes, hypothetically] | Kenneth Fisher | 2016-11-02 | [IDX] | | [Indexing Wide Keys in SQL Server] | Brent Ozar | 2013-05-08 | [IDX] | -| [The Anatomy and (In)Security of Microsoft SQL Server Transparent Data Encryption (TDE), or How to Break TDE] | Simon McAuliffe | 2016-03-31 | | +| [The Anatomy and (In)Security of Microsoft SQL Server Transparent Data Encryption (TDE), or How to Break TDE] | Simon McAuliffe | 2016-03-31 | [SEC] | | [Correctly adding data files to tempdb] | Paul Randal | 2014-10-14 | | | [Why You Should Test Your Queries Against Bigger Data] | Erik Darling | 2016-11-01 | | | [Tally OH! An Improved SQL 8K “CSV Splitter” Function] | Jeff Moden | 2012-12-28 | | @@ -146,8 +145,7 @@ Articles types: | [Measuring Query Duration: SSMS vs SQL Sentry Plan Explorer] | Kendra Little | 2016-09-27 | | | [Inside the Statistics Histogram & Density Vector] | Klaus Aschenbrenner | 2014-01-28 | | | [Misconceptions on parameter sniffing] | Hugo Kornelis | 2016-11-03 | | -| [CAST vs. CONVERT] | Aaron Bertrand | 2016-11-02 | | -| [What Every Accidental DBA Needs to Know Now: Basics of SQL Security] | Tim Ford | 2016-10-03 | | +| [What Every Accidental DBA Needs to Know Now: Basics of SQL Security] | Tim Ford | 2016-10-03 | [SEC] | | [SQL Server Perfmon (Performance Monitor) Best Practices] | Brent Ozar | 2006-12-30 | | | [Top 5 Overlooked Index Features] | Erik Darling | 2016-11-10 | [IDX] | | [A Sysadmin’s Guide to Microsoft SQL Server Memory] | Brent Ozar | 2016-09-15 | | @@ -159,7 +157,7 @@ Articles types: | [SQL Server Audit Walkthrough] | Sadequl Hussain | 2016-01-01 | | | [The SQL Server 2016 Query Store: Overview and Architecture] | Enrico van de Laar | 2015-11-16 | [QS] | | [Reading, Writing, and Creating SQL Server Extended Properties] | Phil Factor | 2015-10-21 | [XE] | -| [Questions About SQL Server Security and Access Control You Were Too Shy to Ask] | William Brewer | 2016-11-04 | | +| [Questions About SQL Server Security and Access Control You Were Too Shy to Ask] | William Brewer | 2016-11-04 | [SEC] | | [The Ten Commandments of SQL Server Monitoring] | Adam Machanic | 2013-04-09 | | | [Should I use NOT IN, OUTER APPLY, LEFT OUTER JOIN, EXCEPT, or NOT EXISTS?] | Adam Machanic | 2012-12-27 | | | [Parameter Sniffing, Embedding, and the RECOMPILE Options] | Paul White | 2013-08-28 | | @@ -167,7 +165,7 @@ Articles types: | [SQL Server Temporary Table Caching] | Simon Liew | 2016-08-12 | | | [Techniques to Monitor SQL Server memory usage] | Basit Farooq | 2016-08-01 | | | [Troubleshooting Query Regressions Caused By The New Cardinality Estimator] | SQL Scotsman | 2016-11-28 | | -| [Migrating Databases to Azure SQL Database] | Tim Radney | 2016-10-25 | [MG],[AZ] | +| [Migrating Databases to Azure SQL Database] | Tim Radney | 2016-10-25 | [AZ][MG] | | [Solve Common SQL Server Restore Issues] | Sergey Gigoyan | 2015-04-12 | | | [Spills SQL Server Doesn’t Warn You About] | Erik Darling | 2016-11-30 | | | [How often should I run DBCC CHECKDB?] | Erik Darling | 2016-02-25 | | @@ -190,7 +188,7 @@ Articles types: | [Troubleshooting SQL Server backup and restore operations] | Microsoft | 2016-07-23 | [B] | | [SQL Server 2016: Getting tempdb a little more right] | Aaron Bertrand | 2015-09-30 | | | [Practical uses of binary types] | Daniel Hutmacher | 2017-01-09 | | -| [Backing Up SQL Server Databases is Easier in PowerShell than T-SQL] | Aaron Nelson | 2017-01-12 | | +| [Backing Up SQL Server Databases is Easier in PowerShell than T-SQL] | Aaron Nelson | 2017-01-12 | [PS] | | [Creating, detaching, re-attaching, and fixing a SUSPECT database] | Paul Randal | 2008-08-29 | | | [Modifying Tables Online – Part 1: Migration Strategy] | Michael J Swart | 2012-04-16 | [MG] | | [Modifying Tables Online – Part 2: Implementation Example] | Michael J Swart | 2012-04-17 | [MG] | @@ -212,9 +210,9 @@ Articles types: | [A Tourist’s Guide to the sp_Blitz Source Code, Part 1: The Big Picture] | Brent Ozar | 2017-02-09 | | | [SQL Server Default Configurations That You Should Change] | Pio Balistoy | 2017-02-06 | | | [Decoding Key and Page WaitResource for Deadlocks and Blocking] | Kendra Little | 2016-10-17 | | -| [Security in the CLR World Inside SQL Server] | Kiely Don | 1990-01-01 | [CLR] | +| [Security in the CLR World Inside SQL Server] | Kiely Don | 1990-01-01 | [CLR][SEC] | | [On the Advantages of DateTime2(n) over DateTime] | William Assaf | 2012-12-04 | | -| [Build Your Own Tools] | Michael J. Swart | 2016-09-23 | | +| [Build Your Own Tools] | Michael J Swart | 2016-09-23 | | | [Enhanced T-SQL Error Handling With Extended Events] | Dave Mason | 2016-09-14 | [XE] | | [Compression and its Effects on Performance] | Erin Stellato | 2017-01-20 | | | [Does Truncate Table Reset Statistics] | Kendra Little | 2016-12-08 | | @@ -235,7 +233,6 @@ Articles types: | [ALTER SCHEMA TRANSFER for Zero Downtime Database Upgrades] | Dave Wentzel | 2013-05-21 | | | [Delayed Durability in SQL Server 2014] | Aaron Bertrand | 2014-04-28 | | | [Daylight Savings end affects not only you, but your SQL Server too] | Aaron Bertrand | 2014-04-28 | | -| [Searching Strings in SQL Server is Expensive] | Brent Ozar | 2016-10-18 | | | [Let’s Corrupt a SQL Server Database Together, Part 1: Clustered Indexes] | Brent Ozar | 2017-02-22 | [COR][IDX] | | [Let’s Corrupt a Database Together, Part 2: Nonclustered Indexes] | Brent Ozar | 2017-02-28 | [COR][IDX] | | [The Guide SQL Server Installation Checklist (settings that increase SQL Server Performance)] | Mark Varnas | 2017-03-03 | | @@ -243,9 +240,9 @@ Articles types: | [PowerShell Getting More From Generic Error Messages] | Shane O'Neill | 2017-03-02 | [PS] | | [#BackToBasics : Common Table Expressions (CTEs)] | Aaron Bertrand | 2016-01-06 | | | [SQL VNext sp_configure on Windows and Linux with dbatools] | Rob Sewell | 2017-03-02 | [PS] | -| [Adding a T-SQL Job Step to a SQL Agent Job with PowerShell] | Rob Sewell | 2017-02-20 | [PS],[J] | +| [Adding a T-SQL Job Step to a SQL Agent Job with PowerShell] | Rob Sewell | 2017-02-20 | [PS][J] | | [Setting up Database Mail to use my Gmail account] | Mat Hayward | 2017-03-01 | [DM] | -| [Using DBCC CLONEDATABASE and Query Store for Testing] | Erin Stellato | 2017-02-22 | [DBCC],[QS] | +| [Using DBCC CLONEDATABASE and Query Store for Testing] | Erin Stellato | 2017-02-22 | [DBCC][QS] | | [Getting Started with Natural Earth — A SQL Server Shapefile Alternative (Geospatial Resource)] | Jeff Pries | 2017-02-17 | [V] | | [SQL Server Temporal Tables: How-To Recipes] | Alex Grinberg | 2017-02-10 | [DEV] | | [The Migration Checklist] | Steve Jones | 2017-03-08 | [MG] | @@ -254,8 +251,8 @@ Articles types: | [Representing Hierarchical Data for Mere Mortals] | Phil Factor | 2016-10-06 | [DEV] | | [KPIs For DBAs to Show Their CIOs] | Thomas Larock | 2017-03-08 | [DBA] | | [How To Forecast Database Disk Capacity If You Don’t Have A Monitoring Tool] | Edwin M Sarmiento | 2015-07-31 | [DBA] | -| [Statistical Sampling for Verifying Database Backups] | Thomas Larock | 2010-05-13 | [DBA],[B] | -| [Using dbatools for automated restore and CHECKDB] | Anthony Nocentino | 2017-03-04 | [DBA],[PS] | +| [Statistical Sampling for Verifying Database Backups] | Thomas Larock | 2010-05-13 | [B][DBA] | +| [Using dbatools for automated restore and CHECKDB] | Anthony Nocentino | 2017-03-04 | [DBA][PS] | | [Bad Habits Revival] | Aaron Bertrand | 2017-01-26 | [DBA] | | [Deploying Multiple SSIS Projects via PowerShell] | Nat Sundar | 2017-02-27 | [SSIS,][PS] | | [Determining the Cost Threshold for Parallelism] | Grant Fritchey | 2017-02-28 | [DBA] | @@ -264,9 +261,9 @@ Articles types: | [Why PFS pages cannot be repaired] | Paul Randal | 2017-03-05 | [DBA] | | [ERRORLOG records max out at 2049 characters] | Cody Konior | 2017-03-02 | [DEV] | | [How to Build a SQL Server Disaster Recovery Plan with Google Compute Engine] | Tara Kizer | 2017-03-10 | [DBA] | -| [SQL Server Performance Tuning in Google Compute Engine] | Erik Darling | 2017-03-09 | [DBA],[P] | -| [Configuring R on SQL Server 2016] | Ginger Grant | 2016-12-06 | [DBA],[R] | -| [Knee-Jerk PerfMon Counters: Page Life Expectancy] | Paul Randal | 2014-10-20 | [DBA],[P] | +| [SQL Server Performance Tuning in Google Compute Engine] | Erik Darling | 2017-03-09 | [DBA][P] | +| [Configuring R on SQL Server 2016] | Ginger Grant | 2016-12-06 | [DBA][R] | +| [Knee-Jerk PerfMon Counters: Page Life Expectancy] | Paul Randal | 2014-10-20 | [DBA][P] | | [Change Management Template for SQL Server DBAs and Developers] | Kendra Little | 2016-04-12 | [DBA] | | [Performance Myths: Clustered vs. Non-Clustered Indexes] | Aaron Bertrand | 2017-03-17 | [IDX] | | [Bad habits: Counting rows the hard way] | Aaron Bertrand | 2014-10-30 | [DEV] | @@ -298,7 +295,7 @@ Articles types: | [Resolving Key Lookup Deadlocks with Plan Explorer] | Greg Gonzalez | 2017-03-21 | [DEV] | | [Why ROWLOCK Hints Can Make Queries Slower and Blocking Worse in SQL Server] | Kendra Little | 2016-02-04 | [DEV] | | [Does a Clustered Index really physically store the rows in key order] | Wayne Sheffield | 2012-10-21 | [DEV] | -| [Ugly Pragmatism For The Win] | Michael J. Swart | 2016-02-11 | [DEV] | +| [Ugly Pragmatism For The Win] | Michael J Swart | 2016-02-11 | [DEV] | | [Architecting Microsoft SQL Server on VMware vSphere] | Niran Even-Chen | 2017-03-15 | [DBA] | | [Hiding tables in SSMS Object Explorer] | Kenneth Fisher | 2017-04-03 | [DEV] | | [Clustered columnstore: on-disk vs. in-mem] | Ned Otter | 2017-03-21 | [DBA] | @@ -313,14 +310,14 @@ Articles types: | [Hack-Attaching a SQL Server database with NORECOVERY] | Argenis Fernandez | 2016-01-24 | [DBA] | | [Switch in Staging Tables Instead of sp_rename] | Kendra Little | 2017-01-19 | [DBA] | | [Performance Myths: Table variables are always in-memory] | Derik Hammer | 2017-04-04 | [DEV] | -| [Questions About SQL Server Collations You Were Too Shy to Ask] | Robert Sheldon | 2017-04-06 | [DBA],[DEV] | +| [Questions About SQL Server Collations You Were Too Shy to Ask] | Robert Sheldon | 2017-04-06 | [DBA][DEV] | | [NULL - The database's black hole] | Hugo Kornelis | 2007-07-06 | [DEV] | | [For The Better Developer: SQL Server Indexes] | Davide Mauri | 2017-04-02 | [DEV] | | [#EntryLevel: Compression & Data Types] | Melissa Connors | 2016-04-17 | [DEV] | | [Cardinality Estimation for a Predicate on a COUNT Expression] | Paul White | 2017-04-12 | [DEV] | | [Changing SQL Server Collation After Installation] | Douglas P. Castilho | 2015-02-19 | [DBA] | | [Does a TempDB spill mean statistics are out of date?] | Brent Ozar | 2017-04-12 | [DEV] | -| [Transaction log growth during BACKUP] | Andy Mallon | 2017-04-10 | [DBA] | +| [Transaction log growth during BACKUP] | Andy Mallon | 2017-04-10 | [B][DBA] | | [When is a SQL function not a function?] | Rob Farley | 2011-11-08 | [DEV] | | [Introducing Batch Mode Adaptive Joins] | Joseph Sack | 2017-04-19 | [DEV] | | [Investigating the proportional fill algorithm] | Paul Randal | 2016-10-04 | [DBA] | @@ -332,30 +329,29 @@ Articles types: | [Disabling ROW and PAGE Level Locks in SQL Server] | Klaus Aschenbrenner | 2016-10-31 | [DEV] | | [Fixing Cardinality Estimation Errors with Filtered Statistics] | Klaus Aschenbrenner | 2013-10-29 | [DEV] | | [Cardinality Estimation for Multiple Predicates] | Paul Randal | 2014-01-15 | [DEV] | -| [Weaning yourself off of SQL Profiler (Part 1)] | Wayne Sheffield | 2017-04-19 | [DBA],[DEV] | +| [Weaning yourself off of SQL Profiler (Part 1)] | Wayne Sheffield | 2017-04-19 | [DBA][DEV] | | [Properly Persisted Computed Columns] | Paul White | 2017-05-25 | [DEV] | | [A SQL Server DBA myth a day: (17/30) page checksums] | Paul Randal | 2010-04-17 | [DBA] | | [What are different ways to replace ISNULL() in a WHERE clause that uses only literal values?] | Eric Darling | 2017-05-27 | [DEV] | -| [SQL Server 2016 enhancements – Truncate Table and Table Partitioning] | Prashanth Jayaram | 2017-04-18 | [DBA],[DEV] | +| [SQL Server 2016 enhancements – Truncate Table and Table Partitioning] | Prashanth Jayaram | 2017-04-18 | [DBA][DEV] | | [SQL Server Mysteries: The Case of the Not 100% RESTORE…] | Bob Ward | 2017-04-21 | [DBA] | | [Transactional Replication and Stored Procedure Execution: Silver Bullet or Poison Pill?] | Drew Furgiuele | 2017-04-11 | [DBA] | -| [STOPAT And Date Formats] | Dave Mason | 2017-07-12 | [DBA],[XE] | +| [STOPAT And Date Formats] | Dave Mason | 2017-07-12 | [DBA][XE] | | [Row-count Estimates when there are no Statistics] | Matthew McGiffen | 2017-06-28 | [DEV] | | [SQL Server DBA On-Boarding Checklist] | Svetlana Golovko | 2017-06-20 | [DBA] | | [Be Wary of Date Formatting in T-SQL] | Randolph West | 2017-07-12 | [DEV] | -| [The ultimate guide to the datetime datatypes] | Tibor Karaszi | 2010-01-01 | [DEV] | | [Statistics and Cardinality Estimation] | Matthew McGiffen | 2017-06-20 | [DEV] | | [Message queues for the DBA: sending data out into the world] | Drew Furgiuele | 2017-07-21 | [DBA] | | [Schema-Based Access Control for SQL Server Databases] | Phil Factor | 2017-04-09 | [DBA] | | [SQL Server: large RAM and DB Checkpointing] | Guillaume Fourrat | 2017-06-29 | [DBA] | -| [Handling SQL Server Deadlocks With Event Notifications] | Dave Mason | 2017-07-17 | [R],[XE] | -| [SQL Server R Services: Digging into the R Language] | Robert Sheldon | 2017-06-29 | [DBA],[DEV] | +| [Handling SQL Server Deadlocks With Event Notifications] | Dave Mason | 2017-07-17 | [R][XE] | +| [SQL Server R Services: Digging into the R Language] | Robert Sheldon | 2017-06-29 | [DBA][DEV] | | [Investigating the Cause of SQL Server High CPU Load Conditions When They Happen] | Laerte Junior | 2017-07-17 | [DBA] | | [In-Memory Engine DURABILITY = SCHEMA_ONLY And Transaction Rollback] | Chris Adkin | 2017-07-17 | [DEV] | -| [Builder Day: Doing a Point-in-Time Restore in Azure SQL DB] | Brent Ozar | 2017-06-20 | [DBA],[AZ] | +| [Builder Day: Doing a Point-in-Time Restore in Azure SQL DB] | Brent Ozar | 2017-06-20 | [DBA][AZ] | | [Creating Continuous Integration Build Pipelines With Jenkins, Docker and SQL Server] | Chris Adkin | 2017-07-18 | [DBA] | | [Scale-able Windows Aggregate Functions With Row Store Object] | Chris Adkin | 2017-07-24 | [DEV] | -| [Azure DWH part 11: Data Warehouse Migration Utility] | Daniel Calbimonte | 2017-07-17 | [DBA], [AZ] | +| [Azure DWH part 11: Data Warehouse Migration Utility] | Daniel Calbimonte | 2017-07-17 | [AZ][MG] | | [Representing a simple hierarchical list in SQL Server with JSON, YAML, XML and HTML] | William Brewer | 2017-07-18 | [DEV], [X] | | [Advanced Analytics with R and SQL Part II - Data Science Scenarios] | Frank A. Banin | 2017-07-27 | [DEV], [R] | | [Think twice before using table variables] | Matthew McGiffen | 2017-07-11 | [DEV] | @@ -363,136 +359,132 @@ Articles types: | [CCIs and String Aggregation] | Joe Obbish | 2017-07-03 | [DEV] | | [Brad’s Sure DBA Checklist] | Brad McGehee | 2010-01-20 | [DBA] | | [Query Store and Parameterization Problems] | Dennes Torres | 2017-07-06 | [QS] | -| [SQL Server Event Handling: Event Notifications] | Dave Mason | 2016-11-30 | [DBA],[XE] | -| [Identifying Deprecated Feature Usage (Part 1)] | Dave Mason | 2017-07-20 | [DBA],[XE] | -| [Let’s Corrupt a Database Together, Part 3: Detecting Corruption] | Brent Ozar | 2017-07-25 | [DBA],[COR] | -| [XML vs JSON Shootout: Which is Superior in SQL Server 2016?] | Bert Wagner | 2017-05-16 | [DEV],[X] | -| [One SQL Cheat Code For Amazingly Fast JSON Queries] | Bert Wagner | 2017-05-09 | [DEV],[X] | -| [The Ultimate SQL Server JSON Cheat Sheet] | Bert Wagner | 2017-03-07 | [DEV],[X] | +| [SQL Server Event Handling: Event Notifications] | Dave Mason | 2016-11-30 | [DBA][XE] | +| [Identifying Deprecated Feature Usage (Part 1)] | Dave Mason | 2017-07-20 | [DBA][XE] | +| [Let’s Corrupt a Database Together, Part 3: Detecting Corruption] | Brent Ozar | 2017-07-25 | [DBA][COR] | +| [XML vs JSON Shootout: Which is Superior in SQL Server 2016?] | Bert Wagner | 2017-05-16 | [DEV][X] | +| [One SQL Cheat Code For Amazingly Fast JSON Queries] | Bert Wagner | 2017-05-09 | [DEV][X] | +| [The Ultimate SQL Server JSON Cheat Sheet] | Bert Wagner | 2017-03-07 | [DEV][X] | | [Are your indexes being thwarted by mismatched datatypes?] | Bert Wagner | 2017-08-01 | [DEV] | -| [Why Missing Index Recommendations Aren’t Perfect] | Brent Ozar | 2017-08-02 | [DBA],[DEV] | -| [Top 5 Misleading SQL Server Performance Counters] | Kendra Little | 2017-06-05 | [DBA],[DEV] | +| [Why Missing Index Recommendations Aren’t Perfect] | Brent Ozar | 2017-08-02 | [DBA][DEV] | | [The Case of the Space at the End] | Adam St. Pierre | 2017-07-24 | [DEV] | | [SELECT…INTO in SQL Server 2017] | Andrew Pruski | 2017-08-02 | [DEV] | | [Your Service Level Agreement is a Disaster] | Jennifer McCown | 2017-07-24 | [DBA] | | [SQLskills SQL101: REBUILD vs. REORGANIZE] | Paul Randal | 2017-08-03 | [DBA] | | [Where do the Books Online index fragmentation thresholds come from?] | Paul Randal | 2009-12-08 | [DBA] | -| [The SQL Hall of Shame] | Adam Machanic | 2017-06-14 | [DBA],[DEV] | +| [The SQL Hall of Shame] | Adam Machanic | 2017-06-14 | [DBA][DEV] | | [A Better Way To Select Star] | Erik Darling | 2017-07-05 | [DEV] | | [UDP vs TCP] | Kenneth Fisher | 2017-06-07 | [DBA] | -| [When a Nonclustered Index and Statistics Make a Query Slower] | Kendra Little | 2017-03-24 | [DBA],[DEV] | | [Lipoaspiration in your SQL Server Database] | Fabiano Amorim | 2011-03-03 | [DEV] | -| [13 Things You Should Know About Statistics and the Query Optimizer] | Fabiano Amorim | 2010-01-07 | [DBA],[DEV] | -| [Creating R Stored Procedures in SQL Server 2016 Using sqlrutils] | Niels Berglund | 2017-06-25 | [DEV],[R] | +| [13 Things You Should Know About Statistics and the Query Optimizer] | Fabiano Amorim | 2010-01-07 | [DBA][DEV] | +| [Creating R Stored Procedures in SQL Server 2016 Using sqlrutils] | Niels Berglund | 2017-06-25 | [DEV][R] | | [A Quick start Guide to Managing SQL Server 2017 on CentOS/RHEL Using the SSH Protocol] | Prashanth Jayaram | 2017-08-08 | [DEV] | | [SQL Server v.Next : STRING_AGG Performance, Part 2] | Aaron Bertrand | 2017-01-06 | [DEV] | | [Why Parameter Sniffing Isn’t Always A Bad Thing (But Usually Is)] | Bert Wagner | 2017-08-08 | [DEV] | | [Persisting statistics sampling rate] | Pedro Lopes | 2017-08-11 | [DBA] | -| [All about locking in SQL Server] | Nikola Dimitrijevic | 2017-06-16 | [DBA],[DEV] | -| [All about Latches in SQL Server] | Nikola Dimitrijevic | 2017-08-10 | [DBA],[DEV] | -| [All about SQL Server spinlocks] | Nikola Dimitrijevic | 2017-08-23 | [DBA],[DEV] | -| [How to monitor object space growth in SQL Server] | Jefferson Elias | 2017-08-16 | [DBA],[DEV] | -| [How to Read a Transaction Log Backup] | Greg Larsen | 2017-07-03 | [DBA] | +| [All about locking in SQL Server] | Nikola Dimitrijevic | 2017-06-16 | [DBA][DEV] | +| [All about Latches in SQL Server] | Nikola Dimitrijevic | 2017-08-10 | [DBA][DEV] | +| [All about SQL Server spinlocks] | Nikola Dimitrijevic | 2017-08-23 | [DBA][DEV] | +| [How to monitor object space growth in SQL Server] | Jefferson Elias | 2017-08-16 | [DBA][DEV] | +| [How to Read a Transaction Log Backup] | Greg Larsen | 2017-07-03 | [B][DBA] | | [How to Find Out Which Database Object Got Deleted] | Greg Larsen | 2017-07-03 | [DBA] | -| [In-Memory OLTP Enhancements in SQL Server 2016] | Ahmad Yaseen | 2017-08-22 | [DBA],[DEV] | -| [Sync SQL Logins and Jobs] | Ryan J. Adams | 2017-08-21 | [DBA] | +| [In-Memory OLTP Enhancements in SQL Server 2016] | Ahmad Yaseen | 2017-08-22 | [DBA][DEV] | +| [Sync SQL Logins and Jobs] | Ryan J. Adams | 2017-08-21 | [DBA][J] | | [The Trillion Row Table] | Joe Obbish | 2017-08-16 | [BENCH] | | [Dynamic Data Unmasking] | Joe Obbish | 2017-08-25 | [DEV] | | [Why is My Database Application so Slow?] | Dan Turner | 2017-08-24 | [DEV] | -| [Generating Concurrent Activity] | Michael J Swart | 2017-01-23 | [DBA],[DEV] | +| [Generating Concurrent Activity] | Michael J Swart | 2017-01-23 | [DBA][DEV] | | [Required Testing for Installing SQL Server Cumulative Updates and Service Packs] | Kendra Little | 2017-04-28 | [DBA] | -| [Microsoft SQL Server R Services - Internals X] | Niels Berglund | 2017-08-29 | [DEV],[R] | -| [Clustered columnstore: on-disk vs. in-mem] | Ned Otter | 2017-08-29 | [DBA],[DEV] | -| [Hands on Full-Text Search in SQL Server] | Jefferson Elias | 2017-08-25 | [DBA],[DEV] | -| [SQL Code Smells] | Phil Factor | 2017-08-31 | [DBA],[DEV] | -| [Corruption demo databases and scripts] | Paul Randal | 2013-01-08 | [DBA],[COR] | -| [Understanding Cross-Database Transactions in SQL Server] | Grahaeme Ross | 2015-04-11 | [DBA],[DEV] | -| [Optional Parameters and Missing Index Requests] | Brent OZar | 2017-09-14 | [DBA],[DEV] | -| [Uniquifier is a rather unique word isn’t it?] | Kenneth Fisher | 2017-09-18 | [DBA],[DEV] | +| [Microsoft SQL Server R Services - Internals X] | Niels Berglund | 2017-08-29 | [DEV][R] | +| [Clustered columnstore: on-disk vs. in-mem] | Ned Otter | 2017-08-29 | [DBA][DEV] | +| [Hands on Full-Text Search in SQL Server] | Jefferson Elias | 2017-08-25 | [DBA][DEV] | +| [SQL Code Smells] | Phil Factor | 2017-08-31 | [DBA][DEV] | +| [Corruption demo databases and scripts] | Paul Randal | 2013-01-08 | [DBA][COR] | +| [Understanding Cross-Database Transactions in SQL Server] | Grahaeme Ross | 2015-04-11 | [DBA][DEV] | +| [Optional Parameters and Missing Index Requests] | Brent OZar | 2017-09-14 | [DBA][DEV] | +| [Uniquifier is a rather unique word isn’t it?] | Kenneth Fisher | 2017-09-18 | [DBA][DEV] | | [Importance of proper transaction log size management] | Paul Randal | 2009-04-10 | [DEV] | -| [#TSQL2sDay – Starting Out with PowerShell] | Rob Sewell | 2017-09-12 | [DBA],[PS] | +| [#TSQL2sDay – Starting Out with PowerShell] | Rob Sewell | 2017-09-12 | [DBA][PS] | | [Using native compilation to insert parent/child tables] | Ned Otter | 2017-09-11 | [DEV] | | [Questions About RDS SQL Server You Were Too Shy to Ask] | Laerte Junior | 2017-09-13 | [DEV] | | [Active Directory Authentication with SQL Server on Ubuntu] | Drew Furgiuele | 2017-09-19 | [DBA] | | [Temporary Tables in Stored Procedures] | Paul Randal | 2012-08-15 | [DEV] | | [SQLCLR in Practice: Creating a Better Way of Sending Email from SQL Server] | Darko Martinović | 2017-07-17 | [CLR] | -| [T-SQL commands performance comparison – NOT IN vs NOT EXISTS vs LEFT JOIN vs EXCEPT] | Ahmad Yaseen | 2017-09-22 | [DBA],[DEV] | -| [Clustered vs Nonclustered: Index Fundamentals You Need To Know] | Bert Wagner | 2017-09-26 | [DBA],[DEV] | +| [T-SQL commands performance comparison – NOT IN vs NOT EXISTS vs LEFT JOIN vs EXCEPT] | Ahmad Yaseen | 2017-09-22 | [DBA][DEV] | +| [Clustered vs Nonclustered: Index Fundamentals You Need To Know] | Bert Wagner | 2017-09-26 | [DBA][DEV] | | [How to Write Efficient TOP N Queries in SQL] | Lukas Eder | 2017-09-22 | [DEV] | | [Checklist: DR Plan Sanity Check] | Robert Davis | 2017-09-04 | [DBA] | | [Table level recovery for selected SQL Server tables] | Tibor Nagy | 2012-11-30 | [DEV] | -| [SQL Mirroring, Preserving the Log Chain During Database Migrations] | SQL Undercover | 2017-01-21 | [DBA] | +| [SQL Mirroring, Preserving the Log Chain During Database Migrations] | SQL Undercover | 2017-01-21 | [DBA][MG] | | [How NOLOCK Will Block Your Queries] | Bert Wagner | 2017-10-10 | [DEV] | -| [8 Ways to Export SQL Results To a Text File] | Daniel Calbimonte | 2017-10-06 | [DBA],[DEV] | -| [SQL Server Installation Failed Due to Pending Restart of Server?] | thelonedba | 2017-09-18 | [DBA],[DEV] | +| [8 Ways to Export SQL Results To a Text File] | Daniel Calbimonte | 2017-10-06 | [DBA][DEV] | +| [SQL Server Installation Failed Due to Pending Restart of Server?] | thelonedba | 2017-09-18 | [DBA][DEV] | | [Six Scary SQL Surprises] | Brent Ozar | 2017-09-06 | [DEV] | | [How the rowversion datatype works when adding and deleting columns] | Louis Davidson | 2017-09-26 | [DEV] | | [Quick! What's the difference between RANK, DENSE_RANK, and ROW_NUMBER?] | Douglas Kline | 2017-10-01 | [DEV] | | [A Serial Parallel Query] | Joe Obbish | 2017-10-20 | [DEV] | -| [Add or Remove IDENTITY Property From an Existing Column Efficiently] | Dan Guzman | 2017-04-16 | [DBA],[DEV] | +| [Add or Remove IDENTITY Property From an Existing Column Efficiently] | Dan Guzman | 2017-04-16 | [DBA][DEV] | | [How Do I Analyze a SQL Server Execution Plan?] | Kendra Little | 2017-09-22 | [DEV] | | [A Subtle Difference Between COALESCE and ISNULL] | Shaneis | 2017-10-09 | [DEV] | | [Puzzle Challenge: Graph Matching with T-SQL Part 1-Concepts] | Itzik Ben-Gan | 2017-08-08 | [DEV] | | [Graph Matching with T-SQL Part 3: Maximum Matching] | Itzik Ben-Gan | 2017-10-12 | [DEV] | | [Running PowerShell in a SQL Agent Job] | Derik Hammer | 2017-03-04 | [PS] | | [Line-Continuation in T-SQL] | Solomon Rutzky | 2017-10-27 | [DEV] | -| [SQL Server 2017: Making Backups Great Again!] | John Sterrett | 2017-10-31 | [DBA],[DEV] | -| [Say NO to Venn Diagrams When Explaining JOINs] | Lukas Eder | 2016-07-05 | [DBA],[DEV] | +| [SQL Server 2017: Making Backups Great Again!] | John Sterrett | 2017-10-31 | [B][DBA] | +| [Say NO to Venn Diagrams When Explaining JOINs] | Lukas Eder | 2016-07-05 | [DBA][DEV] | | [Surprise Delta Stores] | Joe Obbish | 2017-11-07 | [DEV] | -| [SQL 2014 Clustered Columnstore index rebuild and maintenance considerations] | Denzil Ribeiro | 2015-07-08 | [DBA],[DEV] | -| [The Case of the Weirdly Long COLUMNSTORE_BUILD_THROTTLE Wait] | Kendra Little | 2017-11-09 | [DEV] | -| [Multiple Output Datasets With R and SQL Server] | Kendra Little | 2017-11-06 | [DEV],[R] | +| [SQL 2014 Clustered Columnstore index rebuild and maintenance considerations] | Denzil Ribeiro | 2015-07-08 | [DBA][DEV] | +| [Multiple Output Datasets With R and SQL Server] | Kendra Little | 2017-11-06 | [DEV][R] | | [How to Avoid Excessive Sorts in Window Functions] | Lukas Eder | 2017-11-06 | [DEV] | | [Extracting a DAX Query Plan With Analysis Services 2016 Extended Events] | Koen Verbeeck | 2017-10-03 | [DAX], [XE] | -| [What impact can different cursor options have?] | Aaron Bertrand | 2012-09-10 | [DBA],[DEV] | -| [SQL Smackdown!!! Cursors VS Loops] | SQL Undercover | 2017-11-16 | [DBA],[DEV] | -| [Using the OPTION (RECOMPILE) option for a statement] | Kimberly Tripp | 2010-04-15 | [DBA],[DEV] | -| [Execution Plan Caching and Reuse] | Brett Shearer | 2015-02-12 | [DBA],[DEV] | -| [Buffer Management] | Microsoft | ? | [DBA],[DEV] | -| [RECOMPILE Hints and Execution Plan Caching] | Kendra Little | 2017-12-17 | [DBA],[DEV] | -| [Improving query performance with OPTION (RECOMPILE), Constant Folding and avoiding Parameter Sniffing issues] | Robin Lester | 2016-08-10 | [DBA],[DEV] | -| [Eight Different Ways to Clear the SQL Server Plan Cache] | Glenn Berry | 2016-03-26 | [DBA],[DEV] | -| [Introduction and FAQs about Microsoft Azure technologies] | Daniel Calbimonte | 2017-10-13 | [AZ],[DEV] | -| [Inside the XEvent Profiler] | Derik Hammer | 2017-10-11 | [DBA],[DEV] | -| [Does The Join Order of My Tables Matter?] | Bert Wagner | 2017-11-21 | [DBA],[DEV] | +| [What impact can different cursor options have?] | Aaron Bertrand | 2012-09-10 | [DBA][DEV] | +| [SQL Smackdown!!! Cursors VS Loops] | SQL Undercover | 2017-11-16 | [DBA][DEV] | +| [Using the OPTION (RECOMPILE) option for a statement] | Kimberly Tripp | 2010-04-15 | [DBA][DEV] | +| [Execution Plan Caching and Reuse] | Microsoft | 2015-02-12 | [DBA][DEV] | +| [Buffer Management] | Microsoft | 1753-01-01 | [DBA][DEV] | +| [RECOMPILE Hints and Execution Plan Caching] | Kendra Little | 2017-12-17 | [DBA][DEV] | +| [Improving query performance with OPTION (RECOMPILE), Constant Folding and avoiding Parameter Sniffing issues] | Robin Lester | 2016-08-10 | [DBA][DEV] | +| [Eight Different Ways to Clear the SQL Server Plan Cache] | Glenn Berry | 2016-03-26 | [DBA][DEV] | +| [Introduction and FAQs about Microsoft Azure technologies] | Daniel Calbimonte | 2017-10-13 | [AZ][DEV] | +| [Inside the XEvent Profiler] | Derik Hammer | 2017-10-11 | [DBA][DEV] | +| [Does The Join Order of My Tables Matter?] | Bert Wagner | 2017-11-21 | [DBA][DEV] | | [Encrypting SQL Server connections with Let’s Encrypt certificates] | Derik Hammer | 2017-11-12 | [DBA] | | [Start SQL Server without tempdb] | Kenneth Fisher | 2016-01-20 | [DBA] | | [How to configure database mail in SQL Server] | Bojan Petrovic | 2017-11-22 | [DBA] | -| [Understanding SQL server memory grant] | Jay Choe | 2010-02-16 | [DBA],[DEV] | +| [Understanding SQL server memory grant] | Jay Choe | 2010-02-16 | [DBA][DEV] | | [Cleanly Uninstalling Stubborn SQL Server Components] | Aaron Bertrand | 2015-10-06 | [DBA] | | [Hey! What's the deal with SQL Server NOCOUNT and T-SQL WHILE loops?] | @sqL_handLe | 2017-17-30 | [DEV] | | [Query Store Settings] | Erin Stellato | 2010-11-28 | [QS] | | [Using Plan Explorer with Entity Framework] | Jason Hall | 2010-11-28 | [DEV] | -| [Overview of Encryption Tools in SQL Server] | Matthew McGiffen | 2017-12-05 | [DBA],[DEV] | -| [Clustered Index Uniquifier Existence and Size] | Solomon Rutzky | 2017-09-18 | [DBA],[DEV] | -| [Understanding Logging and Recovery in SQL Server] | Paul Randal | 2009-02-01 | [DBA],[B] | -| [Understanding SQL Server Backups] | Paul Randal | 2009-07-01 | [DBA],[B] | -| [Recovering from Disasters Using Backups] | Paul Randal | 2009-11-01 | [DBA],[B] | +| [Overview of Encryption Tools in SQL Server] | Matthew McGiffen | 2017-12-05 | [DBA][DEV] | +| [Clustered Index Uniquifier Existence and Size] | Solomon Rutzky | 2017-09-18 | [DBA][DEV] | +| [Understanding Logging and Recovery in SQL Server] | Paul Randal | 2009-02-01 | [DBA][B] | +| [Understanding SQL Server Backups] | Paul Randal | 2009-07-01 | [B][DBA] | +| [Recovering from Disasters Using Backups] | Paul Randal | 2009-11-01 | [B][DBA] | | [Simple SQL: Handling Location Datatypes] | Joe Celko | 2017-10-19 | [DEV] | -| [Improve SQL Server Performance by Looking at Plan Cache (Part 1)] | Thomas LaRock | 2014-10-30 | [DBA],[DEV] | -| [Improve SQL Server Performance by Looking at Plan Cache (Part 2)] | Thomas LaRock | 2014-10-30 | [DBA],[DEV] | -| [Improve SQL Server Performance by Looking at Plan Cache (Part 3)] | Thomas LaRock | 2014-10-30 | [DBA],[DEV] | -| [Take Care When Scripting Batches] | Michael J Swart | 2014-09-09 | [DBA],[DEV] | -| [When Measuring Timespans, try DATEADD instead of DATEDIFF] | Michael J Swart | 2017-12-20 | [DBA],[DEV] | -| [Which user function do I use?] | Kenneth Fisher | 2015-06-24 | [DBA],[DEV] | -| [What’s So Bad About Shrinking Databases with DBCC SHRINKDATABASE?] | Brent Ozar | 2017-12-29 | [DBA],[DEV] | -| [Which Collation is Used to Convert NVARCHAR to VARCHAR in a WHERE Condition? (Part A of 2: “Duck”)] | Solomon Rutzky | 2017-12-08 | [DBA],[DEV] | -| [Which Collation is Used to Convert NVARCHAR to VARCHAR in a WHERE Condition? (Part B of 2: “Rabbit”)] | Solomon Rutzky | 2017-12-11 | [DBA],[DEV] | -| [Current State of the NewSQL/NoSQL Cloud Arena] | Warner Chaves | 2017-11-27 | [DBA],[DEV] | +| [Improve SQL Server Performance by Looking at Plan Cache (Part 1)] | Thomas LaRock | 2014-10-30 | [DBA][DEV] | +| [Improve SQL Server Performance by Looking at Plan Cache (Part 2)] | Thomas LaRock | 2014-10-30 | [DBA][DEV] | +| [Improve SQL Server Performance by Looking at Plan Cache (Part 3)] | Thomas LaRock | 2014-10-30 | [DBA][DEV] | +| [Take Care When Scripting Batches] | Michael J Swart | 2014-09-09 | [DBA][DEV] | +| [When Measuring Timespans, try DATEADD instead of DATEDIFF] | Michael J Swart | 2017-12-20 | [DBA][DEV] | +| [Which user function do I use?] | Kenneth Fisher | 2015-06-24 | [DBA][DEV] | +| [What’s So Bad About Shrinking Databases with DBCC SHRINKDATABASE?] | Brent Ozar | 2017-12-29 | [DBA][DEV] | +| [Which Collation is Used to Convert NVARCHAR to VARCHAR in a WHERE Condition? (Part A of 2: “Duck”)] | Solomon Rutzky | 2017-12-08 | [DBA][DEV] | +| [Which Collation is Used to Convert NVARCHAR to VARCHAR in a WHERE Condition? (Part B of 2: “Rabbit”)] | Solomon Rutzky | 2017-12-11 | [DBA][DEV] | +| [Current State of the NewSQL/NoSQL Cloud Arena] | Warner Chaves | 2017-11-27 | [DBA][DEV] | | [SQL Server 2017: JSON] | Sergey Syrovatchenko | 2017-11-17 | [X] | | [Simulating Bad Networks to Test SQL Server Replication] | John Paul Cook | 2018-01-02 | [DBA] | | [How to Turn on Instant File Initialization] | Greg Larsen | 2017-12-04 | [DBA] | | [Bad Idea Jeans: Finding Undocumented Trace Flags] | Brent Ozar | 2017-10-04 | [DEV] | | [A Method to Find Trace Flags] | Joe Obbish | 2018-01-16 | [DEV] | | [Using Windows stored credentials to connect to SQL in containers] | Andrew Pruski | 2018-01-17 | [DEV] | -| [Step by Step Guide to Migrate SQL Server Data to SQL Server 2017] | Anoop Kumar | 2017-12-21 | [DBA] | +| [Step by Step Guide to Migrate SQL Server Data to SQL Server 2017] | Anoop Kumar | 2017-12-21 | [DBA][MG] | | [Nasty Fast PERCENT_RANK] | Alan Burstein | 2018-01-05 | [DEV] | | [Administrative Logins and Users] | Kenneth Fisher | 2015-11-02 | [DEV] | | [Parallelism in Hekaton (In-Memory OLTP)] | Niko Neugebauer | 2018-01-20 | [DEV] | | [Troubleshooting THREADPOOL Waits] | Klaus Aschenbrenner · | 2015-10-20 | [DEV] | -| [Andy’s Excellent SSIS-in-the-Cloud Adventure, Part 1 – Build an ADFv2 IR Instance] | Andy Leonard · | 2018-01-28 | [AZ],[SSIS] | +| [Andy’s Excellent SSIS-in-the-Cloud Adventure, Part 1 – Build an ADFv2 IR Instance] | Andy Leonard · | 2018-01-28 | [AZ][SSIS] | | [PRINT vs. RAISERROR] | sqlity.net · | 2012-05-27 | [DEV] | -| [Does a Clustered Index Give a Default Ordering?] | Kendra Little · | 2018-02-02 | [DEV] | | [Without ORDER BY, You Can’t Depend On the Order of Results] | Michael J Swart · | 2013-09-13 | [DEV] | | [Query Store and “in memory”] | Erin Stellato · | 2018-01-31 | [QS] | | [Setting and Identifying Row Goals in Execution Plans] | Paul White · | 2018-02-12 | [DEV] | @@ -504,34 +496,34 @@ Articles types: | [Indexing and Partitioning] | DBA From The Cold | 2018-02-21 | [DEV] | | [Schema Compare for SQL Server] | Thomas Larock | 2018-02-14 | [DEV] | | [How to change SQL Server ERRORLOG location] | Mark Varnas | 2018-03-04 | [DBA] | -| [The Uni-Code: The Search for the True List of Valid Characters for T-SQL Regular Identifiers, Part 1] | Solomon Rutzky | 2018-04-02 | [DBA],[DEV] | -| [The Uni-Code: The Search for the True List of Valid Characters for T-SQL Regular Identifiers, Part 2] | Solomon Rutzky | 2018-04-04 | [DBA],[DEV] | -| [What’s in a Name?: Inside the Wacky World of T-SQL Identifiers] | Solomon Rutzky | 2018-04-09 | [DBA],[DEV] | +| [The Uni-Code: The Search for the True List of Valid Characters for T-SQL Regular Identifiers, Part 1] | Solomon Rutzky | 2018-04-02 | [DBA][DEV] | +| [The Uni-Code: The Search for the True List of Valid Characters for T-SQL Regular Identifiers, Part 2] | Solomon Rutzky | 2018-04-04 | [DBA][DEV] | +| [What’s in a Name?: Inside the Wacky World of T-SQL Identifiers] | Solomon Rutzky | 2018-04-09 | [DBA][DEV] | | [Programming SQL Server with SQL Server Management Objects Framework] | Darko Martinović | 2018-04-09 | [DEV] | | [Interval Queries in SQL Server] | Itzik Ben-Gan | 2013-06-12 | [DEV] | | [Dealing with date and time instead of datetime] | Rob Farley | 2018-03-29 | [DEV] | -| [Insight into the SQL Server buffer cache] | Ed Pollack | 2018-02-18 | [DBA],[DEV] | -| [A concrete example of migration between an Oracle Database and SQL Server using Microsoft Data Migration Assistant] | Jefferson Elias | 2018-04-12 | [DBA],[DEV] | +| [Insight into the SQL Server buffer cache] | Ed Pollack | 2018-02-18 | [DBA][DEV] | +| [A concrete example of migration between an Oracle Database and SQL Server using Microsoft Data Migration Assistant] | Jefferson Elias | 2018-04-12 | [DBA][DEV] | | [Audit SQL Server stop, start, restart] | Steve Keeler | 2018-03-12 | [DBA] | | [Query tuning: Apply yourself] | Daniel Janik | 2018-04-06 | [DEV] | | [How to identify and monitor unused indexes in SQL Server] | Nikola Dimitrijevic | 2018-04-17 | [IDX] | | [Benchmarking: 1-TB table population (part 1: the baseline)] | Paul Randal | 2010-01-21 | [BENCH] | | [Benchmarking: 1-TB table population (part 2: optimizing log block IO size and how log IO works)] | Paul Randal | 2010-01-27 | [BENCH] | -| [An overview of SQL Server database migration tools provided by Microsoft] | Jefferson Elias | 2018-03-16 | [DBA] | +| [An overview of SQL Server database migration tools provided by Microsoft] | Jefferson Elias | 2018-03-16 | [DBA][MG] | | [Calling Http endpoints in T-SQL using CURL extension] | Jovan Popovic | 2018-04-17 | [CLR] | | [Why Table Join Orders In Relational Databases] | Bert Wagner | 2018-04-16 | [DEV] | | [Finding overlapping ranges of data] | Louis Davidson | 2018-04-18 | [DEV] | | [Avoid use of the MONEY and SMALLMONEY datatypes] | Phil Factor | 2018-04-18 | [DEV] | | [Provisioning SQL Server Instances with Docker] | Laerte Junior | 2018-04-18 | [DBA] | -| [Understanding the graphical representation of the SQL Server Deadlock Graph] | Minette Steynberg | 2016-08-16 | [DBA],[DEV] | -| [Digitally Signing a Stored Procedure To Allow It To Run With Elevated Permissions] | SQL Undercover | 2018-05-02 | [DBA],[DEV] | +| [Understanding the graphical representation of the SQL Server Deadlock Graph] | Minette Steynberg | 2016-08-16 | [DBA][DEV] | +| [Digitally Signing a Stored Procedure To Allow It To Run With Elevated Permissions] | SQL Undercover | 2018-05-02 | [DBA][DEV] | | [NOLOCK and Top Optimization] | Dmitry Piliugin | 2018-04-12 | [DEV] | | [Operator Precedence versus the Confusing Constraint Translation] | Louis Davidson | 2018-04-30 | [DEV] | | [Interval Queries in SQL Server] | Itzik Ben-Gan | 2013-06-13 | [DEV] | | [Query Trace Column Values] | Dmitry Piliugin | 2018-04-23 | [XE] | | [Concurrency Week: How to Delete Just Some Rows from a Really Big Table] | Brent Ozar | 2018-04-27 | [DEV] | -| [Break large delete operations into chunks] | Aaron Bertrand | 2013-03-13 | [DBA],[DEV] | -| [How to perform a page level restore in SQL Server] | Prashanth Jayaram | 2018-08-18 | [DBA],[DEV] | +| [Break large delete operations into chunks] | Aaron Bertrand | 2013-03-13 | [DBA][DEV] | +| [How to perform a page level restore in SQL Server - Jayaram] | Prashanth Jayaram | 2018-08-18 | [DBA][DEV] | | [Grouping dates without blocking operators] | Daniel Hutmacher | 2018-05-14 | [DEV] | | [What’s CHECKDB doing in my database restore?] | Mike Fal | 2018-04-10 | [DBA] | | [How To Hide An Instance Of SQL Server] | Thomas Larock | 2018-04-10 | [DBA] | @@ -541,21 +533,21 @@ Articles types: | [When to use the SELECT…INTO statement] | Phil Factor | 2018-03-19 | [DEV] | | [Temp Tables In SSIS] | Tim Mitchel | 2018-05-29 | [SSIS] | | [Changing the Collation of the Instance, the Databases, and All Columns in All User Databases] | Solomon Rutzky | 2018-06-11 | [DBA] | -| [10 Cool SQL Optimisations That do not Depend on the Cost Model] | Lukas Eder | 2017-09-28 | [DBA],[DEV] | -| [Scheduling powershell tasks with sql agent] | Chrissy Lemaire | 2017-09-26 | [J],[PS] | +| [10 Cool SQL Optimisations That do not Depend on the Cost Model] | Lukas Eder | 2017-09-28 | [DBA][DEV] | +| [Scheduling powershell tasks with sql agent] | Chrissy Lemaire | 2017-09-26 | [J][PS] | | [Three ways to track logins using dbatools] | Chrissy Lemaire | 2018-04-10 | [PS] | | [Impact of Fragmentation on Execution Plans] | Jonathan Kehayias | 2017-12-18 | [DEV] | | [How to “debug” a Linked Server from SQL Server to an Oracle Database instance] | Jefferson Elias | 2018-06-11 | [DEV] | | [How to implement error handling in SQL Server] | Bojan Petrovic | 2018-06-15 | [DEV] | | [SQL Server Closure Tables] | Phil Factor | 2018-04-10 | [DEV] | -| [Deadlock victim choice in SQL Server - an exception?] | Josh the Coder | 2018-05-10 | [DBA],[DEV] | -| [Azure and Windows PowerShell: The Basics] | Nicolas Prigent | 2017-12-29 | [AZ],[PS] | -| [Azure and Windows PowerShell: Getting Information] | Nicolas Prigent | 2018-06-26 | [AZ],[PS] | +| [Deadlock victim choice in SQL Server - an exception?] | Josh Darnell | 2018-05-10 | [DBA][DEV] | +| [Azure and Windows PowerShell: The Basics] | Nicolas Prigent | 2017-12-29 | [AZ][PS] | +| [Azure and Windows PowerShell: Getting Information] | Nicolas Prigent | 2018-06-26 | [AZ][PS] | | [Be our guest, be our guest, put our database to the test] | Kenneth Fisher | 2018-06-25 | [DBA] | | [Finding code smells using SQL Prompt: the SET NOCOUNT problem (PE008 and PE009)] | Phil Factor | 2018-01-04 | [DEV] | -| [DATABASES 101 guide for the non-technical professional] | Thomas LaRock | 2018-07-05 | [DBA],[DEV] | +| [DATABASES 101 guide for the non-technical professional] | Thomas LaRock | 2018-07-05 | [DBA][DEV] | | [Understanding your Azure EA Billing Data and Building a Centralized Data Storage Solution] | Feodor Georgiev | 2018-07-17 | [AZ] | -| [READ COMMITTED SNAPSHOT ISOLATION and High version_ghost_record_count] | Uwe Ricken | 2018-03-06 | [DBA],[DEV] | +| [READ COMMITTED SNAPSHOT ISOLATION and High version_ghost_record_count] | Uwe Ricken | 2018-03-06 | [DBA][DEV] | | [In-Memory OLTP Indexes – Part 1: Recommendations.] | Kunal Karoth | 2017-11-02 | [IDX] | | [In-Memory OLTP Indexes – Part 2: Performance Troubleshooting Guide.] | Kunal Karoth | 2017-11-14 | [IDX] | | [Optimization Thresholds – Grouping and Aggregating Data, Part 1] | Itzik Ben-Gan | 2018-04-10 | [DEV] | @@ -566,80 +558,80 @@ Articles types: | [When DBCC OpenTran doesn’t list all open transactions] | Mohamed | 2013-02-17 | [DBA] | | [How I spot not-yet-documented features in SQL Server CTPs] | Aaron Bertrand | 2015-12-02 | [DBA] | | [More ways to discover changes in new versions of SQL Server] | Aaron Bertrand | 2016-03-30 | [DBA] | -| [Tail-Log Backup and Restore in SQL Server] | Prashanth Jayaram | 2018-05-31 | [DBA] | +| [Tail-Log Backup and Restore in SQL Server] | Prashanth Jayaram | 2018-05-31 | [B][DBA] | | [Database Filegroup(s) and Piecemeal restores in SQL Server] | Prashanth Jayaram | 2018-06-22 | [DBA] | | [Updating Statistics with Ola Hallengren’s Script] | Erin Stellato | 2018-06-22 | [DBA] | -| [Interview questions on SQL Server database backups, restores and recovery – Part I] | Prashanth Jayaram | 2018-07-25 | [DBA] | -| [Interview questions on SQL Server database backups, restores and recovery – Part II] | Prashanth Jayaram | 2018-07-25 | [DBA] | -| [Interview questions on SQL Server database backups, restores and recovery – Part III] | Prashanth Jayaram | 2018-07-25 | [DBA] | -| [Can Rowstore Compression Beat Columnstore Compression?] | Joe Obbish | 2018-06-28 | [DBA],[DEV] | -| [Inside the Storage Engine: Anatomy of a record] | Paul Randal | 2007-09-30 | [DBA],[DEV] | -| [Inside the Storage Engine: Using DBCC PAGE and DBCC IND to find out if page splits ever roll back] | Paul Randal | 2007-10-01 | [DBA],[DEV] | -| [Inside the Storage Engine: Anatomy of a page] | Paul Randal | 2007-10-03 | [DBA],[DEV] | -| [Inside the Storage Engine: Anatomy of an extent] | Paul Randal | 2007-10-03 | [DBA],[DEV] | -| [Inside the Storage Engine: IAM pages, IAM chains, and allocation units] | Paul Randal | 2007-10-04 | [DBA],[DEV] | -| [Inside The Storage Engine: GAM, SGAM, PFS and other allocation maps] | Paul Randal | 2008-03-14 | [DBA],[DEV] | -| [Disaster recovery 101: fixing a broken boot page] | Paul Randal | 2015-06-23 | [DBA],[DEV] | -| [How to download a sqlservr.pdb symbol file] | Paul Randal | 2011-04-13 | [DBA],[DEV] | -| [A cause of high-duration ASYNC_IO_COMPLETION waits] | Paul Randal | 2014-03-19 | [DBA],[DEV] | -| [How to solve the Identity Crisis in SQL Server] | Ed Pollack | 2017-11-14 | [DBA],[DEV] | +| [Interview questions on SQL Server database backups, restores and recovery – Part I] | Prashanth Jayaram | 2018-07-25 | [B][DBA] | +| [Interview questions on SQL Server database backups, restores and recovery – Part II] | Prashanth Jayaram | 2018-07-25 | [B][DBA] | +| [Interview questions on SQL Server database backups, restores and recovery – Part III] | Prashanth Jayaram | 2018-07-25 | [B][DBA] | +| [Can Rowstore Compression Beat Columnstore Compression?] | Joe Obbish | 2018-06-28 | [DBA][DEV] | +| [Inside the Storage Engine: Anatomy of a record] | Paul Randal | 2007-09-30 | [DBA][DEV] | +| [Inside the Storage Engine: Using DBCC PAGE and DBCC IND to find out if page splits ever roll back] | Paul Randal | 2007-10-01 | [DBA][DEV] | +| [Inside the Storage Engine: Anatomy of a page] | Paul Randal | 2007-10-03 | [DBA][DEV] | +| [Inside the Storage Engine: Anatomy of an extent] | Paul Randal | 2007-10-03 | [DBA][DEV] | +| [Inside the Storage Engine: IAM pages, IAM chains, and allocation units] | Paul Randal | 2007-10-04 | [DBA][DEV] | +| [Inside The Storage Engine: GAM, SGAM, PFS and other allocation maps] | Paul Randal | 2008-03-14 | [DBA][DEV] | +| [Disaster recovery 101: fixing a broken boot page] | Paul Randal | 2015-06-23 | [DBA][DEV] | +| [How to download a sqlservr.pdb symbol file] | Paul Randal | 2011-04-13 | [DBA][DEV] | +| [A cause of high-duration ASYNC_IO_COMPLETION waits] | Paul Randal | 2014-03-19 | [DBA][DEV] | +| [How to solve the Identity Crisis in SQL Server] | Ed Pollack | 2017-11-14 | [DBA][DEV] | | [Azure SQL Database Performance and Service Tiers Explained] | Glenn Berry | 2018-08-01 | [AZ] | | [What To Do When Wait Stats Don’t Help] | Joe Obbish | 2018-07-20 | [DEV] | | [SQL Server Brute Force Attack Detection: Part 1] | Ryan G Conrad | 2018-03-26 | [DBA] | | [SQL Server Brute Force Attack Detection: Part 2] | Ryan G Conrad | 2018-03-26 | [DBA] | | [SQL Server Brute Force Attack Detection: Part 3] | Ryan G Conrad | 2018-03-26 | [DBA] | -| [SQLCLR vs SQL Server 2017, Part 8: Is SQLCLR Deprecated in Favor of Python or R (sp_execute_external_script)?] | Solomon Rutzky | 2018-08-09 | [DBA],[DEV] | +| [SQLCLR vs SQL Server 2017, Part 8: Is SQLCLR Deprecated in Favor of Python or R (sp_execute_external_script)?] | Solomon Rutzky | 2018-08-09 | [DBA][DEV] | | [Sql Server Agent For Azure Sql Database, Azure Elastic Database Pools & Azure Managed Instance] | ? | 2018-07-20 | [AZ] | | [Storage performance best practices and considerations for Azure SQL DB Managed Instance (General Purpose)] | Dimitri Furman | 2018-07-20 | [AZ] | | [T-SQL Tuesday #017: APPLY: It Slices! It Dices! It Does It All!] | Brad Schulz | 2011-04-12 | [DEV] | -| [SQL Server Encryption, What’s The Key Hierarchy All About?] | David Fowler | 2018-08-12 | [DBA],[DEV] | -| [Overview of the SQLCMD utility in SQL Server] | Prashanth Jayaram | 2018-08-13 | [DBA],[DEV] | -| [The BCP (Bulk Copy Program) command in action] | Prashanth Jayaram | 2018-08-13 | [DBA],[DEV] | -| [Measuring Query Execution Time] | Grant Fritchey | 2018-08-13 | [DBA],[DEV] | -| [How to Check Performance on a New SQL Server] | Brent Ozar | 2018-08-03 | [DBA],[DEV] | +| [SQL Server Encryption, What’s The Key Hierarchy All About?] | David Fowler | 2018-08-12 | [DBA][DEV] | +| [Overview of the SQLCMD utility in SQL Server] | Prashanth Jayaram | 2018-08-13 | [DBA][DEV] | +| [The BCP (Bulk Copy Program) command in action] | Prashanth Jayaram | 2018-08-13 | [DBA][DEV] | +| [Measuring Query Execution Time] | Grant Fritchey | 2018-08-13 | [DBA][DEV] | +| [How to Check Performance on a New SQL Server] | Brent Ozar | 2018-08-03 | [DBA][DEV] | | [Questions About Kerberos and SQL Server That You Were Too Shy to Ask] | Kathi Kellenberger | 2018-08-21 | [DBA] | -| [SQL Server Execution Plans overview] | Ahmad Yaseen | 2018-07-04 | [DBA],[DEV] | -| [SQL Server Execution Plans types] | Ahmad Yaseen | 2018-07-23 | [DBA],[DEV] | -| [How to Analyze SQL Execution Plan Graphical Components] | Ahmad Yaseen | 2018-09-07 | [DBA],[DEV] | -| [Query optimization techniques in SQL Server: the basics] | Ed Pollack | 2018-05-30 | [DBA],[DEV] | -| [Query optimization techniques in SQL Server: tips and tricks] | Ed Pollack | 2018-06-19 | [DBA],[DEV] | -| [Query optimization techniques in SQL Server: Database Design and Architecture] | Ed Pollack | 2018-07-13 | [DBA],[DEV] | -| [SQL Query Optimization Techniques in SQL Server: Parameter Sniffing] | Ed Pollack | 2018-09-04 | [DBA],[DEV] | -| [Similarities and Differences among RANK, DENSE_RANK and ROW_NUMBER Functions] | Ben Richardson | 2018-08-20 | [DBA],[DEV] | -| [Temporal Tables Under The Covers] | Randolph West | 2015-11-17 | [DBA],[DEV] | -| [Faking Temporal Tables with Triggers] | Bert Wagner | 2018-09-11 | [DBA],[DEV] | -| [SQL queries to manage hierarchical or parent-child relational rows in SQL Server] | Dipon Roy | 2014-09-16 | [DBA],[DEV] | -| [Choosing Between Table Variables and Temporary Tables] | Phil Factor | 2018-05-11 | [DBA],[DEV] | -| [What's New in the First Public CTP of SQL Server 2019] | Aaron Bertrand | 2018-09-24 | [DBA],[DEV] | -| [SQL Server support for TLS 1.2 – Read This First!] | Aaron Bertrand | 2016-03-03 | [DBA],[DEV] | -| [Misconceptions in SQL Server: A Trio of table variables] | Gail Shaw | 2010-10-12 | [DBA],[DEV] | -| [Using the Same Column Twice in a SQL UPDATE Statement] | SQL Theater | 2018-09-13 | [DBA],[DEV] | -| [How to perform a performance test against a SQL Server instance] | Jefferson Elias | 2018-09-14 | [DBA],[DEV] | +| [SQL Server Execution Plans overview] | Ahmad Yaseen | 2018-07-04 | [DBA][DEV] | +| [SQL Server Execution Plans types] | Ahmad Yaseen | 2018-07-23 | [DBA][DEV] | +| [How to Analyze SQL Execution Plan Graphical Components] | Ahmad Yaseen | 2018-09-07 | [DBA][DEV] | +| [Query optimization techniques in SQL Server: the basics] | Ed Pollack | 2018-05-30 | [DBA][DEV] | +| [Query optimization techniques in SQL Server: tips and tricks] | Ed Pollack | 2018-06-19 | [DBA][DEV] | +| [Query optimization techniques in SQL Server: Database Design and Architecture] | Ed Pollack | 2018-07-13 | [DBA][DEV] | +| [SQL Query Optimization Techniques in SQL Server: Parameter Sniffing] | Ed Pollack | 2018-09-04 | [DBA][DEV] | +| [Similarities and Differences among RANK, DENSE_RANK and ROW_NUMBER Functions] | Ben Richardson | 2018-08-20 | [DBA][DEV] | +| [Temporal Tables Under The Covers] | Randolph West | 2015-11-17 | [DBA][DEV] | +| [Faking Temporal Tables with Triggers] | Bert Wagner | 2018-09-11 | [DBA][DEV] | +| [SQL queries to manage hierarchical or parent-child relational rows in SQL Server] | Dipon Roy | 2014-09-16 | [DBA][DEV] | +| [Choosing Between Table Variables and Temporary Tables] | Phil Factor | 2018-05-11 | [DBA][DEV] | +| [What's New in the First Public CTP of SQL Server 2019] | Aaron Bertrand | 2018-09-24 | [DBA][DEV] | +| [SQL Server support for TLS 1.2 – Read This First!] | Aaron Bertrand | 2016-03-03 | [DBA][DEV] | +| [Misconceptions in SQL Server: A Trio of table variables] | Gail Shaw | 2010-10-12 | [DBA][DEV] | +| [Using the Same Column Twice in a SQL UPDATE Statement] | SQL Theater | 2018-09-13 | [DBA][DEV] | +| [How to perform a performance test against a SQL Server instance] | Jefferson Elias | 2018-09-14 | [DBA][DEV] | | [The Black Art Of Spatial Index Tuning In SQL Server] | Todd Jackson | 2011-04-26 | [DEV] | | [Patching SQL Server on Windows notes from the field] | Kevin Chant | 2019-01-10 | [DBA] | | [Availability Group Readable Secondaries – Just Say No] | Jonathan Kehayias | 2019-01-10 | [DBA] | -| [Finding the Slowest Query in a Stored Procedure] | Erin Stellato | 2018-12-13 | [DBA],[DEV] | -| [A Monumental Migration to SQL Server 2016 – Part 1] | Andy Levy | 2019-01-07 | [DBA] | -| [A Monumental Migration to SQL Server 2016 – Part 2] | Andy Levy | 2019-01-09 | [DBA] | -| [A unique review of SQL Server index types] | Kevin Chant | 2019-10-18 | [DBA],[DEV] | -| [Don’t Just Rely on Query Execution Stats for T-SQL Execution] | Kevin Chant | 2018-09-18 | [DBA],[DEV] | -| [Posting SQL Server notifications to Slack] | Alessandro Alpi | 2018-09-19 | [DBA],[DEV] | -| [How to create DACPAC file?] | Kamil Nowinski | 2018-10-31 | [DBA],[DEV] | +| [Finding the Slowest Query in a Stored Procedure] | Erin Stellato | 2018-12-13 | [DBA][DEV] | +| [A Monumental Migration to SQL Server 2016 – Part 1] | Andy Levy | 2019-01-07 | [DBA][MG] | +| [A Monumental Migration to SQL Server 2016 – Part 2] | Andy Levy | 2019-01-09 | [DBA][MG] | +| [A unique review of SQL Server index types] | Kevin Chant | 2019-10-18 | [DBA][DEV] | +| [Don’t Just Rely on Query Execution Stats for T-SQL Execution] | Kevin Chant | 2018-09-18 | [DBA][DEV] | +| [Posting SQL Server notifications to Slack] | Alessandro Alpi | 2018-09-19 | [DBA][DEV] | +| [How to create DACPAC file?] | Kamil Nowinski | 2018-10-31 | [DBA][DEV] | | [Find the Next Non-NULL Row in a Series With SQL] | Lukas Eder | 2018-09-03 | [DEV] | | [Calculate Percentiles to Learn About Data Set Skew in SQL] | Lukas Eder | 2019-01-22 | [DEV] | -| [Comparing multiple rows insert vs single row insert with three data load methods] | Phil Factor | 2013-02-21 | [DBA],[DEV] | -| [The Cause of Every Deadlock in SQL Server] | Thomas Larock | 2018-09-19 | [DBA],[DEV] | -| [Deadlock Troubleshooting, Part 1] | Bart Dunkan | 2006-09-08 | [DBA],[DEV] | -| [Deadlock Troubleshooting, Part 2] | Bart Dunkan | 2006-09-12 | [DBA],[DEV] | -| [Deadlock Troubleshooting, Part 3] | Bart Dunkan | 2006-09-08 | [DBA],[DEV] | -| [The Good, the Bad and the Ugly of Table Variable Deferred Compilation – Part 1] | Milosra Divojevic | 2018-10-04 | [DBA],[DEV] | -| [The Good, the Bad and the Ugly of Table Variable Deferred Compilation – Part 2] | Milosra Divojevic | 2018-10-05 | [DBA],[DEV] | -| [The Good, the Bad and the Ugly of Table Variable Deferred Compilation – Part 3] | Milosra Divojevic | 2018-10-08 | [DBA],[DEV] | -| [Creating a SQL Server 2019 Demo Environment in a Docker Container] | Cathrine Wilhelmsen | 2018-12-02 | [DBA],[DEV] | -| [Overview of Data Compression in SQL Server] | Prashanth Jayaram | 2018-12-06 | [DBA],[DEV] | -| [SQL Server Hash Match Operator] | Hugo Kornelis | 2018-06-01 | [DBA],[DEV] | +| [Comparing multiple rows insert vs single row insert with three data load methods] | Phil Factor | 2013-02-21 | [DBA][DEV] | +| [The Cause of Every Deadlock in SQL Server] | Thomas Larock | 2018-09-19 | [DBA][DEV] | +| [Deadlock Troubleshooting, Part 1] | Bart Dunkan | 2006-09-08 | [DBA][DEV] | +| [Deadlock Troubleshooting, Part 2] | Bart Dunkan | 2006-09-12 | [DBA][DEV] | +| [Deadlock Troubleshooting, Part 3] | Bart Dunkan | 2006-09-08 | [DBA][DEV] | +| [The Good, the Bad and the Ugly of Table Variable Deferred Compilation – Part 1] | Milosra Divojevic | 2018-10-04 | [DBA][DEV] | +| [The Good, the Bad and the Ugly of Table Variable Deferred Compilation – Part 2] | Milosra Divojevic | 2018-10-05 | [DBA][DEV] | +| [The Good, the Bad and the Ugly of Table Variable Deferred Compilation – Part 3] | Milosra Divojevic | 2018-10-08 | [DBA][DEV] | +| [Creating a SQL Server 2019 Demo Environment in a Docker Container] | Cathrine Wilhelmsen | 2018-12-02 | [DBA][DEV] | +| [Overview of Data Compression in SQL Server] | Prashanth Jayaram | 2018-12-06 | [DBA][DEV] | +| [SQL Server Hash Match Operator] | Hugo Kornelis | 2018-06-01 | [DBA][DEV] | | [How to use Microsoft Assessment and Planning (MAP) Toolkit for SQL Server] | Musab Umair | 2017-03-31 | [DBA] | -| [Improve the Performance of Your Azure SQL Database (and Save Money!) with Automatic Tuning] | Monica Rathbun | 2019-01-30 | [AZ],[DBA] | +| [Improve the Performance of Your Azure SQL Database (and Save Money!) with Automatic Tuning] | Monica Rathbun | 2019-01-30 | [AZ][DBA] | | [The Importance of Database Compatibility Level in SQL Server] | Glenn Berry | 2019-01-14 | [DBA] | | [Azure Managed vs Unmanaged disks : The choice] | Samir Farhat | 2017-05-31 | [AZ] | | [Storage options for SQL Server database files in Azure] | James Serra | 2019-01-29 | [AZ] | @@ -648,154 +640,858 @@ Articles types: | [Preparation for SQL Server Installation] | Michal Sadowski | 2018-12-12 | [DBA] | | [Executing xp_cmdshell with Non SysAdmin Account] | Lucas Kartawidjaja | 2019-01-04 | [DBA] | | [Generating SQL using Biml (T-SQL Tuesday #110)] | Cathrine Wilhelmsen | 2019-01-08 | [DEV] | -| [Avoiding SQL Server Upgrade Performance Issues] | Glenn Berry | 2019-02-05 | [DBA] | -| [Using Temporary Procedures] | Phil Factor | 2019-02-08 | [DBA],[DEV] | -| [Introduction to SQL Server Security — Part 1] | Robert Sheldon | 2018-12-31 | [DBA],[DEV] | -| [Introduction to SQL Server Security — Part 2] | Robert Sheldon | 2019-01-28 | [DBA],[DEV] | -| [Introduction to SQL Server Security — Part 3] | Robert Sheldon | 2019-02-25 | [DBA],[DEV] | -| [Introduction to SQL Server Security — Part 4] | Robert Sheldon | 2019-03-26 | [DBA],[DEV] | -| [Introduction to T-SQL Window Functions] | Kathi Kellenberger | 2018-07-13 | [DBA],[DEV] | -| [Intro to Debugging a Memory Dump] | Adam W. Saxton | 2012-03-15 | [DBA],[DEV] | -| [Considering Security with SQL Bulk Insert] | Timothy Smith | 2019-01-17 | [DBA],[DEV] | +| [Using Temporary Procedures] | Phil Factor | 2019-02-08 | [DBA][DEV] | +| [Introduction to SQL Server Security — Part 1] | Robert Sheldon | 2018-12-31 | [SEC] | +| [Introduction to SQL Server Security — Part 2] | Robert Sheldon | 2019-01-28 | [SEC] | +| [Introduction to SQL Server Security — Part 3] | Robert Sheldon | 2019-02-25 | [SEC] | +| [Introduction to SQL Server Security — Part 4] | Robert Sheldon | 2019-03-26 | [SEC] | +| [Introduction to T-SQL Window Functions] | Kathi Kellenberger | 2018-07-13 | [DBA][DEV] | +| [Intro to Debugging a Memory Dump] | Adam W. Saxton | 2012-03-15 | [DBA][DEV] | +| [Considering Security with SQL Bulk Insert] | Timothy Smith | 2019-01-17 | [SEC] | | [SQL Server 2012 AlwaysOn – Part 11 – Performance Aspects and Performance Monitoring I] | Juergen Thomas | 2013-04-21 | [DBA] | | [SQL Server 2012 AlwaysOn – Part 11 – Performance Aspects and Performance Monitoring II] | Juergen Thomas | 2013-04-24 | [DBA] | -| [Data Compression Internals] | Jess Pomfret | 2019-02-19 | [DBA],[DEV] | -| [SQL Server Data Compression – Crunch Time!] | Jeff Mlakar | 2019-02-22 | [DBA],[DEV] | +| [Data Compression Internals] | Jess Pomfret | 2019-02-19 | [DBA][DEV] | +| [SQL Server Data Compression – Crunch Time!] | Jeff Mlakar | 2019-02-22 | [DBA][DEV] | | [Create a slipstream installer for SQL Server on Windows] | Randolph West | 2018-10-24 | [DBA] | -| [Temporary Tables in SQL Server] | Phil Factor | 2011-09-01 | [DBA],[DEV] | +| [Temporary Tables in SQL Server] | Phil Factor | 2011-09-01 | [DBA][DEV] | | [SQL unit testing with the tSQLt framework for beginners] | Esat Erkec | 2019-03-19 | [DEV] | -| [Oracle vs. SQL Server Architecture] | Kellyn Pot'vin-Gorman | 2019-03-20 | [DBA],[DEV] | -| [Oracle RAC vs. SQL Server AG] | Kellyn Pot'vin-Gorman | 2019-03-28 | [DBA],[DEV] | -| [SSIS vs. Oracle GG] | Kellyn Pot'vin-Gorman | 2019-04-10 | [DBA],[DEV] | +| [Oracle vs. SQL Server Architecture] | Kellyn Pot'vin-Gorman | 2019-03-20 | [DBA][DEV] | +| [Oracle RAC vs. SQL Server AG] | Kellyn Pot'vin-Gorman | 2019-03-28 | [DBA][DEV] | +| [SSIS vs. Oracle GG] | Kellyn Pot'vin-Gorman | 2019-04-10 | [DBA][DEV] | | [Analysis Services Telemetry: What information does SSAS submit? and how has it changed in SSAS 2019?] | Shabnam Watson | 2019-04-13 | [DBA] | | [The Curious Case of… how to find FILESTREAM info from an MDF] | Paul Randal | 2019-04-18 | [DBA] | -| [Does index fragmentation matter?] | Tibor Karaszi | 2019-04-05 | [DBA],[DEV] | +| [Does index fragmentation matter?] | Tibor Karaszi | 2019-04-05 | [DBA][DEV] | | [How to perform a Page Level Restore in SQL Server] | Klaus Aschenbrenner | 2015-10-13 | [DBA] | | [How Much Memory Does SSIS Need?] | Tim Mitchell | 2019-05-02 | [SSIS] | | [The Curious Case of… trying to find an MDF file in a RAW disk] | Paul Randal | 2019-04-30 | [DBA] | -| [Understanding the SQL Server NOLOCK hint] | Greg Robidoux | 2019-04-29 | [DBA],[DEV] | -| [Methods to Insert Data into SQL Server] | Ed Pollack | 2019-04-10 | [DBA],[DEV] | -| [Batching data manipulation is great as long as you do it correctly] | Jeff Iannucci | 2018-09-15 | [DBA],[DEV] | +| [Understanding the SQL Server NOLOCK hint] | Greg Robidoux | 2019-04-29 | [DBA][DEV] | +| [Methods to Insert Data into SQL Server] | Ed Pollack | 2019-04-10 | [DBA][DEV] | +| [Batching data manipulation is great as long as you do it correctly] | Jeff Iannucci | 2018-09-15 | [DBA][DEV] | | [Azure and Windows PowerShell: Using VM Extensions] | Nicolas Prigent | 2018-10-09 | [PS] | -| [Reloading fact tables with zero downtime] | Daniel Hutmacher | 2014-08-24 | [DBA],[DEV] | -| [Transferring Data Efficiently by Using Partition Switching] | Microsoft Docs | 2012-04-10 | [DBA],[DEV] | -| [Another Difference between N'' and '' in SQL Server] | Shane O'Neill | 2018-10-24 | [DBA],[DEV] | +| [Reloading fact tables with zero downtime] | Daniel Hutmacher | 2014-08-24 | [DBA][DEV] | +| [Transferring Data Efficiently by Using Partition Switching] | Microsoft Docs | 2012-04-10 | [DBA][DEV] | +| [Another Difference between N'' and '' in SQL Server] | Shane O'Neill | 2018-10-24 | [DBA][DEV] | | [Ignoring NULLs with FIRST_VALUE] | Bert Wagner | 2018-08-28 | [DEV] | | [Shortchanged with International Money in SQL Server] | Bert Wagner | 2018-09-25 | [DEV] | | [Understanding database recovery with SQL Server 2016 Extended Events] | Rajendra Gupta | 2016-07-05 | [DBA] | -| [SQL Server 2019: Batch Mode on Rowstore] | Dmitri Pilugin | 2018-10-04 | [DBA],[DEV] | -| [Using Indexing To Solve Blocking and Deadlocking Issues] | David Fowler | 2019-03-15 | [DBA],[DEV] | +| [SQL Server 2019: Batch Mode on Rowstore] | Dmitri Pilugin | 2018-10-04 | [DBA][DEV] | +| [Using Indexing To Solve Blocking and Deadlocking Issues] | David Fowler | 2019-03-15 | [DBA][DEV] | | [Change collation of existing Azure SQL database] | Fonseca Sergio | 2018-11-09 | [AZ] | | [Creating Database Maintenance Plans] | Nisarg Upadhyay | 2018-11-09 | [DBA] | | [SQL Server Upgrade Checklist] | Mike Walsh | 2019-03-07 | [DBA] | | [Failing a PowerShell Sql Agent step] | Stuart Moore | 2019-03-04 | [PS] | -| [The Curse of Cursor Options] | Brent Ozar | 2018-11-02 | [DBA],[DEV] | +| [The Curse of Cursor Options] | Brent Ozar | 2018-11-02 | [DBA][DEV] | | [Accelerated Database Recovery; Instant Rollback and Database Recovery] | Rajendra Gupta | 2019-03-12 | [DBA] | | [Accelerated Database Recovery and Long Running Transactions with Transaction Log Growth] | Rajendra Gupta | 2019-03-21 | [DBA] | -| [Using docker named volumes to persist databases in SQL Server] | Andrew Pruski | 2019-03-21 | [DBA],[DEV] | -| [T-SQL bugs, pitfalls, and best practices – determinism] | Itzik Ben-Gan | 2019-03-13 | [DBA],[DEV] | -| [Grouped Concatenation in SQL Server] | Aaron Bertrand | 2014-08-06 | [DBA],[DEV] | -| [Working with tempdb in SQL Server 2005] | Microsoft Docs | 2010-01-28 | [DBA],[DEV] | -| [SQLskills SQL101: Temporary table misuse] | Paul Randal | 2017-03-13 | [DBA],[DEV] | -| [Running SQL Server on Linux on your own laptop] | Kevin Chant | 2019-03-26 | [DBA],[DEV] | +| [Using docker named volumes to persist databases in SQL Server] | Andrew Pruski | 2019-03-21 | [DBA][DEV] | +| [T-SQL bugs, pitfalls, and best practices – determinism] | Itzik Ben-Gan | 2019-03-13 | [DBA][DEV] | +| [Grouped Concatenation in SQL Server] | Aaron Bertrand | 2014-08-06 | [DBA][DEV] | +| [Working with tempdb in SQL Server 2005] | Microsoft Docs | 2010-01-28 | [DBA][DEV] | +| [SQLskills SQL101: Temporary table misuse] | Paul Randal | 2017-03-13 | [DBA][DEV] | +| [Running SQL Server on Linux on your own laptop] | Kevin Chant | 2019-03-26 | [DBA][DEV] | | [SSIS and Pentaho – A Quick Comparison] | Koen Verbeeck | 2018-10-17 | [SSIS] | -| [WinDbg and SQL Server Fun] | Shane O'Neill | 2017-06-14 | [DBA],[DEV] | -| [Certificates, Proxies and Jobs! Oh My!] | Kenneth Fisher | 2016-04-27 | [DBA],[DEV] | -| [SQL Server: Diagnosing Intermittent Connectivity Issues] | Mitch Wheat | 2019-04-12 | [DBA],[DEV] | -| [Difference between Identity & Sequence in SQL Server] | Ben Richardson | 2018-08-15 | [DBA],[DEV] | -| [Does the Rowmodctr Update for Non-Updating Updates?] | Brent Ozar | 2019-05-20 | [DBA],[DEV] | -| [An Intro To Data Modeling] | JBOSEMS | 2019-04-12 | [DBA],[DEV] | -| [On telemetry and other data collected by SQL Server] | Aaron Bertrand | 2016-04-04 | [DBA],[DEV] | -| [Purging data with batched deletes] | Andy Mallon | 2019-04-03 | [DBA],[DEV] | +| [WinDbg and SQL Server Fun] | Shane O'Neill | 2017-06-14 | [DBA][DEV] | +| [Certificates, Proxies and Jobs! Oh My!] | Kenneth Fisher | 2016-04-27 | [DBA][J] | +| [SQL Server: Diagnosing Intermittent Connectivity Issues] | Mitch Wheat | 2019-04-12 | [DBA][DEV] | +| [Difference between Identity & Sequence in SQL Server] | Ben Richardson | 2018-08-15 | [DBA][DEV] | +| [Does the Rowmodctr Update for Non-Updating Updates?] | Brent Ozar | 2019-05-20 | [DBA][DEV] | +| [An Intro To Data Modeling] | JBOSEMS | 2019-04-12 | [DBA][DEV] | +| [On telemetry and other data collected by SQL Server] | Aaron Bertrand | 2016-04-04 | [DBA][DEV] | +| [Purging data with batched deletes] | Andy Mallon | 2019-04-03 | [DBA][DEV] | | [Don’t Forget RoboCopy] | John Morehouse | 2019-03-03 | [DBA] | -| [Understanding the graphical representation of the SQL Server Deadlock Graph] | Minette Steynberg | 2016-04-26 | [DBA],[DEV] | -| [Understanding the XML description of the Deadlock Graph in SQL Server] | Minette Steynberg | 2016-04-26 | [DBA],[DEV] | +| [Understanding the XML description of the Deadlock Graph in SQL Server] | Minette Steynberg | 2016-04-26 | [DBA][DEV] | | [What Is The Difference Between Checkpoint And Lazy Writer] | Saurabh Sinha | 2012-10-01 | [DBA] | -| [Efficiently Indexing Long Character Strings] | Jon Seigel | 2013-07-13 | [DBA],[DEV] | +| [Efficiently Indexing Long Character Strings] | Jon Seigel | 2013-07-13 | [DBA][DEV] | | [SQL Server Read-only tables] | Kenneth Fisher | 2019-01-21 | [DBA] | -| [Slow inserts across a linked server?] | Max Vernon | 2019-04-25 | [DBA],[DEV] | -| [Using IGNORE NULLS With SQL Window Functions to Fill Gaps] | Lukas Eder | 2019-04-24 | [DBA],[DEV] | -| [SQL Server Logical Reads] | Ami Levin | 2008-01-01 | [DBA],[DEV] | -| [Two Words For Faster Scalar Functions] | Bert Wagner | 2018-12-04 | [DBA],[DEV] | -| [How to Get SQL Server Dates and Times Horribly Wrong] | Robert Sheldon | 2015-05-28 | [DBA],[DEV] | -| [Diagnosing and Resolving Spinlock Contention on SQL Server] | Ewan Fairweather, Mike Ruthruff | 2011-06-01 | [DBA],[DEV] | -| [Diagnosing and Resolving Latch Contention on SQL Server] | Ewan Fairweather, Mike Ruthruff | 2011-06-01 | [DBA],[DEV] | +| [Slow inserts across a linked server?] | Max Vernon | 2019-04-25 | [DBA][DEV] | +| [Using IGNORE NULLS With SQL Window Functions to Fill Gaps] | Lukas Eder | 2019-04-24 | [DBA][DEV] | +| [SQL Server Logical Reads] | Ami Levin | 2008-01-01 | [DBA][DEV] | +| [Two Words For Faster Scalar Functions] | Bert Wagner | 2018-12-04 | [DBA][DEV] | +| [How to Get SQL Server Dates and Times Horribly Wrong] | Robert Sheldon | 2015-05-28 | [DBA][DEV] | +| [Diagnosing and Resolving Spinlock Contention on SQL Server] | Ewan Fairweather, Mike Ruthruff | 2011-06-01 | [DBA][DEV] | +| [Diagnosing and Resolving Latch Contention on SQL Server] | Ewan Fairweather, Mike Ruthruff | 2011-06-01 | [DBA][DEV] | | [Advanced Nutanix: SQL Server on Nutanix Best Practices Released!] | Steven Poitras | 2013-11-09 | [DBA] | | [Gaps and Islands Across Date Ranges] | Bert Wagner | 2019-03-12 | [DBA] | -| [NOT NULL Persisted Computed Columns (And What They Allow)] | Louis Davidson | 2019-06-01 | [DBA],[DEV] | -| [How many ways are there to sort GUIDs? How much time do you have?] | Raymond Chen | 2019-04-26 | [DBA],[DEV] | +| [NOT NULL Persisted Computed Columns (And What They Allow)] | Louis Davidson | 2019-06-01 | [DBA][DEV] | +| [How many ways are there to sort GUIDs? How much time do you have?] | Raymond Chen | 2019-04-26 | [DBA][DEV] | | [How do I force a SQL Login to change it’s password on next login] | Kenneth Fisher | 2019-06-05 | [DBA] | | [SQL Server Performance Benchmarking with Patterns] | Paul Brewer | 2017-10-19 | [BENCH] | -| [SQL Server function to convert integer date to datetime format] | Tim Ford | 2019-05-24 | [DBA],[DEV] | -| [Storing Utc Is Not A Silver Bullet] | Jon Skeet | 2019-03-27 | [DBA],[DEV] | -| [Logical Query Processing Part 8 : SELECT and ORDER BY] | Itzik Ben-Gan | 2016-11-15 | [DBA],[DEV] | -| [SQL Server Common Table Expression vs Temp Table] | Rick Dobson | 2019-05-22 | [DBA],[DEV] | +| [SQL Server function to convert integer date to datetime format] | Tim Ford | 2019-05-24 | [DBA][DEV] | +| [Storing Utc Is Not A Silver Bullet] | Jon Skeet | 2019-03-27 | [DBA][DEV] | +| [Logical Query Processing Part 8 : SELECT and ORDER BY] | Itzik Ben-Gan | 2016-11-15 | [DBA][DEV] | +| [SQL Server Common Table Expression vs Temp Table] | Rick Dobson | 2019-05-22 | [DBA][DEV] | | [Which Query Used The Most Cpu? Implementing Extended Events] | Grant Fritchey | 2019-06-03 | [XE] | | [SQL Server Plan Cache Limits] | Erin Stellato | 2019-05-28 | [DBA] | | [SQL Server and ReFS: Part 1 – DBCC and In Memory OLTP] | swasheck | 2014-11-11 | [DBA] | | [SQL Server and ReFS: Part 2 – FIO Benchmarking NTFS vs. ReFS] | swasheck | 2014-12-18 | [DBA] | -| [Why Rolling back inserts with Identity columns is a bad idea] | Adrian Buckman | 2019-04-11 | [DBA],[DEV] | -| [What’s Better, CTEs or Temp Tables?] | Brent Ozar | 2019-06-06 | [DBA],[DEV] | -| [The Difference Between SQL’s JOIN .. ON Clause and the Where Clause] | Lukas Eder | 2019-04-09 | [DBA],[DEV] | +| [Why Rolling back inserts with Identity columns is a bad idea] | Adrian Buckman | 2019-04-11 | [DBA][DEV] | +| [What’s Better, CTEs or Temp Tables?] | Brent Ozar | 2019-06-06 | [DBA][DEV] | +| [The Difference Between SQL’s JOIN .. ON Clause and the Where Clause] | Lukas Eder | 2019-04-09 | [DBA][DEV] | | [My IT department installed an antivirus with SQL Server] | Randolph West | 2019-06-05 | [DBA] | -| [An Experiment with Deadlocks - ROWLOCK hint myth] | Jason Brimhall | 2019-03-25 | [DBA],[DEV] | +| [An Experiment with Deadlocks - ROWLOCK hint myth] | Jason Brimhall | 2019-03-25 | [DBA][DEV] | | [Adding a New Transaction Log File when the Existing Log is Full] | Max Vernon | 2019-03-19 | [DBA] | -| [Transactions Don't Start At BEGIN TRAN] | Josh Darnell | 2019-06-05 | [DBA],[DEV] | -| [CAST/CONVERT makes expressions nullable] | Daniel Hutmacher | 2019-06-05 | [DBA],[DEV] | -| [Deciding between COALESCE and ISNULL in SQL Server] | Aaron Bertrand | 2012-04-30 | [DBA],[DEV] | -| [How do you choose which columns to include in your SQL Server clustered index?] | agilesql | 2019-06-01 | [DBA],[DEV] | -| [A ever-increasing Clustered Key value doesn’t scale] | Klaus Aschenbrenner | 2014-04-15 | [DBA],[DEV] | -| [SQL Server Bit reversion] | Rick | 2011-10-03 | [DBA],[DEV] | +| [Transactions Don't Start At BEGIN TRAN] | Josh Darnell | 2019-06-05 | [DBA][DEV] | +| [CAST/CONVERT makes expressions nullable] | Daniel Hutmacher | 2019-06-05 | [DBA][DEV] | +| [Deciding between COALESCE and ISNULL in SQL Server] | Aaron Bertrand | 2012-04-30 | [DBA][DEV] | +| [How do you choose which columns to include in your SQL Server clustered index?] | agilesql | 2019-06-01 | [DBA][DEV] | +| [A ever-increasing Clustered Key value doesn’t scale] | Klaus Aschenbrenner | 2014-04-15 | [DBA][DEV] | +| [SQL Server Bit reversion] | Rick | 2011-10-03 | [DBA][DEV] | | [Troubleshooting a renamed SQL Server] | Jamie Wick | 2019-06-05 | [DBA] | -| [Are Differential Backups Necessary?] | Jamie Wick | 2019-04-02 | [DBA] | +| [Are Differential Backups Necessary?] | Jamie Wick | 2019-04-02 | [B][DBA] | | [Updating Statistics on Secondary Replicas of the Availability Groups] | Niko Neugebauer | 2019-06-20 | [DBA] | -| [It’s interesting how an OR short circuits] | Kenneth Fisher | 2019-06-17 | [DBA],[DEV] | -| [SQL Server NOLOCK Anomalies, Issues and Inconsistencies] | Aaron Bertrand | 2019-06-18 | [DBA],[DEV] | +| [It’s interesting how an OR short circuits] | Kenneth Fisher | 2019-06-17 | [DBA][DEV] | +| [SQL Server NOLOCK Anomalies, Issues and Inconsistencies] | Aaron Bertrand | 2019-06-18 | [DBA][DEV] | | [Choosing a Database for Serverless Applications] | Alex DeBrie | 2019-06-22 | [DEV] | | [SQL Server On Linux: Forced Unit Access (Fua) Internals] | Robert Dorr | 2018-12-18 | [DBA] | -| [Socrates: The New SQL Server in the Cloud] | Microsoft | 2019-05-01 | [DBA],[DEV] | -| [What permissions do temp stored procedures use?] | Kenneth Fisher | 2019-06-19 | [DBA],[DEV] | +| [Socrates: The New SQL Server in the Cloud] | Microsoft | 2019-05-01 | [DBA][DEV] | +| [What permissions do temp stored procedures use?] | Kenneth Fisher | 2019-06-19 | [DBA][DEV] | | [Common SQL Server Mishaps] | Tim Radney | 2019-06-21 | [DBA] | | [SQL Server Agent for SQL Express on Linux] | Thom Andrews | 2019-06-18 | [DBA] | | [Trailing Spaces in SQL Server] | Bert Wagner | 2019-06-18 | [DEV] | -| [Troubleshooting a Change in Query Performance] | Erin Stellato | 2019-06-20 | [DBA],[DEV] | -| [The Silent Bug I Find in Most Triggers] | Brent Ozar | 2019-05-06 | [DBA],[DEV] | -| [How to Copy a Table in SQL Server to Another Database] | Pablo Echeverria | 2019-05-14 | [DBA],[DEV] | +| [Troubleshooting a Change in Query Performance] | Erin Stellato | 2019-06-20 | [P] | +| [The Silent Bug I Find in Most Triggers] | Brent Ozar | 2019-05-06 | [DBA][DEV] | +| [How to Copy a Table in SQL Server to Another Database] | Pablo Echeverria | 2019-05-14 | [DBA][DEV] | | [Configuration of SQL Server instance] | Michal Sadowski | 2019-06-18 | [DBA] | | [What is the SQL Server Virtual Log file and how to monitor it] | Musab Umair | 2017-04-26 | [DBA] | | [Important change to VLF creation algorithm in SQL Server 2014] | Paul Randal | 2015-01-06 | [DBA] | | [SQL Server Transaction Log Fragmentation: a Primer] | Greg Larsen | 2012-04-26 | [DBA] | | [8 Steps to better Transaction Log throughput] | Kimberly Tripp | 2019-01-01 | [DBA] | -| [Joins With OR Clauses = 💔] | Erik Darling | 2019-06-04 | [DBA],[DEV] | -| [Thoughts on MAXDOP] | Erik Darling | 2019-06-18 | [DBA],[DEV] | -| [What the Arrow Sizes in Query Plans Really Mean] | Brent Ozar | 2019-06-21 | [DBA],[DEV] | -| [Query Store Best Practices] | Erin Stellato | 2019-06-25 | [DBA],[DEV] | -| [Introduction to Data Normalization: A Database "Best" Practice] | Scott Wambler | 2019-01-01 | [DBA],[DEV] | -| [Dr. OUTPUT or: How I Learned to Stop Worrying and Love the MERGE] | Adam Machanic | 2009-08-24 | [DBA],[DEV] | -| [SQL Server Tipping Games – Why Non-Clustered Indexes are just ignored!] | Klaus Aschenbrenner | 2013-06-12 | [DBA],[DEV] | -| [SQL Server Guide To NULL Handling] | Gavin Draper | 2018-11-29 | [DBA],[DEV] | -| [Living with SQL’s 900 Byte Index Key Length Limit] | Bart Duncan | 2011-01-06 | [DBA],[DEV] | -| [Memory-Optimized TempDB Metadata in SQL Server 2019] | Ed Pollack | 2019-07-10 | [DBA],[DEV] | -| [Forcing A Plan That Has A Plan Guide] | Grant Fritchey | 2018-11-26 | [DBA],[DEV] | -| [Remember the Default Window] | Steve Jones | 2018-08-23 | [DBA],[DEV] | +| [Joins With OR Clauses = 💔] | Erik Darling | 2019-06-04 | [DBA][DEV] | +| [Thoughts on MAXDOP] | Erik Darling | 2019-06-18 | [DBA][DEV] | +| [What the Arrow Sizes in Query Plans Really Mean] | Brent Ozar | 2019-06-21 | [DBA][DEV] | +| [Query Store Best Practices] | Erin Stellato | 2019-06-25 | [DBA][DEV] | +| [Introduction to Data Normalization: A Database "Best" Practice] | Scott Wambler | 2019-01-01 | [DBA][DEV] | +| [Dr. OUTPUT or: How I Learned to Stop Worrying and Love the MERGE] | Adam Machanic | 2009-08-24 | [DBA][DEV] | +| [SQL Server Tipping Games – Why Non-Clustered Indexes are just ignored!] | Klaus Aschenbrenner | 2013-06-12 | [DBA][DEV] | +| [SQL Server Guide To NULL Handling] | Gavin Draper | 2018-11-29 | [DBA][DEV] | +| [Living with SQL’s 900 Byte Index Key Length Limit] | Bart Duncan | 2011-01-06 | [DBA][DEV] | +| [Memory-Optimized TempDB Metadata in SQL Server 2019 - SQLHack] | Ed Pollack | 2019-07-10 | [DBA][DEV] | +| [Forcing A Plan That Has A Plan Guide] | Grant Fritchey | 2018-11-26 | [DBA][DEV] | +| [Remember the Default Window] | Steve Jones | 2018-08-23 | [DBA][DEV] | +| [The Impact of Non-Updating Updates] | Paul Randal | 2010-08-11 | [DBA][DEV] | +| [What are Columnstore Indexes?] | Monica Rathbun | 2019-07-22 | [DBA][DEV] | +| [PolyBase in SQL Server 2019 – The End of ETL?] | Benjamin Weissman | 2019-07-23 | [DBA][DEV] | +| [Overview of Service Principal Name and Kerberos authentication in SQL Server] | Rajendra Gupta | 2019-07-18 | [DBA] | +| [Data Transfer Strategies between MongoDB and SQL Server] | Phil Factor | 2019-07-22 | [DBA][DEV] | +| [SQL Server and Excel Hierarchyid Example for Organization Charts] | Rick Dobson | 2019-07-04 | [DEV] | +| [Difference between sp_execute and sp_executesql and exec] | Prasad Sahoo | 2015-02-09 | [DBA][DEV] | +| [EXEC and sp_executesql – how are they different?] | Kimberly Tripp | 2010-04-05 | [DBA][DEV] | +| [Little Bobby Tables, SQL Injection and EXECUTE AS] | Kimberly Tripp | 2010-04-04 | [DBA][DEV] | +| [Examining the Performance Impact of an Adhoc Workload] | Erin Stellato | 2019-05-22 | [BENCH] | +| [Backup to URL] | Jon Gurgul | 2019-01-01 | [B][DBA] | +| [Spotting Unauthorized Configuration Settings in SQL Server] | Phil Factor | 2018-09-30 | [DBA][DEV] | +| [Window Functions in SQL Server] | Fabiano Amorim | 2011-10-27 | [DBA][DEV] | +| [Window Functions in SQL Server: Part 2-The Frame] | Fabiano Amorim | 2011-11-24 | [DBA][DEV] | +| [An Intro to SQL Window Functions] | Neal Barnett | 2019-07-07 | [DBA][DEV] | +| [SQL Database Performance Tuning for Developers] | Rodrigo Koch | 1753-01-01 | [P] | +| [“But NOLOCK Is Okay When The Data Isn’t Changing, Right?”] | Brent Ozar | 2019-08-05 | [DBA][DEV] | +| [tempdb Enhancements in SQL Server 2019] | Erin Stellato | 2019-08-02 | [BENCH] | +| [Feature Restrictions in SQL Server 2019 are Worse Than Useless: a False Sense of Security And Wasted Opportunity] | Solomon Rutzky | 2019-08-05 | [SEC] | +| [How to get SQL Server Sysadmin Privileges as a Local Admin with PowerUpSQL] | Scott Sutherland | 2017-05-23 | [PS][SEC] | +| [Views of the Same Problem: Network Admin, DBA, and Developer] | Kyle Brandt | 2011-03-16 | [DBA][DEV] | +| [Finding Max Concurrent Operations With T-SQL (Part 1)] | Kevin Feasel | 2019-01-02 | [DEV] | +| [Finding Max Concurrent Operations With T-SQL (Part 2)] | Kevin Feasel | 2019-01-03 | [DEV] | +| [Stack Overflow: The Architecture - 2016 Edition] | Nick Craver | 2019-02-17 | [DBA][DEV] | +| [Stack Overflow: The Hardware - 2016 Edition] | Nick Craver | 2016-03-29 | [DBA] | +| [Stack Overflow: How We Do Deployment - 2016 Edition] | Nick Craver | 2016-05-03 | [DBA][DEV] | +| [Stack Overflow: How We Do Monitoring - 2018 Edition] | Nick Craver | 2018-11-29 | [DBA][DEV] | +| [Stack Overflow: How We Do App Caching - 2019 Edition] | Nick Craver | 2019-08-06 | [DBA][DEV] | +| [Adding a Missing Index Killed Performance] | Jeffry Schwartz | 2019-08-15 | [DBA][DEV] | +| [Corruption in TempDB] | Steve Stedman | 2019-08-12 | [COR][DBA] | +| [Corruption recovery using DBCC WRITEPAGE] | Paul Randal | 2014-02-13 | [COR][DBA] | +| [Why DBCC CHECKDB can miss memory corruption] | Paul Randal | 2017-07-19 | [COR][DBA] | +| [Fixing Cardinality Estimation Errors with Filtered Statistics] | Klaus Aschenbrenner | 2013-10-29 | [DBA][DEV] | +| [Plan Stitch: Harnessing the Best of Many Plans] | Bailu Ding, Sudipto Das Wentao … | 2018-07-01 | [DBA][DEV] | +| [Query and Resource Optimization: Bridging the Gap] | Lalitha Viswanathan, Alekh Jindal … | 2018-02-01 | [DBA][DEV] | +| [Cuttlefish: A Lightweight Primitive for Adaptive Query Processing] | Tomer Kaftan, Magdalena Balazinska … | 2018-02-01 | [DBA][DEV] | +| [Leveraging Re-costing for Online Optimization of Parameterized Queries with Guarantees] | Anshuman Dutt, Vivek Narasayya … | 2017-05-01 | [DBA][DEV] | +| [How to choose antivirus software to run on computers that are running SQL Server] | Microsoft | 2018-10-31 | [DBA][SEC] | +| [Why is SYSDATETIME() slower than SYSUTCDATETIME()?] | Erik Darling | 2019-05-28 | [DBA][DEV] | +| [Constant Time Recovery in Azure SQL Database] | Panagiotis Antonopoulos, Peter Byrne … | 2019-06-01 | [AZ] | +| [Improving Optimistic Concurrency Control Through Transaction Batching and Operation Reordering] | Bailu Ding, Lucja Kot, Johannes Gehrke | 2019-01-01 | [DBA][DEV] | +| [An Empirical Evaluation of In-Memory Multi-Version Concurrency Control] | Yingjun Wu, Joy Arulraj, Jiexi Lin … | 2019-01-01 | [DBA][DEV] | +| [Automatically Indexing Millions of Databases in Microsoft Azure SQL Database] | Sudipto Das, Miroslav Grbic, Igor Ilic … | 2019-01-01 | [AZ][IDX] | +| [Adding a Column with a Default Constraint] | Matthew Mcgiffen | 2019-07-16 | [DBA][DEV] | +| [A Hidden Value Of Apply] | Erik Darling | 2019-06-24 | [DEV] | +| [Improve Performance of UDFs with NULL ON NULL INPUT] | Jonathan Kehayias | 2018-12-27 | [DEV] | +| [The ‘= NULL’ Mistake and other SQL NULL Heresies] | Phill Factor | 2019-06-17 | [DBA][DEV] | +| [How to Corrupt a Database] | Max Vernon | 2019-07-29 | [DBA][COR] | +| [SQL Server Page Types] | John Huang | 2011-10-31 | [DBA][DEV] | +| [SQL Server Index Maintenance – You’re Doing It Wrong] | Sean Gallardy | 2019-09-01 | [DBA][DEV] | +| [Stop Worrying About SQL Server Fragmentation] | Brent Ozar | 2012-08-14 | [DBA] | +| [How much will it cost or save to rebuild that index?] | Jeff Moden | 2019-09-03 | [DBA][DEV] | +| [To BLOB or Not To BLOB: Large Object Storage in a Database or a Filesystem?] | Russell Sears2, Catharine van Ingen … | 2019-04-01 | [DBA][DEV] | +| [SQL Server UPSERT Patterns and Antipatterns] | Michael J Swart | 2017-07-20 | [DBA][DEV] | +| [Use Caution with SQL Server's MERGE Statement] | Aaron Bertrand | 2018-07-24 | [DBA][DEV] | +| [“UPSERT” Race Condition With MERGE] | Dan Guzman | 2009-01-31 | [DBA][DEV] | +| [Checking for potential constraint violations before entering SQL Server TRY and CATCH logic] | Aaron Bertrand | 2012-02-18 | [DBA][DEV] | +| [Performance impact of different error handling techniques] | Aaron Bertrand | 2012-08-12 | [DBA][DEV] | +| [Backup and Restore Databases with CHECKSUM and VERIFYONLY] | Lori Brown | 2019-08-29 | [B][DBA] | +| [dm_db_database_page_allocations] | Max Vernon | 2019-08-01 | [DBA][DEV] | +| [Compress Big Tables] | Max Vernon | 2019-08-22 | [DBA][DEV] | +| [Hardening SQL Server Security] | Mitch Wheat | 2019-08-21 | [DBA][SEC] | +| [Splitting Strings With OPENJSON] | Dave Mason | 2019-05-06 | [DEV][X] | +| [How to migrate to Amazon RDS for SQL Server using transactional replication] | Richard Waymire | 2018-05-17 | [AMZ][MG] | +| [The Hardest Part Of Query Tuning: Logical Equivalence] | Erik Darling | 2019-08-13 | [DBA][DEV] | +| [SQL Injection: What is it? Causes and exploits] | Ed Pollack | 2019-08-30 | [SEC] | +| [SQL Injection: Detection and prevention] | Ed Pollack | 2019-08-30 | [SEC] | +| [Some T-SQL INSERTs DO Follow the Fill Factor!] | Jeff Moden | 2019-08-08 | [DBA][DEV] | +| [Install SQL Server 2019 Big Data Cluster using Azure Data Studio] | Niels Berglund | 2019-09-11 | [DBA][DEV] | +| [Indirect Checkpoint and tempdb – the good, the bad and the non-yielding scheduler] | Parikshit Savjani | 2018-09-14 | [DBA] | +| [Ghost Records in SQL Server… Now whats that ????] | Sachin Nandanwar | 2011-04-10 | [DBA] | +| [Transaction Isolation Levels and sp_executesql] | Max Vernon | 2019-08-19 | [DBA][DEV] | +| [Batch Mode Bitmaps in SQL Server] | Paul White | 2019-08-23 | [DBA][DEV] | +| [Transparent Data Encryption (TDE) on Azure SQL database] | Ranga Babu | 2019-09-13 | [DBA][AZ] | +| [Analyzing Estimates from the CSelCalcAscendingKeyFilter Calculator] | Josh Darnell | 2019-08-21 | [DEV] | +| [Building Storage for SQL Server (and other database) Virtual Machines in the Cloud] | Joey Dantoni | 2019-09-18 | [AZ] | +| [SQL Server Simple and Forced Parameterization] | Brady Upton | 2013-04-23 | [DBA][DEV] | +| [How to use a SQL Server Plan Guide to Tune Queries] | Armando Prato | 2018-06-02 | [DBA][DEV] | +| [Neglecting to Use, or Misusing, the RETURN Keyword (BP016)] | Phil Factor | 2019-08-14 | [DBA][DEV] | +| [Defensive Error Handling] | Alex Kuznetsov | 2010-10-08 | [DBA][DEV] | +| [A Self-Tuning Fill Factor Technique for SQL Server – Part 1] | Mike Byrd | 2019-08-20 | [DBA][DEV] | +| [A Self-Tuning Fill Factor Technique for SQL Server – Part 2] | Mike Byrd | 2019-08-27 | [DBA][DEV] | +| [SQL: Been told you can't access master database system views in Azure SQL Database? Not true!] | Greg Low | 2019-09-17 | [AZ] | +| [How to increase SQL Database Full Backup speed using compression and Solid State Disks] | Henk | 2010-01-15 | [DBA] | +| [Troubleshooting NUMA Node Imbalance Problems (HammerDB Benchmark)] | Klaus Aschenbrenner | 2019-09-23 | [BENCH] | +| [SQL Server Unequal NUMA CPU engagement] | @sqL_handLe | 2019-09-19 | [DBA] | +| [SSIS Connection Managers: OLE DB vs ODBC vs ADO.NET] | Hadi Fadlallah | 2019-10-04 | [SSIS] | +| [SSIS Data Flows – ADO.NET vs. OLE DB vs. ODBC] | Ross at Datatell | 2015-01-13 | [SSIS] | +| [SSIS – Fastest data flow task item for transferring data over the network] | Gilbert Quevauvilliers | 2013-01-19 | [SSIS] | +| [The Case of the Vanishing Index Compression] | Louis Davidson | 2019-09-30 | [DBA][IDX] | +| [Migrating from MSSQL to PostgreSQL - What You Should Know] | Severalnines | 2018-11-05 | [DEV] | +| [Difference between Identity and Sequence in SQL Server 2012] | Muhammad Imran | 2012-05-01 | [DEV] | +| [Sequence vs Identity – Performance Comparison] | Bill Anton | 2012-09-02 | [DEV] | +| [Read Excel File in SQL Server with OPENROWSET or OPENDATASOURCE] | Diana Moldovan | 2019-10-10 | [DBA][DEV] | +| [Upgrading SQL Server using Availability Groups – Checklist] | Thomas Rushton | 2019-10-17 | [DBA] | +| [Using indexed views? WITH (NOEXPAND) for Standard Edition] | Randolph West | 2019-10-09 | [DEV][IDX] | +| [Using indexed views? What is an imprecise or non-deterministic convert?] | Randolph West | 2019-10-16 | [DEV][IDX] | +| [JSON in your Azure SQL Database? Let’s benchmark some options!] | Silvano Coriani | 2019-10-15 | [X] | +| [Looking for strange - addition to system_health XE] | Tibor Karaszi's | 1753-01-01 | [DBA][XE] | +| [What's new in SQL Server version x] | Tibor Karaszi's | 1753-01-01 | [DBA][DEV] | +| [The ultimate guide to the datetime datatypes] | Tibor Karaszi's | 2010-01-01 | [DBA][DEV] | +| [Some numbers that you will know by heart if you have been working with SQL Server for a while] | Unknown | 2019-03-20 | [DBA][DEV] | +| [#TSQL2sday: How Much Plan Cache History Do You Have?] | Brent Ozar | 2018-07-10 | [DBA][DEV] | +| [Fixing SQL Server Management Studio’s Tab Text] | Brent Ozar | 2011-06-07 | [DBA][DEV] | +| [An overview of the SQL table variable] | Rajendra Gupta | 2019-10-16 | [DBA][DEV] | +| [Performance Impact of Small Queries] | Forrest McDaniel | 2019-06-15 | [DBA][DEV] | +| [How we use SQL Server as a Document Store] | Paul Stovell | 2019-03-24 | [DBA][DEV] | +| [Overlooked T-SQL Gems] | Itzik Ben-Gan | 2019-10-09 | [DBA][DEV] | +| [Are SQL Server database triggers evil?] | Daniel Calbimonte | 2017-01-25 | [DBA][DEV] | +| [Configuration Best Practices for SQL Server Tempdb–Initial Sizing] | Christian Bolton, Justin Langford … | 2013-02-12 | [DBA] | +| [Sql Server Extended Events Trace Overhead] | Nenad Noveljic | 2018-09-04 | [DBA] | +| [Measuring "Observer Overhead" of SQL Trace vs. Extended Events] | Jonathan Kehayias | 2012-10-23 | [DBA][XE] | +| [Performance overhead of tracing with Extended Event targets vs SQL Trace under CPU Load] | Andreas Wolter | 2013-07-01 | [DBA][XE] | +| [Fragmentation, the final installment] | Tibor Karaszi's | 2019-10-18 | [DBA][IX] | +| [Atomic Durability - How do databases recover from a crash ?] | Pedro Ramalhete | 2019-10-01 | [DBA][DEV] | +| [Truth First, or Why You Should Mostly Implement Database First Designs] | Lukas Eder | 2018-06-06 | [DEV] | +| [SQL Server CHECKPOINT, Lazy Writer, Eager Writer and Dirty Pages in SQL Server] | Rajendra Gupta | 2019-08-22 | [DBA] | +| [T-SQL bugs, pitfalls, and best practices – window functions] | Itzik Ben-Gan | 2019-08-14 | [DBA][DEV] | +| [#BackToBasics: Why I use lower case for data type names (now)] | Aaron Bertrand | 2016-10-04 | [DBA][DEV] | +| [New high availability and disaster recovery benefits for SQL Server] | Amit Banerjee | 2019-10-30 | [DBA] | +| [Because Your Index Maintenance Script Is Measuring The Wrong Thing] | Eric Darling | 2019-10-28 | [DBA][IDX] | +| [Memory-Optimized TempDB Metadata] | Niko Neugebauer | 2019-10-30 | [DBA][BENCH]| +| [Build a SQL Cluster Lab Part 1] | Ryan Adams | 2019-10-28 | [DBA] | +| [There is no Such Thing as Object-Relational Impedance Mismatch] | Lukas Eder | 2015-08-26 | [DEV] | +| [ORMs Under the Hood] | Patrycja Dybka | 2015-08-18 | [DEV] | +| [EMERGENCY-mode repair: the very, very last resort] | Paul Randal | 2007-10-02 | [DBA] | +| [Scalar functions and improvements in SQL Server 2019] | Tibor Karaszi's | 2019-11-07 | [DEV] | +| [Scalar functions in SQL server 2019, part 2] | Tibor Karaszi's | 2019-11-07 | [DEV] | +| [Dos and Don'ts of Dynamic SQL] | Thom Andrews | 2019-04-29 | [DEV][DBA] | +| [Differences Between Sql Server TEXT and VARCHAR(MAX) Data Type] | Basavaraj Biradar | 2016-05-11 | [DEV][DBA] | +| [VARBINARY(MAX) Tames the BLOB] | Michael Otey | 2006-08-22 | [DEV][DBA] | +| [Query Store Options in SSMS 18.4] | Erin Stellato | 2019-11-12 | [DBA][QS] | +| [Query Store Performance Overhead: What you need to know] | Erin Stellato | 2018-11-06 | [DBA][QS] | +| [How to fork a GitHub repository and contribute to an open source project] | Rob Sewell | 2019-11-29 | [DBA][DEV] | +| [But I Need To Compare Two Date Columns In My Where Clause] | Eric Darling | 2019-11-27 | [DBA][IDX] | +| [The Difference Between Fault Tolerance, High Availability, & Disaster Recovery] | Patrick Benson | 2014-02-25 | [DBA][DEV] | +| [Why LOB data makes shrink run slooooowly] | Paul Randal | 2010-05-11 | [DBA] | +| [SQL Server 2019 Scalar UDF inlining - out of memory in some cases] | @sqL_handLe | 2019-11-19 | [DBA][DEV] | +| [Is it true that editing a single row in Management Studio empties and reloads the entire table?] | Randolph West | 2019-11-27 | [DBA][DEV] | +| [A Guide to SQL Naming Conventions] | Lukas Eder | 2019-10-29 | [DBA][DEV] | +| [Stop Mapping Stuff in Your Middleware. Use SQL’s XML or JSON Operators Instead] | Lukas Eder | 2019-11-13 | [DBA][DEV] | +| [How Does Accelerated Database Recovery Work] | Forrest McDaniel | 2019-11-26 | [DBA] | +| [Recover SQL Server Resource Database] | Daniel Farina | 2019-10-25 | [DBA] | +| [What’s in that database? Getting information about routines] | Phil Factor | 2019-11-04 | [DBA][DEV] | +| [The Gloop: An Easier way of Managing SQL Server Documentation] | Phil Factor | 2019-12-03 | [DBA][DEV] | +| [The SQL of Gaps and Islands in Sequences] | Dwain Camps | 2013-07-25 | [DEV] | +| [Drop Database Objects Practically Risk-Free!] | Pamela Mooney | 2019-04-17 | [DBA] | +| [Predicate Pushdown and why should I care?] | Pedro Lopes | 2018-07-06 | [DBA][DEV] | +| [Stack Overflow Demo Database Column Store Edition: Downloads And Links] | Eric Darling | 2019-11-11 | [DBA][DEV] | +| [Stack Overflow Demo Database Column Store Edition: Exploring Relationships] | Eric Darling | 2019-11-14 | [DBA][DEV] | +| [Stack Overflow Demo Database Column Store Edition: Helpful Links] | Eric Darling | 2019-11-15 | [DBA][DEV] | +| [Online, Resumable, and WAIT_AT_LOW_PRIORITY operations in SQL Server] | Kendra Little | 2019-12-09 | [DBA][DEV] | +| [How filtered indexes could be a more powerful feature] | Aaron Bertrand | 2013-04-24 | [IDX] | +| [How Forced Parameterization in SQL Server Affects Filtered Indexes] | Aaron Bertrand | 2019-09-19 | [IDX] | +| [Filtered Indexes and Forced Parameterization (redux)] | Aaron Bertrand | 2019-12-03 | [IDX] | +| [Interpreting SQL Server 2019 DBCC MEMORYSTATUS output -- Part 1] | @sqL_handLe | 2019-12-15 | [DBA] | +| [Invisible tempdb Killer] | Josh Darnell | 2019-12-18 | [DBA][DEV] | +| [Batch Mode On Row Store Is Fickle] | Eric Darling | 2019-12-19 | [DBA][DEV] | +| [Use Azure To Store Sql Server Backups Offsite] | Sander Stad | 2019-12-18 | [AZ][B] | +| [Handling Data Returned from a SQL Stored Procedure] | Drew | 2019-12-20 | [DBA][DEV] | +| [When QUERY_OPTIMIZER_COMPATIBILITY_LEVEL_140 does not follow CL 140 rules] | Milos Radivojevic | 2019-12-20 | [DBA][DEV] | +| [SQL Server–HOW-TO: quickly retrieve accurate row count for table] | martijnh1 | 2010-07-15 | [DBA][DEV] | +| [Do You Have REFERENCES?] | Joe Celko | 2019-12-03 | [DBA][DEV] | +| [Fun with (columnstore) compression on a very large table – part 1] | Aaron Bertrand | 2019-12-27 | [DBA] | +| [How to Make SELECT COUNT(*) Queries Crazy Fast] | Brent Ozar | 2019-12-26 | [DBA][DEV] | +| [SSISDB Catalog Defaults Best Practices] | Steve Rezhener | 2019-12-26 | [DBA][DEV] | +| [Temporal Tables, and how to deal with computed columns] | Randolph West | 2019-12-25 | [DBA][DEV] | +| [Cardinality Estimation for Disjunctive Predicates in SQL Server 2014] | Paul White | 2014-04-15 | [DBA][DEV] | +| [Create Distributed Availability Group in Sql Server Linux(Redhat) --- step by step] | Liwei | 2019-11-14 | [DBA] | +| [Connection options in SSMS] | Kenneth Fisher | 2013-11-18 | [DBA][DEV] | +| [A Script To Automatically Align Columnstore Indexes To Enhance Segment Elimination (and Hence Performances)] | Emanuele Meazzo | 2018-06-04 | [DBA][IDX] | +| [Issues with SQLCMD when using special characters] | Daniel Farina | 2018-01-11 | [DBA][DEV] | +| [Encrypting passwords with Python Scripts in SQL Notebooks of Azure Data Studio] | Rajendra Gupta | 2020-01-06 | [DBA][DEV] | +| [Fun with (columnstore) compression on a very large table – part 2] | Aaron Bertrand | 2020-01-07 | [DBA][IDX] | +| [The curious case of the sqlcmd password] | Randolph West | 2020-01-08 | [DBA][DEV] | +| [Setting up Management Studio for remote SQL Server] | aveek22 | 2020-01-06 | [DBA][DEV] | +| [SQL Server Security Best Practices for an Application Installed on SQL Server] | Svetlana Golovko | 2019-12-08 | [DBA][SEC] | +| [PCI Best Practices Guide for SQL Server DBAs] | Tibor Nagy | 2015-05-08 | [DBA][SEC] | +| [SQL Server Security Checklist] | Tibor Nagy | 2014-02-06 | [DBA][SEC] | +| [Replace Model SQL Server Database with a User Database] | Daniel Farina | 2019-12-13 | [DBA] | +| [SQL Server Linux installation for Amazon EC2 instance with Red Hat OS] | Rajendra Gupta | 2020-01-09 | [AMZ | +| [Departure of a SQL Server Administrator – What to Check?] | Thomas Rushton | 2020-01-03 | [DBA] | +| [The Curious Case of… transactions rolling back during DBCC CHECKDB] | Paul Randal | 2020-01-15 | [DBA] | +| [Don’t install SQL Server from a mounted ISO] | Randolph West | 2020-01-15 | [DBA] | +| [NULL complexities – Part 1] | Itzik Ben-Gan | 2019-12-11 | [DBA][DEV] | +| [NULL complexities – Part 2] | Itzik Ben-Gan | 2020-01-08 | [DBA][DEV] | +| [NULL complexities – Part 3] | Itzik Ben-Gan | 2020-02-12 | [DBA][DEV] | +| [How to fix the “Agent XPs disabled” error] | Nisarg Upadhyay | 2019-12-27 | [DBA][DEV] | +| [Number of Rows Read / Actual Rows Read warnings in Plan Explorer] | Rob Farley | 2016-06-02 | [DBA][DEV] | +| [Data Compression + Backup Compression = Double Compression?] | Jess Pomfret | 2019-08-12 | [B][DBA] | +| [How Many Bytes Per Character in SQL Server: a Completely Complete Guide] | Solomon Rutzky | 2019-11-12 | [DBA][DEV] | +| [Storage 101: Welcome to the Wonderful World of Storage] | Robert Sheldon | 2019-12-03 | [DBA][DEV] | +| [How to detect and prevent unexpected growth of the TempDB database] | Ahmad Yaseen | 2020-01-13 | [DBA] | +| [Understanding the SQL Server Proportional fill algorithm] | Ahmad Yaseen | 2016-11-22 | [DBA] | +| [VALUES() and Long Parameter Lists] | Joe Celko | 2010-07-22 | [DBA][DEV] | +| [Going Serverless with Azure SQL Database] | John Miner | 2019-12-20 | [DBA][DEV] | +| [SQLskills SQL101: Why are Statistics so Important?] | Kimberly Tripp | 2020-01-20 | [DBA][DEV] | +| [Configuring SQL Server Express edition as SQL witness server in Database Mirroring] | Nisarg Upadhyay | 2020-01-20 | [DBA] | +| [The Half Apply Query] | Forrest McDaniel | 2020-01-20 | [DBA][DEV] | +| [Import JSON data into SQL Server] | Rajendra Gupta | 2020-01-17 | [X] | +| [Auditing in AWS RDS SQL Server] | Rajendra Gupta | 2020-01-20 | [DBA] | +| [Types of SQL Server Indexes] | Ben Snaidero | 2019-12-24 | [IDX] | +| [Use SQL Server's UNPIVOT operator to help normalize output] | Aaron Bertrand | 2013-07-12 | [DBA][DEV] | +| [Prevent SSMS from seeing the server's file system] | Randi Vertongen | 2019-09-02 | [DBA] | +| [Add the ability to disable or enable a few new DMVs and DMFs introduced in SQL Server 2017] | Microsoft | 2017-11-08 | [DBA] | +| [Actual Difference Between EXISTS(SELECT 1 …), EXISTS(SELECT * …), and EXISTS(SELECT column …)] | Solomon Rutzky | 2020-01-24 | [DBA][DEV] | +| [Why Wait Stats Alone Are Not Enough] | Greg Gonzalez | 2020-01-24 | [DBA][DEV] | +| [Estimating AWS RDS SQL Server costs] | Rajendra Gupta | 2020-01-23 | [DEV] | +| [SQL Server Performance Tuning Using Wait Statistics: A Beginner’s Guide] | Jonathan Kehayias, Erin Stellato | 2014-04-01 | [DBA][DEV] | +| [sys.xp_delete_files and ‘allow filesystem enumeration’: two new undocumented items in SQL Server 2019] | Solomon Rutzky | 2020-01-26 | [DBA][DEV] | +| [Why Database Monitoring Tools Are So Hard to Interpret] | Brent Ozar | 2020-01-27 | [DBA] | +| [Extended Events Misperceptions: Profiler Is Easier] | Grant Fritchey | 2020-01-20 | [DBA][DEV] | +| [Extended Events Misperceptions: Profiler Is Easier, Part 2] | Grant Fritchey | 2020-01-27 | [DBA][DEV] | +| [Automate SFTP File Transfer with SQL Server Agent and WinSCP] | Joe Gavin | 2020-01-16 | [DBA][DEV] | +| [Running Database Console Commands (DBCCs) on Azure SQL Database] | Marcin Policht | 2020-01-20 | [AZ] | +| [How to Remove Times from Dates in SQL Server] | Brent Ozar | 2020-01-29 | [DBA][DEV] | +| [Export/Import Data using BCP - SQL Server on Linux] | Carlos Robles | 2020-01-30 | [DBA][DEV] | +| [Prevent SQL Server Blocking using Lock_Timeout] | Bhavesh Patel | 2020-01-07 | [DBA][DEV] | +| [Bin Packing Problems: The SQL] | Joe Celko | 2012-03-22 | [DBA][DEV] | +| [Causation, Correlation and Crackpots] | Joe Celko | 2009-09-15 | [DBA][DEV] | +| [What Events are in a Trace?] | Erin Stellato | 2020-01-23 | [DBA] | +| [What Are Soft Deletes, and How Are They Implemented?] | Brent Ozar | 2020-02-04 | [DBA][DEV] | +| [Why You Should Switch in Staging Tables Instead of Renaming Them (Dear SQL DBA Episode 26)] | Kendra Little | 2017-01-19 | [DBA][DEV] | +| [Changing a column from int to bigint, without downtime] | Andy Mallon | 2019-12-11 | [DBA][DEV] | +| [I hate sp_estimate_data_compression_savings] | Andy Mallon | 2019-12-17 | [DBA][DEV] | +| [Testing as another user…without their password - impersonate the other user] | Andy Mallon | 2019-12-18 | [DBA][DEV] | +| [How does a database RESTORE affect plan cache?] | Andy Mallon | 2019-10-24 | [DBA] | +| [Recovery of database is 0% complete (approximately 1000000 seconds remain)] | Andy Mallon | 2019-10-12 | [DBA] | +| [Code to purge data based on creation date] | Andy Mallon | 2019-04-04 | [DBA] | +| [Blocking with OBJECT_NAME()] | Andy Mallon | 2019-12-24 | [DBA] | +| [Performance Myths: The query result cache] | Andy Mallon | 2018-07-23 | [DBA][DEV] | +| [Fun with (columnstore) compression on a very large table – part 3] | Aaron Bertrand | 2020-02-03 | [DBA][DEV] | +| [Indexing basics] | Daniel Hutmacher | 2013-02-19 | [IDX] | +| [Working with covering indexes] | Daniel Hutmacher | 2013-02-19 | [IDX] | +| [Using Erik Darling’s sp_pressure_detector to resolve CPU issues] | Jeff Iannucci | 2020-01-28 | [DBA][DEV] | +| [The Accidental DBA (Day 16 of 30): General Security] | Jonathan Kehayias | 2013-01-16 | [DBA][SEC] | +| [Securing Data in SQL Server] | Jonathan Kehayias | 2020-01-27 | [DBA][SEC] | +| [Performance Testing SQL 2008's Transparent Data Encryption] | Rob Garrison | 2009-04-20 | [DBA] | +| [Common SQL Server Security Issues and Solutions] | Paul Randal | 2016-10-04 | [DBA][SEC] | +| [Chaos Engineering and SQL Server] | Andrew Pruski | 2020-01-29 | [DBA] | +| [Different methods to attach SQL Server MDF files] | Nisarg Upadhyay | 2020-02-07 | [DBA] | +| [Learn SQL: How to Write a Complex SELECT Query] | Emil Drkusic | 2020-02-04 | [DBA][DEV] | +| [Filling In Missing Values Using the T-SQL Window Frame] | Dwain Camps | 2014-09-18 | [DBA][DEV] | +| [Select * in a view] | Reitse Eskens | 2020-02-20 | [DBA][DEV] | +| [T-SQL TUESDAY #123: Aggregates of Aggregates using Windowing Functions] | James Mcgillivray | 2020-02-20 | [DBA][DEV] | +| [SQL Server Statistics: Explained] | Krishna Golla | 2012-09-04 | [DBA][DEV] | +| [How to Pass a List of Values Into a Stored Procedure] | Brent Ozar | 2020-02-13 | [DBA][DEV] | +| [What's the difference between a temp table and table variable in SQL Server?] | Paul White | 2019-05-04 | [DBA][DEV] | +| [Be Mindful of SQL Server Tempdb Use (aka Tempdb Parasites!)] | Jason Hall | 2020-01-28 | [DBA][DEV] | +| [Robyn Page’s SQL Server Cursor Workbench (Quirky Update)] | Robyn Page | 2007-01-24 | [DBA][DEV] | +| [Solving the Running Total and Ordinal Rank Problems (Rewritten) (Quirky Update)] | Jeff Moden | 2012-01-27 | [DBA][DEV] | +| [Running totals in “Denali” CTP3 (Quirky Update)] | Wayne Sheffield | 2011-08-23 | [DBA][DEV] | +| [WHERE GETDATE() BETWEEN StartDate AND EndDate Is Hard to Tune.] | Brent Ozar | 2020-02-18 | [DBA][DEV] | +| [WHERE GETDATE() BETWEEN StartDate AND COALESCE(CancelDate, EndDate) Is Even Harder to Tune.] | Brent Ozar | 2020-02-19 | [DBA][DEV] | +| [How to solve the SQL Identity Crisis in SQL Server] | Ed Pollack | 2017-11-14 | [DBA][DEV] | +| [Significant SQL Server 2019 licensing changes] | Kevin Chant | 2020-02-17 | [DBA] | +| [Indexed View Maintenance Is Only As Bad As Your Indexes] | Erik Darling | 2020-02-19 | [DBA][DEV] | +| [Why Design Impacts Performance on Microsoft SQL Server] | Kevin Kline | 2020-01-29 | [DBA][DEV] | +| [Apply versus Nested Loops Join] | Paul White | 2019-06-09 | [DBA][DEV] | +| [Inside the Optimizer: Constructing a Plan - Part 1] | Paul White | 2010-07-29 | [DBA][DEV] | +| [Inside the Optimizer: Constructing a Plan - Part 2] | Paul White | 2010-07-29 | [DBA][DEV] | +| [Inside the Optimizer: Constructing a Plan - Part 3] | Paul White | 2010-07-31 | [DBA][DEV] | +| [Inside the Optimizer: Constructing a Plan - Part 4] | Paul White | 2010-07-31 | [DBA][DEV] | +| [Tips for dealing with large SQL Server scripts] | Kevin Chant | 2020-02-24 | [DBA][DEV] | +| [Database Normalization in SQL with Examples] | Gouri Shankar | 2020-02-18 | [DBA][DEV] | +| [Why SQL Server May Not Parallelize a Query] | SolarWinds | 2015-10-30 | [DBA][DEV] | +| [Parallelism in SQL Server Execution Plan] | Ahmad Yaseen | 2018-03-30 | [DBA][DEV] | +| [An XEvent a Day (26 of 31) – Configuring Session Options] | Jonathan Kehayias | 2010-12-26 | [XE] | +| [Azure SQL Managed Instance Performance Considerations] | Tim Radney | 2020-02-26 | [AZ] | +| [The Curious Case of… whether corruption can propagate to secondary databases] | Paul Randal | 2020-02-26 | [COR][DBA] | +| [Stop and Think Before You Shrink – Shrinking a SQL Server Database] | Jeff Mlakar | 2018-09-25 | [DBA] | +| [How to Analyze the SQL Server Error Log] | Jeff Mlakar | 2018-11-02 | [DBA] | +| [Converting SQL Trace to Extended Events in SQL Server 2012] | Jonathan Kehayias | 2012-04-04 | [DBA] | +| [What event information can I get by default from SQL Server?] | Aaron Bertrand | 2019-03-28 | [DBA] | +| [Removing the default trace – Part 1] | Aaron Bertrand | 2020-03-02 | [DBA] | +| [Removing the default trace – Part 2] | Aaron Bertrand | 2020-03-02 | [DBA] | +| [Removing the default trace – Part 3] | Aaron Bertrand | 2020-03-02 | [DBA] | +| [Keeping DRY in SQL Server with Scalar User Defined Functions – Part 1] | Adrian Hills | 2020-02-20 | [DBA][DEV] | +| [Different Ways to Monitor SQL Server AlwaysOn Availability Groups] | Nisarg Upadhyay | 2020-02-21 | [DBA] | +| [SQL Server internals: Is Order of Column in the table important?] | Ronen Ariely | 2018-08-11 | [DBA][DEV] | +| [Code: Order of columns in table might impact the size of the table/database and even related to errors] | Ronen Ariely | 2019-10-13 | [DBA][DEV] | +| [SQL Server Internals: Getting the data of deleted column] | Ronen Ariely | 2018-11-28 | [DBA][DEV] | +| [Queue table issues with Availability Groups in SQL Server] | Aaron Bertrand | 2020-01-29 | [DBA] | +| [Transact-SQL: openjson hierarchy solution] | Ronen Ariely | 2019-09-29 | [DBA][DEV] | +| [CREATE DLL TRIGGER ON CREATE_LOGIN to configure default parameters for any new LOGIN] | Ronen Ariely | 2019-10-12 | [DBA][DEV] | +| [SQL Server Internals: Getting the data of deleted column] | Ronen Ariely | 2018-08-11 | [DBA][DEV] | +| [SQL varchar data type deep dive] | Gauri Mahajan | 2019-05-29 | [DBA][DEV] | +| [What is the datatype SQL_VARIANT] | Kenneth Fisher | 2020-04-16 | [DBA][DEV] | +| [An Introduction to Asynchronous Processing with Service Broker] | Jonathan Kehayias | 2014-03-18 | [DBA][DEV] | +| [Detecting and Alerting on SQL Server Agent Missed Jobs] | Ed Pollack | 2019-02-21 | [DBA][J] | +| [Execute multiple jobs Synchronously from in a main job] | Ronen Ariely | 2020-04-11 | [J] | +| [Why Ordering Isn’t Guaranteed Without an ORDER BY] | Brent Ozar | 2020-04-22 | [DBA][DEV] | +| [How to Attach a SQL Server Database without a Transaction Log and with Open Transactions] | Daniel Farina | 2020-04-29 | [COR] | +| [SQL 2016 - It Just Runs Faster: Indirect Checkpoint Default] | Ryan Stonecipher, Peter Byrne, Bob Dorr | 2016-04-12 | [DBA][CHP] | +| [How do checkpoints work and what gets logged] | Paul Randal | 2009-09-27 | [DBA][CHP] | +| [Inside the Storage Engine: What’s in the buffer pool?] | Paul Randal | 2008-08-26 | [DBA] | +| [What does checkpoint do for tempdb?] | Paul Randal | 2009-10-07 | [DBA][CHP] | +| [Performance issues from wasted buffer pool memory] | Paul Randal | 2011-06-01 | [DBA] | +| [How It Works: When is the FlushCache message added to SQL Server Error Log?] | Bob Dorr | 2012-01-06 | [DBA] | +| [Negative identity values don’t suck] | Randolph West | 2020-05-06 | [DBA][DEV] | +| [How SQL Server stores data types: integers and decimals] | Randolph West | 2020-05-13 | [DBA][DEV] | +| [How SQL Server stores data types: DATETIME, DATE, TIME, and DATETIME2] | Randolph West | 2020-04-22 | [DBA][DEV] | +| [Cross Database Transactions on One Server] | Michael J Swart | 2020-05-15 | [DBA][DEV] | +| [Your Views Aren’t The Problem. Your Code Is.] | Brent Ozar | 2020-05-06 | [DBA][DEV] | +| [Can I Offload DBCC CHECKDB To Another Server?] | Brent Ozar | 2020-05-19 | [DBA] | +| [Negative (-) is an operator and will affect the order of operations.] | Kenneth Fisher | 2020-05-18 | [DBA][DEV] | +| ["0 to 60" : Switching to indirect checkpoints] | Aaron Bertrand | 2020-05-01 | [DBA][CHP] | +| [Parallelism Can Make Queries Perform Worse.] | Brent Ozar | 2020-05-20 | [DBA][DEV] | +| [A SQL Server DBA myth a day: (15/30) checkpoint only writes pages from committed transactions] | Paul Randal | 2010-04-15 | [DBA][CHP] | +| [Can You Use NVARCHAR As a Universal Parameter? Almost.] | Brent Ozar | 2020-04-30 | [DBA][DEV] | +| [The Learner’s Guide to SQL Server Performance Triage] | Kendra Little | 2020-03-19 | [DBA] | +| [Learner’s Guide to SQL Server Query Tuning] | Kendra Little | 2020-05-01 | [DBA][DEV] | +| [How to Get Better Estimates for Modification Queries] | Brent Ozar | 2020-04-27 | [DBA][DEV] | +| [SSMS: Prevent Copy and Paste of Text in “Messages” tab (Cruel Joke #2)] | Solomon Rutzky | 2020-05-22 | [DBA][DEV] | +| [Compare the Best SQL Server Performance Monitoring Tools] | SentryOne | 2020-01-01 | [DBA][DEV] | +| [Minimal Logging with INSERT…SELECT into Heap Tables] | Paul White | 2020-05-01 | [DBA][DEV] | +| [Minimal Logging with INSERT…SELECT into Empty Clustered Tables] | Paul White | 2020-05-16 | [DBA][DEV] | +| [Minimal Logging with INSERT…SELECT and Fast Load Context] | Paul White | 2020-05-19 | [DBA][DEV] | +| [Avoiding SQL Server Upgrade Performance Issues] | Glenn Berry | 2020-02-05 | [DBA][DEV] | +| [Compatibility Levels and Cardinality Estimation Primer] | Glenn Berry | 2020-01-29 | [DBA][DEV] | +| [An approach to index tuning – Part 1] | Erin Stellato | 2020-03-26 | [DBA][DEV] | +| [An approach to index tuning – Part 2] | Erin Stellato | 2020-04-13 | [DBA][DEV] | +| [Moving A Database to New Storage With No Downtime] | Bob Pusateri | 2013-03-12 | [DBA] | +| [RESOURCE_GOVERNOR_IDLE in Azure] | Josh Darnell | 2020-06-15 | [AZ] | +| [Automated Backup Tuning] | Nicholas Cain | 2012-12-13 | [B] | +| [Optimizing Database Restores] | Nicholas Cain | 2011-09-26 | [DBA] | +| [AVAILABILITY_REPLICA - The Deception of the Log Reuse Wait Type] | Nicholas Cain | 2020-05-19 | [DBA] | +| [Changing an INT to a BIGINT with no downtime] | Michael J Swart | 2020-06-19 | [DBA] | +| [New Metadata-Only Column Changes in SQL Server 2016] | Paul White | 2020-04-17 | [DBA][DEV] | +| [Bandwidth-friendly Query Profiling for Azure SQL Database] | Greg Gonzalez | 2020-04-15 | [AZ][XE] | +| [Column scope and binding order in subqueries] | Gail Shaw | 2019-04-23 | [DBA][DEV] | +| [Improve SQL Server Extended Events system_health Session] | Aaron Bertrand | 2020-06-17 | [DBA][DEV] | +| [Page Life Expectancy Doesn’t Mean Jack, and You Should Stop Looking At It.] | Brent Ozar | 2020-06-17 | [DBA][DEV] | +| [Unsupported but working versions of SQL Server on Windows Server 2019] | Randolph West | 2020-06-24 | [DBA][DEV] | +| [Bad Idea Jeans: Building Big Query Plans] | Brent Ozar | 2020-06-23 | [DBA][DEV] | +| [SQL Server performance tuning – RESOURCE_SEMAPHORE waits] | Timothy Smith | 2020-06-16 | [DBA][DEV] | +| [Use session_context to create a “variable” that lasts between batches.] | Kenneth Fisher | 2020-05-26 | [DBA][DEV] | +| [Phase out CONTEXT_INFO() in SQL Server 2016 with SESSION_CONTEXT()] | Aaron Bertrand | 2015-11-19 | [DBA][DEV] | +| [How to Balance SQL Server Core Licenses Across NUMA Nodes] | Glenn Berry | 2020-06-25 | [DBA] | +| [What is the Difference Between Physical Sockets, Physical Cores, and Logical Cores?] | Glenn Berry | 2019-12-18 | [DBA] | +| [What is the Difference Between Physical Sockets, Physical Cores, and Logical Cores?] | Kevin Kline | 2020-06-01 | [DBA][DEV] | +| [The 201 Buckets Problem, Part 1: Why You Still Don’t Get Accurate Estimates] | Brent Ozar | 2020-07-07 | [DBA][DEV] | +| [The 201 Buckets Problem, Part 2: How Bad Estimates Backfire As Your Data Grows] | Brent Ozar | 2020-07-08 | [DBA][DEV] | +| [Sql Server — Widely Random Query Exec Times (cxconsumer Wait/cxpacket) & Possible Remediation] | VIKTOR | 2020-06-26 | [DBA][DEV] | +| [How MAXDOP Really Works] | Paul White | 2020-06-07 | [DBA][DEV] | +| [What is MaxDOP controlling?] | Pedro Lopes | 2020-07-07 | [DBA][DEV] | +| [What If You Really DO Need to Shrink a Database?] | Brent Ozar | 2020-07-14 | [DBA] | +| [Everything I Never Wanted to Know About Collation] | Kendra Little | 2020-07-16 | [DBA][DEV] | +| [Comparing SSIS And Azure Data Factory] | Tim Mitchell | 2020-07-16 | [AZ][SSIS] | +| [sp_Blitz for All Servers] | Garry Bargsley | 2020-07-14 | [DBA] | +| [Where is the SQL Server Community Networking Online?] | Brent Ozar | 2020-07-13 | [DBA][DEV] | +| [Make the most out of your Azure Disks using Storage Pools] | Roberto Marras | 2020-07-01 | [AZ][DBA] | +| [SQL Server High Availability Solutions on Azure VMs] | Marco Obinu | 2020-07-12 | [AZ][DBA] | +| [How to Get Started with SQL Server Management Studio] | Brent Ozar | 2020-07-21 | [DBA][DEV] | +| [How should I store currency values in SQL Server?] | Randolph West | 2020-06-03 | [DBA][DEV] | +| [Read committed isolation level doesn’t guarantee much…] | Paul Randal | 2010-04-17 | [DBA][DEV] | +| [Prevent Unexpected Failovers When Patching AGs] | Josh Darnell | 2010-05-21 | [DBA] | +| [Updating Statistics Causes Parameter Sniffing] | Brent Ozar | 2010-06-02 | [DBA][DEV] | +| [The Ascending Key Problem in Fact Tables– Part one: Pain!] | Thomas Kejser | 2011-01-01 | [DBA][DEV] | +| [The Ascending Key Problem In Fact Tables –Part Two: Stat Job!] | Thomas Kejser | 2011-07-07 | [DBA][DEV] | +| [Are Statistics Being Used for inserted and deleted tables and table variables?] | Deborah Melkin | 2020-05-05 | [DBA][DEV] | +| [Tackling Imperial and US Customary Measurements in Databases] | Phil Factor | 2020-05-06 | [DBA][DEV] | +| [In-Memory OLTP Best Practices – Part 1] | Jon Guerin, Daniel Taylor | 2020-03-11 | [DBA][DEV] | +| [In-Memory OLTP Best Practices – Part 2] | Jon Guerin, Daniel Taylor | 2020-05-06 | [DBA][DEV] | +| [Things I Wished More Developers Knew About Databases] | Jaana Dogan | 2020-04-21 | [DBA][DEV] | +| [Online migrations at scale] | Jacqueline Xu | 2017-02-02 | [DBA] | +| [The Dirty (Baker’s) Dozen of SQL Server Technical Debt] | Andy Jones | 2020-06-01 | [DBA][DEV] | +| [15 SQL Server Performance Counters to Monitor In 2020] | Allen White | 2020-05-05 | [DBA][DEV] | +| [Pulling Group By Above a Join] | Paul White | 2020-05-31 | [DBA][DEV] | +| [SQLskills SQL101: Running out of ints and bigints] | Paul Randal | 2017-10-03 | [DBA][DEV] | +| [Understanding and Using Parallelism in SQL Server] | Paul White | 2011-03-03 | [DBA][DEV] | +| [Top Asked Availability Group Questions… and Maybe Some Helpful Tidbits as Answers] | Sean Gallardy | 2020-06-16 | [DBA] | +| [Encrypting SQL Server Database Backups] | David Fowler | 2018-04-04 | [DBA] | +| [Using Track Causality to Understand Query Execution] | Erin Stellato | 2019-01-04 | [DBA][DEV] | +| [Understanding SQL Server Backup Types] | Prashanth Jayaram | 2018-04-19 | [B][DBA] | +| [Scripting the Description of Database Tables Using Extended Properties] | Phil Factor | 2020-03-03 | [DBA][DEV] | +| [The Table Variable in SQL Server] | Esat Erkec | 2019-12-03 | [DBA][DEV] | +| [Multiple Plans for an "Identical" Query] | Aaron Bertrand | 2014-11-20 | [DBA][DEV] | +| [Another argument for stored procedures versus ORM versus Add Hoc Queries] | Aaron Bertrand | 2013-05-17 | [DBA][DEV] | +| [Bad habits to kick : avoiding the schema prefix] | Aaron Bertrand | 2019-09-12 | [DBA][DEV] | +| [How not to call Hekaton natively-compiled stored procedures] | Aaron Bertrand | 2015-06-05 | [DBA][DEV] | +| [A One-Slide Summary of the Differences Between TDE and Always Encrypted] | Brent Ozar | 2020-07-31 | [SEC] | +| [Remember “Nothing Stops a Hekaton Transaction?” Yeah, About That.] | Brent Ozar | 2020-07-29 | [DBA][DEV] | +| [Finding & Downloading Required SQL Server Updates] | Andy Levy | 2020-07-21 | [DBA] | +| [SQLskills SQL101: Why do some wait types need to be ignored?] | Paul Randal | 2018-05-23 | [DBA][DEV] | +| [What is the SOS_WORK_DISPATCHER Wait Type? (Or how to work with Call Stacks in SQL Server)] | Joe Obbish | 2018-09-27 | [DBA][DEV] | +| [SQL Server 2019 Aggregate Splitting] | Paul White | 2020-08-04 | [DBA][DEV] | +| [Security Best Practice: dny and revoke permissions granted to All Users by default - HIGHLY IMPORTANT!] | Ronen Ariely | 2019-10-13 | [DBA][SEC] | +| [The Trillion Row Table] | Joe Obbish | 2020-08-12 | [BENCH] | +| [Temporal Tables and Table Partitioning: Not If You Like Switching Partitions] | Erik Darlling | 2020-03-03 | [DBA][DEV] | +| [Long Running Query on Read-Only Replica that takes moments on the Primary] | Sean Gallardy,Joe Obbish | 2019-09-05 | [DBA][DEV] | +| [Date Tables are Great for Users, but Not So Great for Performance] | Brent Ozar | 2020-08-05 | [DBA][DEV] | +| [Should I install SSMS on a server running SQL Server?] | Andy Mallon | 2020-04-14 | [DBA][DEV] | +| [Finding a table name from a page ID] | Paul Randal | 2014-09-25 | [DBA][DEV] | +| [Finding Distinct Values Quickly] | Paul White | 2020-04-17 | [DBA][DEV] | +| [Can You Fail To Spill To tempdb?] | Josh Darnell | 2019-07-17 | [DBA][DEV] | +| [Migrating SQL workloads to Microsoft Azure: Databases Trip to Azure SQL Database] | Ahmad Yaseen | 2020-08-03 | [AZ][DBA] | +| [How It Works: Bob Dorr's SQL Server I/O Presentation] | Bob Dorr | 2010-03-24 | [DBA][DEV] | +| [Who does SQL Server run xp_cmdshell command as?] | Steve Stedman | 2020-04-14 | [DBA][DEV] | +| [Transaction Modes in SQL Server] | Kevin Feasel | 2020-08-10 | [DBA][DEV] | +| [Working Effectively with Legacy SQL] | Kevin Feasel | 2015-03-15 | [DBA][DEV] | +| [A SQL Server DBA myth a day: (26/30) nested transactions are real] | Paul Randal | 2010-04-26 | [DBA][DEV] | +| [dbatools multithreading commands with PoshRSJob module] | Kin | 2019-01-04 | [DBA][PS] | +| [SQL Server Debugging with WinDbg – an Introduction] | Klaus Aschenbrenner | 2014-05-05 | [DBA][DEV] | +| [Looking deeper into SQL Server using Minidumps] | Thomas Kejser | 2009-09-11 | [DBA][DEV] | +| [Anatomy of a spool operators in SQL Server execution plans] | Hugo Kornelis | 2020-01-01 | [DBA][DEV] | +| [CAST v/s CONVERT – Is there a difference as far as SQL Server is concerned? Which is better?] | Nakul Vachhrajani | 2011-07-18 | [DBA][DEV] | +| [#BackToBasics: CAST vs. CONVERT] | Aaron Bertrand | 2016-11-02 | [DBA][DEV] | +| [Productivity Hacks: Migrate in Minutes to the Most Current Version of SQL Server] | Chris Lumnah | 2020-07-29 | [DBA] | +| [Database alias in Microsoft SQL Server] | Bohumír Kubík | 2011-01-11 | [DBA][DEV] | +| [The Curious Case of… the 8060-byte row size limit] | Paul Randal | 2020-03-11 | [DBA][DEV] | +| [.NET TransactionScope Considered Annoying - Default Isolation Level is Serializable] | Josh Darnell | 2020-07-27 | [DBA][DEV] | +| [Parameter Sniffing, Embedding, and the RECOMPILE Options] | Paul White | 2013-08-28 | [DBA][DEV] | +| [Why You’re Tuning Stored Procedures Wrong (the Problem with Local Variables)] | Kendra Little | 2020-05-06 | [DBA][DEV] | +| [Yet Another Post About Local Variables] | Erik Darlling | 2020-03-31 | [DBA][DEV] | +| [Cleaning up Backups from Azure Blob Storage] | Niko Neugebauer | 2020-03-30 | [AZ][B] | +| [Temporary Table Caching Explained] | Paul White | 2012-08-17 | [DBA][DEV] | +| [SQL Server Temporary Object Caching] | Paul White | 2017-05-02 | [DBA][DEV] | +| [3 Ways to Run DBCC CHECKDB Faster] | Brent Ozar | 2020-08-27 | [DBA][DEV] | +| [Back Up SQL Server 43%-67% Faster by Writing to Multiple Files] | Brent Ozar | 2020-08-23 | [DBA][DEV] | +| [Bad Habits to Kick : Using SELECT * / omitting the column list] | Aaron Bertrand | 2009-10-10 | [DBA][DEV] | +| [All The Problems With Select *] | Erik Darlling | 2019-12-10 | [DBA][DEV] | +| [When Select * Doesn’t Matter] | Erik Darlling | 2019-11-18 | [DBA][DEV] | +| [HT Waits – Explained and Animated] | Forrest McDaniel | 2020-08-12 | [DBA][DEV] | +| [SQL Server 100% Online Deployments] | Michael J Swart | 2018-01-05 | [DBA] | +| [The Curious Case of… setting up a server for DBCC CHECKDB] | Paul Randal | 2020-08-24 | [DBA] | +| [When should a primary key be declared non-clustered?] | Paul White | 2012-12-01 | [IDX] | +| [Guid vs INT - Which is better as a primary key?] | Sandeep Kumar M | 2011-01-05 | [DBA][DEV] | +| [Control SQL Jobs based on HADR Role – Taking it to the Next Level] | Eitan Blumin | 2020-05-26 | [DBA][J] | +| [SQL Friday #16: Eitan Blumin on “How to HADR Your SQL Jobs”] | Eitan Blumin | 2020-07-31 | [DBA][J] | +| [Choosing the Correct Azure VM Size for Your Workload] | Eric Smith | 2020-09-09 | [AZ][DBA] | +| [Table Partitioning in SQL Server – The Basics] | Cathrine Wilhelmsen | 2015-04-12 | [AZ][DBA] | +| [Table Partitioning in SQL Server – Partition Switching] | Cathrine Wilhelmsen | 2015-04-19 | [AZ][DBA] | +| [TempDB in SQL Server] | SentryOne | 2020-09-15 | [DBA] | +| [SQL Server’s Cost Threshold for Parallelism] | Kendra Little | 2014-11-20 | [DBA][DEV] | +| [How many CPUs is my parallel query using in SQL Server?] | Kendra Little | 2014-05-04 | [DBA][DEV] | +| [Protecting your data against unauthorised reads on SQL Server] | Monin | 2020-06-24 | [SEC] | +| [SET IMPLICIT_TRANSACTIONS ON Is One Hell of a Bad Idea] | Brent Ozar | 2019-05-06 | [DBA][DEV] | +| [Tempdb: The Ghost Of Version Store] | Stijn Wynants | 2015-11-09 | [DBA][DEV] | +| [When Tempdb Becomes Permanentdb (In-memory tempdb metadata and Resource governor problems)] | Glenn Boonen | 2020-05-07 | [DBA][DEV] | +| [The Best Medium-Hard Data Analyst SQL Interview Questions] | Zachary Thomas | 2020-01-01 | [DBA][DEV] | +| [Starting SQL: Why Not Make Everything Dynamic?] | Eric Darling | 2020-09-28 | [DBA][DEV] | +| [dbatools multithreading commands] | Kin | 2019-01-04 | [PS] | +| [Preventing Brute Force Attacks in SQL Server] | Raul Gonzalez | 2020-01-01 | [SEC] | +| [Asynchronous T-SQL Execution Without Service Broker] | Oleg Vorkunov | 2008-09-15 | [CLR] | +| [Using hash values in SSIS to determine when to insert or update rows] | Koen Verbeeck | 2019-10-15 | [SSIS] | +| [Capturing Queries Can Be A Pain] | Grant Fritchey | 2020-08-03 | [XE] | +| [Building full-text indexes using the Sphinx search engine] | Hadi Fadlallah | 2020-08-04 | [DBA][DEV] | +| [Starting SQL: Measuring A Query] | Eric Darling | 2020-09-28 | [DBA][DEV] | +| [When to use SET vs SELECT when assigning values to variables in SQL Server] | Atif Shehzad | 2009-11-25 | [DBA][DEV] | +| [What is the difference between SET and SELECT when assigning values to variables, in T-SQL?] | Narayana Vyas Kondreddi | 2005-10-29 | [DBA][DEV] | +| [CHECKDB From Every Angle: How long will CHECKDB take to run?] | Paul Randal | 2007-11-15 | [DBA] | +| [CHECKDB From Every Angle: Consistency Checking Options for a VLDB] | Paul Randal | 2007-11-19 | [DBA] | +| [Minimizing the impact of DBCC CHECKDB : DOs and DON'Ts] | Aaron Bertrand | 2012-11-29 | [DBA] | +| [A faster CHECKDB – Part II] | Bob Ward | 2012-02-23 | [DBA] | +| [A faster CHECKDB – Part III] | Bob Dorr | 2014-11-10 | [DBA] | +| [A faster CHECKDB – Part III] | Bob Dorr | 2015-01-26 | [DBA] | +| [A faster CHECKDB – Part IV (SQL CLR UDTs)] | Bob Dorr | 2015-01-26 | [DBA] | +| [Minimize performance impact of SQL Server DBCC CHECKDB] | Robert Pearl | 2011-06-02 | [DBA] | +| [Starting SQL: A Little More Fun With Logging Dynamic SQL] | Eric Darling | 2020-10-01 | [DBA][DEV] | +| [Allocation Order Scans] | Paul White | 2015-01-23 | [DBA][DEV] | +| [Parameter Sniffing in SQL Server 2019: Air_Quote_Actual Plans] | Brent Ozar | 2020-05-26 | [DBA][DEV] | +| [Guide For Set Up Of Telegraf For Monitoring Sql Server Xplat] | Tracy Boggiano | 2018-02-24 | [DBA] | +| [Azure Table Storage Tips for the RDBMS Developer] | Adrian Hills | 2020-10-21 | [AZ] | +| [sql_handle and the SQL Server batch text hash] | Paul White | 2020-10-11 | [DBA][DEV] | +| [Navigating DBCC CHECKDB for VLDB] | Aaron Bertrand | 2020-11-05 | [DBA] | +| [Hidden Formatting Troubles with STR() (SQL Spackle)] | Jeff Moden | 2019-04-26 | [DBA][DEV] | +| [The What, Why, When, and How of Incremental Loads] | Tim Mitchell | 2020-07-23 | [DBA][DEV] | +| [How Do I Know If My Query Is Good Enough for Production?] | Brent Ozar | 2020-08-12 | [DBA][DEV] | +| [How to Find Out Whose Queries are Using The Most CPU] | Brent Ozar | 2020-08-10 | [DBA][DEV] | +| [Limitations of SQL Server Native Backup and Restore in Amazon RDS] | Sadequl Hussain | 2017-08-23 | [AMZ][B] | +| [SQL Server Native Backup and Restore in Amazon RDS] | Sadequl Hussain | 2017-08-18 | [AMZ][B] | +| [What Is the SQL Server CEIP Service (telemetry)?] | Brent Ozar | 2020-10-07 | [DBA] | +| [Maximum Simultaneous User Connections] | Michael J Swart | 2020-10-16 | [DBA] | +| [Find Database Connection Leaks in Your Application] | Michael J Swart | 2017-07-07 | [DBA][DEV] | +| [How to Troubleshoot THREADPOOL Waits and Deadlocked Schedulers] | Eitan Blumin | 2020-10-05 | [DBA][DEV] | +| [Prevent Lock Escalation On Indexed Views] | Thomas Costers | 2019-10-30 | [DBA][DEV] | +| [Concatenating Strings in SQL Server] | Guy Glantser | 2020-11-30 | [DBA][DEV] | +| [Why Full Text’s CONTAINS Queries Are So Slow] | Brent Ozar | 2020-11-07 | [DBA][DEV] | +| [Migrating SSIS to Azure – an Overview] | Koen Verbeeck | 2020-11-03 | [AZ][MG] | +| [A Parameterization Puzzle With TOP: Part 1] | Eric Darling | 2020-10-21 | [DBA][DEV] | +| [A Parameterization Puzzle With TOP: Part 2] | Eric Darling | 2020-10-22 | [DBA][DEV] | +| [T-SQL: Get The Text Between Two Delimiters] | Eric Darling | 2020-10-22 | [DBA][DEV] | +| [Explore dynamic management views for monitoring SQL Server Always On Availability Groups] | Rajendra Gupta | 2020-11-16 | [DBA] | +| [Deploy SQLWATCH to SQL Server using GitHub Actions] | Kevin Chant | 2020-11-17 | [DBA] | +| [SQL Server table hints – WITH (NOLOCK) best practices] | Ahmad Yaseen | 2018-02-24 | [DBA][DEV] | +| [Memory-Optimized TempDB Metadata in SQL Server 2019] | Aaron Bertrand | 2020-02-14 | [DBA] | +| [SQLskills SQL101: Should you kill that long-running transaction?] | Paul Randal | 2020-10-10 | [DBA][DEV] | +| [A quick and dirty scan of a list of instances using a dynamic linked server] | Kenneth Fisher | 2020-11-12 | [DBA] | +| [sp_whoisactive: Analyzing Tempdb Contention] | Adam Machanic | 2017-01-01 | [DBA][DEV] | +| [How to Choose Between RCSI and Snapshot Isolation Levels] | Little Kendra | 2018-02-18 | [DBA][DEV] | +| [Explore the SQL query table hint READPAST] | Rajendra Gupta | 2020-11-14 | [DBA][DEV] | +| [How Bad Statistics Cause Bad SQL Server Query Performance] | Brent Ozar | 2020-11-14 | [DBA][DEV] | +| [How Scalar User-Defined Functions Slow Down Queries] | Brent Ozar | 2020-11-14 | [DBA][DEV] | +| [Could verifying your backups be costing you money?] | Matt Robertshaw | 2020-01-01 | [AZ][B] | +| [Extended Events: System_health And A Long Running Query] | Grant Fritchey | 2020-05-09 | [XE] | +| [Altering an indexed view in SQL Server drops all indexes] | Little Kendra | 2020-03-02 | [DBA][DEV] | +| [Deprecated and discontinued features in SQL Server] | Randolph West | 2020-03-04 | [DBA][DEV] | +| [Query Store, Plan Forcing, And Drop/create] | Grant Fritchey | 2020-03-02 | [QS] | +| [Uncommon SQL in SQL Server] | Shane O'Neill | 2020-11-20 | [DBA][DEV] | +| [Configure SQL Server Replication between AWS RDS SQL Server and On-premises SQL Server] | Rajendra Gupta | 2020-11-12 | [AMZ] | +| [Import data into Azure SQL database from AWS Redshift] | Rahul Mehta | 2020-11-10 | [AMZ][AZ] | +| [When You’re Troubleshooting Blocking, Look at Query #2, Too.] | Brent Ozar | 2020-11-19 | [DBA][DEV] | +| [Finding the One Query to Tune in a Multi-Query Batch] | Brent Ozar | 2020-11-23 | [DBA][DEV] | +| [Recursion in SQL Explained Visually] | Denis Lukichev | 2020-11-22 | [DBA][DEV] | +| [Viva la Famiglia! Stored procedure for created recursive family tree] | Brad Schulz | 2020-10-01 | [DEV] | +| [How to Set & Get the Next ID Without Serializable Isolation] | Brent Ozar | 2020-11-25 | [DBA][DEV] | +| [Discovering Three or Four Part Names in SQL Server Database Code] | Louis Davidson | 2019-03-08 | [DBA][DEV] | +| [Troubleshooting RESOURCE_SEMAPHORE_QUERY_COMPILE Helper Queries] | Eric Darling | 2020-11-24 | [DBA][DEV] | +| [When Do I Need to Use DESC in Indexes?] | Brent Ozar | 2020-11-30 | [DBA][DEV] | +| [Export Power BI Desktop data to SQL Server] | Rui Romano | 2016-04-21 | [DBA][DEV] | +| [Exploring errors to reveal unauthorized information] | Fabiano Amorim | 2020-10-19 | [SEC] | +| [How to run your CTE just once, and re-use the output] | Daniel Hutmacher | 2020-12-01 | [DBA][DEV] | +| [Documenting SSIS Packages using Sequence Diagrams] | Aveek Das | 2020-11-25 | [SSIS] | +| [Performance testing with DBCC DROPCLEANBUFFERS] | Dan Guzman | 2018-07-29 | [P] | +| [Optimizing memory settings in Analysis Services] | Marco Russo | 2020-12-07 | [DBA] | +| [VMware and SQL Server Best Practices] | Mike Walsh | 2020-12-02 | [DBA] | +| [Autoparameterized Trivial Queries May Not Get Partition Elimination] | Brent Ozar | 2020-11-26 | [DBA][DEV] | +| [Trigram Wildcard String Search in SQL Server] | Paul White | 2017-09-08 | [DBA][DEV] | +| [Which Locks Count Toward Lock Escalation?] | Kendra Little | 2017-04-03 | [DBA][DEV] | +| [The challenge is on! Community call for creating the fastest number series generator] | Itzik Ben-Gan | 2020-12-09 | [DBA][DEV] | +| [SQL Injection Prevention Cheat Sheet] | OWASP | 2020-07-14 | [SEC] | +| [A cheat sheet for isolation levels in SQL Server] | Dan Jackson | 2020-01-01 | [DBA][DEV] | +| [Don't Fear the Trace] | Greg Gonzalez | 2011-04-26 | [DBA][DEV] | +| [Which sp_configure Options Clear the Plan Cache?] | Brent Ozar | 2017-05-26 | [DBA][DEV] | +| [The danger of HADR_SYNC_COMMIT wait and synchronous replication in AlwaysOn Availability Groups] | Dmitri Korotkevitch | 2016-06-26 | [DBA][DEV] | +| [Faster SQL Pagination with Keysets, Continued] | Lukas Eder | 2013-11-18 | [DBA][DEV] | +| [We need tool support for keyset pagination] | Markus Winand | 2014-08-16 | [DBA][DEV] | +| [Insight into the SQL Server buffer cache] | Ed Pollack | 2016-02-18 | [DBA][DEV] | +| [Index-Only Scan: Avoiding Table Access] | Markus Winand | 2014-01-01 | [DBA][DEV] | +| [The two top performance problems caused by ORM tool] | Markus Winand | 2013-04-23 | [DBA][DEV] | +| [Nested loops join and n1 problem in ORM] | Markus Winand | 2013-01-01 | [DBA][DEV] | +| [Hash join partial objects] | Markus Winand | 2013-01-01 | [DBA][DEV] | +| [Myth: Select * (asterisk) is bad] | Markus Winand | 2013-11-03 | [DBA][DEV] | +| [Indexing LIKE Filters] | Markus Winand | 2013-01-01 | [DBA][DEV] | +| [Date and time conditions causing SQL performance problems] | Markus Winand | 2013-01-01 | [DBA][DEV] | +| [Dates and Times in SQL Server: more functions you should never use] | Randolph West | 2018-05-16 | [DBA][DEV] | +| [Dates and Times in SQL Server: T-SQL functions to get the current date and time] | Randolph West | 2018-04-25 | [DBA][DEV] | +| [Super Scaling Queues Using the LMax Disruptor Pattern And The In-Memory OLTP Engine] | Chris Adkin | 2016-01-18 | [DBA][DEV] | +| [Early History of SQL] | Donald D. Chamberlin | 2012-01-01 | [DBA][DEV] | +| [Is it a bad practice to always create a transaction?] | Kin Shah | 2013-09-06 | [DBA][DEV] | +| [Incomplete checkpoints and recovery] | Paul Randal | 2015-03-18 | [DBA] | +| [4 SQL Injection Techniques For Stealing Data] | Bert Wagner | 2018-11-20 | [DBA][DEV] | +| [Towards Safer Dynamic SQL] | Eric Darling | 2020-10-11 | [DBA][DEV] | +| [Setting the timezone to anything other than UTC] | Yeller | 2015-01-12 | [DBA][DEV] | +| [Advanced Service Broker Sample: Multi-Threading] | Eitan Blumin | 2018-10-31 | [DBA][DEV] | +| [Copy a SQL Server database with just the objects and no data] | Jeffrey Yao | 2017-02-01 | [DBA][DEV] | +| [QOMPLX Knowledge: Kerberoasting Attacks Explained] | QOMPLX | 2020-01-01 | [SEC] | +| [How to create a SQL dependency diagram in SQL Server] | Marko Zivkovic | 2018-09-24 | [DBA][DEV] | +| [Query Memory Grants and Resource Semaphores in SQL Server] | Klaus Aschenbrenner | 2018-10-16 | [DBA][DEV] | +| [Using a Table of Numbers (or a Table of Dates, Months etc)] | Erland Sommarskog | 2020-09-16 | [DBA][DEV] | +| [SQL Server MDF and NDF files] | SQL Recovery | 2020-01-01 | [DBA][DEV] | +| [The SQL Standard ANSI ISO is Public!] | Markus Winand | 2020-01-01 | [DBA][DEV] | +| [SQL Server Full Backup] | Alexandr Omelchenko | 2015-10-28 | [DBA][DEV] | +| [Import data from PDF files using R Scripts SQL Server] | Rajendra Gupta | 2020-12-08 | [R] | +| [Adding Additional Data Files To The TempDB Database In SQL Server] | Jack Worthen | 2017-08-24 | [DBA] | +| [SQL Server Isolation Levels: A Series] | Paul White | 2014-07-01 | [DBA][DEV] | +| [SQL Server Isolation Levels: The ACID Properties of Statements & Transactions] | Paul White | 2014-02-27 | [DBA][DEV] | +| [SQL Server Isolation Levels: The Serializable Isolation Level] | Paul White | 2014-04-10 | [DBA][DEV] | +| [SQL Server Isolation Levels: The Repeatable Read Isolation Level] | Paul White | 2014-04-15 | [DBA][DEV] | +| [SQL Server Isolation Levels: The Read Committed Isolation Level] | Paul White | 2014-04-22 | [DBA][DEV] | +| [SQL Server Isolation Levels: Read Committed Snapshot Isolation] | Paul White | 2014-05-07 | [DBA][DEV] | +| [SQL Server Isolation Levels: Data Modifications under Read Committed Snapshot Isolation] | Paul White | 2014-05-14 | [DBA][DEV] | +| [SQL Server Isolation Levels: The SNAPSHOT Isolation Level] | Paul White | 2014-06-30 | [DBA][DEV] | +| [SQL Server Isolation Levels: The Read Uncommitted Isolation Level] | Paul White | 2015-04-23 | [DBA][DEV] | +| [The OUTPUT Clause for the MERGE Statements] | Amarendra Reddy Thummeti | 2019-03-08 | [DBA][DEV] | +| [SQLskills SQL101: Query plans based on what’s in memory] | Paul Randal | 2017-03-03 | [DBA][DEV] | +| [Performance: String Concatenation in SQL Server] | Steve Stedman | 2021-01-25 | [DBA][DEV] | +| [Performance: Faster way to concatenate longer string] | Steve Stedman | 2021-01-26 | [DBA][DEV] | +| [Identifying Cost-Saving Opportunities in Azure DevOps] | Eric Smith | 2020-04-28 | [Az] | +| [One wide index or multiple narrow indexes?] | Gail Shaw | 2010-09-14 | [DBA][DEV] | +| [The Hidden Danger of Readable Secondaries in SQL Server AlwaysOn Availability Groups] | Dmitri Korotkevitch | 2018-09-04 | [DBA] | +| [When a Columnstore Index Makes Your Query Fail - 1/0 error] | Brent Ozar | 2020-06-08 | [DBA] | +| [Poor Man’s Resource Governor: Database-Scoped Configurations] | Brent Ozar | 2020-09-26 | [DBA] | +| [SQL Server Suddenly Frozen? You Might Be Snapshotting Too Many Databases.] | Brent Ozar | 2020-11-27 | [DBA] | +| [How to Batch Updates A Few Thousand Rows at a Time] | Brent Ozar | 2020-12-17 | [DBA][DEV] | +| [Using Amazon Fsx For Sql Server Failover Cluster Instances – What You Need To Know!] | Dave Berm | 2020-01-24 | [AMZ] | +| [Sometimes you CAN upsize a column in-place] | Aaron Bertrand | 2020-08-19 | [DBA] | +| [Which Microsoft Certification Should You Get?] | Brent Ozar | 2021-01-04 | [DBA][DEV] | +| [SQL Server RAISERROR Cheatsheet] | Chad Baldwin | 2021-01-15 | [DBA][DEV] | +| [Want to Avoid Deployment Downtime? Replication Probably Isn’t the Answer.] | Brent Ozar | 2021-01-06 | [DBA][DEV] | +| [“But Surely NOLOCK Is Okay If No One’s Changing Data, Right?”] | Brent Ozar | 2021-01-25 | [DBA][DEV] | +| [Why Multiple Plans for One Query Are Bad] | Brent Ozar | 2018-01-17 | [DBA][DEV] | +| [Partitioned Tables Cause Longer Plan Compilation Times.] | Brent Ozar | 2021-02-26 | [DBA][DEV] | +| [Query Hints You Can Use to Avoid Blocking] | Brent Ozar | 2021-01-21 | [DBA][DEV] | +| [Changing Statistics Cause Longer Compilation Times] | Brent Ozar | 2021-02-13 | [DBA][DEV] | +| [Understanding Execution Plan Operator Timings] | Paul White | 2021-03-08 | [DBA][DEV] | +| [What Does a Database Administrator Actually Do?] | Brent Ozar | 2021-03-20 | [DBA] | +| [How Useful Is Column Store In Standard Edition?] | Erik Darling | 2021-03-17 | [DBA] | +| [Task Manager’s CPU numbers are all but meaningless] | Aaron Margosis | 2021-03-25 | [DBA] | +| [Global temporary tables are almost never the answer in SQL Server] | Greg Low | 2021-02-04 | [DBA][DEV] | +| [Never, Ever, Ever Start T-SQL Comments with Two Dashes] | Brent Ozar | 2021-04-05 | [DBA][DEV] | +| [Why All My Servers Have an 8GB Empty File] | Brian Schrader | 2021-03-25 | [DBA] | +| [Incorrect Results with Parallel Eager Spools and Batch Mode] | Paul White | 2021-03-24 | [DBA][DEV] | +| [Deprecated features to take out of your toolbox – Part 1] | Aaron Bertrand | 2021-02-22 | [DBA][DEV] | +| [Deprecated features to take out of your toolbox – Part 2] | Aaron Bertrand | 2021-03-15 | [DBA][DEV] | +| [Deprecated features to take out of your toolbox – Part 3] | Aaron Bertrand | 2021-07-01 | [DBA][DEV] | +| [Troubleshooting Security Cache Issues: USERSTORE_TOKENPERM And TokenAndPermUserStore] | Erik Darling | 2021-04-19 | [DBA] | +| [Execution Plans Don’t Have the Yellow Bang They Really Need.] | Brent Ozar | 2021-04-29 | [DBA][DEV] | +| [The Curious Case of… the un-killable thread] | Paul Randal | 2021-04-20 | [DBA] | +| [olved steries #1 – SQL FCI Failovers] | Sean Gallardy | 2021-04-29 | [DBA] | +| [Possible configuration error: 1000000 IO requests allocated] | Sean Gallardy | 2021-05-23 | [DBA] | +| [Availability Group Long Failover Times] | Sean Gallardy | 2021-04-18 | [DBA] | +| [Testing Backups and Offloading CheckDB] | Taryn Pratt | 2021-04-19 | [DBA] | +| [Fighting with Deadlocks] | Taryn Pratt | 2021-04-09 | [DBA][DEV] | +| [Syncing Logins Between Availability Group Replicas] | Taryn Pratt | 2020-12-18 | [DBA] | +| [SQL JOINs and UNIONs] | Austin Smith | 2020-03-13 | [DBA][DEV] | +| [Some opinionated thoughts on SQL databases] | Nelson Elhage | 2020-03-30 | [DBA][DEV] | +| [How MERGE on two different rows can still deadlock you] | Daniel Hutmacher | 2021-05-04 | [DBA][DEV] | +| [Auto-failover Groups for Azure – Grace Period With Data Loss Hours] | Taiob Ali | 2021-03-31 | [AZ][DBA] | +| [How Parallel Plans Start Up – Part 1] | Paul White | 2021-03-30 | [DBA][DEV] | +| [How Parallel Plans Start Up – Part 2] | Paul White | 2021-04-08 | [DBA][DEV] | +| [How Parallel Plans Start Up – Part 3] | Paul White | 2021-04-20 | [DBA][DEV] | +| [How Parallel Plans Start Up – Part 4] | Paul White | 2021-05-06 | [DBA][DEV] | +| [How Parallel Plans Start Up – Part 5] | Paul White | 2021-05-17 | [DBA][DEV] | +| [Iterators, Query Plans, and Why They Run Backwards] | Paul White | 2010-08-05 | [DBA][DEV] | +| [What account is xp_cmdshell using?] | Kenneth Fisher | 2021-05-25 | [DBA] | +| [Hammer Part 1 -What is HammerDB and why would I use it?] | Tom Wilson | 2021-04-17 | [BENCH][P] | +| [Hammer Part 2 -Let the Nail see the Hammer!] | Tom Wilson | 2021-05-26 | [BENCH][P] | +| [Fun with DATETIME Arithmetics] | Eitan Blumin | 2021-04-27 | [DBA][DEV] | +| [Even more fun with DATETIME arithmetics!] | Eitan Blumin | 2021-06-17 | [DBA][DEV] | +| [I learned to love WHILE (true) and you should too] | Eitan Blumin | 2021-02-16 | [DBA][DEV] | +| [Troubleshooting Long-Running SHRINK Operations] | Eitan Blumin | 2020-04-07 | [DBA] | +| [The Ultimate Compression Savings Estimation Script for an Entire Database] | Eitan Blumin | 2020-02-18 | [DBA] | +| [The Complete Guide to Temporary Tables and Table Variables - Part 1] | Guy Glanster | 2021-04-08 | [DBA][DEV] | +| [Store Files in a File System, Not a Relational Database.] | Brent Ozar | 2021-07-01 | [DBA][DEV] | +| [Most (XML) and Least (SQL_VARIANT) Favorite Data Type] | Eitan Blumin | 2021-03-09 | [DBA][DEV] | +| [What should the CPU usage be of a fully-loaded CPU that has been throttled?] | Raymond | 2021-06-29 | [DBA][DEV] | +| [Fixing Queues with Watermarks] | Forrest Daniel | 2021-06-30 | [DBA][DEV] | +| [How to Patch SQL Server] | Brent Ozar | 2021-06-04 | [DBA] | +| [“I’m getting index seeks. Why are my row estimates still wrong?”] | Brent Ozar | 2021-06-06 | [DBA][DEV] | +| [OLAP != OLAP Cube] | Cedric Chin | 2020-02-06 | [DBA][DEV] | +| [Connecting a SQL Server client on Linux using Active Directory authentication] | Daniel Hutmacher | 2021-04-15 | [DBA][DEV] | +| [Is a sort faster when the data is already sorted?] | Daniel Hutmacher | 2021-02-15 | [DBA][DEV] | +| [Connect using Windows authentication across domains] | Daniel Hutmacher | 2021-02-05 | [DBA][DEV] | +| [The uncorrelated correlated subquery] | Daniel Hutmacher | 2020-12-21 | [DBA][DEV] | +| [How to fix rounding errors] | Daniel Hutmacher | 2020-12-15 | [DBA][DEV] | +| [The curious case of the Top N Sort] | Daniel Hutmacher | 2020-12-08 | [DBA][DEV] | +| [Consolidating grouped transactions into evenly sized batches] | Daniel Hutmacher | 2020-07-13 | [DBA][DEV] | +| [A “shock absorber” pattern for high-performance data ingestion] | Daniel Hutmacher | 2021-07-15 | [P] | +| [Why Are Linked Server Queries So Bad?] | Brent Ozar | 2021-07-15 | [DBA][DEV] | +| [Fundamentals of table expressions, Part 1] | Itzik Ben-Gan | 2020-04-08 | [DBA][DEV] | +| [Fundamentals of table expressions, Part 2 – Derived tables, logical considerations] | Itzik Ben-Gan | 2020-05-13 | [DBA][DEV] | +| [Fundamentals of table expressions, Part 3 – Derived tables, optimization considerations] | Itzik Ben-Gan | 2020-06-10 | [DBA][DEV] | +| [Fundamentals of table expressions, Part 4 – Derived tables, optimization considerations, continued] | Itzik Ben-Gan | 2020-07-08 | [DBA][DEV] | +| [Fundamentals of table expressions, Part 5 – CTEs, logical considerations] | Itzik Ben-Gan | 2020-08-12 | [DBA][DEV] | +| [Fundamentals of table expressions, Part 6 – Recursive CTEs] | Itzik Ben-Gan | 2020-09-09 | [DBA][DEV] | +| [Fundamentals of table expressions, Part 7 – CTEs, optimization considerations] | Itzik Ben-Gan | 2020-10-14 | [DBA][DEV] | +| [Fundamentals of table expressions, Part 8 – CTEs, optimization considerations continued] | Itzik Ben-Gan | 2020-11-11 | [DBA][DEV] | +| [Fundamentals of table expressions, Part 9 – Views, compared with derived tables and CTEs] | Itzik Ben-Gan | 2021-06-09 | [DBA][DEV] | +| [Fundamentals of table expressions, Part 10 – Views, SELECT *, and DDL changes] | Itzik Ben-Gan | 2021-07-14 | [DBA][DEV] | +| [Understanding xp_fileexist and its usage] | Nisarg Upadhyay | 2021-07-09 | [DBA][DEV] | +| [SQL Server Restore Database Options and Examples] | Joe Gavin | 2021-06-21 | [DBA] | +| [SQL Server Database RESTORE WITH MOVE or not WITH MOVE] | Mike Eastland | 2013-11-22 | [DBA] | +| [Getting exclusive access to restore SQL Server database] | Greg Robidoux | 2021-02-21 | [DBA] | +| [How to migrate a SQL Server database to a lower version] | Basit Farooq | 2019-08-05 | [DBA] | +| [Make Network Path Visible For SQL Server Backup and Restore in SSMS] | Ahmad Yaseen | 2015-03-03 | [DBA] | +| [T-SQL bugs, pitfalls, and best practices – pivoting and unpivoting] | Itzik Ben-Gan | 2019-09-12 | [DBA][DEV] | +| [How to Prep a SQL Server Availability Group for VM-Level DR Replication] | David Klee | 2021-02-08 | [DBA] | +| [Special Agent Jenkins] | Kirill Kravtsov | 2018-03-03 | [J] | +| [What To Avoid If You Want To Use MERGE] | Michael J Swart | 2021-08-04 | [DBA][DEV] | +| [Solving Gaps and Islands with Enhanced Window] | Itzik Ben-Gan | 2012-09-20 | [DBA][DEV] | +| [How to choose between SQL and NoSQL databases] | Robert Sheldon | 2021-04-13 | [DBA][DEV] | +| [SQL Server plan cache mining – Plan attributes] | Edward Pollack | 2021-04-26 | [DBA][DEV] | +| [How to Prep a SQL Server Availability Group for VM-Level DR Replication] | David Klee | 2021-02-08 | [DBA] | +| [How to create an autonomous transaction in SQL Server 2008] | SQL-Server-Team | 2021-02-08 | [DBA][DEV] | +| [Cloud Comparison: AWS vs. Azure vs. GCP] | Troy Blake | 2021-03-24 | [DBA][DEV] | +| [New VLF status value] | Troy Blake | 2021-03-24 | [DBA][DEV] | +| [The Simplest Alternative to sp_MSforeachdb] | Eitan Blumin | 2021-08-05 | [DBA][DEV] | +| [Your database connection deserves a name] | Andy Grunwald | 2021-07-25 | [DBA][DEV] | +| [Renaming a Database Table In-Flight] | Arvind Paul | 2021-01-01 | [DBA][DEV] | +| [Upgrading/Migrating Large Replicated Databases Without Reinitializing] | Jonathan Kehayias | 2021-08-12 | [DBA][DEV] | +| [TempDB configuration for people in a hurry] | Jeff Iannucci | 2021-07-03 | [DBA][DEV] | +| [Help! My tempdb database won’t shrink!] | Jeff Iannucci | 2018-06-22 | [DBA][DEV] | +| [SQL Server Checkpoint Monitoring with Extended Events] | Aaron Bertrand | 2020-02-17 | [DBA][DEV] | +| ["0 to 60" : Switching to indirect checkpoints] | Aaron Bertrand | 2020-05-01 | [DBA][DEV] | +| [A case against using Basic and Standard (S0 & S1) tiers in Azure SQL Databases] | Niko Neugebauer | 2021-02-09 | [AZ] | +| [Experiment: Does sp_recompile on a table update associated views.] | Kenneth Fisher | 2021-08-17 | [DBA][DEV] | +| [On index key size, index depth, and performance] | Paul Radal | 2015-10-23 | [DBA][DEV] | +| [SQL Server Hierarchyid Data Type Overview and Examples] | Rick Dobson | 2019-06-21 | [DBA][DEV] | +| [Make It Easier for the DBA: Give SQL Connections the Application’s Name!] | Ben Gribaudo | 2017-06-23 | [DBA][DEV] | +| [You Probably Shouldn’t Index Your Temp Tables.] | Brent Ozar | 2021-08-17 | [DBA][DEV] | +| [SQL Server Error Handling Gotchas] | Niels Berglund | 2016-12-31 | [DBA][DEV] | +| [B-Trees: More Than I Thought I'd Want to Know] | Ben Congdon | 2021-08-17 | [DBA][DEV] | +| [Wait Stats During Hash Spills] | Eric Darling | 2021-09-21 | [DBA][DEV] | +| [Shrinking The tempdb System Database Without Restarting SQL Server] | Jack Worthen | 2016-06-02 | [DBA][DEV] | +| [Graphing SQL Server wait stats on Prometheus and Grafana] | David Barbarin | 2021-09-09 | [M] | +| [Transition from SSMS to DataGrip: 10 tips] | Maksim Sobolevskiy | 2021-08-19 | [DBA][DEV] | +| [Query Store Hints] | Erin Stellato | 2021-06-09 | [DBA][DEV] | +| [Announcing SSIS Framework Manager, v1] | Andy Leonard | 2021-06-09 | [SSIS] | +| [Improving The Performance of RBAR Modifications] | Erik Darling | 2021-02-15 | [DBA][DEV] | +| [Minimal Logging with INSERT…SELECT into Empty Clustered Tables] | Paul White | 2019-05-16 | [DBA][DEV] | +| [What Is a Cost-Based Optimizer?] | Brent Ozar | 2021-09-17 | [DBA][DEV] | +| [Unusual Parameter Sniffing: Big Problems with Small Data] | Brent Ozar | 2021-02-03 | [DBA][DEV] | +| [Rowcount estimates when there are no Statistics] | Matthew Mcgiffen | 2021-01-26 | [DBA][DEV] | +| [Processing Data Queues in SQL Server with READPAST and UPDLOCK] | Armando Prato | 2007-06-04 | [DBA][DEV] | +| [Can You Get Parameter Sniffing on Updates and Deletes?] | Brent Ozar | 2021-01-27 | [DBA][DEV] | +| [An Empirical Look at Key Lookups] | Forrest mc Daniel | 2020-12-30 | [DBA][DEV] | +| [Please stop using this UPSERT anti-pattern] | Aaron Bertrand | 2020-09-02 | [DBA][DEV] | +| [The Curious Case of… the failing differential restore] | Paul Randal | 2021-01-18 | [DBA] | +| [Starting SQL: Compensating For Lock Waits] | Erik Darling | 2020-01-31 | [DBA][DEV] | +| [Finding & Downloading Required SQL Server Updates] | Andy Levy | 2020-07-21 | [DBA] | +| [Quick SQL Server CPU Comparison Tests] | Joe Obbish | 2021-09-22 | [DBA][DEV] | +| [Using fn_dblog, fn_dump_dblog, and restoring with STOPBEFOREMARK to an LSN] | Paul Randal | 2012-05-17 | [DBA][DEV] | +[Understanding how SQL Server executes a query]:http://rusanu.com/2013/08/01/understanding-how-sql-server-executes-a-query/ [SQL Server Index Design Guide]:https://technet.microsoft.com/en-us/library/jj835095.aspx [SQL Server 2012 Security Best Practices - Microsoft]:http://download.microsoft.com/download/8/f/a/8fabacd7-803e-40fc-adf8-355e7d218f4c/sql_server_2012_security_best_practice_whitepaper_apr2012.docx [Help, my database is corrupt. Now what?]:http://www.sqlservercentral.com/articles/Corruption/65804/ [What to Do When DBCC CHECKDB Reports Corruption]:https://www.brentozar.com/archive/2016/05/dbcc-checkdb-reports-corruption/ -[Understanding how SQL Server executes a query]:http://rusanu.com/2013/08/01/understanding-how-sql-server-executes-a-query/ [Troubleshooting SQL Server CPU Performance Issues]:http://sqlperformance.com/2013/05/io-subsystem/cpu-troubleshooting [Knee-Jerk Performance Tuning : Incorrect Use of Temporary Tables]:http://sqlperformance.com/2016/04/t-sql-queries/knee-jerk-temporary-tables [High Performance T-SQL using Code Patterns]:https://dwaincsql.com/2015/05/27/high-performance-t-sql-using-code-patterns/ [SQL Server Database Corruption Repair]:http://stevestedman.com/2015/08/sql-server-database-corruption-repair/ [Basic SQL Server Performance Troubleshooting For Developers]:https://www.simple-talk.com/sql/performance/basic-sql-server-performance-troubleshooting-for-developers/ [The Curse and Blessings of Dynamic SQL]:http://sommarskog.se/dynamic_sql.html -[Dynamic Search Conditions in T-SQL]:http://www.sommarskog.se/dynamic_sql.html +[Dynamic Search Conditions in T-SQL]:http://www.sommarskog.se/dyn-search.html [Slow in the Application, Fast in SSMS]:http://www.sommarskog.se/query-plan-mysteries.html [How to share data between stored procedures]:http://www.sommarskog.se/share_data.html [Arrays and Lists in SQL Server 2008]:http://www.sommarskog.se/arrays-in-sql-2008.html -[Giving Permissions through Stored Procedures]:http://www.sommarskog.se/grantperm.html -[Error and Transaction Handling in SQL Server]:http://www.sommarskog.se/error_handling/Part1.html +[Packaging Permissions in Stored Procedures]:http://www.sommarskog.se/grantperm.html +[Error and Transaction Handling in SQL Server Part One – Jumpstart Error Handling]:http://www.sommarskog.se/error_handling/Part1.html +[Error and Transaction Handling in SQL Server Part Two – Commands and Mechanisms]:http://www.sommarskog.se/error_handling/Part2.html +[Error and Transaction Handling in SQL Server Part Three – Implementation]:http://www.sommarskog.se/error_handling/Part3.html [Using the Bulk-Load Tools in SQL Server]:http://www.sommarskog.se/bulkload.html [Using Table-Valued Parameters in SQL Server and .NET]:http://www.sommarskog.se/arrays-in-sql-2008.html [SQL Server Columnstore Articles]:http://www.nikoport.com/columnstore/ @@ -814,7 +1510,6 @@ Articles types: [Monitor SQL Server Transaction Log File Free Space]:https://www.mssqltips.com/sqlservertip/3617/monitor-sql-server-transaction-log-file-free-space/ [Dynamically Query a 100 Million Row Table-Efficiently]:http://www.sqlservercentral.com/articles/T-SQL/121906/ [Understanding and Using Parallelism in SQL Server]:https://www.simple-talk.com/sql/learn-sql-server/understanding-and-using-parallelism-in-sql-server/ -[Diagnosing and Resolving Latch Contention on SQL Server]:https://www.microsoft.com/en-us/download/details.aspx?id=26665 [Parallel Execution Plans – Branches and Threads]:http://sqlperformance.com/2013/10/sql-plan/parallel-plans-branches-threads [Nasty Fast PERCENT_RANK]:http://www.sqlservercentral.com/articles/PERCENT_RANK/141532/ [Looking at VIEWs, Close Up]:https://www.simple-talk.com/sql/t-sql-programming/looking-at-views,-close-up/ @@ -833,7 +1528,7 @@ Articles types: [Graphs and Graph Algorithms in T-SQL]:http://www.hansolav.net/sql/graphs.html [Episode 4: SQL Server R Services makes you a smarter T-SQL Developer]:https://blogs.msdn.microsoft.com/sqlcat/2016/07/12/sqlsweet16-episode-4-sql-server-r-services-makes-you-a-smarter-t-sql-developer/ [How to Set Max Degree of Parallelism in SQL Server]:http://www.littlekendra.com/2016/07/14/max-degree-of-parallelism-cost-threshold-for-parallelism/ -[Undocumented Query Plans: Equality Comparisons]:http://sqlblog.com/blogs/paul_white/archive/2011/06/22/undocumented-query-plans-equality-comparisons.aspx +[Undocumented Query Plans: Equality Comparisons]:https://www.sql.kiwi/2011/06/undocumented-query-plans-equality-comparisons.html [Simplified Order Of Operations]:http://michaeljswart.com/2016/07/simplified-order-of-operations/ [SQL Server Statistics Basics]:https://www.simple-talk.com/sql/performance/sql-server-statistics-basics/ [Learn to Use sp_Blitz, sp_BlitzCache, sp_BlitzFirst, and sp_BlitzIndex with These Tutorial Videos]:https://www.brentozar.com/archive/2016/09/learn-use-sp_blitz-sp_blitzcache-sp_blitzfirst-sp_blitzindex-tutorial-videos/ @@ -846,33 +1541,31 @@ Articles types: [How To Fix Forwarded Records]:https://www.brentozar.com/archive/2016/07/fix-forwarded-records/ [Should I Automate my Windows Updates for SQL Server?]:http://www.littlekendra.com/2016/07/28/should-i-automate-my-windows-updates-for-sql-server-dear-sql-dba-episode-10/ [Finding the Right Path]:http://jasonbrimhall.info/2016/08/24/finding-the-right-path/ -[#BackToBasics : An Updated "Kitchen Sink" Example]:https://blogs.sqlsentry.com/aaronbertrand/backtobasics-updated-kitchen-sink-example/ +[#BackToBasics : An Updated "Kitchen Sink" Example]:https://www.sentryone.com/blog/aaronbertrand/backtobasics-updated-kitchen-sink-example [Locking and Blocking in SQL Server]:https://www.brentozar.com/sql/locking-and-blocking-in-sql-server/ -[Nested Loops Prefetching]:http://sqlblog.com/blogs/paul_white/archive/2013/08/31/sql-server-internals-nested-loops-prefetching.aspx +[Nested Loops Prefetching]:https://www.sql.kiwi/2013/08/sql-server-internals-nested-loops-prefetching.html [Performance tuning backup and restore operations]:http://www.sqlhammer.com/performance-tuning-backup-restore-operations/ -[Execution Plan Analysis: The Mystery Work Table]:http://sqlblog.com/blogs/paul_white/archive/2013/03/08/execution-plan-analysis-the-mystery-work-table.aspx +[Execution Plan Analysis: The Mystery Work Table]:https://www.sql.kiwi/2013/03/execution-plan-analysis-the-mystery-work-table.html [How to move data between File Groups in SQL Server]:http://www.sqlpassion.at/archive/2016/09/26/how-to-move-data-between-file-groups-in-sql-server/ -[Optimizing Your Query Plans with the SQL Server 2014 Cardinality Estimator]:https://msdn.microsoft.com/en-us/library/dn673537.aspx +[Optimizing Your Query Plans with the SQL Server 2014 Cardinality Estimator]:https://docs.microsoft.com/en-us/previous-versions/dn673537(v=msdn.10)?redirectedfrom=MSDN [Parallelism in SQL Server Query Tuning]:http://sqlmag.com/sql-server/parallelism-sql-server-query-tuning [What You Need to Know about the Batch Mode Window Aggregate Operator in SQL Server 2016: Part 1]:http://sqlmag.com/sql-server/what-you-need-know-about-batch-mode-window-aggregate-operator-sql-server-2016-part-1 [What To Do If sp_BlitzFirst Warns About High Compilations]:https://www.brentozar.com/archive/2016/09/what-to-do-if-sp_blitzfirst-warns-about-high-compilations/ [Questions You Should Be Asking About Your Backups]:https://www.brentozar.com/archive/2016/10/questions-asking-backups/ [Evolutionary Database Design]:http://martinfowler.com/articles/evodb.html [Implementing a custom sort]:https://sqlperformance.com/2016/10/sql-plan/implementing-custom-sort -[Deletes that Split Pages and Forwarded Ghosts]:http://sqlblog.com/blogs/paul_white/archive/2012/08/31/deletes-that-split-pages-and-forwarded-ghosts.aspx -[Query Optimizer Deep Dive - Part 1]:http://sqlblog.com/blogs/paul_white/archive/2012/04/28/query-optimizer-deep-dive-part-1.aspx -[Query Optimizer Deep Dive - Part 2]:http://sqlblog.com/blogs/paul_white/archive/2012/04/28/query-optimizer-deep-dive-part-2.aspx -[Query Optimizer Deep Dive - Part 3]:http://sqlblog.com/blogs/paul_white/archive/2012/04/29/query-optimizer-deep-dive-part-3.aspx -[Query Optimizer Deep Dive - Part 4]:http://sqlblog.com/blogs/paul_white/archive/2012/05/01/query-optimizer-deep-dive-part-4.aspx +[Deletes that Split Pages and Forwarded Ghosts]:https://www.sql.kiwi/2012/08/deletes-that-split-pages-and-forwarded-ghosts.html +[Query Optimizer Deep Dive - Part 1]:https://www.sql.kiwi/2012/04/query-optimizer-deep-dive-part-1.html +[Query Optimizer Deep Dive - Part 2]:https://www.sql.kiwi/2012/04/query-optimizer-deep-dive-part-2.html +[Query Optimizer Deep Dive - Part 3]:https://www.sql.kiwi/2012/04/query-optimizer-deep-dive-part-3.html +[Query Optimizer Deep Dive - Part 4]:https://www.sql.kiwi/2012/05/query-optimizer-deep-dive-part-4.html [Should You Rebuild or Reorganize Indexes on Large Tables?]:https://www.littlekendra.com/2016/10/13/should-you-rebuild-or-reorganize-indexes-on-large-tables-dear-sql-dba-episode-19/ [Retrieving SQL Server Query Execution Plans]:https://www.simple-talk.com/sql/database-administration/retrieving-sql-server-query-execution-plans/ [Introduction to Latches in SQL Server]:http://www.sqlpassion.at/archive/2014/06/23/introduction-to-latches-in-sql-server/ [Latch Coupling in SQL Server]:https://www.sqlpassion.at/archive/2016/10/24/latch-coupling-in-sql-server/ [Partitioned Views? A How-To Guide]:https://www.brentozar.com/archive/2016/09/partitioned-views-guide/ -[How to Choose Between RCSI and Snapshot Isolation Levels]:https://www.littlekendra.com/2016/02/18/how-to-choose-rcsi-snapshot-isolation-levels/ [TroubleShooting SQL Server Memory Consumption]:http://www.sql-server-performance.com/2016/trouble-shooting-sql-server-ra-memory-consumption/ [Time Series Algorithms in SQL Server]:http://www.sql-server-performance.com/2015/time-series-algorithms-sql-server/ -[Heap Tables in SQL Server]:http://www.sqlpassion.at/archive/2015/10/19/heap-tables-in-sql-server/ [Internals of the Seven SQL Server Sorts – Part 1]:https://sqlperformance.com/2015/04/sql-plan/internals-of-the-seven-sql-server-sorts-part-1 [Internals of the Seven SQL Server Sorts – Part 2]:https://sqlperformance.com/2015/05/sql-plan/internals-of-the-seven-sql-server-sorts-part-2 [The 9 Letters That Get DBAs Fired]:https://www.brentozar.com/archive/2011/12/letters-that-get-dbas-fired/ @@ -884,7 +1577,6 @@ Articles types: [Successful Anti-Patterns, Storage Requirements]:http://www.sqldoubleg.com/2016/10/19/successful-anti-patterns-storage-requirements/ [SQL Server table columns under the hood]:http://rusanu.com/2011/10/20/sql-server-table-columns-under-the-hood/ [How to analyse SQL Server performance]:http://rusanu.com/2014/02/24/how-to-analyse-sql-server-performance/ -[To BLOB or Not To BLOB: Large Object Storage in a Database or a Filesystem?]:https://www.microsoft.com/en-us/research/publication/to-blob-or-not-to-blob-large-object-storage-in-a-database-or-a-filesystem/ [Asynchronous procedure execution]:http://rusanu.com/2009/08/05/asynchronous-procedure-execution/ [What is the CXPACKET Wait Type, and How Do You Reduce It?]:https://www.brentozar.com/archive/2013/08/what-is-the-cxpacket-wait-type-and-how-do-you-reduce-it/ [New indexes, hypothetically]:https://sqlstudies.com/2016/11/02/new-indexes-hypothetically/ @@ -895,11 +1587,10 @@ Articles types: [Tally OH! An Improved SQL 8K “CSV Splitter” Function]:http://www.sqlservercentral.com/articles/Tally+Table/72993/ [Set Statistics… Profile?]:https://www.brentozar.com/archive/2016/10/set-statistics-profile/ [Hierarchies on Steroids #1: Convert an Adjacency List to Nested Sets]:http://www.sqlservercentral.com/articles/Hierarchy/94040/ -[Optimizing T-SQL queries that change data]:http://sqlblog.com/blogs/paul_white/archive/2013/01/26/optimizing-t-sql-queries-that-change-data.aspx +[Optimizing T-SQL queries that change data]:https://www.sql.kiwi/2013/01/optimizing-t-sql-queries-that-change-data.html [Measuring Query Duration: SSMS vs SQL Sentry Plan Explorer]:https://www.littlekendra.com/2016/09/27/measuring-query-duration-ssms-vs-sql-sentry-plan-explorer/ [Inside the Statistics Histogram & Density Vector]:http://www.sqlpassion.at/archive/2014/01/28/inside-the-statistics-histogram-density-vector/ -[Misconceptions on parameter sniffing]:http://sqlblog.com/blogs/hugo_kornelis/archive/2016/11/03/misconceptions-on-parameter-sniffing.aspx -[CAST vs. CONVERT]:https://blogs.sentryone.com/aaronbertrand/backtobasics-cast-vs-convert/ +[Misconceptions on parameter sniffing]:https://sqlserverfast.com/blog/hugo/2016/11/misconceptions-on-parameter-sniffing/ [What Every Accidental DBA Needs to Know Now: Basics of SQL Security]:http://sqlmag.com/database-security/what-every-accidental-dba-needs-know-now-basics-sql-security [SQL Server Perfmon (Performance Monitor) Best Practices]:https://www.brentozar.com/archive/2006/12/dba-101-using-perfmon-for-sql-performance-tuning/ [Top 5 Overlooked Index Features]:https://www.brentozar.com/archive/2016/11/top-5-overlooked-index-features/ @@ -930,7 +1621,7 @@ Articles types: [Why is This Partitioned Query Slower?]:https://www.brentozar.com/archive/2015/09/why-is-this-partitioned-query-slower/ [A Beginner’s Guide to the True Order of SQL Operations]:https://blog.jooq.org/2016/12/09/a-beginners-guide-to-the-true-order-of-sql-operations/ [Logical Query Processing: What It Is And What It Means to You]:http://sqlmag.com/sql-server/logical-query-processing-what-it-and-what-it-means-you -[Forcing a Parallel Query Execution Plan]:http://sqlblog.com/blogs/paul_white/archive/2011/12/23/forcing-a-parallel-query-execution-plan.aspx +[Forcing a Parallel Query Execution Plan]:https://www.sql.kiwi/2011/12/forcing-a-parallel-query-execution-plan.html [Join Containment Assumption and CE Model Variation]:http://www.queryprocessor.com/ce_join_base_containment_assumption/ [Table Variable Tip]:http://sqlmag.com/t-sql/table-variable-tip [Heap tables in SQL Server]:http://www.sqlhammer.com/heaps-in-microsoft-sql-server/ @@ -941,7 +1632,7 @@ Articles types: [Sync Vs Async Statistics: The Old Debate]:https://sqlserverscotsman.wordpress.com/2016/12/10/sync-vs-async-statistics-the-old-debate/ [Recommended updates and configuration options for SQL Server 2012 and SQL Server 2014 with high-performance workloads]:https://support.microsoft.com/en-gb/kb/2964518 [Troubleshooting SQL Server backup and restore operations]:https://support.microsoft.com/en-us/kb/224071 -[SQL Server 2016: Getting tempdb a little more right]:https://blogs.sentryone.com/aaronbertrand/sql-server-2016-tempdb-fixes/ +[SQL Server 2016: Getting tempdb a little more right]:https://www.sentryone.com/blog/aaronbertrand/sql-server-2016-tempdb-fixes [Practical uses of binary types]:https://sqlsunday.com/2017/01/09/binary-types/ [Backing Up SQL Server Databases is Easier in PowerShell than T-SQL]:http://www.sqlservercentral.com/articles/PowerShell/151510/ [Creating, detaching, re-attaching, and fixing a SUSPECT database]:http://www.sqlskills.com/blogs/paul/creating-detaching-re-attaching-and-fixing-a-suspect-database/ @@ -975,8 +1666,8 @@ Articles types: [New SQL Server Database Request Questionnaire and Checklist]:https://www.mssqltips.com/sqlservertip/3523/new-sql-server-database-request-questionnaire-and-checklist/ [Adding Partitions to the Lower End of a Left Based Partition Function]:https://www.littlekendra.com/2017/02/21/adding-partitions-to-the-lower-end-of-a-left-based-partition-function/ [Don't Panic Busting a File Space Myth]:http://sqlmag.com/database-administration/dont-panic-busting-file-space-myth -[#BackToBasics : Dating Responsibly]:https://blogs.sentryone.com/aaronbertrand/backtobasics-dating-responsibly/ -[#BackToBasics : Common Table Expressions (CTEs)]:https://blogs.sentryone.com/aaronbertrand/backtobasics-ctes/ +[#BackToBasics : Dating Responsibly]:https://www.sentryone.com/blog/aaronbertrand/backtobasics-dating-responsibly/ +[#BackToBasics : Common Table Expressions (CTEs)]:https://www.sentryone.com/blog/aaronbertrand//backtobasics-ctes/ [How to Establish Dedicated Admin Connection (DAC) to SQL Server]:https://www.codeproject.com/tips/1136361/how-to-establish-dedicated-admin-connection-dac-to [SQL and SQL only Best Practice]:http://strictlysql.blogspot.ru/search/label/Best%20Practices [There Is No Difference Between Table Variables, Temporary Tables, and Common Table Expressions]:https://dzone.com/articles/there-is-no-difference-between-table-variables-tem @@ -989,7 +1680,6 @@ Articles types: [ALTER SCHEMA TRANSFER for Zero Downtime Database Upgrades]:http://www.davewentzel.com/content/alter-schema-transfer-zero-downtime-database-upgrades [Delayed Durability in SQL Server 2014]:https://sqlperformance.com/2014/04/io-subsystem/delayed-durability-in-sql-server-2014 [Daylight Savings end affects not only you, but your SQL Server too]:http://www.sqldoubleg.com/2015/10/28/daylight-savings-end-affects-not-only-you-but-your-sql-server-too/ -[Searching Strings in SQL Server is Expensive]:https://www.brentozar.com/archive/2016/10/searching-strings-sql-server-expensive/ [Let’s Corrupt a SQL Server Database Together, Part 1: Clustered Indexes]:https://www.brentozar.com/archive/2017/02/lets-corrupt-sql-server-database-together/ [Let’s Corrupt a Database Together, Part 2: Nonclustered Indexes]:https://www.brentozar.com/archive/2017/02/lets-corrupt-database-together-part-2-nonclustered-indexes/ [The Guide SQL Server Installation Checklist (settings that increase SQL Server Performance)]:https://red9.com/blog/sql-server-installation-checklist/ @@ -1003,14 +1693,13 @@ Articles types: [SQL Server Temporal Tables: How-To Recipes]:https://www.simple-talk.com/sql/sql-training/sql-server-temporal-tables-recipes/ [The Migration Checklist]:http://www.sqlservercentral.com/articles/Editorial/154033/ [Upgrading to SQL Server 2014: A Dozen Things to Check]:https://thomaslarock.com/2014/06/upgrading-to-sql-server-2014-a-dozen-things-to-check/ -[Number of Rows Read / Actual Rows Read warnings in Plan Explorer]:https://sqlperformance.com/2016/06/sql-indexes/actual-rows-read-warnings-plan-explorer [Introducing the Set-based Loop]:http://www.sqlservercentral.com/articles/set-based+loop/127670/ [Representing Hierarchical Data for Mere Mortals]:https://www.simple-talk.com/sql/database-administration/representing-hierarchical-data-for-mere-mortals/ [KPIs For DBAs to Show Their CIOs]:https://thomaslarock.com/2017/03/kpis-dbas-show-cios/ [How To Forecast Database Disk Capacity If You Don’t Have A Monitoring Tool]:http://www.edwinmsarmiento.com/how-to-forecast-database-disk-capacity-if-you-dont-have-a-monitoring-tool/ [Statistical Sampling for Verifying Database Backups]:https://www.simple-talk.com/sql/database-administration/statistical-sampling-for-verifying-database-backups/ [Using dbatools for automated restore and CHECKDB]:http://www.centinosystems.com/blog/sql/using-dbatools-for-automated-restore-and-checkdb/ -[Bad Habits Revival]:https://blogs.sentryone.com/aaronbertrand/bad-habits-revival/ +[Bad Habits Revival]:https://www.sentryone.com/blog/aaronbertrand/bad-habits-revival/ [Deploying Multiple SSIS Projects via PowerShell]:https://www.simple-talk.com/sql/ssis/deploying-multiple-ssis-projects-via-powershell/ [Determining the Cost Threshold for Parallelism]:http://www.scarydba.com/2017/02/28/determining-the-cost-threshold-for-parallelism/ [Identifying a row’s physical location]:http://blog.waynesheffield.com/wayne/archive/2017/03/identifying-rows-physical-location/ @@ -1025,7 +1714,7 @@ Articles types: [Performance Myths: Clustered vs. Non-Clustered Indexes]:https://sqlperformance.com/2017/03/sql-indexes/performance-myths-clustered-vs-non-clustered [Bad habits: Counting rows the hard way]:https://sqlperformance.com/2014/10/t-sql-queries/bad-habits-count-the-hard-way [Why Cost Threshold For Parallelism Shouldn’t Be Set To 5]:https://www.brentozar.com/archive/2017/03/why-cost-threshold-for-parallelism-shouldnt-be-set-to-5/ -[Join Performance, Implicit Conversions, and Residuals]:http://sqlblog.com/blogs/paul_white/archive/2011/07/19/join-performance-implicit-conversions-and-residuals.aspx +[Join Performance, Implicit Conversions, and Residuals]:https://www.sql.kiwi/2011/07/join-performance-implicit-conversions-and-residuals.html [Implicit Conversions that cause Index Scans]:https://www.sqlskills.com/blogs/jonathan/implicit-conversions-that-cause-index-scans/ [When Is It Appropriate To Store JSON in SQL Server?]:https://bertwagner.com/2017/03/14/when-is-it-appropriate-to-store-json-in-sql-server/ [The Performance Penalty of Bookmark Lookups in SQL Server]:http://www.sqlpassion.at/archive/2017/03/13/the-performance-penalty-of-bookmark-lookups-in-sql-server/ @@ -1049,7 +1738,7 @@ Articles types: [Why Is This Query Sometimes Fast and Sometimes Slow]:https://www.brentozar.com/archive/2016/11/query-sometimes-fast-sometimes-slow/ [Using Plan Guides to Remove OPTIMIZE FOR UNKNOWN Hints]:https://www.brentozar.com/archive/2016/11/using-plan-guides-remove-optimize-unknown-hints/ [ETL Best Practices]:https://www.timmitchell.net/etl-best-practices/ -[Resolving Key Lookup Deadlocks with Plan Explorer]:https://blogs.sentryone.com/greggonzalez/key-lookup-deadlocks-plan-explorer/ +[Resolving Key Lookup Deadlocks with Plan Explorer]:https://www.sentryone.com/blog/greggonzalez/key-lookup-deadlocks-plan-explorer/ [Why ROWLOCK Hints Can Make Queries Slower and Blocking Worse in SQL Server]:https://www.littlekendra.com/2016/02/04/why-rowlock-hints-can-make-queries-slower-and-blocking-worse-in-sql-server/ [Does a Clustered Index really physically store the rows in key order]:http://www.sqlservercentral.com/blogs/discussionofsqlserver/2012/10/21/does-a-clustered-index-really-physically-store-the-rows-in-key-order/ [Ugly Pragmatism For The Win]:http://michaeljswart.com/2016/02/ugly-pragmatism-for-the-win/ @@ -1068,20 +1757,20 @@ Articles types: [Switch in Staging Tables Instead of sp_rename]:https://www.littlekendra.com/2017/01/19/why-you-should-switch-in-staging-tables-instead-of-renaming/ [Performance Myths: Table variables are always in-memory]:https://sqlperformance.com/2017/04/performance-myths/table-variables-in-memory [Questions About SQL Server Collations You Were Too Shy to Ask]:https://www.simple-talk.com/sql/sql-development/questions-sql-server-collations-shy-ask/ -[NULL - The database's black hole]:http://sqlblog.com/blogs/hugo_kornelis/archive/2007/07/06/null-ndash-the-database-rsquo-s-black-hole.aspx +[NULL - The database's black hole]:https://sqlserverfast.com/blog/hugo/2007/07/null-the-databases-black-hole/ [Inside the Storage Engine: Using DBCC PAGE and DBCC IND to find out if page splits ever roll back]:http://www.sqlskills.com/blogs/paul/inside-the-storage-engine-using-dbcc-page-and-dbcc-ind-to-find-out-if-page-splits-ever-roll-back/ [Inside the Storage Engine: Anatomy of a page]:http://www.sqlskills.com/blogs/paul/inside-the-storage-engine-anatomy-of-a-page/ -[For The Better Developer: SQL Server Indexes]:http://sqlblog.com/blogs/davide_mauri/archive/2017/04/02/for-the-better-developer-sql-server-indexes.aspx -[#EntryLevel: Compression & Data Types]:https://blogs.sentryone.com/melissaconnors/entry-level-compression/ +[For The Better Developer: SQL Server Indexes]:https://medium.com/sql-server-for-the-better-developer/know-your-data-base-affd6241bcac +[#EntryLevel: Compression & Data Types]:https://www.sentryone.com/blog/melissaconnors/entry-level-compression/ [Cardinality Estimation for a Predicate on a COUNT Expression]:https://sqlperformance.com/2017/04/sql-optimizer/cardinality-count [Changing SQL Server Collation After Installation]:https://www.mssqltips.com/sqlservertip/3519/changing-sql-server-collation-after-installation/ [Does a TempDB spill mean statistics are out of date?]:https://www.brentozar.com/archive/2017/04/tempdb-spill-mean-statistics-date/ [Transaction log growth during BACKUP]:https://www.am2.co/2017/04/transaction-log-growth-backup/ -[When is a SQL function not a function?]:http://sqlblog.com/blogs/rob_farley/archive/2011/11/08/when-is-a-sql-function-not-a-function.aspx +[When is a SQL function not a function?]:http://blogs.lobsterpot.com.au/2011/11/08/when-is-a-sql-function-not-a-function/ [Introducing Batch Mode Adaptive Joins]:https://blogs.msdn.microsoft.com/sqlserverstorageengine/2017/04/19/introducing-batch-mode-adaptive-joins/ [Investigating the proportional fill algorithm]:https://www.sqlskills.com/blogs/paul/investigating-the-proportional-fill-algorithm/ [Understanding Logging and Recovery in SQL Server]:https://technet.microsoft.com/en-us/library/2009.02.logging.aspx -[Bad Habits to Kick: Using shorthand with date/time operations]:http://sqlblog.com/blogs/aaron_bertrand/archive/2011/09/20/bad-habits-to-kick-using-shorthand-with-date-time-operations.aspx +[Bad Habits to Kick: Using shorthand with date/time operations]:https://sqlblog.org/2011/09/20/bad-habits-to-kick-using-shorthand-with-date-time-operations [Generating Charts and Drawings in SQL Server Management Studio]:http://sqlmag.com/t-sql/generating-charts-and-drawings-sql-server-management-studio [How expensive are column-side Implicit Conversions?]:https://sqlperformance.com/2013/04/t-sql-queries/implicit-conversion-costs [Execution Plan Basics]:https://www.simple-talk.com/sql/performance/execution-plan-basics/ @@ -1099,7 +1788,6 @@ Articles types: [Row-count Estimates when there are no Statistics]:http://www.sqlservercentral.com/blogs/matthew-mcgiffen-dba/2017/06/28/row-count-estimates-when-there-are-no-statistics/ [SQL Server DBA On-Boarding Checklist]:https://www.mssqltips.com/sqlservertip/4871/sql-server-dba-onboarding-checklist/ [Be Wary of Date Formatting in T-SQL]:https://bornsql.ca/2017/07/wary-date-formatting-t-sql/ -[The ultimate guide to the datetime datatypes]:http://www.karaszi.com/SQLServer/info_datetime.asp [Statistics and Cardinality Estimation]:http://www.sqlservercentral.com/blogs/matthew-mcgiffen-dba/2017/06/20/statistics-and-cardinality-estimation/ [Message queues for the DBA: sending data out into the world]:http://port1433.com/2017/07/21/messaging-queuing-for-the-dba-sending-data-out-into-the-world/ [Schema-Based Access Control for SQL Server Databases]:https://www.red-gate.com/simple-talk/sql/sql-training/schema-based-access-control-for-sql-server-databases/ @@ -1127,16 +1815,14 @@ Articles types: [The Ultimate SQL Server JSON Cheat Sheet]:https://bertwagner.com/2017/03/07/the-ultimate-sql-server-json-cheat-sheet/ [Are your indexes being thwarted by mismatched datatypes?]:https://bertwagner.com/2017/08/01/are-your-indexes-being-thwarted-by-mismatched-datatypes/ [Why Missing Index Recommendations Aren’t Perfect]:https://www.brentozar.com/archive/2017/08/missing-index-recommendations-arent-perfect/ -[Top 5 Misleading SQL Server Performance Counters]:https://sqlworkbooks.com/2017/06/top-5-misleading-sql-server-performance-counters/ [The Case of the Space at the End]:http://www.sqlservercentral.com/articles/ANSI_PADDING/157467/ [SELECT…INTO in SQL Server 2017]:https://dbafromthecold.com/2017/08/02/select-into-in-sql-server-2017/ [Your Service Level Agreement is a Disaster]:http://minionware.net/service-level-agreement-disaster/ [SQLskills SQL101: REBUILD vs. REORGANIZE]:https://www.sqlskills.com/blogs/paul/sqlskills-sql101-rebuild-vs-reorganize/ [Where do the Books Online index fragmentation thresholds come from?]:https://www.sqlskills.com/blogs/paul/where-do-the-books-online-index-fragmentation-thresholds-come-from/ -[The SQL Hall of Shame]:http://sqlblog.com/blogs/adam_machanic/archive/2017/06/14/the-sql-hall-of-shame.aspx +[The SQL Hall of Shame]:http://dataeducation.com/the-sql-hall-of-shame/ [A Better Way To Select Star]:https://www.brentozar.com/archive/2017/07/better-way-select-star/ [UDP vs TCP]:https://sqlstudies.com/2017/06/07/udp-vs-tcp/ -[When a Nonclustered Index and Statistics Make a Query Slower]:https://sqlworkbooks.com/2017/05/when-a-nonclustered-index-and-statistics-make-a-query-slower/ [Lipoaspiration in your SQL Server Database]:https://www.red-gate.com/simple-talk/sql/performance/lipoaspiration-in-your-sql-server-database/ [13 Things You Should Know About Statistics and the Query Optimizer]:https://www.red-gate.com/simple-talk/sql/t-sql-programming/13-things-you-should-know-about-statistics-and-the-query-optimizer/ [Creating R Stored Procedures in SQL Server 2016 Using sqlrutils]:http://www.nielsberglund.com/2017/06/25/creating-r-stored-procedures-in-sql-server-2016-using-sqlrutils/ @@ -1156,9 +1842,7 @@ Articles types: [Dynamic Data Unmasking]:https://orderbyselectnull.com/2017/08/25/dynamic-data-unmasking/ [Why is My Database Application so Slow?]:https://www.red-gate.com/simple-talk/dotnet/net-performance/database-application-slow/ [Generating Concurrent Activity]:http://michaeljswart.com/2014/01/generating-concurrent-activity/ -[Required Testing for Installing SQL Server Cumulative Updates and Service Packs]:http://littlekendra.com/2016/04/28/required-testing-for-installing-sql-server-cumulative-updates-and-service-packs/ [Microsoft SQL Server R Services - Internals X]:http://www.nielsberglund.com/2017/08/29/microsoft-sql-server-r-services-internals-x/ -[Clustered columnstore: on-disk vs. in-mem]:http://nedotter.com/archive/2017/03/clustered-columnstore-on-disk-vs-in-mem/ [Hands on Full-Text Search in SQL Server]:https://www.sqlshack.com/hands-full-text-search-sql-server/ [SQL Code Smells]:https://www.red-gate.com/simple-talk/sql/t-sql-programming/sql-code-smells/ [Corruption demo databases and scripts]:https://www.sqlskills.com/blogs/paul/corruption-demo-databases-and-scripts/ @@ -1170,7 +1854,7 @@ Articles types: [Using native compilation to insert parent/child tables]:http://nedotter.com/archive/2017/09/using-native-compilation-to-insert-parentchild-tables/ [Questions About RDS SQL Server You Were Too Shy to Ask]:https://www.red-gate.com/simple-talk/cloud/cloud-data/questions-rds-sql-server-shy-ask/ [Active Directory Authentication with SQL Server on Ubuntu]:http://port1433.com/2017/09/19/active-directory-authentication-with-sql-server-on-ubuntu/ -[Temporary Tables in Stored Procedures]:http://sqlblog.com/blogs/paul_white/archive/2012/08/15/temporary-tables-in-stored-procedures.aspx +[Temporary Tables in Stored Procedures]:https://www.sql.kiwi/2012/08/temporary-tables-in-stored-procedures.html [SQLCLR in Practice: Creating a Better Way of Sending Email from SQL Server]:https://www.red-gate.com/simple-talk/sql/sql-development/sqlclr-practice-creating-better-way-sending-email-sql-server/ [T-SQL commands performance comparison – NOT IN vs NOT EXISTS vs LEFT JOIN vs EXCEPT]:https://www.sqlshack.com/t-sql-commands-performance-comparison-not-vs-not-exists-vs-left-join-vs-except/ [Clustered vs Nonclustered: Index Fundamentals You Need To Know]:https://bertwagner.com/2017/09/26/clustered-vs-nonclustered-index-fundamentals-you-need-to-know/ @@ -1196,7 +1880,6 @@ Articles types: [Say NO to Venn Diagrams When Explaining JOINs]:https://blog.jooq.org/2016/07/05/say-no-to-venn-diagrams-when-explaining-joins/ [Surprise Delta Stores]:https://orderbyselectnull.com/2017/11/07/delta-stores/ [SQL 2014 Clustered Columnstore index rebuild and maintenance considerations]:https://blogs.msdn.microsoft.com/sqlcat/2015/07/08/sql-2014-clustered-columnstore-index-rebuild-and-maintenance-considerations/ -[The Case of the Weirdly Long COLUMNSTORE_BUILD_THROTTLE Wait]:https://sqlworkbooks.com/2017/11/the-case-of-the-weirdly-long-columnstore_build_throttle-wait/ [Multiple Output Datasets With R and SQL Server]:https://itsalljustelectrons.blogspot.ru/2017/11/Multiple-Output-Datasets-with-R-and-SQL-Server.html [How to Avoid Excessive Sorts in Window Functions]:https://blog.jooq.org/2017/11/06/how-to-avoid-excessive-sorts-in-window-functions/ [Extracting a DAX Query Plan With Analysis Services 2016 Extended Events]:https://www.mssqltips.com/sqlservertip/5106/extracting-a-dax-query-plan-with-analysis-services-2016-extended-events/ @@ -1218,11 +1901,10 @@ Articles types: [Cleanly Uninstalling Stubborn SQL Server Components]:https://www.mssqltips.com/sqlservertip/4050/cleanly-uninstalling-stubborn-sql-server-components/ [Hey! What's the deal with SQL Server NOCOUNT and T-SQL WHILE loops?]:http://sql-sasquatch.blogspot.ru/2017/11/hey-whats-deal-with-nocount-and-t-sql.html [Query Store Settings]:https://www.sqlskills.com/blogs/erin/query-store-settings/ -[Using Plan Explorer with Entity Framework]:https://blogs.sentryone.com/jasonhall/using-plan-explorer-entity-framework/ +[Using Plan Explorer with Entity Framework]:https://www.sentryone.com/blog/jasonhall/using-plan-explorer-entity-framework/ [Overview of Encryption Tools in SQL Server]:https://matthewmcgiffen.com/2017/12/05/overview-of-encryption-tools-in-sql-server/ [Clustered Index Uniquifier Existence and Size]:https://sqlquantumleap.com/2017/09/18/clustered-index-uniquifier-existence-and-size/ -[Understanding Logging and Recovery in SQL Server]:https://technet.microsoft.com/en-us/library/2009.02.logging.aspx -[Understanding SQL Server Backups]:https://technet.microsoft.com/en-us/library/2009.07.sqlbackup.aspx +[Understanding SQL Server Backups]:https://docs.microsoft.com/en-us/previous-versions/technet-magazine/dd822915(v=msdn.10) [Recovering from Disasters Using Backups]:https://technet.microsoft.com/en-us/library/ee677581.aspx [Simple SQL: Handling Location Datatypes]:https://www.red-gate.com/simple-talk/sql/t-sql-programming/simple-sql-handling-location-datatypes/ [Improve SQL Server Performance by Looking at Plan Cache (Part 1)]:https://logicalread.com/sql-server-minimize-single-use-plans-tl01/ @@ -1242,13 +1924,11 @@ Articles types: [A Method to Find Trace Flags]:https://rebrand.ly/joe-finding-undocumented-trace-flags [Using Windows stored credentials to connect to SQL in containers]:https://dbafromthecold.com/2018/01/17/using-windows-stored-credentials-to-connect-to-sql-in-containers/ [Step by Step Guide to Migrate SQL Server Data to SQL Server 2017]:https://www.databasejournal.com/features/mssql/step-by-step-guide-to-migrate-sql-server-data-to-sql-server-2017.html -[Nasty Fast PERCENT_RANK]:http://www.sqlservercentral.com/articles/PERCENT_RANK/141532/ [Administrative Logins and Users]:https://sqlstudies.com/2015/11/02/administrative-logins-and-users/ [Parallelism in Hekaton (In-Memory OLTP)]:http://www.nikoport.com/2018/01/20/parallelism-in-hekaton-in-memory-oltp/ [Troubleshooting THREADPOOL Waits]:https://www.sqlpassion.at/archive/2011/10/25/troubleshooting-threadpool-waits/ [Andy’s Excellent SSIS-in-the-Cloud Adventure, Part 1 – Build an ADFv2 IR Instance]:https://andyleonard.blog/2018/01/andys-excellent-ssis-in-the-cloud-adventure-part-1/ [PRINT vs. RAISERROR]:http://sqlity.net/en/984/print-vs-raiserror/ -[Does a Clustered Index Give a Default Ordering?]:https://sqlworkbooks.com/2018/02/does-a-clustered-index-give-a-default-ordering/ [Without ORDER BY, You Can’t Depend On the Order of Results]:http://michaeljswart.com/2013/09/without-order-by-you-cant-depend-on-the-order-of-results/ [Query Store and “in memory”]:https://www.sqlskills.com/blogs/erin/query-store-and-in-memory/ [Setting and Identifying Row Goals in Execution Plans]:https://sqlperformance.com/2018/02/sql-plan/setting-and-identifying-row-goals @@ -1283,11 +1963,10 @@ Articles types: [Digitally Signing a Stored Procedure To Allow It To Run With Elevated Permissions]:https://sqlundercover.com/2018/05/02/digitally-signing-a-stored-procedure-to-allow-it-to-run-with-elevated-permissions/ [NOLOCK and Top Optimization]:https://www.sqlshack.com/nolock-and-top-optimization/ [Operator Precedence versus the Confusing Constraint Translation]:https://www.red-gate.com/simple-talk/blogs/operator-precedence-versus-confusing-constraint-translation/ -[Interval Queries in SQL Server]:http://www.itprotoday.com/software-development/interval-queries-sql-server [Query Trace Column Values]:https://www.sqlshack.com/query-trace-column-values/ [Concurrency Week: How to Delete Just Some Rows from a Really Big Table]:https://www.brentozar.com/archive/2018/04/how-to-delete-just-some-rows-from-a-really-big-table/ [Break large delete operations into chunks]:https://sqlperformance.com/2013/03/io-subsystem/chunk-deletes -[How to perform a page level restore in SQL Server]:https://www.sqlshack.com/how-to-perform-a-page-level-restore-in-sql-server/ +[How to perform a page level restore in SQL Server - Jayaram]:https://www.sqlshack.com/how-to-perform-a-page-level-restore-in-sql-server/ [Grouping dates without blocking operators]:https://sqlsunday.com/2018/05/14/grouping-dates-without-blocking-operators/ [What’s CHECKDB doing in my database restore?]:http://www.mikefal.net/2018/04/10/whats-checkdb-doing-in-my-database-restore/ [How To Hide An Instance Of SQL Server]:https://thomaslarock.com/2018/04/how-to-hide-an-instance-of-sql-server/ @@ -1305,7 +1984,6 @@ Articles types: [How to implement error handling in SQL Server]:https://www.sqlshack.com/how-to-implement-error-handling-in-sql-server/ [SQL Server Closure Tables]:https://www.red-gate.com/simple-talk/sql/t-sql-programming/sql-server-closure-tables/ [Deadlock victim choice in SQL Server - an exception?]:http://joshthecoder.com/2018/05/10/deadlock-victim-choice-an-exception.html -[Azure and Windows PowerShell: The Basics]:https://www.red-gate.com/simple-talk/sysadmin/powershell/azure-windows-powershell-basics/ [Azure and Windows PowerShell: Getting Information]:https://www.red-gate.com/simple-talk/sysadmin/powershell/azure-and-windows-powershell-getting-information/ [Be our guest, be our guest, put our database to the test]:https://sqlstudies.com/2018/06/25/be-our-guest-be-our-guest-put-our-database-to-the-test/ [Finding code smells using SQL Prompt: the SET NOCOUNT problem (PE008 and PE009)]:https://www.red-gate.com/hub/product-learning/sql-prompt/finding-code-smells-using-sql-prompt-set-nocount-problem-pe008-pe009 @@ -1320,8 +1998,8 @@ Articles types: [Optimization Thresholds – Grouping and Aggregating Data, Part 4]:https://sqlperformance.com/2018/07/sql-performance/grouping-and-aggregating-part-4 [Optimization Thresholds – Grouping and Aggregating Data, Part 5]:https://sqlperformance.com/2018/08/sql-performance/grouping-and-aggregating-part-5 [When DBCC OpenTran doesn’t list all open transactions]:https://blogs.msdn.microsoft.com/mosharaf/2013/02/17/when-dbcc-opentran-doesnt-list-all-open-transactions/ -[How I spot not-yet-documented features in SQL Server CTPs]:https://blogs.sentryone.com/aaronbertrand/fishing-for-features-in-ctps/ -[More ways to discover changes in new versions of SQL Server]:https://blogs.sentryone.com/aaronbertrand/more-changes-sql-server/ +[How I spot not-yet-documented features in SQL Server CTPs]:https://www.sentryone.com/blog/aaronbertrand/fishing-for-features-in-ctps/ +[More ways to discover changes in new versions of SQL Server]:https://www.sentryone.com/blog/aaronbertrand/more-changes-sql-server/ [Tail-Log Backup and Restore in SQL Server]:https://www.sqlshack.com/tail-log-backup-and-restore-in-sql-server/ [Database Filegroup(s) and Piecemeal restores in SQL Server]:https://www.sqlshack.com/database-filegroups-and-piecemeal-restores-in-sql-server/ [Updating Statistics with Ola Hallengren’s Script]:https://www.sqlskills.com/blogs/erin/updating-statistics-with-ola-hallengrens-script/ @@ -1331,7 +2009,6 @@ Articles types: [Can Rowstore Compression Beat Columnstore Compression?]:https://orderbyselectnull.com/2018/06/28/can-rowstore-compression-beat-columnstore-compression/ [Inside the Storage Engine: Anatomy of a record]:https://www.sqlskills.com/blogs/paul/inside-the-storage-engine-anatomy-of-a-record/ [Inside the Storage Engine: Anatomy of an extent]:https://www.sqlskills.com/blogs/paul/inside-the-storage-engine-anatomy-of-an-extent/ -[Inside the Storage Engine: Anatomy of a page]:https://www.sqlskills.com/blogs/paul/inside-the-storage-engine-anatomy-of-a-page/ [Inside the Storage Engine: IAM pages, IAM chains, and allocation units]:https://www.sqlskills.com/blogs/paul/inside-the-storage-engine-iam-pages-iam-chains-and-allocation-units/ [Inside The Storage Engine: GAM, SGAM, PFS and other allocation maps]:https://www.sqlskills.com/blogs/paul/inside-the-storage-engine-gam-sgam-pfs-and-other-allocation-maps/ [Disaster recovery 101: fixing a broken boot page]:https://www.sqlskills.com/blogs/paul/disaster-recovery-101-fixing-a-broken-boot-page/ @@ -1366,7 +2043,7 @@ Articles types: [SQL queries to manage hierarchical or parent-child relational rows in SQL Server]:https://www.codeproject.com/Articles/818694/SQL-queries-to-manage-hierarchical-or-parent-child [Choosing Between Table Variables and Temporary Tables]:https://www.red-gate.com/hub/product-learning/sql-prompt/choosing-table-variables-temporary-tables [What's New in the First Public CTP of SQL Server 2019]:https://www.mssqltips.com/sqlservertip/5710/whats-new-in-the-first-public-ctp-of-sql-server-2019/ -[SQL Server support for TLS 1.2 – Read This First!]:https://blogs.sentryone.com/aaronbertrand/tls-1-2-support-read-first/ +[SQL Server support for TLS 1.2 – Read This First!]:https://www.sentryone.com/blog/aaronbertrand/tls-1-2-support-read-first/ [Misconceptions in SQL Server: A Trio of table variables]:https://sqlinthewild.co.za/index.php/2010/10/12/a-trio-of-table-variables/ [Using the Same Column Twice in a SQL UPDATE Statement]:https://www.sqltheater.com/blog/using-the-same-column-twice-in-an-update-statement/ [How to perform a performance test against a SQL Server instance]:https://www.sqlshack.com/how-to-perform-a-performance-test-against-a-sql-server-instance/ @@ -1403,7 +2080,6 @@ Articles types: [Preparation for SQL Server Installation]:https://sqlplayer.net/2018/12/preparation-for-sql-server-installation/ [Executing xp_cmdshell with Non SysAdmin Account]:http://www.lucasnotes.com/2019/01/executing-xpcmdshell-with-non-sysadmin.html [Generating SQL using Biml (T-SQL Tuesday #110)]:https://www.cathrinewilhelmsen.net/2019/01/08/generating-sql-using-biml/ -[Avoiding SQL Server Upgrade Performance Issues]:https://www.sqlskills.com/blogs/glenn/avoiding-sql-server-upgrade-performance-issues/ [Using Temporary Procedures]:https://www.red-gate.com/simple-talk/blogs/using-temporary-procedures/ [Introduction to SQL Server Security — Part 1]:https://www.red-gate.com/simple-talk/sysadmin/data-protection-and-privacy/introduction-to-sql-server-security-part-1/ [Introduction to SQL Server Security — Part 2]:https://www.red-gate.com/simple-talk/sysadmin/data-protection-and-privacy/introduction-to-sql-server-security-part-2/ @@ -1428,7 +2104,6 @@ Articles types: [How to perform a Page Level Restore in SQL Server]:https://sqlperfmon.blogspot.com/2016/07/how-to-perform-page-level-restore-in.html [How Much Memory Does SSIS Need?]:https://www.timmitchell.net/post/2019/05/02/how-much-memory-does-ssis-need/ [The Curious Case of… trying to find an MDF file in a RAW disk]:https://www.sqlskills.com/blogs/paul/the-curious-case-of-trying-to-find-an-mdf-file-in-a-raw-disk/ -[Understanding the SQL Server NOLOCK hint]:https://www.mssqltips.com/sqlservertip/2470/understanding-the-sql-server-nolock-hint/ [Methods to Insert Data into SQL Server]:https://www.sqlshack.com/methods-to-insert-data-into-sql-server/ [Batching data manipulation is great as long as you do it correctly]:http://desertdba.com/batching-data-manipulation-is-great/ [Azure and Windows PowerShell: Using VM Extensions]:https://www.red-gate.com/simple-talk/sysadmin/powershell/azure-and-windows-powershell-using-vm-extensions/ @@ -1460,10 +2135,9 @@ Articles types: [Difference between Identity & Sequence in SQL Server]:https://www.sqlshack.com/difference-between-identity-sequence-in-sql-server/ [Does the Rowmodctr Update for Non-Updating Updates?]:https://www.brentozar.com/archive/2019/05/does-the-rowmodctr-update-for-non-updating-updates/ [An Intro To Data Modeling]:https://donedifferent.data.blog/2019/04/12/an-intro-to-data-modeling/ -[On telemetry and other data collected by SQL Server]:https://blogs.sentryone.com/aaronbertrand/sql-server-telemetry/ +[On telemetry and other data collected by SQL Server]:https://www.sentryone.com/blog/aaronbertrand/sql-server-telemetry/ [Purging data with batched deletes]:https://am2.co/2019/04/purging-data-with-batched-deletes/ [Don’t Forget RoboCopy]:https://sqlrus.com/2019/05/dont-forget-robocopy/ -[Understanding the graphical representation of the SQL Server Deadlock Graph]:https://www.sqlshack.com/understanding-graphical-representation-sql-server-deadlock-graph/ [Understanding the XML description of the Deadlock Graph in SQL Server]:https://www.sqlshack.com/understanding-the-xml-description-of-the-deadlock-graph-in-sql-server/ [What Is The Difference Between Checkpoint And Lazy Writer]:https://saurabhsinhainblogs.blogspot.com/2012/10/interview-question-checkpoint-and-lazy.html?m=1 [Efficiently Indexing Long Character Strings]:https://voluntarydba.com/2013/07/30/efficiently-indexing-long-character-strings/ @@ -1529,8 +2203,708 @@ Articles types: [Dr. OUTPUT or: How I Learned to Stop Worrying and Love the MERGE]:http://dataeducation.com/dr-output-or-how-i-learned-to-stop-worrying-and-love-the-merge/ [SQL Server Tipping Games – Why Non-Clustered Indexes are just ignored!]:https://www.sqlpassion.at/archive/2013/06/12/sql-server-tipping-games-why-non-clustered-indexes-are-just-ignored/ [SQL Server Guide To NULL Handling]:https://gavindraper.com//2018/11/29/SQL-Server-Guide-To-NULL-Handling/ -[Data Compression + Backup Compression = Double Compression?]:https://jesspomfret.com/double-compression/ [Living with SQL’s 900 Byte Index Key Length Limit]:https://blogs.msdn.microsoft.com/bartd/2011/01/06/living-with-sqls-900-byte-index-key-length-limit/ -[Memory-Optimized TempDB Metadata in SQL Server 2019]:https://www.sqlshack.com/memory-optimized-tempdb-metadata-in-sql-server-2019/ +[Memory-Optimized TempDB Metadata in SQL Server 2019 - SQLHack]:https://www.sqlshack.com/memory-optimized-tempdb-metadata-in-sql-server-2019/ [Forcing A Plan That Has A Plan Guide]:https://www.scarydba.com/2018/11/26/forcing-a-plan-that-has-a-plan-guide/ [Remember the Default Window]:https://voiceofthedba.com/2018/08/23/remember-the-default-window/ +[The Impact of Non-Updating Updates]:https://www.sql.kiwi/2010/08/the-impact-of-non-updating-updates.html +[What are Columnstore Indexes?]:https://www.red-gate.com/simple-talk/sql/sql-development/what-are-columnstore-indexes/ +[PolyBase in SQL Server 2019 – The End of ETL?]:https://www.red-gate.com/simple-talk/sql/data-platform/polybase-in-sql-server-2019-the-end-of-etl/ +[Overview of Service Principal Name and Kerberos authentication in SQL Server]:https://www.sqlshack.com/overview-of-service-principal-name-and-kerberos-authentication-sql-server/ +[Data Transfer Strategies between MongoDB and SQL Server]:https://www.sqlservercentral.com/articles/data-transfer-strategies-between-mongodb-and-sql-server +[SQL Server and Excel Hierarchyid Example for Organization Charts]:https://www.mssqltips.com/sqlservertip/6054/sql-server-and-excel-hierarchyid-example-for-organization-charts/ +[Difference between sp_execute and sp_executesql and exec]:https://www.sqlindia.com/difference-between-sp_execute-sp_executesql-exec/ +[EXEC and sp_executesql – how are they different?]:https://www.sqlskills.com/blogs/kimberly/exec-and-sp_executesql-how-are-they-different/ +[Little Bobby Tables, SQL Injection and EXECUTE AS]:https://www.sqlskills.com/blogs/kimberly/little-bobby-tables-sql-injection-and-execute-as/ +[Examining the Performance Impact of an Adhoc Workload]:https://sqlperformance.com/2019/05/sql-plan/perf-impact-adhoc-workload +[Backup to URL]:https://blog.coeo.com/backup-to-url +[Spotting Unauthorized Configuration Settings in SQL Server]:https://www.red-gate.com/hub/product-learning/sql-monitor/spotting-unauthorized-configuration-settings-sql-server +[Window Functions in SQL Server]:https://www.red-gate.com/simple-talk/sql/learn-sql-server/window-functions-in-sql-server/ +[Window Functions in SQL Server: Part 2-The Frame]:https://www.red-gate.com/simple-talk/sql/learn-sql-server/window-functions-in-sql-server-part-2-the-frame/ +[An Intro to SQL Window Functions]:https://www.toptal.com/sql/intro-to-sql-windows-functions +[SQL Database Performance Tuning for Developers]:https://www.toptal.com/sql-server/sql-database-tuning-for-developers +[“But NOLOCK Is Okay When The Data Isn’t Changing, Right?”]:https://www.brentozar.com/archive/2019/08/but-nolock-is-okay-when-the-data-isnt-changing-right/ +[tempdb Enhancements in SQL Server 2019]:https://sqlperformance.com/2019/08/tempdb/tempdb-enhancements-in-sql-server-2019 +[Feature Restrictions in SQL Server 2019 are Worse Than Useless: a False Sense of Security And Wasted Opportunity]:https://sqlquantumleap.com/2019/08/05/feature-restrictions-in-sql-server-2019-are-worse-than-useless-a-false-sense-of-security-and-wasted-opportunity/ +[How to get SQL Server Sysadmin Privileges as a Local Admin with PowerUpSQL]:https://blog.netspi.com/get-sql-server-sysadmin-privileges-local-admin-powerupsql/ +[Views of the Same Problem: Network Admin, DBA, and Developer]:https://blog.serverfault.com/2011/03/16/views-of-the-same-problem-network-admin-dba-and-developer/ +[Finding Max Concurrent Operations With T-SQL (Part 1)]:https://36chambers.wordpress.com/2019/01/02/finding-max-concurrent-operations-with-t-sql-part-1/ +[Finding Max Concurrent Operations With T-SQL (Part 2)]:https://36chambers.wordpress.com/2019/01/03/finding-max-concurrent-operations-with-t-sql-part-2/ +[Stack Overflow: The Architecture - 2016 Edition]:https://nickcraver.com/blog/2016/02/17/stack-overflow-the-architecture-2016-edition/ +[Stack Overflow: The Hardware - 2016 Edition]:https://nickcraver.com/blog/2016/03/29/stack-overflow-the-hardware-2016-edition/ +[Stack Overflow: How We Do Deployment - 2016 Edition]:https://nickcraver.com/blog/2016/05/03/stack-overflow-how-we-do-deployment-2016-edition/ +[Stack Overflow: How We Do Monitoring - 2018 Edition]:https://nickcraver.com/blog/2018/11/29/stack-overflow-how-we-do-monitoring/ +[Stack Overflow: How We Do App Caching - 2019 Edition]:https://nickcraver.com/blog/2019/08/06/stack-overflow-how-we-do-app-caching/ +[Adding a Missing Index Killed Performance]:https://www.sqlrx.com/missing-index-killed-performance/ +[Corruption in TempDB]:https://stevestedman.com/2019/08/corruption-in-tempdb/ +[Corruption recovery using DBCC WRITEPAGE]:https://www.sqlskills.com/blogs/paul/corruption-recovery-using-dbcc-writepage/ +[Why DBCC CHECKDB can miss memory corruption]:https://www.sqlskills.com/blogs/paul/sqlskills-sql101-why-dbcc-checkdb-can-miss-memory-corruption/ +[Plan Stitch: Harnessing the Best of Many Plans]:https://www.microsoft.com/en-us/research/publication/plan-stitch-harnessing-the-best-of-many-plans-2/ +[Query and Resource Optimization: Bridging the Gap]:https://www.microsoft.com/en-us/research/publication/query-resource-optimization-bridging-gap/ +[Cuttlefish: A Lightweight Primitive for Adaptive Query Processing]:https://www.microsoft.com/en-us/research/publication/cuttlefish-a-lightweight-primitive-for-adaptive-query-processing/ +[Leveraging Re-costing for Online Optimization of Parameterized Queries with Guarantees]:https://www.microsoft.com/en-us/research/publication/leveraging-re-costing-online-optimization-parameterized-queries-guarantees/ +[How to choose antivirus software to run on computers that are running SQL Server]:https://support.microsoft.com/help/309422 +[Why is SYSDATETIME() slower than SYSUTCDATETIME()?]:https://erikdarlingdata.com/2019/05/why-is-sysdatetime-slower-than-sysutcdatetime/ +[Constant Time Recovery in Azure SQL Database]:https://www.microsoft.com/en-us/research/publication/constant-time-recovery-in-azure-sql-database/ +[Improving Optimistic Concurrency Control Through Transaction Batching and Operation Reordering]:https://www.microsoft.com/en-us/research/publication/improving-optimistic-concurrency-control-through-transaction-batching-and-operation-reordering/ +[An Empirical Evaluation of In-Memory Multi-Version Concurrency Control]:https://www.cs.cmu.edu/~pavlo/papers/p781-wu.pdf +[Automatically Indexing Millions of Databases in Microsoft Azure SQL Database]:https://www.microsoft.com/en-us/research/publication/automatically-indexing-millions-of-databases-in-microsoft-azure-sql-database/ +[Adding a Column with a Default Constraint]:https://matthewmcgiffen.com/2019/07/16/adding-a-column-with-a-default-constraint/ +[A Hidden Value Of Apply]:https://erikdarlingdata.com/2019/06/a-hidden-value-of-apply/ +[Improve Performance of UDFs with NULL ON NULL INPUT]:https://sqlperformance.com/2018/12/sql-performance/improve-udfs-null-on-null-input +[The ‘= NULL’ Mistake and other SQL NULL Heresies]:https://www.red-gate.com/hub/product-learning/sql-prompt/the-null-mistake-and-other-sql-null-heresies +[How to Corrupt a Database]:https://www.sqlserverscience.com/tools/how-to-corrupt-a-database/ +[SQL Server Page Types]:http://www.sqlnotes.info/2011/10/31/page-type/ +[SQL Server Index Maintenance – You’re Doing It Wrong]:http://www.seangallardy.com/sql-server-index-maintenance-youre-doing-it-wrong/ +[Stop Worrying About SQL Server Fragmentation]:https://www.brentozar.com/archive/2012/08/sql-server-index-fragmentation/ +[How much will it cost or save to rebuild that index?]:https://www.sqlservercentral.com/articles/rebuild-index +[To BLOB or Not To BLOB: Large Object Storage in a Database or a Filesystem?]:https://www.microsoft.com/en-us/research/wp-content/uploads/2006/04/tr-2006-45.pdf +[SQL Server UPSERT Patterns and Antipatterns]:https://michaeljswart.com/2017/07/sql-server-upsert-patterns-and-antipatterns/ +[“UPSERT” Race Condition With MERGE]:https://weblogs.sqlteam.com/dang/2009/01/31/upsert-race-condition-with-merge/ +[Use Caution with SQL Server's MERGE Statement]:https://www.mssqltips.com/sqlservertip/3074/use-caution-with-sql-servers-merge-statement/ +[Checking for potential constraint violations before entering SQL Server TRY and CATCH logic]:https://www.mssqltips.com/sqlservertip/2632/checking-for-potential-constraint-violations-before-entering-sql-server-try-and-catch-logic/ +[Performance impact of different error handling techniques]:https://sqlperformance.com/2012/08/t-sql-queries/error-handling +[Backup and Restore Databases with CHECKSUM and VERIFYONLY]:https://www.sqlrx.com/backup-and-restore-databases-with-checksum-and-verifyonly/ +[dm_db_database_page_allocations]:https://www.sqlserverscience.com/sys/dm_db_database_page_allocations/ +[Compress Big Tables]:https://www.sqlserverscience.com/performance/compress-big-tables/ +[Hardening SQL Server Security]:https://mitchwheat.com/2019/08/21/hardening-sql-server-security/ +[Splitting Strings With OPENJSON]:https://itsalljustelectrons.blogspot.com/2019/05/Splitting-Strings-With-OPENJSON.html +[How to migrate to Amazon RDS for SQL Server using transactional replication]:https://aws.amazon.com/ru/blogs/database/how-to-migrate-to-amazon-rds-for-sql-server-using-transactional-replication/ +[The Hardest Part Of Query Tuning: Logical Equivalence]:https://erikdarlingdata.com/2019/08/the-hardest-part-of-query-tuning-logical-equivalence/ +[SQL Injection: What is it? Causes and exploits]:https://www.sqlshack.com/sql-injection-what-is-it-causes-and-exploits/ +[SQL Injection: Detection and prevention]:https://www.sqlshack.com/sql-injection-detection-and-prevention/ +[Some T-SQL INSERTs DO Follow the Fill Factor!]:https://www.sqlservercentral.com/articles/some-t-sql-inserts-do-follow-the-fill-factor-sql-oolie +[Install SQL Server 2019 Big Data Cluster using Azure Data Studio]:https://nielsberglund.com/2019/09/11/install-sql-server-2019-big-data-cluster-using-azure-data-studio/ +[Ghost Records in SQL Server… Now whats that ????]:https://www.sqlservergeeks.com/sql-server-ghost-records-in-sql-server-now-whats-that/ +[Transaction Isolation Levels and sp_executesql]:https://www.sqlserverscience.com/basics/stored-procedure-dynamic-sql-execute-as/ +[Batch Mode Bitmaps in SQL Server]:https://sqlperformance.com/2019/08/sql-performance/batch-mode-bitmaps-in-sql-server +[Transparent Data Encryption (TDE) on Azure SQL database]:https://www.sqlshack.com/transparent-data-encryption-tde-on-the-azure-sql-database/ +[Analyzing Estimates from the CSelCalcAscendingKeyFilter Calculator]:https://www.joshthecoder.com/2019/08/21/analyzing-estimates-cselcalcascendingkeyfilter-calculator.html +[Building Storage for SQL Server (and other database) Virtual Machines in the Cloud]:https://joeydantoni.com/2019/09/18/building-storage-for-sql-server-and-other-database-virtual-machines-in-the-cloud/ +[SQL Server Simple and Forced Parameterization]:https://www.mssqltips.com/sqlservertip/2935/sql-server-simple-and-forced-parameterization/ +[How to use a SQL Server Plan Guide to Tune Queries]:https://www.mssqltips.com/sqlservertip/1630/how-to-use-a-sql-server-plan-guide-to-tune-queries/ +[Neglecting to Use, or Misusing, the RETURN Keyword (BP016)]:https://www.red-gate.com/hub/product-learning/sql-prompt/neglecting-to-use-or-misusing-the-return-keyword-bp016 +[Defensive Error Handling]:https://www.red-gate.com/simple-talk/sql/t-sql-programming/defensive-error-handling/ +[A Self-Tuning Fill Factor Technique for SQL Server – Part 1]:https://www.sqlservercentral.com/articles/a-self-tuning-fill-factor-technique-for-sql-server-part-1 +[A Self-Tuning Fill Factor Technique for SQL Server – Part 2]:https://www.sqlservercentral.com/articles/a-self-tuning-fill-factor-technique-for-sql-server-part-2 +[SQL: Been told you can't access master database system views in Azure SQL Database? Not true!]:https://blog.greglow.com/2019/09/17/sql-told-cannot-access-master-database-system-views-azure-sql-database-not-true/ +[How to increase SQL Database Full Backup speed using compression and Solid State Disks]:http://henkvandervalk.com/how-to-increase-sql-database-full-backup-speed-using-compression-and-solid-state-disks +[Troubleshooting NUMA Node Imbalance Problems (HammerDB Benchmark)]:https://www.sqlpassion.at/archive/2019/09/23/troubleshooting-numa-node-inbalance-problems/ +[SQL Server Unequal NUMA CPU engagement]:https://sql-sasquatch.blogspot.com/2019/09/sql-server-numa-cpu-engagement.html +[SSIS Connection Managers: OLE DB vs ODBC vs ADO.NET]:https://www.sqlshack.com/ssis-connection-managers-ole-db-vs-odbc-vs-ado-net/ +[SSIS Data Flows – ADO.NET vs. OLE DB vs. ODBC]:https://datatellblog.wordpress.com/2015/01/13/ssis-data-flows-ado-net-vs-ole-db-vs-odbc/ +[SSIS – Fastest data flow task item for transferring data over the network]:https://gqbi.wordpress.com/2013/06/19/ssis-fastest-data-flow-task-item-for-transferring-data-over-the-network/ +[The Case of the Vanishing Index Compression]:red-gate.com/simple-talk/blogs/the-case-of-the-vanishing-index-compression/ +[Migrating from MSSQL to PostgreSQL - What You Should Know]:https://severalnines.com/database-blog/migrating-mssql-postgresql-what-you-should-know +[Difference between Identity and Sequence in SQL Server 2012]:https://raresql.com/2012/05/01/difference-between-identity-and-sequence/ +[Sequence vs Identity – Performance Comparison]:http://byobi.com/2012/09/sequence-vs-identity-performance-comparison/ +[Read Excel File in SQL Server with OPENROWSET or OPENDATASOURCE]:https://www.mssqltips.com/sqlservertip/6178/read-excel-file-in-sql-server-with-openrowset-or-opendatasource/ +[Upgrading SQL Server using Availability Groups – Checklist]:https://thelonedba.wordpress.com/2019/10/17/upgrading-sql-server-using-availability-groups-checklist/ +[Using indexed views? WITH (NOEXPAND) for Standard Edition]:https://bornsql.ca/blog/using-indexed-views-dont-forget-this-important-tip/ +[Using indexed views? What is an imprecise or non-deterministic convert?]:https://bornsql.ca/blog/using-indexed-views-what-is-an-imprecise-or-non-deterministic-convert/ +[JSON in your Azure SQL Database? Let’s benchmark some options!]:https://techcommunity.microsoft.com/t5/SQL-Customer-Success-Engineering/JSON-in-your-Azure-SQL-Database-Let-s-benchmark-some-options/ba-p/909131 +[Looking for strange - addition to system_health XE]:https://karaszi.com/looking-for-strange +[What's new in SQL Server version x]:https://karaszi.com/new-in-version-x +[The ultimate guide to the datetime datatypes]:https://karaszi.com/the-ultimate-guide-to-the-datetime-datatypes +[Some numbers that you will know by heart if you have been working with SQL Server for a while]:https://sqlservercode.blogspot.com/2019/03/some-numbers-that-you-will-know-by.html +[#TSQL2sday: How Much Plan Cache History Do You Have?]:https://www.brentozar.com/archive/2018/07/tsql2sday-how-much-plan-cache-history-do-you-have/ +[Fixing SQL Server Management Studio’s Tab Text]:https://www.brentozar.com/archive/2011/06/fixing-sql-server-management-studios-tab-text/ +[An overview of the SQL table variable]:https://www.sqlshack.com/an-overview-of-the-sql-table-variable/ +[Performance Impact of Small Queries]:https://forrestmcdaniel.com/2019/06/25/performance-impact-of-small-queries/ +[How we use SQL Server as a Document Store]:https://octopus.com/blog/sql-as-document-store +[Overlooked T-SQL Gems]:https://sqlperformance.com/2019/10/t-sql-queries/overlooked-t-sql-gems +[Are SQL Server database triggers evil?]:https://www.sqlshack.com/are-sql-server-database-triggers-evil/ +[Configuration Best Practices for SQL Server Tempdb–Initial Sizing]:https://logicalread.com/2013/02/12/sql-server-tempdb-best-practices-initial-sizing-w01/ +[Sql Server Extended Events Trace Overhead]:https://nenadnoveljic.com/blog/sql-server-extended-events-trace-overhead/ +[Measuring "Observer Overhead" of SQL Trace vs. Extended Events]:https://sqlperformance.com/2012/10/sql-trace/observer-overhead-trace-extended-events +[Performance overhead of tracing with Extended Event targets vs SQL Trace under CPU Load]:http://andreas-wolter.com/en/performance-overhead-of-tracing-with-extended-event-targets-vs-sql-trace-under-cpu-load/ +[Fragmentation, the final installment]:http://sqlblog.karaszi.com/fragmentation-the-final-installment/ +[Atomic Durability - How do databases recover from a crash ?]:https://concurrencyfreaks.blogspot.com/2019/10/atomic-durability-how-do-databases.html +[Truth First, or Why You Should Mostly Implement Database First Designs]:https://blog.jooq.org/2018/06/06/truth-first-or-why-you-should-mostly-implement-database-first-designs/ +[SQL Server CHECKPOINT, Lazy Writer, Eager Writer and Dirty Pages in SQL Server]:https://www.sqlshack.com/sql-server-checkpoint-lazy-writer-eager-writer-and-dirty-pages-in-sql-server/ +[T-SQL bugs, pitfalls, and best practices – window functions]:https://sqlperformance.com/2019/08/sql-performance/t-sql-bugs-pitfalls-and-best-practices-window-functions +[#BackToBasics: Why I use lower case for data type names (now)]:https://www.sentryone.com/blog/aaronbertrand/backtobasics-lower-case-data-types +[New high availability and disaster recovery benefits for SQL Server]:https://cloudblogs.microsoft.com/sqlserver/2019/10/30/new-high-availability-and-disaster-recovery-benefits-for-sql-server/ +[Because Your Index Maintenance Script Is Measuring The Wrong Thing]:https://www.erikdarlingdata.com/2019/10/because-your-index-maintenance-script-is-measuring-the-wrong-thing/ +[Memory-Optimized TempDB Metadata]:http://www.nikoport.com/2019/10/30/memory-optimized-tempdb-metadata/ +[Build a SQL Cluster Lab Part 1]:https://www.ryanjadams.com/2019/10/build-a-sql-cluster-lab-part-1/ +[There is no Such Thing as Object-Relational Impedance Mismatch]:https://blog.jooq.org/2015/08/26/there-is-no-such-thing-as-object-relational-impedance-mismatch/ +[ORMs Under the Hood]:https://www.vertabelo.com/blog/orms-under-the-hood/ +[EMERGENCY-mode repair: the very, very last resort]:https://www.sqlskills.com/blogs/paul/checkdb-from-every-angle-emergency-mode-repair-the-very-very-last-resort/ +[Scalar functions and improvements in SQL Server 2019]:http://sqlblog.karaszi.com/scalar-functions-and-improvements-in-sql-server-2019/ +[Scalar functions in SQL server 2019, part 2]:http://sqlblog.karaszi.com/scalar-functions-in-sql-server-2019-part-2/ +[Dos and Don'ts of Dynamic SQL]:https://www.sqlservercentral.com/articles/dos-and-donts-of-dynamic-sql +[Differences Between Sql Server TEXT and VARCHAR(MAX) Data Type]:https://sqlhints.com/2016/05/11/differences-between-sql-server-text-and-varcharmax-data-type/ +[VARBINARY(MAX) Tames the BLOB]:https://www.itprotoday.com/microsoft-visual-studio/varbinarymax-tames-blob +[Query Store Options in SSMS 18.4]:https://www.sqlskills.com/blogs/erin/query-store-options-in-ssms-18-4/ +[Query Store Performance Overhead: What you need to know]:https://www.sqlskills.com/blogs/erin/query-store-performance-overhead/ +[How to fork a GitHub repository and contribute to an open source project]:https://sqldbawithabeard.com/2019/11/29/how-to-fork-a-github-repository-and-contribute-to-an-open-source-project/ +[But I Need To Compare Two Date Columns In My Where Clause]:https://www.erikdarlingdata.com/2019/11/but-i-need-to-compare-two-date-columns-in-my-where-clause/ +[The Difference Between Fault Tolerance, High Availability, & Disaster Recovery]:http://www.pbenson.net/2014/02/the-difference-between-fault-tolerance-high-availability-disaster-recovery/ +[Why LOB data makes shrink run slooooowly]:https://www.sqlskills.com/blogs/paul/why-lob-data-makes-shrink-run-slooooowly-t-sql-tuesday-006/ +[SQL Server 2019 Scalar UDF inlining - out of memory in some cases]:https://sql-sasquatch.blogspot.com/2019/11/sql-server-2019-udf-inlining-oom-in.html +[Is it true that editing a single row in Management Studio empties and reloads the entire table?]:https://bornsql.ca/blog/is-it-true-that-editing-a-single-row-in-management-studio-empties-and-reloads-the-entire-table/ +[A Guide to SQL Naming Conventions]:https://blog.jooq.org/2019/10/29/a-guide-to-sql-naming-conventions/ +[Stop Mapping Stuff in Your Middleware. Use SQL’s XML or JSON Operators Instead]:https://blog.jooq.org/2019/11/13/stop-mapping-stuff-in-your-middleware-use-sqls-xml-or-json-operators-instead/ +[How Does Accelerated Database Recovery Work]:https://www.red-gate.com/simple-talk/sql/database-administration/how-does-accelerated-database-recovery-work/ +[Recover SQL Server Resource Database]:https://www.mssqltips.com/sqlservertip/6194/recover-sql-server-resource-database/ +[What’s in that database? Getting information about routines]:https://www.red-gate.com/simple-talk/blogs/whats-in-that-database-getting-information-about-routines/ +[The Gloop: An Easier way of Managing SQL Server Documentation]:https://www.red-gate.com/simple-talk/blogs/the-gloop-an-easier-way-of-managing-sql-server-documentation/ +[The SQL of Gaps and Islands in Sequences]:https://www.red-gate.com/simple-talk/sql/t-sql-programming/the-sql-of-gaps-and-islands-in-sequences/ +[Drop Database Objects Practically Risk-Free!]:https://thenonclutteredindex.com/2019/04/17/drop-database-objects-practically-risk-free/ +[Predicate Pushdown and why should I care?]:https://techcommunity.microsoft.com/t5/SQL-Server/Predicate-Pushdown-and-why-should-I-care/bc-p/1045243#M1406 +[Stack Overflow Demo Database Column Store Edition: Downloads And Links]:https://www.erikdarlingdata.com/2019/11/stack-overflow-demo-database-column-store-edition-downloads-and-links/ +[Stack Overflow Demo Database Column Store Edition: Exploring Relationships]:https://www.erikdarlingdata.com/2019/11/stack-overflow-demo-database-column-store-edition-exploring-relationships/ +[Stack Overflow Demo Database Column Store Edition: Helpful Links]:https://www.erikdarlingdata.com/2019/11/stack-overflow-demo-database-column-store-edition-helpful-links/ +[Online, Resumable, and WAIT_AT_LOW_PRIORITY operations in SQL Server]:https://littlekendra.com/2019/12/09/online-resumable-and-wait_at_low_priority-operations-in-sql-server/ +[How filtered indexes could be a more powerful feature]:https://sqlperformance.com/2013/04/t-sql-queries/filtered-indexes +[How Forced Parameterization in SQL Server Affects Filtered Indexes]:https://www.mssqltips.com/sqlservertip/6139/how-forced-parameterization-in-sql-server-affects-filtered-indexes/ +[Filtered Indexes and Forced Parameterization (redux)]:https://sqlperformance.com/2019/12/t-sql-queries/filtered-indexes-forced-parameterization +[Interpreting SQL Server 2019 DBCC MEMORYSTATUS output -- Part 1]:https://sql-sasquatch.blogspot.com/2019/12/interpreting-sql-server-2019-dbcc.html +[Invisible tempdb Killer]:https://www.joshthecoder.com/2019/12/18/invisible-tempdb-killer.html +[Batch Mode On Row Store Is Fickle]:https://www.erikdarlingdata.com/2019/12/batch-mode-on-row-store-is-fickle/ +[Use Azure To Store Sql Server Backups Offsite]:https://www.sqlstad.nl/sql-server/use-azure-to-store-sql-server-backups-offsite/ +[Handling Data Returned from a SQL Stored Procedure]:https://www.drewsk.tech/2019/12/20/handling-data-returned-from-a-sql-stored-procedure/ +[When QUERY_OPTIMIZER_COMPATIBILITY_LEVEL_140 does not follow CL 140 rules]:https://milossql.wordpress.com/2019/12/20/query_optimizer_compatibility_level_140/ +[SQL Server–HOW-TO: quickly retrieve accurate row count for table]:https://blogs.msdn.microsoft.com/martijnh/2010/07/15/sql-serverhow-to-quickly-retrieve-accurate-row-count-for-table/ +[Do You Have REFERENCES?]:https://www.red-gate.com/simple-talk/sql/t-sql-programming/do-you-have-references/ +[Fun with (columnstore) compression on a very large table – part 1]:https://sqlperformance.com/2019/12/columnstore/fun-with-compression-very-large-table-1 +[How to Make SELECT COUNT(*) Queries Crazy Fast]:https://www.brentozar.com/archive/2019/12/how-to-make-select-count-queries-crazy-fast/ +[SSISDB Catalog Defaults Best Practices]:https://datasteve.com/2019/12/06/ssisdb-catalog-defaults-best-practices/ +[Temporal Tables, and how to deal with computed columns]:https://bornsql.ca/blog/temporal-tables-and-how-to-deal-with-computed-columns/ +[Cardinality Estimation for Disjunctive Predicates in SQL Server 2014]:https://www.sql.kiwi/2014/04/cardinality-estimation-for-disjunctive-predicates-in-2014.html +[Create Distributed Availability Group in Sql Server Linux(Redhat) --- step by step]:https://techcommunity.microsoft.com/t5/sql-server-support/create-distributed-availability-group-in-sql-server-linux-redhat/ba-p/1003471 +[Connection options in SSMS]:https://sqlstudies.com/2013/11/18/connection-options-in-ssms/ +[A Script To Automatically Align Columnstore Indexes To Enhance Segment Elimination (and Hence Performances)]:https://tsql.tech/a-script-to-automatically-align-columnstore-indexes-to-enhance-segment-elimination-and-hence-performances/ +[Issues with SQLCMD when using special characters]:https://www.mssqltips.com/sqlservertip/5132/issues-with-sqlcmd-when-using-special-characters/ +[Encrypting passwords with Python Scripts in SQL Notebooks of Azure Data Studio]:https://www.sqlshack.com/encrypting-passwords-with-python-scripts-in-sql-notebooks-of-azure-data-studio/ +[Fun with (columnstore) compression on a very large table – part 2]:https://sqlperformance.com/2020/01/columnstore/fun-with-compression-very-large-table-2 +[The curious case of the sqlcmd password]:https://bornsql.ca/blog/the-curious-case-of-the-sqlcmd-password/ +[Setting up Management Studio for remote SQL Server]:https://www.sqlservercentral.com/articles/setting-up-management-studio-for-remote-sql-server +[SQL Server Security Best Practices for an Application Installed on SQL Server]:https://www.mssqltips.com/sqlservertip/6266/sql-server-security-best-practices-for-an-application-installed-on-sql-server/ +[PCI Best Practices Guide for SQL Server DBAs]:https://www.mssqltips.com/sqlservertip/3609/pci-best-practices-guide-for-sql-server-dbas/ +[SQL Server Security Checklist]:https://www.mssqltips.com/sqlservertip/3159/sql-server-security-checklist/ +[Replace Model SQL Server Database with a User Database]:https://www.mssqltips.com/sqlservertip/6154/replace-model-sql-server-database-with-a-user-database/ +[SQL Server Linux installation for Amazon EC2 instance with Red Hat OS]:https://www.sqlshack.com/sql-server-linux-installation-for-amazon-ec2-instance-with-red-hat-os/ +[Departure of a SQL Server Administrator – What to Check?]:https://thelonedba.wordpress.com/2020/01/03/departure-of-a-sql-server-administrator-what-to-check/ +[The Curious Case of… transactions rolling back during DBCC CHECKDB]:https://www.sqlskills.com/blogs/paul/the-curious-case-of-transactions-rolling-back-during-dbcc-checkdb/ +[Don’t install SQL Server from a mounted ISO]:https://bornsql.ca/blog/dont-install-sql-server-from-a-mounted-iso/ +[NULL complexities – Part 1]:https://sqlperformance.com/2019/12/t-sql-queries/null-complexities-part-1 +[NULL complexities – Part 2]:https://sqlperformance.com/2020/01/t-sql-queries/null-complexities-part-2 +[NULL complexities – Part 3]:https://sqlperformance.com/2020/02/t-sql-queries/null-complexities-part-3-missing-standard-features-and-t-sql-alternatives +[How to fix the “Agent XPs disabled” error]:https://www.sqlshack.com/how-to-fix-the-agent-xps-disabled-error/ +[Number of Rows Read / Actual Rows Read warnings in Plan Explorer]:https://sqlperformance.com/2016/06/sql-indexes/actual-rows-read-warnings-plan-explorer +[Data Compression + Backup Compression = Double Compression?]:https://jesspomfret.com/double-compression/ +[How Many Bytes Per Character in SQL Server: a Completely Complete Guide]:https://sqlquantumleap.com/2019/11/22/how-many-bytes-per-character-in-sql-server-a-completely-complete-guide/ +[Storage 101: Welcome to the Wonderful World of Storage]:https://www.red-gate.com/simple-talk/sql/database-administration/storage-101-welcome-to-the-wonderful-world-of-storage/ +[How to detect and prevent unexpected growth of the TempDB database]:https://www.sqlshack.com/how-to-detect-and-prevent-unexpected-growth-of-the-tempdb-database/ +[Understanding the SQL Server Proportional fill algorithm]:https://www.sqlshack.com/understanding-sql-server-proportional-fill-algorithm/ +[VALUES() and Long Parameter Lists]:https://www.red-gate.com/simple-talk/sql/learn-sql-server/values-and-long-parameter-lists/ +[Going Serverless with Azure SQL Database]:https://www.mssqltips.com/sqlservertip/6273/going-serverless-with-azure-sql-database/ +[SQLskills SQL101: Why are Statistics so Important?]:https://www.sqlskills.com/blogs/kimberly/sql101_whystatisticsareimportant/ +[Configuring SQL Server Express edition as SQL witness server in Database Mirroring]:https://www.sqlshack.com/configuring-sql-server-express-edition-as-sql-witness-server-in-database-mirroring/ +[The Half Apply Query]:https://forrestmcdaniel.com/2020/01/20/the-half-apply-query/ +[Import JSON data into SQL Server]:https://www.sqlshack.com/import-json-data-into-sql-server/ +[Auditing in AWS RDS SQL Server]:https://www.sqlshack.com/auditing-in-aws-rds-sql-server/ +[Types of SQL Server Indexes]:https://www.mssqltips.com/sqlservertip/6274/types-of-sql-server-indexes/ +[Use SQL Server's UNPIVOT operator to help normalize output]:https://www.mssqltips.com/sqlservertip/3000/use-sql-servers-unpivot-operator-to-help-normalize-output/ +[Prevent SSMS from seeing the server's file system]:https://dba.stackexchange.com/a/246783/107045 +[Add the ability to disable or enable a few new DMVs and DMFs introduced in SQL Server 2017]:https://support.microsoft.com/help/4046638/ +[Actual Difference Between EXISTS(SELECT 1 …), EXISTS(SELECT * …), and EXISTS(SELECT column …)]:https://sqlquantumleap.com/2020/01/24/actual-difference-between-existsselect-1-existsselect-and-existsselect-column/ +[Why Wait Stats Alone Are Not Enough]:https://sqlperformance.com/2020/01/sql-performance/why-waits-alone-are-not-enough +[Estimating AWS RDS SQL Server costs]:https://www.sqlshack.com/estimating-aws-rds-sql-server-costs/ +[SQL Server Performance Tuning Using Wait Statistics: A Beginner’s Guide]:https://www.sqlskills.com/wp-content/uploads/2014/04/sql-server-performance-tuning-using-wait-statistics-whitepaper.pdf +[sys.xp_delete_files and ‘allow filesystem enumeration’: two new undocumented items in SQL Server 2019]:https://sqlquantumleap.com/2020/01/26/sys-xp_delete_files-and-allow-filesystem-enumeration-two-new-undocumented-items-in-sql-server-2019/ +[Why Database Monitoring Tools Are So Hard to Interpret]:https://www.brentozar.com/archive/2020/01/why-database-monitoring-tools-are-so-hard-to-interpret/ +[Extended Events Misperceptions: Profiler Is Easier]:https://www.scarydba.com/2020/01/20/extended-events-misperceptions-profiler-is-easier/ +[Extended Events Misperceptions: Profiler Is Easier, Part 2]:https://www.scarydba.com/2020/01/27/extended-events-misperceptions-profiler-is-easier-part-2/ +[Automate SFTP File Transfer with SQL Server Agent and WinSCP]:https://www.mssqltips.com/sqlservertip/6285/automate-sftp-file-transfer-with-sql-server-agent-and-winscp/ +[Running Database Console Commands (DBCCs) on Azure SQL Database]:https://www.databasejournal.com/features/mssql/running-database-console-commands-dbccs-on-azure-sql-database.html +[How to Remove Times from Dates in SQL Server]:https://www.brentozar.com/archive/2020/01/how-to-remove-times-from-dates-in-sql-server/ +[Export/Import Data using BCP - SQL Server on Linux]:https://www.sqlservercentral.com/articles/export-import-data-using-bcp-sql-server-on-linux +[Prevent SQL Server Blocking using Lock_Timeout]:https://www.mssqltips.com/sqlservertip/6279/prevent-sql-server-blocking-using-locktimeout/ +[Bin Packing Problems: The SQL]:https://www.red-gate.com/simple-talk/sql/t-sql-programming/bin-packing-problems-the-sql/ +[Causation, Correlation and Crackpots]:https://www.red-gate.com/simple-talk/sql/t-sql-programming/causation-correlation-and-crackpots/ +[What Events are in a Trace?]:https://www.sqlskills.com/blogs/erin/what-events-are-in-a-trace/ +[What Are Soft Deletes, and How Are They Implemented?]:https://www.brentozar.com/archive/2020/02/what-are-soft-deletes-and-how-are-they-implemented/ +[Why You Should Switch in Staging Tables Instead of Renaming Them (Dear SQL DBA Episode 26)]:https://littlekendra.com/2017/01/19/why-you-should-switch-in-staging-tables-instead-of-renaming/ +[Changing a column from int to bigint, without downtime]:https://am2.co/2019/12/changing-a-column-from-int-to-bigint-without-downtime/ +[I hate sp_estimate_data_compression_savings]:https://am2.co/2019/12/i-hate-sp_estimate_data_compression_savings/ +[Testing as another user…without their password - impersonate the other user]:https://am2.co/2019/12/testing-as-another-user-without-their-password/ +[How does a database RESTORE affect plan cache?]:https://am2.co/2019/10/how-does-a-database-restore-affect-plan-cache/ +[Recovery of database is 0% complete (approximately 1000000 seconds remain)]:https://am2.co/2019/10/recovery-of-database-is-0-complete-approximately-1000000-seconds-remain/ +[Code to purge data based on creation date]:https://am2.co/2019/04/code-to-purge-data-on-creation-date/ +[Blocking with OBJECT_NAME()]:https://am2.co/2019/12/blocking-with-object_name/ +[Performance Myths: The query result cache]:https://sqlperformance.com/2018/07/performance-myths/query-result-cache +[Fun with (columnstore) compression on a very large table – part 3]:https://sqlperformance.com/2020/02/columnstore/fun-with-columnstore-compression-on-a-very-large-table-part-3 +[Indexing basics]:https://sqlsunday.com/2013/02/19/indexing-basics/ +[Working with covering indexes]:https://sqlsunday.com/2013/02/24/covering-indexes/ +[Using Erik Darling’s sp_pressure_detector to resolve CPU issues]:https://desertdba.com/using-erik-darlings-sp_pressure_detector-to-resolve-cpu-issues/ +[The Accidental DBA (Day 16 of 30): General Security]:https://www.sqlskills.com/blogs/jonathan/the-accidental-dba-day-16-of-30-general-security/ +[Securing Data in SQL Server]:https://www.sqlskills.com/blogs/jonathan/securing-data-in-sql-server/ +[Performance Testing SQL 2008's Transparent Data Encryption]:https://www.databasejournal.com/features/mssql/article.php/3815501/Performance-Testing-SQL-2008146s-Transparent-Data-Encryption.htm +[Common SQL Server Security Issues and Solutions]:https://docs.microsoft.com/en-us/previous-versions/technet-magazine/dd637114(v=msdn.10) +[Chaos Engineering and SQL Server]:https://dbafromthecold.com/2020/01/29/chaos-engineering-and-sql-server/ +[Different methods to attach SQL Server MDF files]:https://www.sqlshack.com/different-methods-to-attach-sql-server-mdf-files/ +[Learn SQL: How to Write a Complex SELECT Query]:https://www.sqlshack.com/learn-sql-how-to-write-a-complex-select-query/ +[Filling In Missing Values Using the T-SQL Window Frame]:https://www.red-gate.com/simple-talk/sql/t-sql-programming/filling-in-missing-values-using-the-t-sql-window-frame/ +[Select * in a view]:https://sqlreitse.home.blog/2020/02/12/select-in-a-view/ +[T-SQL TUESDAY #123: Aggregates of Aggregates using Windowing Functions]:https://jimbabwe.co.za/2020/02/12/t-sql-tuesday-123-life-hacking-by-opening-windows/ +[SQL Server Statistics: Explained]:https://blogs.msdn.microsoft.com/srgolla/2012/09/04/sql-server-statistics-explained/ +[How to Pass a List of Values Into a Stored Procedure]:https://www.brentozar.com/archive/2020/02/how-to-pass-a-list-of-values-into-a-stored-procedure/ +[What's the difference between a temp table and table variable in SQL Server?]:https://dba.stackexchange.com/a/16386/107045 +[Be Mindful of SQL Server Tempdb Use (aka Tempdb Parasites!)]:https://www.sentryone.com/blog/be-mindful-of-sql-server-tempdb-use-aka-tempdb-parasites +[Robyn Page’s SQL Server Cursor Workbench (Quirky Update)]:https://www.red-gate.com/simple-talk/sql/learn-sql-server/robyn-pages-sql-server-cursor-workbench/ +[Solving the Running Total and Ordinal Rank Problems (Rewritten) (Quirky Update)]:https://www.sqlservercentral.com/articles/solving-the-running-total-and-ordinal-rank-problems-rewritten +[Running totals in “Denali” CTP3 (Quirky Update)]:https://blog.waynesheffield.com/wayne/archive/2011/08/running-totals-in-denali-ctp3/ +[WHERE GETDATE() BETWEEN StartDate AND EndDate Is Hard to Tune.]:https://www.brentozar.com/archive/2020/02/where-getdate-between-startdate-and-enddate-is-hard-to-tune/ +[WHERE GETDATE() BETWEEN StartDate AND COALESCE(CancelDate, EndDate) Is Even Harder to Tune.]:https://www.brentozar.com/archive/2020/02/where-getdate-between-startdate-and-coalescecanceldate-enddate-is-even-harder-to-tune/ +[How to solve the SQL Identity Crisis in SQL Server]:https://www.sqlshack.com/solve-identity-crisis-sql-server/ +[Significant SQL Server 2019 licensing changes]:https://www.kevinrchant.com/2020/02/17/significant-sql-server-2019-licensing-changes/ +[Indexed View Maintenance Is Only As Bad As Your Indexes]:https://www.erikdarlingdata.com/2020/02/indexed-view-maintenance-is-only-as-bad-as-your-indexes/ +[Why Design Impacts Performance on Microsoft SQL Server]:https://www.sentryone.com/blog/why-design-impacts-performance-microsoft-sql-server +[Apply versus Nested Loops Join]:https://www.sql.kiwi/2019/06/apply-versus-nested-loops-join.html +[Inside the Optimizer: Constructing a Plan - Part 1]:https://www.sql.kiwi/2010/07/inside-the-optimiser-constructing-a-plan.html +[Inside the Optimizer: Constructing a Plan - Part 2]:https://www.sql.kiwi/2010/07/inside-the-optimiser-constructing-a-plan-ii.html +[Inside the Optimizer: Constructing a Plan - Part 3]:https://www.sql.kiwi/2010/07/inside-the-optimiser-constructing-a-plan-part-3.html +[Inside the Optimizer: Constructing a Plan - Part 4]:https://www.sql.kiwi/2010/07/inside-the-optimiser-constructing-a-plan-part-4.html +[Tips for dealing with large SQL Server scripts]:https://www.kevinrchant.com/2020/02/24/tips-for-dealing-with-large-sql-server-scripts/ +[Database Normalization in SQL with Examples]:https://www.sqlservercentral.com/articles/database-normalization-in-sql-with-examples +[Why SQL Server May Not Parallelize a Query]:https://logicalread.com/2015/10/30/sql-server-query-parallelizing-mc11/ +[Parallelism in SQL Server Execution Plan]:https://www.mssqltips.com/sqlservertip/5404/parallelism-in-sql-server-execution-plan/ +[An XEvent a Day (26 of 31) – Configuring Session Options]:https://www.sqlskills.com/blogs/jonathan/an-xevent-a-day-26-of-31-configuring-session-options/ +[Azure SQL Managed Instance Performance Considerations]:https://sqlperformance.com/2020/02/azure/sql-managed-instance-performance-considerations +[The Curious Case of… whether corruption can propagate to secondary databases]:https://www.sqlskills.com/blogs/paul/the-curious-case-of-whether-corruption-can-propagate-to-secondary-databases/ +[Stop and Think Before You Shrink – Shrinking a SQL Server Database]:https://www.mlakartechtalk.com/stop-and-think-before-you-shrink-shrinking-a-sql-server-database/ +[How to Analyze the SQL Server Error Log]:https://www.mlakartechtalk.com/how-to-analyze-the-sql-server-error-log/ +[Converting SQL Trace to Extended Events in SQL Server 2012]:https://www.sqlskills.com/blogs/jonathan/converting-sql-trace-to-extended-events-in-sql-server-2012/ +[What event information can I get by default from SQL Server?]:https://dba.stackexchange.com/a/48053/107045 +[Removing the default trace – Part 1]:https://sqlperformance.com/2020/03/extended-events/removing-default-trace-1 +[Removing the default trace – Part 2]:https://sqlperformance.com/2020/04/extended-events/removing-default-trace-2 +[Removing the default trace – Part 3]:https://sqlperformance.com/2020/04/extended-events/removing-default-trace-3 +[Keeping DRY in SQL Server with Scalar User Defined Functions – Part 1]:https://www.sentryone.com/blog/keeping-dry-in-sql-server-with-scalar-user-defined-functions-part-1 +[Different Ways to Monitor SQL Server AlwaysOn Availability Groups]:https://codingsight.com/different-ways-to-monitor-sql-server-alwayson-availability-groups/ +[SQL Server internals: Is Order of Column in the table important?]:http://ariely.info/Blog/tabid/83/EntryId/219/SQL-Server-internals-Is-Order-of-Column-in-the-table-important.aspx +[Code: Order of columns in table might impact the size of the table/database and even related to errors]:http://ariely.info/Blog/tabid/83/EntryId/243/Code-Order-of-columns-in-table-might-impact-the-size-of-the-table-database-and-even-related-to-errors.aspx +[SQL Server Internals: Getting the data of deleted column]:http://ariely.info/Blog/tabid/83/EntryId/213/SQL-Server-Internals-Getting-the-data-of-deleted-column.aspx +[Queue table issues with Availability Groups in SQL Server]:mssqltips.com/sqlservertip/6284/queue-table-issues-with-availability-groups-in-sql-server/ +[Transact-SQL: openjson hierarchy solution]:http://ariely.info/Blog/tabid/83/EntryId/239/Transact-SQL-openjson-hierarchy-solution.aspx +[CREATE DLL TRIGGER ON CREATE_LOGIN to configure default parameters for any new LOGIN]:http://ariely.info/Blog/tabid/83/EntryId/240/CREATE-DLL-TRIGGER-ON-CREATE_LOGIN-to-configure-default-parameters-for-any-new-LOGIN.aspx +[SQL varchar data type deep dive]:https://www.sqlshack.com/sql-varchar-data-type-deep-dive/ +[What is the datatype SQL_VARIANT]:https://sqlstudies.com/2020/04/16/what-is-the-datatype-sql_varient/ +[An Introduction to Asynchronous Processing with Service Broker]:https://sqlperformance.com/2014/03/sql-performance/intro-to-service-broker +[Detecting and Alerting on SQL Server Agent Missed Jobs]:https://www.sqlshack.com/detecting-and-alerting-on-sql-server-agent-missed-jobs-2/ +[Execute multiple jobs Synchronously from in a main job]:http://ariely.info/Blog/tabid/83/EntryId/250/Execute-multiple-jobs-Synchronously-from-in-a-main-job.aspx +[Why Ordering Isn’t Guaranteed Without an ORDER BY]:https://www.brentozar.com/archive/2020/04/why-ordering-isnt-guaranteed-without-an-order-by/ +[How to Attach a SQL Server Database without a Transaction Log and with Open Transactions]:https://www.mssqltips.com/sqlservertip/3579/how-to-attach-a-sql-server-database-without-a-transaction-log-and-with-open-transactions/ +[SQL 2016 - It Just Runs Faster: Indirect Checkpoint Default]:https://docs.microsoft.com/en-gb/archive/blogs/psssql/sql-2016-it-just-runs-faster-indirect-checkpoint-default +[SQL Server : large RAM and DB Checkpointing]:https://docs.microsoft.com/en-us/archive/blogs/psssql/sql-server-large-ram-and-db-checkpointing +[Indirect Checkpoint and tempdb – the good, the bad and the non-yielding scheduler]:https://docs.microsoft.com/en-gb/archive/blogs/sql_server_team/indirect-checkpoint-and-tempdb-the-good-the-bad-and-the-non-yielding-scheduler +[How do checkpoints work and what gets logged]:https://www.sqlskills.com/blogs/paul/how-do-checkpoints-work-and-what-gets-logged/ +[Inside the Storage Engine: What’s in the buffer pool?]:https://www.sqlskills.com/blogs/paul/inside-the-storage-engine-whats-in-the-buffer-pool/ +[What does checkpoint do for tempdb?]:https://www.sqlskills.com/blogs/paul/what-does-checkpoint-do-for-tempdb/ +[Performance issues from wasted buffer pool memory]:https://www.sqlskills.com/blogs/paul/performance-issues-from-wasted-buffer-pool-memory/ +[How It Works: When is the FlushCache message added to SQL Server Error Log?]:https://docs.microsoft.com/en-us/archive/blogs/psssql/how-it-works-when-is-the-flushcache-message-added-to-sql-server-error-log +[Cross Database Transactions on One Server]:https://michaeljswart.com/2020/05/cross_database_transactions/ +[Your Views Aren’t The Problem. Your Code Is.]:https://www.brentozar.com/archive/2020/05/your-views-arent-the-problem-your-code-is/ +[Negative identity values don’t suck]:https://bornsql.ca/blog/negative-identity-values-dont-suck/ +[How SQL Server stores data types: integers and decimals]:https://bornsql.ca/blog/how-sql-server-stores-data-types-integers-and-decimals/ +[How SQL Server stores data types: DATETIME, DATE, TIME, and DATETIME2]:https://bornsql.ca/blog/how-sql-server-stores-data-types-datetime-date-time-and-datetime2/ +[Can I Offload DBCC CHECKDB To Another Server?]:https://www.brentozar.com/archive/2020/05/can-i-offload-dbcc-checkdb-to-another-server/ +[Negative (-) is an operator and will affect the order of operations.]:https://sqlstudies.com/2020/05/18/negative-is-an-operator-and-will-effect-the-order-of-operations/ +["0 to 60" : Switching to indirect checkpoints]:https://sqlperformance.com/2020/05/system-configuration/0-to-60-switching-to-indirect-checkpoints +[Parallelism Can Make Queries Perform Worse.]:https://www.brentozar.com/archive/2020/05/parallelism-can-make-queries-perform-worse/ +[A SQL Server DBA myth a day: (15/30) checkpoint only writes pages from committed transactions]:https://www.sqlskills.com/blogs/paul/a-sql-server-dba-myth-a-day-1530-checkpoint-only-writes-pages-from-committed-transactions/ +[Can You Use NVARCHAR As a Universal Parameter? Almost.]:https://www.brentozar.com/archive/2020/04/can-you-use-nvarchar-as-a-universal-parameter-almost/ +[The Learner’s Guide to SQL Server Performance Triage]:https://littlekendra.com/2020/03/19/the-learners-guide-to-sql-server-performance-triage/ +[Learner’s Guide to SQL Server Query Tuning]:https://littlekendra.com/2020/05/01/learners-guide-to-sql-server-query-tuning/ +[How to Get Better Estimates for Modification Queries]:https://www.brentozar.com/archive/2020/04/how-to-get-better-estimates-for-modification-queries/ +[SSMS: Prevent Copy and Paste of Text in “Messages” tab (Cruel Joke #2)]:https://sqlquantumleap.com/2020/05/22/ssms-prevent-copy-and-paste-of-text-in-messages-tab-cruel-joke-2/s +[Compare the Best SQL Server Performance Monitoring Tools]:https://www.sentryone.com/compare-best-sql-server-monitoring-tools +[Minimal Logging with INSERT…SELECT into Heap Tables]:https://sqlperformance.com/2019/05/sql-performance/minimal-logging-insert-select-heap +[Minimal Logging with INSERT…SELECT into Empty Clustered Tables]:https://sqlperformance.com/2019/05/sql-performance/minimal-logging-empty-clustered +[Minimal Logging with INSERT…SELECT and Fast Load Context]:https://sqlperformance.com/2019/05/sql-performance/minimal-logging-fast-load-context +[Avoiding SQL Server Upgrade Performance Issues]:https://www.sqlskills.com/blogs/glenn/avoid-sql-server-upgrade-performance-issues/ +[Compatibility Levels and Cardinality Estimation Primer]:https://sqlperformance.com/2019/01/sql-performance/compatibility-levels-and-cardinality-estimation-primer +[An approach to index tuning – Part 1]:https://sqlperformance.com/2020/03/sql-indexes/an-approach-to-index-tuning-part-1 +[An approach to index tuning – Part 2]:https://sqlperformance.com/2020/04/sql-indexes/an-approach-to-index-tuning-part-2 +[Moving A Database to New Storage With No Downtime]:https://www.bobpusateri.com/archive/2013/03/moving-a-database-to-new-storage-with-no-downtime/ +[RESOURCE_GOVERNOR_IDLE in Azure]:https://joshthecoder.com/2020/06/15/resource-governor-idle-in-azure.html +[Automated Backup Tuning]:https://sirsql.net/2012/12/13/20121212automated-backup-tuning/ +[Optimizing Database Restores]:https://sirsql.net/2011/09/26/2011926optimizing-database-restores-html/ +[AVAILABILITY_REPLICA - The Deception of the Log Reuse Wait Type]:https://sirsql.net/2020/05/19/the-deception-of-the-log-reuse-wait-type/ +[Changing an INT to a BIGINT with no downtime]:https://michaeljswart.com/2020/06/problem-solving-by-cheating/ +[New Metadata-Only Column Changes in SQL Server 2016]:https://sqlperformance.com/2020/04/database-design/new-metadata-column-changes-sql-server-2016 +[Bandwidth-friendly Query Profiling for Azure SQL Database]:https://sqlperformance.com/2020/04/sql-performance/bandwidth-friendly-query-profiling-azure-sql-database +[When a Columnstore Index Makes Your Query Fail - 1/0 error]:https://www.brentozar.com/archive/2020/06/when-a-columnstore-index-makes-your-query-fail/ +[Column scope and binding order in subqueries]:https://sqlinthewild.co.za/index.php/2019/04/23/no-this-is-not-a-bug-in-t-sql/ +[Improve SQL Server Extended Events system_health Session]:https://www.mssqltips.com/sqlservertip/6456/improve-sql-server-extended-events-systemhealth-session/ +[Page Life Expectancy Doesn’t Mean Jack, and You Should Stop Looking At It.]:https://www.brentozar.com/archive/2020/06/page-life-expectancy-doesnt-mean-jack-and-you-should-stop-looking-at-it/ +[Unsupported but working versions of SQL Server on Windows Server 2019]:https://bornsql.ca/blog/unsupported-but-working-versions-of-sql-server-on-windows-server-2019/ +[Bad Idea Jeans: Building Big Query Plans]:https://www.brentozar.com/archive/2020/06/bad-idea-jeans-building-big-query-plans/ +[SQL Server performance tuning – RESOURCE_SEMAPHORE waits]:https://www.sqlshack.com/sql-server-performance-tuning-resource_semaphore-waits/ +[Use session_context to create a “variable” that lasts between batches.]:https://sqlstudies.com/2020/05/26/use-session_context-to-create-a-variable-that-lasts-between-batches/ +[Phase out CONTEXT_INFO() in SQL Server 2016 with SESSION_CONTEXT()]:https://www.mssqltips.com/sqlservertip/4094/phase-out-contextinfo-in-sql-server-2016-with-sessioncontext/ +[How to Balance SQL Server Core Licenses Across NUMA Nodes]:https://glennsqlperformance.com/2020/06/25/how-to-balance-sql-server-core-licenses-across-numa-nodes/ +[What is the Difference Between Physical Sockets, Physical Cores, and Logical Cores?]:https://glennsqlperformance.com/2019/12/18/what-is-the-difference-between-physical-sockets-physical-cores-and-logical-cores/ +[Troubleshooting SQL Server Wait Stats]:https://www.sentryone.com/white-papers/troubleshooting-sql-server-wait-stats +[The 201 Buckets Problem, Part 1: Why You Still Don’t Get Accurate Estimates]:https://www.brentozar.com/archive/2020/07/the-201-buckets-problem-part-1-why-you-still-dont-get-accurate-estimates/ +[The 201 Buckets Problem, Part 2: How Bad Estimates Backfire As Your Data Grows]:https://www.brentozar.com/archive/2020/07/the-201-buckets-problem-part-2-how-bad-estimates-backfire-as-your-data-grows/ +[Sql Server — Widely Random Query Exec Times (cxconsumer Wait/cxpacket) & Possible Remediation]:https://viktorsrandomposts.wordpress.com/2020/06/26/sql-server-widely-random-query-exec-times-cxconsumer-wait-possible-remediation/ +[How MAXDOP Really Works]:https://www.sql.kiwi/2020/07/how-maxdop-really-works.html +[What is MaxDOP controlling?]:https://techcommunity.microsoft.com/t5/sql-server/what-is-maxdop-controlling/ba-p/1505968 +[What If You Really DO Need to Shrink a Database?]:https://www.brentozar.com/archive/2020/07/what-if-you-really-do-need-to-shrink-a-database/ +[Everything I Never Wanted to Know About Collation]:https://littlekendra.com/2020/07/16/everything-i-never-wanted-to-know-about-collation-14-minute-video-podcast-episode/ +[Comparing SSIS And Azure Data Factory]:https://www.timmitchell.net/post/2020/07/16/comparing-ssis-and-azure-data-factory/ +[sp_Blitz for All Servers]:https://garrybargsley.com/2020/07/14/sp_blitz-for-all-servers/ +[Where is the SQL Server Community Networking Online?]:https://www.brentozar.com/archive/2020/07/where-is-the-sql-server-community-networking-online/ +[Make the most out of your Azure Disks using Storage Pools]:https://blog.coeo.com/make-the-most-out-of-your-azure-disks-using-storage-pools +[SQL Server High Availability Solutions on Azure VMs]:https://www.brentozar.com/archive/2020/07/where-is-the-sql-server-community-networking-online/ +[How to Get Started with SQL Server Management Studio]:https://www.brentozar.com/archive/2020/07/how-to-get-started-with-sql-server-management-studio/ +[How should I store currency values in SQL Server?]:https://bornsql.ca/blog/how-should-i-store-currency-values-in-sql-server/ +[Read committed isolation level doesn’t guarantee much…]:https://www.sqlskills.com/blogs/paul/read-committed-doesnt-guarantee-much/ +[Prevent Unexpected Failovers When Patching AGs]:https://joshthecoder.com/2020/05/21/prevent-unexpected-failovers-when-patching-ags.html +[Updating Statistics Causes Parameter Sniffing]:https://www.brentozar.com/archive/2020/06/updating-statistics-causes-parameter-sniffing/ +[The Ascending Key Problem in Fact Tables– Part one: Pain!]:https://kejserbi.wordpress.com/2011/07/01/the-ascending-key-problem-in-fact-tables-part-one-pain/ +[The Ascending Key Problem In Fact Tables –Part Two: Stat Job!]:http://blog.kejser.org/the-ascending-column-problem-in-fact-tables-part-two-stat-job/ +[Are Statistics Being Used for inserted and deleted tables and table variables?]:https://community.idera.com/database-tools/blog/b/community_blog/posts/are-statistics-being-used +[Tackling Imperial and US Customary Measurements in Databases]:https://www.red-gate.com/simple-talk/blogs/tackling-imperial-and-us-customary-measurements-in-databases/ +[In-Memory OLTP Best Practices – Part 1]:https://devblogs.microsoft.com/premier-developer/in-memory-oltp-best-practices-part-1/ +[In-Memory OLTP Best Practices – Part 2]:https://devblogs.microsoft.com/premier-developer/in-memory-oltp-best-practices-part-2/ +[Things I Wished More Developers Knew About Databases]:https://medium.com/@rakyll/things-i-wished-more-developers-knew-about-databases-2d0178464f78 +[Online migrations at scale]:https://stripe.com/blog/online-migrations +[The Dirty (Baker’s) Dozen of SQL Server Technical Debt]:https://blog.coeo.com/the-dirty-bakers-dozen-of-sql-server-technical-debt +[15 SQL Server Performance Counters to Monitor In 2020]:https://www.sentryone.com/blog/allenwhite/sql-server-performance-counters-to-monitor +[Pulling Group By Above a Join]:https://www.sql.kiwi/2020/05/pulling-group-by-above-join.html +[SQLskills SQL101: Running out of ints and bigints]:https://www.sqlskills.com/blogs/paul/sqlskills-sql101-running-out-of-ints-and-bigints/ +[Top Asked Availability Group Questions… and Maybe Some Helpful Tidbits as Answers]:https://www.seangallardy.com/top-asked-availability-group-questions-and-maybe-some-helpful-tidbits-as-answers/ +[Encrypting SQL Server Database Backups]:https://sqlundercover.com/2018/04/04/encrypting-sql-server-database-backups/ +[Using Track Causality to Understand Query Execution]:https://sqlperformance.com/2019/01/extended-events/using-track-causality-to-understand-query-execution +[Understanding SQL Server Backup Types]:https://www.sqlshack.com/understanding-sql-server-backup-types/ +[Scripting the Description of Database Tables Using Extended Properties]:https://www.red-gate.com/simple-talk/sql/database-delivery/scripting-description-database-tables-using-extended-properties/ +[The Table Variable in SQL Server]:https://www.sqlshack.com/the-table-variable-in-sql-server/ +[Multiple Plans for an "Identical" Query]:https://sqlperformance.com/2014/11/t-sql-queries/multiple-plans-identical-query +[Another argument for stored procedures versus ORM versus Add Hoc Queries]:https://sqlperformance.com/2013/05/t-sql-queries/another-argument-for-stored-procedures +[Bad habits to kick : avoiding the schema prefix]:https://sqlblog.org/2019/09/12/bad-habits-to-kick-avoiding-the-schema-prefix +[How not to call Hekaton natively-compiled stored procedures]:https://sqlperformance.com/2015/06/t-sql-queries/how-not-to-call-hekaton-procedures +[A One-Slide Summary of the Differences Between TDE and Always Encrypted]:https://www.brentozar.com/archive/2020/07/a-one-slide-summary-of-the-differences-between-tde-and-always-encrypted/ +[Remember “Nothing Stops a Hekaton Transaction?” Yeah, About That.]:https://www.brentozar.com/archive/2020/07/remember-nothing-stops-a-hekaton-transaction-yeah-about-that/ +[Finding & Downloading Required SQL Server Updates]:https://flxsql.com/downloading-latest-sql-server-updates/ +[SQLskills SQL101: Why do some wait types need to be ignored?]:https://www.sqlskills.com/blogs/paul/sqlskills-sql101-why-do-some-wait-types-need-to-be-ignored/ +[What is the SOS_WORK_DISPATCHER Wait Type? (Or how to work with Call Stacks in SQL Server)]:https://orderbyselectnull.com/2018/09/27/what-is-the-sos_work_dispatcher-wait-type/ +[SQL Server 2019 Aggregate Splitting]:https://www.sql.kiwi/2020/08/sql-server-2019-aggregate-splitting.html +[Security Best Practice: dny and revoke permissions granted to All Users by default - HIGHLY IMPORTANT!]:https://ariely.info/Blog/tabid/83/EntryId/241/Security-Best-Practice-dny-and-revoke-permissions-granted-to-All-Users-by-default-HIGHLY-IMPORTANT.aspx +[The Trillion Row Operator]:https://www.erikdarlingdata.com/2020/08/the-trillion-row-operator/ +[Temporal Tables and Table Partitioning: Not If You Like Switching Partitions]:https://www.erikdarlingdata.com/sql-server/temporal-tables-and-table-partitioning-not-if-you-like-switching-partitions/ +[Long Running Query on Read-Only Replica that takes moments on the Primary]:https://dba.stackexchange.com/questions/237671/long-running-query-on-read-only-replica-that-takes-moments-on-the-primary/ +[Date Tables are Great for Users, but Not So Great for Performance]:https://www.brentozar.com/archive/2020/08/date-tables-are-great-for-users-but-not-so-great-for-performance/ +[Should I install SSMS on a server running SQL Server?]:https://am2.co/2020/04/should-i-install-ssms-on-a-server-running-sql-server/ +[Finding a table name from a page ID]:https://www.sqlskills.com/blogs/paul/finding-table-name-page-id/ +[Finding Distinct Values Quickly]:https://sqlperformance.com/2020/03/sql-performance/finding-distinct-values-quickly +[Can You Fail To Spill To tempdb?]:https://www.joshthecoder.com/2019/07/17/can-you-fail-to-spill-to-tempdb.html +[Migrating SQL workloads to Microsoft Azure: Databases Trip to Azure SQL Database]:https://www.sqlshack.com/migrate-sql-workloads-to-microsoft-azure-databases-trip-to-azure-sql-database/ +[How It Works: Bob Dorr's SQL Server I/O Presentation]:https://techcommunity.microsoft.com/t5/sql-server-support/how-it-works-bob-dorr-s-sql-server-i-o-presentation/ba-p/316031 +[Who does SQL Server run xp_cmdshell command as?]:https://stevestedman.com/2020/04/who-does-sql-server-run-xp_cmdshell-command-as/ +[Transaction Modes in SQL Server]:https://36chambers.wordpress.com/2020/08/10/transaction-modes-in-sql-server/ +[Working Effectively with Legacy SQL]:https://www.catallaxyservices.com/presentations/legacy-sql/ +[A SQL Server DBA myth a day: (26/30) nested transactions are real]:https://www.sqlskills.com/blogs/paul/a-sql-server-dba-myth-a-day-2630-nested-transactions-are-real/ +[dbatools multithreading commands with PoshRSJob module]:https://dbatools.io/multithread/ +[SQL Server Debugging with WinDbg – an Introduction]:https://www.sqlpassion.at/archive/2014/05/05/sql-server-debugging-with-windbg-an-introduction/ +[Looking deeper into SQL Server using Minidumps]:https://docs.microsoft.com/en-gb/archive/blogs/sqlcat/looking-deeper-into-sql-server-using-minidumps +[Anatomy of a spool operators in SQL Server execution plans]:https://sqlserverfast.com/articles/anatomy-of-a-spool/ +[CAST v/s CONVERT – Is there a difference as far as SQL Server is concerned? Which is better?]:https://nakulvachhrajani.com/2011/07/18/cast-vs-convert-is-there-a-difference-as-far-as-sql-server-is-concerned-which-is-better/ +[#BackToBasics: CAST vs. CONVERT]:https://www.sentryone.com/blog/aaronbertrand/backtobasics-cast-vs-convert +[Productivity Hacks: Migrate in Minutes to the Most Current Version of SQL Server]:https://www.rubrik.com/blog/migrate-quickly-current-version-sql-server/ +[Database alias in Microsoft SQL Server]:http://www.baud.cz/blog/database-alias-in-microsoft-sql-server +[The Curious Case of… the 8060-byte row size limit]:https://www.sqlskills.com/blogs/paul/the-curious-case-of-the-8060-byte-row-size-limit/ +[.NET TransactionScope Considered Annoying - Default Isolation Level is Serializable]:https://joshthecoder.com/2020/07/27/transactionscope-considered-annoying.html +[Why You’re Tuning Stored Procedures Wrong (the Problem with Local Variables)]:https://www.brentozar.com/archive/2014/06/tuning-stored-procedures-local-variables-problems/ +[Yet Another Post About Local Variables]:https://www.erikdarlingdata.com/sql-server/yet-another-post-about-local-variables/ +[Cleaning up Backups from Azure Blob Storage]:http://www.nikoport.com/2020/03/30/cleaning-up-backups-from-azure-blob-storage/ +[Temporary Table Caching Explained]:https://www.sql.kiwi/2012/08/temporary-object-caching-explained.html +[SQL Server Temporary Object Caching]:https://sqlperformance.com/2017/05/sql-performance/sql-server-temporary-object-caching +[3 Ways to Run DBCC CHECKDB Faster]:https://www.brentozar.com/archive/2020/08/3-ways-to-run-dbcc-checkdb-faster/ +[Back Up SQL Server 43%-67% Faster by Writing to Multiple Files]:https://www.brentozar.com/archive/2020/08/back-up-sql-server-43-67-faster-by-writing-to-multiple-files/ +[Bad Habits to Kick : Using SELECT * / omitting the column list]:https://sqlblog.org/2009/10/10/bad-habits-to-kick-using-select-omitting-the-column-list +[All The Problems With Select *]:https://www.erikdarlingdata.com/sql-server/all-the-problems-with-select/ +[When Select * Doesn’t Matter]:https://www.erikdarlingdata.com/sql-server/when-select-doesnt-matter/ +[HT Waits – Explained and Animated]:https://forrestmcdaniel.com/2020/08/12/ht-waits-explained-and-animated/ +[SQL Server 100% Online Deployments]:https://michaeljswart.com/2018/01/100-online-deployments/ +[The Curious Case of… setting up a server for DBCC CHECKDB]:https://www.sqlskills.com/blogs/paul/the-curious-case-of-setting-up-a-server-for-dbcc-checkdb/ +[When should a primary key be declared non-clustered?]:https://dba.stackexchange.com/q/7741/107045 +[Guid vs INT - Which is better as a primary key?]:https://dba.stackexchange.com/q/264/107045 +[Control SQL Jobs based on HADR Role – Taking it to the Next Level]:https://eitanblumin.com/2020/05/26/sql-jobs-based-on-hadr-role-next-level/ +[SQL Friday #16: Eitan Blumin on “How to HADR Your SQL Jobs”]:https://sqlfriday.net/past-sql-friday-sessions/sql-friday-16-eitan-blumin-on-how-to-hadr-your-sql-jobs/ +[Choosing the Correct Azure VM Size for Your Workload]:https://www.sentryone.com/blog/choosing-the-correct-azure-vm-size-for-your-workload +[Table Partitioning in SQL Server – The Basics]:https://www.cathrinewilhelmsen.net/2015/04/12/table-partitioning-in-sql-server/ +[Table Partitioning in SQL Server – Partition Switching]:https://www.cathrinewilhelmsen.net/2015/04/19/table-partitioning-in-sql-server-partition-switching/ +[TempDB in SQL Server]:https://www.sentryone.com/tempdb-in-sql-server +[SQL Server’s Cost Threshold for Parallelism]:https://www.brentozar.com/archive/2014/11/sql-server-cost-threshold-for-parallelism/ +[How many CPUs is my parallel query using in SQL Server?]:https://www.brentozar.com/archive/2014/11/many-cpus-parallel-query-using-sql-server/ +[Protecting your data against unauthorised reads on SQL Server]:https://monin-it.be/2020/06/23/protectingyourdata/ +[SET IMPLICIT_TRANSACTIONS ON Is One Hell of a Bad Idea]:https://www.brentozar.com/archive/2018/02/set-implicit_transactions-one-hell-bad-idea/ +[Tempdb: The Ghost Of Version Store]:https://kohera.be/blog/sql-server/tempdb-the-ghost-of-version-store/ +[Row Versioning Concurrency in SQL Server]:https://www.red-gate.com/simple-talk/sql/t-sql-programming/row-versioning-concurrency-in-sql-server/ +[When Tempdb Becomes Permanentdb (In-memory tempdb metadata and Resource governor problems)]:https://kohera.be/blog/sql-server/when-tempdb-becomes-permanentdb/ +[The Best Medium-Hard Data Analyst SQL Interview Questions]:https://quip.com/2gwZArKuWk7W +[Starting SQL: Why Not Make Everything Dynamic?]:https://www.erikdarlingdata.com/starting-sql/starting-sql-why-not-make-everything-dynamic/ +[dbatools multithreading commands]:https://dbatools.io/multithread/ +[Preventing Brute Force Attacks in SQL Server]:https://blog.coeo.com/preventing-brute-force-attacks-in-sql-server +[Asynchronous T-SQL Execution Without Service Broker]:https://www.codeproject.com/Articles/29356/Asynchronous-T-SQL-Execution-Without-Service-Broke +[Using hash values in SSIS to determine when to insert or update rows]:https://www.mssqltips.com/sqlservertip/3170/using-hash-values-in-ssis-to-determine-when-to-insert-or-update-rows/ +[Capturing Queries Can Be A Pain]:https://www.scarydba.com/2020/08/03/capturing-queries-can-be-a-pain/ +[Building full-text indexes using the Sphinx search engine]:https://www.sqlshack.com/building-full-text-indexes-using-the-sphinx-search-engine/ +[Starting SQL: Measuring A Query]:https://www.erikdarlingdata.com/starting-sql/starting-sql-measuring-a-query/ +[When to use SET vs SELECT when assigning values to variables in SQL Server]:https://www.mssqltips.com/sqlservertip/1888/when-to-use-set-vs-select-when-assigning-values-to-variables-in-sql-server/ +[What is the difference between SET and SELECT when assigning values to variables, in T-SQL?]:http://vyaskn.tripod.com/differences_between_set_and_select.htm +[CHECKDB From Every Angle: How long will CHECKDB take to run?]:https://www.sqlskills.com/blogs/paul/checkdb-from-every-angle-how-long-will-checkdb-take-to-run/ +[CHECKDB From Every Angle: Consistency Checking Options for a VLDB]:https://www.sqlskills.com/blogs/paul/checkdb-from-every-angle-consistency-checking-options-for-a-vldb/ +[Minimizing the impact of DBCC CHECKDB : DOs and DON'Ts]:https://sqlperformance.com/2012/11/io-subsystem/minimize-impact-of-checkdb +[A faster CHECKDB – Part II]:https://web.archive.org/web/20150315173540/http://blogs.msdn.com/b/psssql/archive/2012/02/23/a-faster-checkdb-part-ii.aspx +[A faster CHECKDB – Part III]:https://web.archive.org/web/20150206201933/http://blogs.msdn.com/b/psssql/archive/2014/11/10/a-faster-checkdb-part-iii.aspx +[A faster CHECKDB – Part IV (SQL CLR UDTs)]:https://web.archive.org/web/20150205043737/http://blogs.msdn.com/b/psssql/archive/2015/01/26/a-faster-checkdb-part-iv-sql-clr-udts.aspx +[Minimize performance impact of SQL Server DBCC CHECKDB]:https://www.mssqltips.com/sqlservertip/2399/minimize-performance-impact-of-sql-server-dbcc-checkdb/ +[Starting SQL: A Little More Fun With Logging Dynamic SQL]:https://www.erikdarlingdata.com/starting-sql/starting-sql-a-little-more-fun-with-logging-dynamic-sql/ +[Allocation Order Scans]:https://sqlperformance.com/2015/01/t-sql-queries/allocation-order-scans +[Parameter Sniffing in SQL Server 2019: Air_Quote_Actual Plans]:https://www.brentozar.com/archive/2019/04/parameter-sniffing-in-sql-server-2019-air_quote_actual-plans/ +[Guide For Set Up Of Telegraf For Monitoring Sql Server Xplat]:https://tracyboggiano.com/archive/2018/02/setup-of-telegraf/ +[Azure Table Storage Tips for the RDBMS Developer]:https://www.sentryone.com/blog/azure-table-storage-tips-for-the-rdbms-developer +[sql_handle and the SQL Server batch text hash]:https://www.sql.kiwi/2020/10/sqlhandle-and-sql-server-batch-text-hash.html +[Navigating DBCC CHECKDB for VLDB]:https://sqlblog.org/2020/11/05/navigating-dbcc-checkdb-for-vldb +[Hidden Formatting Troubles with STR() (SQL Spackle)]:https://www.sqlservercentral.com/articles/hidden-formatting-troubles-with-str-sql-spackle +[The What, Why, When, and How of Incremental Loads]:https://www.timmitchell.net/post/2020/07/23/incremental-loads/ +[How Do I Know If My Query Is Good Enough for Production?]:https://www.brentozar.com/archive/2020/08/how-do-i-know-if-my-query-is-good-enough-for-production/ +[How to Find Out Whose Queries are Using The Most CPU]:https://www.brentozar.com/archive/2020/08/how-to-find-out-whose-queries-are-using-the-most-cpu/ +[Limitations of SQL Server Native Backup and Restore in Amazon RDS]:https://www.mssqltips.com/sqlservertip/5042/limitations-of-sql-server-native-backup-and-restore-in-amazon-rds/ +[SQL Server Native Backup and Restore in Amazon RDS]:https://www.mssqltips.com/sqlservertip/5041/sql-server-native-backup-and-restore-in-amazon-rds/ +[What Is the SQL Server CEIP Service (telemetry)?]:https://www.brentozar.com/archive/2020/10/what-is-the-sql-server-ceip-service/ +[Maximum Simultaneous User Connections]:http://www.sqlnuggets.com/blog/disable-telemetry-on-multiple-sql-servers-with-powershell/ +[Find Database Connection Leaks in Your Application]:https://sqlperformance.com/2017/07/sql-performance/find-database-connection-leaks +[How to Troubleshoot THREADPOOL Waits and Deadlocked Schedulers]:https://eitanblumin.com/2020/10/05/how-to-troubleshoot-threadpool-waits-and-deadlocked-schedulers/ +[Prevent Lock Escalation On Indexed Views]:https://kohera.be/blog/sql-server/prevent-lock-escalation-on-indexed-views/ +[Concatenating Strings in SQL Server]:https://www.madeiradata.com/post/concatenating-strings +[Why Full Text’s CONTAINS Queries Are So Slow]:https://www.brentozar.com/archive/2020/11/why-full-texts-contains-queries-are-so-slow/ +[Migrating SSIS to Azure – an Overview]:https://sqlkover.com/migrating-ssis-to-azure-an-overview/ +[(Video) How to Troubleshoot Someone Else’s Temp Table Contents]:https://www.brentozar.com/archive/2020/11/video-how-to-troubleshoot-someone-elses-temp-table-contents/ +[A Parameterization Puzzle With TOP: Part 1]:https://www.erikdarlingdata.com/execution-plans/a-parameterization-puzzle-with-top-part-1/ +[A Parameterization Puzzle With TOP: Part 2]:https://www.erikdarlingdata.com/execution-plans/a-parameterization-puzzle-with-top-part-2/ +[T-SQL: Get The Text Between Two Delimiters]:https://www.erikdarlingdata.com/sql-server/t-sql-get-the-text-between-two-delimiters/ +[Explore dynamic management views for monitoring SQL Server Always On Availability Groups]:https://www.sqlshack.com/explore-dynamic-management-views-for-monitoring-sql-server-always-on-availability-groups/ +[Deploy SQLWATCH to SQL Server using GitHub Actions]:https://www.kevinrchant.com/2020/11/17/deploy-sqlwatch-to-sql-server-using-github-actions/ +[SQL Server table hints – WITH (NOLOCK) best practices]:https://www.sqlshack.com/understanding-impact-clr-strict-security-configuration-setting-sql-server-2017/ +[Memory-Optimized TempDB Metadata in SQL Server 2019]:https://www.mssqltips.com/sqlservertip/6230/memoryoptimized-tempdb-metadata-in-sql-server-2019/ +[SQLskills SQL101: Should you kill that long-running transaction?]:https://www.sqlskills.com/blogs/paul/sqlskills-sql101-should-you-kill-that-long-running-transaction/ +[A quick and dirty scan of a list of instances using a dynamic linked server]:https://sqlstudies.com/2020/11/12/a-quick-and-dirty-scan-of-a-list-of-instances-using-a-dynamic-linked-server/ +[sp_whoisactive: Analyzing Tempdb Contention]:http://whoisactive.com/docs/21_tempdb/ +[How to Choose Between RCSI and Snapshot Isolation Levels]:https://littlekendra.com/2016/02/18/how-to-choose-rcsi-snapshot-isolation-levels/ +[Explore the SQL query table hint READPAST]:https://www.sqlshack.com/explore-the-sql-query-table-hint-readpast/ +[How Bad Statistics Cause Bad SQL Server Query Performance]:https://www.brentozar.com/archive/2020/11/how-bad-statistics-cause-bad-sql-server-query-performance/ +[How Scalar User-Defined Functions Slow Down Queries]:https://www.brentozar.com/archive/2020/11/how-scalar-user-defined-functions-slow-down-queries/ +[Could verifying your backups be costing you money?]:https://blog.coeo.com/verifying-backups-cost +[Extended Events: System_health And A Long Running Query]:https://www.scarydba.com/2020/03/09/extended-events-system_health-and-a-long-running-query/ +[Altering an indexed view in SQL Server drops all indexes]:https://littlekendra.com/2020/03/02/altering-an-indexed-view-in-sql-server-drops-all-indexes/ +[Deprecated and discontinued features in SQL Server]:https://bornsql.ca/blog/deprecated-and-discontinued-features-in-sql-server/ +[Query Store, Plan Forcing, And Drop/create]:https://www.scarydba.com/2020/03/02/query-store-plan-forcing-and-drop-create/ +[Uncommon SQL in SQL Server]:https://nocolumnname.blog/2020/11/20/uncommon-sql/ +[Configure SQL Server Replication between AWS RDS SQL Server and On-premises SQL Server]:https://www.sqlshack.com/configure-sql-server-replication-between-aws-rds-sql-server-and-on-premises-sql-server/ +[Import data into Azure SQL database from AWS Redshift]:https://www.sqlshack.com/import-data-into-azure-sql-database-from-aws-redshift/ +[When You’re Troubleshooting Blocking, Look at Query #2, Too.]:https://www.brentozar.com/archive/2020/11/when-youre-troubleshooting-blocking-look-at-query-2-too/ +[Finding the One Query to Tune in a Multi-Query Batch]:https://www.brentozar.com/archive/2020/11/finding-the-one-query-to-tune-in-a-multi-query-batch/ +[Recursion in SQL Explained Visually]:https://medium.com/swlh/recursion-in-sql-explained-graphically-679f6a0f143b +[Viva la Famiglia! Stored procedure for created recursive family tree]:https://bradsruminations.blogspot.com/2009/10/viva-la-famiglia.html +[How to Set & Get the Next ID Without Serializable Isolation]:https://www.brentozar.com/archive/2020/11/how-to-set-get-the-next-id-without-serializable-isolation/ +[Discovering Three or Four Part Names in SQL Server Database Code]:https://www.red-gate.com/simple-talk/blogs/discovering-three-or-four-part-names-in-sql-server-database-code/ +[Troubleshooting RESOURCE_SEMAPHORE_QUERY_COMPILE Helper Queries]:https://www.erikdarlingdata.com/sql-server/troubleshooting-resource_semaphore_query_compile-helper-queries/ +[When Do I Need to Use DESC in Indexes?]:https://www.brentozar.com/archive/2020/11/when-do-i-need-to-use-desc-in-indexes/ +[Export Power BI Desktop data to SQL Server]:https://ruiromanoblog.wordpress.com/2016/04/21/use-power-bi-desktop-as-an-etl-tool/ +[Exploring errors to reveal unauthorized information]:https://www.red-gate.com/simple-talk/sql/database-administration/exploring-errors-to-reveal-unauthorized-information/ +[How to run your CTE just once, and re-use the output]:https://sqlsunday.com/2020/12/01/run-your-cte-just-once-and-reuse-output/ +[Documenting SSIS Packages using Sequence Diagrams]:https://www.sqlshack.com/documenting-ssis-packages-using-sequence-diagrams-2/ +[Performance testing with DBCC DROPCLEANBUFFERS]:https://www.dbdelta.com/performance-testing-with-dbcc-dropcleanbuffers/ +[Optimizing memory settings in Analysis Services]:https://www.sqlbi.com/articles/optimizing-memory-settings-in-analysis-services/ +[VMware and SQL Server Best Practices]:https://straightpathsql.com/archives/2020/12/vmware-and-sql-server-best-practices/ +[Autoparameterized Trivial Queries May Not Get Partition Elimination]:https://www.brentozar.com/archive/2020/12/autoparameterized-trivial-queries-may-not-get-partition-elimination/ +[Trigram Wildcard String Search in SQL Server]:https://sqlperformance.com/2017/09/sql-performance/sql-server-trigram-wildcard-search +[Which Locks Count Toward Lock Escalation?]:https://littlekendra.com/2017/04/03/which-locks-count-toward-lock-escalation/ +[The challenge is on! Community call for creating the fastest number series generator]:https://sqlperformance.com/2020/12/t-sql-queries/number-series-challenge +[SQL Injection Prevention Cheat Sheet]:https://cheatsheetseries.owasp.org/cheatsheets/SQL_Injection_Prevention_Cheat_Sheet.html +[A cheat sheet for isolation levels in SQL Server]:https://blog.coeo.com/a-cheat-sheet-for-isolation-levels-in-sql-server +[Don't Fear the Trace]:https://www.sentryone.com/blog/dont-fear-the-trace +[Which sp_configure Options Clear the Plan Cache?]:https://www.brentozar.com/archive/2017/09/sp_configure-options-clear-plan-cache/ +[The danger of HADR_SYNC_COMMIT wait and synchronous replication in AlwaysOn Availability Groups]:https://aboutsqlserver.com/2019/06/09/hadr-sync-commit/ +[Faster SQL Pagination with Keysets, Continued]:https://blog.jooq.org/2013/11/18/faster-sql-pagination-with-keysets-continued/ +[We need tool support for keyset pagination]:https://use-the-index-luke.com/no-offset +[Index-Only Scan: Avoiding Table Access]:https://use-the-index-luke.com/sql/clustering/index-only-scan-covering-index +[The two top performance problems caused by ORM tool]:https://use-the-index-luke.com/blog/2013-04/the-two-top-performance-problems-caused-by-ORM-tools +[Nested loops join and n1 problem in ORM]:https://use-the-index-luke.com/sql/join/nested-loops-join-n1-problem +[Hash join partial objects]:https://use-the-index-luke.com/sql/join/hash-join-partial-objects +[Myth: Select * (asterisk) is bad]:https://use-the-index-luke.com/blog/2013-08/its-not-about-the-star-stupid +[Indexing LIKE Filters]:https://use-the-index-luke.com/sql/where-clause/searching-for-ranges/like-performance-tuning +[Date and time conditions causing SQL performance problems]:https://use-the-index-luke.com/sql/where-clause/obfuscation/dates +[Dates and Times in SQL Server: more functions you should never use]:https://bornsql.ca/blog/dates-and-times-in-sql-server-more-functions-you-should-never-use/ +[Dates and Times in SQL Server: T-SQL functions to get the current date and time]:https://bornsql.ca/blog/dates-times-sql-server-t-sql-functions-get-current-date-time/ +[Super Scaling Queues Using the LMax Disruptor Pattern And The In-Memory OLTP Engine]:https://chrisadkin.io/2016/01/18/super-scaling-queues-using-the-lmax-disruptor-pattern-and-the-in-memory-oltp-engine/ +[Early History of SQL]:https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=6359709 +[Is it a bad practice to always create a transaction?]:https://dba.stackexchange.com/a/43256 +[Incomplete checkpoints and recovery]:https://www.sqlskills.com/blogs/paul/incomplete-checkpoints-and-recovery/ +[4 SQL Injection Techniques For Stealing Data]:https://bertwagner.com/posts/4-sql-injection-techniques-for-stealing-data/ +[Towards Safer Dynamic SQL]:https://www.erikdarlingdata.com/sql-server/towards-safer-dynamic-sql/ +[Setting the timezone to anything other than UTC]:http://yellerapp.com/posts/2015-01-12-the-worst-server-setup-you-can-make.html +[Advanced Service Broker Sample: Multi-Threading]:https://eitanblumin.com/2018/10/31/advanced-service-broker-sample-multi-threading/ +[Copy a SQL Server database with just the objects and no data]:https://www.mssqltips.com/sqlservertip/4664/copy-a-sql-server-database-with-just-the-objects-and-no-data/ +[QOMPLX Knowledge: Kerberoasting Attacks Explained]:https://www.qomplx.com/qomplx-knowledge-kerberoasting-attacks-explained/ +[How to create a SQL dependency diagram in SQL Server]:https://www.sqlshack.com/how-to-create-a-sql-dependency-diagram-in-sql-server/ +[Query Memory Grants and Resource Semaphores in SQL Server]:https://www.sqlpassion.at/archive/2018/10/16/query-memory-grants-and-resource-semaphores-in-sql-server/ +[Using a Table of Numbers (or a Table of Dates, Months etc)]:https://www.sommarskog.se/Short%20Stories/table-of-numbers.html +[SQL Server MDF and NDF files]:https://www.sqlrecoverysoftware.net/sql-server-mdf-file/recover-mdf-ndf.html +[The SQL Standard ANSI ISO is Public!]:https://modern-sql.com/standard +[SQL Server Full Backup]:https://sqlbak.com/academy/full-backup +[Import data from PDF files using R Scripts SQL Server]:https://www.sqlshack.com/import-data-from-pdf-files-using-r-scripts-sql-server/ +[Adding Additional Data Files To The TempDB Database In SQL Server]:https://jackworthen.com/2017/08/24/adding-additional-data-files-to-the-tempdb-database-in-sql-server/ +[SQL Server Isolation Levels: A Series]:https://sqlperformance.com/2014/07/t-sql-queries/isolation-levels +[SQL Server Isolation Levels: The ACID Properties of Statements & Transactions]:https://sqlperformance.com/2014/02/t-sql-queries/confusion-caused-by-trusting-acid +[SQL Server Isolation Levels: The Serializable Isolation Level]:https://sqlperformance.com/2014/04/t-sql-queries/the-serializable-isolation-level +[SQL Server Isolation Levels: The Repeatable Read Isolation Level]:https://sqlperformance.com/2014/04/t-sql-queries/the-repeatable-read-isolation-level +[SQL Server Isolation Levels: The Read Committed Isolation Level]:https://sqlperformance.com/2014/04/t-sql-queries/the-read-committed-isolation-level +[SQL Server Isolation Levels: Read Committed Snapshot Isolation]:https://sqlperformance.com/2014/05/t-sql-queries/read-committed-snapshot-isolation +[SQL Server Isolation Levels: Data Modifications under Read Committed Snapshot Isolation]:https://sqlperformance.com/2014/05/t-sql-queries/data-modifications-under-rcsi +[SQL Server Isolation Levels: The SNAPSHOT Isolation Level]:https://sqlperformance.com/2014/06/sql-performance/the-snapshot-isolation-level +[SQL Server Isolation Levels: The Read Uncommitted Isolation Level]:https://sqlperformance.com/2015/04/t-sql-queries/the-read-uncommitted-isolation-level +[The OUTPUT Clause for the MERGE Statements]:https://www.sqlservercentral.com/articles/the-output-clause-for-the-merge-statements +[SQLskills SQL101: Query plans based on what’s in memory]:https://www.sqlskills.com/blogs/paul/sqlskills-sql101-query-plans-based-on-whats-in-memory/ +[Performance: String Concatenation in SQL Server]:https://stevestedman.com/2021/01/performance-string-concatenation-in-sql-server/ +[Performance: Faster way to concatenate longer string]:https://stevestedman.com/2021/01/performance-faster-way-to-concatenate-longer-string/ +[Identifying Cost-Saving Opportunities in Azure DevOps]:https://www.sentryone.com/blog/cost-savings-in-azuredevops +[One wide index or multiple narrow indexes?]:https://sqlinthewild.co.za/index.php/2010/09/14/one-wide-index-or-multiple-narrow-indexes/ +[The Hidden Danger of Readable Secondaries in SQL Server AlwaysOn Availability Groups]:https://www.apress.com/de/blog/all-blog-posts/readable-secondaries-in-sql-server/16064064 +[Poor Man’s Resource Governor: Database-Scoped Configurations]:https://www.brentozar.com/archive/2020/10/poor-mans-resource-governor-database-scoped-configurations/ +[SQL Server Suddenly Frozen? You Might Be Snapshotting Too Many Databases.]:https://www.brentozar.com/archive/2020/09/sql-server-suddenly-frozen-you-might-be-snapshotting-too-many-databases/ +[How to Batch Updates A Few Thousand Rows at a Time]:https://www.brentozar.com/archive/2020/12/how-to-batch-updates-a-few-thousand-rows-at-a-time/ +[USING AMAZON FSX FOR SQL SERVER FAILOVER CLUSTER INSTANCES – WHAT YOU NEED TO KNOW!]:https://clusteringformeremortals.com/2021/01/08/using-amazon-fsx-for-sql-server-failover-cluster-instances-what-you-need-to-know/ +[Sometimes you CAN upsize a column in-place]:https://sqlperformance.com/2020/08/sql-indexes/upsize-column-in-place +[Which Microsoft Certification Should You Get?]:https://www.brentozar.com/archive/2021/01/which-microsoft-certification-should-you-get/ +[SQL Server RAISERROR Cheatsheet]:https://chadbaldwin.net/2021/01/15/raiserror-cheatsheet.html +[Want to Avoid Deployment Downtime? Replication Probably Isn’t the Answer.]:https://www.brentozar.com/archive/2021/01/want-to-avoid-deployment-downtime-replication-probably-isnt-the-answer/ +[“But Surely NOLOCK Is Okay If No One’s Changing Data, Right?”]:https://www.brentozar.com/archive/2021/01/but-surely-nolock-is-okay-if-no-ones-changing-data-right/ +[Why Multiple Plans for One Query Are Bad]:https://www.brentozar.com/archive/2018/03/why-multiple-plans-for-one-query-are-bad/ +[Partitioned Tables Cause Longer Plan Compilation Times.]:https://www.brentozar.com/archive/2021/02/partitioned-tables-cause-longer-plan-compilation-times/ +[Query Hints You Can Use to Avoid Blocking]:https://www.brentozar.com/archive/2021/01/query-hints-you-can-use-to-avoid-blocking/ +[Changing Statistics Cause Longer Compilation Times]:https://www.brentozar.com/archive/2021/02/changing-statistics-cause-longer-compilation-times/ +[Understanding Execution Plan Operator Timings]:https://sqlperformance.com/2021/03/sql-performance/execution-plan-timings +[What Does a Database Administrator Actually Do?]:https://www.brentozar.com/archive/2021/03/what-does-a-database-administrator-actually-do/ +[How Useful Is Column Store In Standard Edition?]:https://www.erikdarlingdata.com/sql-server/how-useful-is-column-store-in-standard-edition/ +[Task Manager’s CPU numbers are all but meaningless]:https://aaron-margosis.medium.com/task-managers-cpu-numbers-are-all-but-meaningless-2d165b421e43 +[Global temporary tables are almost never the answer in SQL Server]:https://blog.greglow.com/2021/02/04/sql-global-temporary-tables-are-almost-never-the-answer-in-sql-server/ +[Never, Ever, Ever Start T-SQL Comments with Two Dashes]:https://www.brentozar.com/archive/2021/04/never-ever-ever-start-t-sql-comments-with-two-dashes/ +[Why All My Servers Have an 8GB Empty File]:https://brianschrader.com/archive/why-all-my-servers-have-an-8gb-empty-file/ +[Incorrect Results with Parallel Eager Spools and Batch Mode]:https://www.sql.kiwi/2021/03/spools-batch-mode-hp.html +[Deprecated features to take out of your toolbox – Part 1]:https://sqlperformance.com/2021/02/sql-performance/deprecated-features-1 +[Deprecated features to take out of your toolbox – Part 2]:https://sqlperformance.com/2021/03/sql-performance/deprecated-features-2 +[Deprecated features to take out of your toolbox – Part 3]:https://sqlperformance.com/2021/07/sql-performance/deprecated-features-3 +[Troubleshooting Security Cache Issues: USERSTORE_TOKENPERM And TokenAndPermUserStore]:https://www.erikdarlingdata.com/sql-server/troubleshooting-security-cache-issues-userstore_tokenperm-and-tokenandpermuserstore/ +[Execution Plans Don’t Have the Yellow Bang They Really Need.]:https://www.brentozar.com/archive/2021/04/execution-plans-dont-have-the-yellow-bang-they-really-need/ +[The Curious Case of… the un-killable thread]:https://www.sqlskills.com/blogs/paul/the-curious-case-of-the-un-killable-thread/ +[olved steries #1 – SQL FCI Failovers]:https://www.seangallardy.com/olved-steries-1-sql-fci-failovers/ +[Possible configuration error: 1000000 IO requests allocated]:https://www.seangallardy.com/possible-configuration-error-1000000-io-requests-allocated/ +[Availability Group Long Failover Times]:https://www.seangallardy.com/availability-group-long-failover-times/ +[Testing Backups and Offloading CheckDB]:https://www.tarynpivots.com/post/2021/testing-backups-offload-dbcc-checkdb/ +[Fighting with Deadlocks]:https://www.tarynpivots.com/post/2021/fighting-with-deadlocks/ +[Syncing Logins Between Availability Group Replicas]:https://www.tarynpivots.com/post/2020/syncing-logins-between-availablity-group-replicas/ +[SQL JOINs and UNIONs]:https://levelup.gitconnected.com/sql-joins-2cc89babb6f9 +[Some opinionated thoughts on SQL databases]:https://blog.nelhage.com/post/some-opinionated-sql-takes/ +[How MERGE on two different rows can still deadlock you]:https://sqlsunday.com/2021/05/04/how-merge-can-deadlock-you/ +[Auto-failover Groups for Azure – Grace Period With Data Loss Hours]:https://sqlworldwide.com/auto-failover-groups-graceperiodwithdatalosshours/ +[How Parallel Plans Start Up – Part 1]:https://sqlperformance.com/2021/03/sql-performance/parallel-plans-start-1 +[How Parallel Plans Start Up – Part 2]:https://sqlperformance.com/2021/04/sql-performance/parallel-plans-start-2 +[How Parallel Plans Start Up – Part 3]:https://sqlperformance.com/2021/04/sql-performance/parallel-plans-start-3 +[How Parallel Plans Start Up – Part 4]:https://sqlperformance.com/2021/05/sql-performance/parallel-plans-start-4 +[How Parallel Plans Start Up – Part 5]:https://sqlperformance.com/2021/05/sql-performance/parallel-plans-start-5 +[Iterators, Query Plans, and Why They Run Backwards]:https://www.sql.kiwi/2010/08/iterators-query-plans-and-why-they-run-backwards.html +[What account is xp_cmdshell using?]:https://sqlstudies.com/2021/05/25/what-account-is-xp_cmdshell-using/ +[Hammer Part 1 -What is HammerDB and why would I use it?]:https://t101wilson.wordpress.com/2021/04/17/hammer-part-1-what-is-hammerdb-and-why-would-i-use-it/ +[Hammer Part 2 -Let the Nail see the Hammer!]:https://t101wilson.wordpress.com/2021/05/26/hammer-part-2-let-the-nail-see-the-hammer/ +[Fun with DATETIME Arithmetics]:https://eitanblumin.com/2021/04/27/fun-with-datetime-arithmetics/ +[Even more fun with DATETIME arithmetics!]:https://eitanblumin.com/2021/06/17/even-more-fun-with-datetime-arithmetics/ +[I learned to love WHILE (true) and you should too]:https://eitanblumin.com/2021/02/16/i-learned-to-love-while-true-and-you-should-too/ +[Troubleshooting Long-Running SHRINK Operations]:https://eitanblumin.com/2020/04/07/troubleshooting-long-running-shrink-operations/ +[The Ultimate Compression Savings Estimation Script for an Entire Database]:https://eitanblumin.com/2020/02/18/ultimate-compression-savings-estimation-script-entire-database/ +[The Complete Guide to Temporary Tables and Table Variables - Part 1]:https://www.madeiradata.com/post/the-complete-guide-to-temporary-tables-and-table-variables-part-1 +[Store Files in a File System, Not a Relational Database.]:https://www.brentozar.com/archive/2021/07/store-files-in-a-file-system-not-a-relational-database/ +[Most (XML) and Least (SQL_VARIANT) Favorite Data Type]:https://eitanblumin.com/2021/03/09/t-sql-tuesday-136-most-and-least-favorite-data-type/ +[What should the CPU usage be of a fully-loaded CPU that has been throttled?]:https://devblogs.microsoft.com/oldnewthing/20210629-00/?p=105378 +[Fixing Queues with Watermarks]:https://forrestmcdaniel.com/2021/06/30/fixing-queues-with-watermarks/ +[How to Patch SQL Server]:https://www.brentozar.com/archive/2021/06/how-to-patch-sql-server/ +[“I’m getting index seeks. Why are my row estimates still wrong?”]:https://www.brentozar.com/archive/2021/06/how-can-index-seeks-get-inaccurate-row-estimates/ +[OLAP != OLAP Cube]:https://www.holistics.io/blog/olap-is-not-olap-cube/ +[Connecting a SQL Server client on Linux using Active Directory authentication]:https://sqlsunday.com/2021/04/15/connecting-linux-using-ad-authentication/ +[Is a sort faster when the data is already sorted?]:https://sqlsunday.com/2021/02/15/is-a-sort-faster-when-data-already-sorted/ +[Connect using Windows authentication across domains]:https://sqlsunday.com/2021/02/05/connect-using-windows-authentication-across-domains/ +[The uncorrelated correlated subquery]:https://sqlsunday.com/2020/12/21/the-uncorrelated-correlated-subquery/ +[How to fix rounding errors]:https://sqlsunday.com/2020/12/15/how-to-fix-rounding-errors/ +[The curious case of the Top N Sort]:https://sqlsunday.com/2020/12/08/the-curious-case-of-the-top-n-sort/ +[Consolidating grouped transactions into evenly sized batches]:https://sqlsunday.com/2020/07/13/grouping-into-evenly-sized-batches/ +[A “shock absorber” pattern for high-performance data ingestion]:https://sqlsunday.com/2021/07/15/a-shock-absorber-pattern-for-high-performance-data-ingest/ +[Why Are Linked Server Queries So Bad?]:https://www.brentozar.com/archive/2021/07/why-are-linked-server-queries-so-bad/ +[Fundamentals of table expressions, Part 1]:https://sqlperformance.com/2020/04/t-sql-queries/table-expressions-part-1 +[Fundamentals of table expressions, Part 2 – Derived tables, logical considerations]:https://sqlperformance.com/2020/04/t-sql-queries/table-expressions-part-2 +[Fundamentals of table expressions, Part 3 – Derived tables, optimization considerations]:https://sqlperformance.com/2020/06/t-sql-queries/table-expressions-part-3 +[Fundamentals of table expressions, Part 4 – Derived tables, optimization considerations, continued]:https://sqlperformance.com/2020/07/t-sql-queries/table-expressions-part-4 +[Fundamentals of table expressions, Part 5 – CTEs, logical considerations]:https://sqlperformance.com/2020/08/t-sql-queries/table-expressions-part-5 +[Fundamentals of table expressions, Part 6 – Recursive CTEs]:https://sqlperformance.com/2020/09/t-sql-queries/fundamentals-of-table-expressions-part-6-recursive-ctes +[Fundamentals of table expressions, Part 7 – CTEs, optimization considerations]:https://sqlperformance.com/2020/10/t-sql-queries/table-expressions-part-7 +[Fundamentals of table expressions, Part 8 – CTEs, optimization considerations continued]:https://sqlperformance.com/2020/11/t-sql-queries/table-expressions-part-8 +[Fundamentals of table expressions, Part 9 – Views, compared with derived tables and CTEs]:https://sqlperformance.com/2021/06/t-sql-queries/table-expressions-part-9 +[Fundamentals of table expressions, Part 10 – Views, SELECT *, and DDL changes]:https://sqlperformance.com/2021/07/t-sql-queries/table-expressions-part-10 +[Understanding xp_fileexist and its usage]:https://www.sqlshack.com/understanding-xp_fileexist-and-its-usage/ +[SQL Server Restore Database Options and Examples]:https://www.mssqltips.com/sqlservertip/6893/restore-database-sql-server-options-examples/ +[SQL Server Database RESTORE WITH MOVE or not WITH MOVE]:https://www.mssqltips.com/sqlservertip/3113/sql-server-database-restore-with-move-or-not-with-move/ +[Getting exclusive access to restore SQL Server database]:https://www.mssqltips.com/sqlservertip/1407/getting-exclusive-access-to-restore-sql-server-database/ +[How to migrate a SQL Server database to a lower version]:https://www.mssqltips.com/sqlservertip/2810/how-to-migrate-a-sql-server-database-to-a-lower-version/ +[Make Network Path Visible For SQL Server Backup and Restore in SSMS]:https://www.mssqltips.com/sqlservertip/3499/make-network-path-visible-for-sql-server-backup-and-restore-in-ssms/ +[T-SQL bugs, pitfalls, and best practices – pivoting and unpivoting]:https://sqlperformance.com/2019/09/t-sql-queries/t-sql-pitfalls-pivoting-unpivoting +[How to Prep a SQL Server Availability Group for VM-Level DR Replication]:https://www.davidklee.net/2021/02/08/how-to-prep-a-sql-server-availability-group-for-vm-level-dr-replication/ +[Special Agent Jenkins]:https://nvarscar.wordpress.com/2018/05/03/special-agent-jenkins/ +[What To Avoid If You Want To Use MERGE]:https://michaeljswart.com/2021/08/what-to-avoid-if-you-want-to-use-merge/ +[Solving Gaps and Islands with Enhanced Window]:https://www.itprotoday.com/sql-server/solving-gaps-and-islands-enhanced-window-functions +[How to choose between SQL and NoSQL databases]:https://www.red-gate.com/simple-talk/databases/nosql/how-to-choose-between-sql-and-nosql-databases/ +[SQL Server plan cache mining – Plan attributes]:https://www.red-gate.com/simple-talk/homepage/sql-server-plan-cache-mining-plan-attributes/ +[How to Prep a SQL Server Availability Group for VM-Level DR Replication]:https://www.davidklee.net/2021/02/08/how-to-prep-a-sql-server-availability-group-for-vm-level-dr-replication/ +[How to create an autonomous transaction in SQL Server 2008]:https://techcommunity.microsoft.com/t5/sql-server/how-to-create-an-autonomous-transaction-in-sql-server-2008/ba-p/383471 +[Cloud Comparison: AWS vs. Azure vs. GCP]:https://seniordba.wordpress.com/2021/05/24/cloud-comparison-aws-vs-azure-vs-gcp/ +[New VLF status value]:https://www.sqlskills.com/blogs/paul/new-vlf-status-value/ +[The Simplest Alternative to sp_MSforeachdb]:https://eitanblumin.com/2021/08/05/simplest-alternative-to-sp_msforeachdb/ +[Your database connection deserves a name]:https://andygrunwald.com/blog/your-database-connection-deserves-a-name/ +[Renaming a Database Table In-Flight]:https://engineering.outschool.com/posts/renaming-database-table/ +[Upgrading/Migrating Large Replicated Databases Without Reinitializing]:https://www.sqlskills.com/blogs/jonathan/upgrading-migrating-large-replicated-databases-without-reinitializing/ +[TempDB configuration for people in a hurry]:https://desertdba.com/tempdb-configuration-for-people-in-a-hurry/ +[Help! My tempdb database won’t shrink!]:https://desertdba.com/help-my-tempdb-database-wont-shrink/ +[SQL Server Checkpoint Monitoring with Extended Events]:https://www.mssqltips.com/sqlservertip/6319/sql-server-checkpoint-monitoring-with-extended-events/ +["0 to 60" : Switching to indirect checkpoints]:https://sqlperformance.com/2020/05/system-configuration/0-to-60-switching-to-indirect-checkpoints +[A case against using Basic and Standard (S0 & S1) tiers in Azure SQL Databases]:https://www.nikoport.com/2021/02/09/a-case-against-using-basic-and-standard-s0-s1-tiers-in-azure-sql-databases/ +[Experiment: Does sp_recompile on a table update associated views.]:https://sqlstudies.com/2021/08/17/experiment-does-sp_recompile-on-a-table-update-associated-views/ +[On index key size, index depth, and performance]:https://www.sqlskills.com/blogs/paul/on-index-key-size-index-depth-and-performance/ +[SQL Server Hierarchyid Data Type Overview and Examples]:https://www.mssqltips.com/sqlservertip/6048/sql-server-hierarchyid-data-type-overview-and-examples/ +[Make It Easier for the DBA: Give SQL Connections the Application’s Name!]:https://bengribaudo.com/blog/2017/06/23/3657/give-sql-connections-the-applications-name +[You Probably Shouldn’t Index Your Temp Tables.]:https://www.brentozar.com/archive/2021/08/you-probably-shouldnt-index-your-temp-tables/ +[SQL Server Error Handling Gotchas]:https://nielsberglund.com/2016/12/31/sql-server-error-handling-gotchas/ +[B-Trees: More Than I Thought I'd Want to Know]:https://benjamincongdon.me/blog/2021/08/17/B-Trees-More-Than-I-Thought-Id-Want-to-Know/ +[Wait Stats During Hash Spills]:https://www.erikdarlingdata.com/sql-server/wait-stats-during-hash-spills/ +[Shrinking The tempdb System Database Without Restarting SQL Server]:https://jackworthen.com/2016/06/02/shrinking-the-tempdb-system-database-without-restarting-sql-server/ +[Graphing SQL Server wait stats on Prometheus and Grafana]:https://blog.developpez.com/mikedavem/p13209/devops/graphing-sql-server-wait-stats-on-prometheus-and-grafana +[Transition from SSMS to DataGrip: 10 tips]:https://blog.jetbrains.com/datagrip/2021/08/19/transition-from-ssms-to-datagrip-10-tips/ +[Query Store Hints]:https://www.sqlskills.com/blogs/erin/query-store-hints/ +[Announcing SSIS Framework Manager, v1]:https://andyleonard.blog/2021/06/announcing-ssis-framework-manager-v1/ +[Improving The Performance of RBAR Modifications]:https://www.erikdarlingdata.com/sql-server/improving-the-performance-of-rbar-modifications/ +[Minimal Logging with INSERT…SELECT into Empty Clustered Tables]:https://sqlperformance.com/2019/05/sql-performance/minimal-logging-empty-clustered +[What Is a Cost-Based Optimizer?]:https://www.brentozar.com/archive/2021/09/what-is-a-cost-based-optimizer/ +[Unusual Parameter Sniffing: Big Problems with Small Data]:https://www.brentozar.com/archive/2021/02/unusual-parameter-sniffing-big-problems-with-small-data/ +[Rowcount estimates when there are no Statistics]:https://matthewmcgiffen.com/2021/01/26/rowcount-estimates-when-there-are-no-statistics/ +[Processing Data Queues in SQL Server with READPAST and UPDLOCK]:https://www.mssqltips.com/sqlservertip/1257/processing-data-queues-in-sql-server-with-readpast-and-updlock/ +[Can You Get Parameter Sniffing on Updates and Deletes?]:https://www.brentozar.com/archive/2021/01/can-you-get-parameter-sniffing-on-updates-and-deletes/ +[An Empirical Look at Key Lookups]:https://forrestmcdaniel.com/2020/12/30/an-empirical-look-at-key-lookups/ +[Please stop using this UPSERT anti-pattern]:https://sqlperformance.com/2020/09/locking/upsert-anti-pattern +[The Curious Case of… the failing differential restore]:https://www.sqlskills.com/blogs/paul/the-curious-case-of-the-failing-differential-restore/ +[Starting SQL: Compensating For Lock Waits]:https://www.erikdarlingdata.com/starting-sql/starting-sql-compensating-for-lock-waits/ +[Finding & Downloading Required SQL Server Updates]:https://www.flxsql.com/downloading-latest-sql-server-updates/ +[Quick SQL Server CPU Comparison Tests]:https://www.erikdarlingdata.com/sql-server/quick-sql-server-cpu-comparison-tests/ +[Using fn_dblog, fn_dump_dblog, and restoring with STOPBEFOREMARK to an LSN]:https://www.sqlskills.com/blogs/paul/using-fn_dblog-fn_dump_dblog-and-restoring-with-stopbeforemark-to-an-lsn/ diff --git a/Errors/Identity_gap_sql_server_2012.sql b/Errors/Identity_gap_sql_server_2012.sql index eb90ddae..3465f56e 100644 --- a/Errors/Identity_gap_sql_server_2012.sql +++ b/Errors/Identity_gap_sql_server_2012.sql @@ -3,12 +3,12 @@ DROP TABLE t1; GO CREATE TABLE t1 ( - col1 INTEGER IDENTITY(1,1), + col1 INTEGER IDENTITY(1,1), col2 VARCHAR(10), - col3 CHAR(10), - col4 NCHAR(10), - col5 TINYINT, - col6 BIGINT + col3 CHAR(10), + col4 NCHAR(10), + col5 TINYINT, + col6 BIGINT ); GO @@ -34,15 +34,15 @@ SELECT *, LEN(col1) AS integer_len, LEN(col2) AS varchar_len, LEN(col3) AS char_len, - LEN(col4) AS nchar_len, - LEN(col5) AS tinyint_len, - LEN(col6) AS bigint_len, - DATALENGTH(col1) AS integer_datalength, - DATALENGTH(col2) AS varchar_datalength, - DATALENGTH(col3) AS char_datalength, - DATALENGTH(col4) AS nchar_datalength, - DATALENGTH(col5) AS tinyint_datalength, - DATALENGTH(col6) AS bigint_datalength + LEN(col4) AS nchar_len, + LEN(col5) AS tinyint_len, + LEN(col6) AS bigint_len, + DATALENGTH(col1) AS integer_datalength, + DATALENGTH(col2) AS varchar_datalength, + DATALENGTH(col3) AS char_datalength, + DATALENGTH(col4) AS nchar_datalength, + DATALENGTH(col5) AS tinyint_datalength, + DATALENGTH(col6) AS bigint_datalength FROM t1; -- DBCC CHECKIDENT('t1', 'RESEED', 5); @@ -55,14 +55,14 @@ GO BEGIN TRY SELECT --/* CAST(-1 AS tinyint), - 1/0 + 1/0 --*/ * FROM t1; END TRY BEGIN CATCH SELECT ERROR_NUMBER() AS ERROR_NUMBER, ERROR_SEVERITY() AS ERROR_SEVERITY, - ERROR_STATE() AS ERROR_STATE, - ERROR_PROCEDURE() AS ERROR_PROCEDURE, + ERROR_STATE() AS ERROR_STATE, + ERROR_PROCEDURE() AS ERROR_PROCEDURE, ERROR_MESSAGE() AS ERROR_MESSAGE, - ERROR_LINE() AS ERROR_LINE; -END CATCH; \ No newline at end of file + ERROR_LINE() AS ERROR_LINE; +END CATCH; diff --git a/Errors/PDB/README.md b/Errors/PDB/README.md new file mode 100644 index 00000000..52624419 --- /dev/null +++ b/Errors/PDB/README.md @@ -0,0 +1,22 @@ +# SQL Server Debugging + +- [Obtaining symbol files (.PDB) for SQL Server Releases](https://github.com/arvindshmicrosoft/SQLCallStackResolver/wiki/Scripts-to-download-symbols-for-SQL-Server-2019) +- [What is the SOS_WORK_DISPATCHER Wait Type?](https://orderbyselectnull.com/2018/09/27/what-is-the-sos_work_dispatcher-wait-type/) +- [An XEvent a Day (24 of 31) – What is the callstack?](https://www.sqlskills.com/blogs/jonathan/an-xevent-a-day-24-of-31-what-is-the-callstack/) + +This section contains PowerShell scripts which automate the download and extraction of `.PDB` files corresponding to major releases of SQL Server. + +For running any of these scripts, please note the following: +- You must run them within PowerShell, preferably within Windows +- You must have Internet access from the machine running the PowerShell script +- You might want to replace the $outputFolder placeholder with a different folder path (for example, `N:\sqlsymbols\SQL2016SP1`) +- The script will automatically create the folder where the downloaded PDB files are stored. + +Please click on one of the links below depending on the major version of SQL Server that you are looking at: +- [SQL Server 2019](SQL-Server-2019.md) +- [SQL Server 2017](SQL-Server-2017.md) +- [SQL Server 2016](SQL-Server-2016.md) +- [SQL Server 2014](SQL-Server-2014.md) +- [SQL Server 2012](SQL-Server-2012.md) +- [SQL Server 2008 R2](SQL-Server-2008-R2.md) +- [SQL Server 2008](SQL-Server-2008.md) diff --git a/Errors/PDB/SQL-Server-2008-R2.md b/Errors/PDB/SQL-Server-2008-R2.md new file mode 100644 index 00000000..c3fce980 --- /dev/null +++ b/Errors/PDB/SQL-Server-2008-R2.md @@ -0,0 +1,100 @@ +# SQL Server 2008 R2 SP3 Security update January 6, 2018 - 10.50.6560.0 - x64 (4057113) +``` powershell +# SQL Server 2008 R2 SP3 Security update January 6, 2018 - 10.50.6560.0 - x64 (4057113) +$outputFolder = 'c:\sqlsyms\10.50.6560.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/b981ac9f18d144989cdc934947f492811/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2009.0100.6560.00 ((KJ_SP3_QFE-OD).171228-1456 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/9e7a839d91dd474a8631dfef6abca4501/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2009.0100.6560.00 ((KJ_SP3_QFE-OD).171228-1456 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/cc4bfc0743fc46b392fa0fdb7c7826452/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2009.0100.6560.00 ((KJ_SP3_QFE-OD).171228-1456 ) +``` + +# SQL Server 2008 R2 SP3 Security update January 6, 2018 - 10.50.6560.0 - x86 (4057113) +``` powershell +# SQL Server 2008 R2 SP3 Security update January 6, 2018 - 10.50.6560.0 - x86 (4057113) +$outputFolder = 'c:\sqlsyms\10.50.6560.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/ef09e694a6c54677a0e350aa61328a851/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2009.0100.6560.00 ((KJ_SP3_QFE-OD).171228-1537 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/a0dd581a069a4f46892922b421e679d41/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2009.0100.6560.00 ((KJ_SP3_QFE-OD).171228-1537 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/31933e3ce06745e1a57659e51088a0082/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2009.0100.6560.00 ((KJ_SP3_QFE-OD).171228-1537 ) +``` + +# SQL Server 2008 R2 SP3 Hotfix KB 3146034 - 10.50.6542.0 - x64 (3146034) +``` powershell +# SQL Server 2008 R2 SP3 Hotfix KB 3146034 - 10.50.6542.0 - x64 (3146034) +$outputFolder = 'c:\sqlsyms\10.50.6542.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/4f088282518843b79e0478994de908221/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2009.0100.6542.00 ((KJ_SP3_QFE-OD).160222-1803 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/ded28d8ceae641748aec32fb45cb2b451/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2009.0100.6542.00 ((KJ_SP3_QFE-OD).160222-1803 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/1efb80e5273747c397f6185ab6670c9d2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2009.0100.6542.00 ((KJ_SP3_QFE-OD).160222-1803 ) +``` + +# SQL Server 2008 R2 SP3 Hotfix KB 3146034 - 10.50.6542.0 - x86 (3146034) +``` powershell +# SQL Server 2008 R2 SP3 Hotfix KB 3146034 - 10.50.6542.0 - x86 (3146034) +$outputFolder = 'c:\sqlsyms\10.50.6542.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/989ad268055f459aa1fd4d1eea34c6ae1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2009.0100.6542.00 ((KJ_SP3_QFE-OD).160222-1804 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/569d9d76538b4106a8c414bf7dcdbe511/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2009.0100.6542.00 ((KJ_SP3_QFE-OD).160222-1804 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/33f28fb385a04fd5afdc44264428efcb2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2009.0100.6542.00 ((KJ_SP3_QFE-OD).160222-1804 ) +``` + +# SQL Server 2008 R2 SP3 MS15-058: Security update QFE: July 14, 2015 - 10.50.6529.0 - x64 (3045314) +``` powershell +# SQL Server 2008 R2 SP3 MS15-058: Security update QFE: July 14, 2015 - 10.50.6529.0 - x64 (3045314) +$outputFolder = 'c:\sqlsyms\10.50.6529.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/6fd8bc7e6da241f9acfef95aa7529e671/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2009.0100.6529.00 ((KJ_SP3_QFE-OD).150319-1313 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/afa19b0c44e54bef8028f5aae687c1751/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2009.0100.6529.00 ((KJ_SP3_QFE-OD).150319-1313 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/282885315f3e4925a0753fdd1e2eae612/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2009.0100.6529.00 ((KJ_SP3_QFE-OD).150319-1313 ) +``` + +# SQL Server 2008 R2 SP3 MS15-058: Security update QFE: July 14, 2015 - 10.50.6529.0 - x86 (3045314) +``` powershell +# SQL Server 2008 R2 SP3 MS15-058: Security update QFE: July 14, 2015 - 10.50.6529.0 - x86 (3045314) +$outputFolder = 'c:\sqlsyms\10.50.6529.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/57832ff449b14214bfbb5b3976147d2c1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2009.0100.6529.00 ((KJ_SP3_QFE-OD).150319-1314 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/bb45c06675b04636aeaa71423c08c0bd1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2009.0100.6529.00 ((KJ_SP3_QFE-OD).150319-1314 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/37b52eaf08284c23bdfda05c7b5bd0f52/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2009.0100.6529.00 ((KJ_SP3_QFE-OD).150319-1314 ) +``` + +# SQL Server 2008 R2 SP3 Hotfix KB3033860 - 10.50.6525.0 - x64 (3033860) +``` powershell +# SQL Server 2008 R2 SP3 Hotfix KB3033860 - 10.50.6525.0 - x64 (3033860) +$outputFolder = 'c:\sqlsyms\10.50.6525.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/fd1e350610034849822cdb74a90e3f4a1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2009.0100.6525.00 ((KJ_SP3_QFE-OD).150123-1315 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/8e5d923c1e744b2395d0faebb7b27aed1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2009.0100.6525.00 ((KJ_SP3_QFE-OD).150123-1315 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/a80a08b5910a4b7c81bca4f7ea5737cb2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2009.0100.6525.00 ((KJ_SP3_QFE-OD).150123-1315 ) +``` + +# SQL Server 2008 R2 SP3 Hotfix KB3033860 - 10.50.6525.0 - x86 (3033860) +``` powershell +# SQL Server 2008 R2 SP3 Hotfix KB3033860 - 10.50.6525.0 - x86 (3033860) +$outputFolder = 'c:\sqlsyms\10.50.6525.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/5705adbab9074c1a8aa3f8086b0b9e351/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2009.0100.6525.00 ((KJ_SP3_QFE-OD).150123-1339 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/24b6b9fb3e3248459032337981a515701/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2009.0100.6525.00 ((KJ_SP3_QFE-OD).150123-1339 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/41239188b6494cedb627d7bb0a7bd2a12/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2009.0100.6525.00 ((KJ_SP3_QFE-OD).150123-1339 ) +``` + +# SQL Server 2008 R2 SP3 SP3 - 10.50.6000.34 - x64 (2979597) +``` powershell +# SQL Server 2008 R2 SP3 SP3 - 10.50.6000.34 - x64 (2979597) +$outputFolder = 'c:\sqlsyms\10.50.6000.34\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/bf37a41b8a974a9a90ac6aaef464011a1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2009.0100.6000.034 ((KJ_SP3).140819-1214 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/21cf8932b0184570858de406b79475031/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2009.0100.6000.034 ((KJ_SP3).140819-1214 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/293c90c8918b4aaaa39ea16237b39eff2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2009.0100.6000.034 ((KJ_SP3).140819-1214 ) +``` + +# SQL Server 2008 R2 SP3 SP3 - 10.50.6000.34 - x86 (2979597) +``` powershell +# SQL Server 2008 R2 SP3 SP3 - 10.50.6000.34 - x86 (2979597) +$outputFolder = 'c:\sqlsyms\10.50.6000.34\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/2a05437dc1204cff970a2275d6335ada1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2009.0100.6000.034 ((KJ_SP3).140819-1213 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/682d729f9e6e43f3a47a9c158e905e171/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2009.0100.6000.034 ((KJ_SP3).140819-1213 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/5b7a3d00503e4924bd365f20b6ea87642/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2009.0100.6000.034 ((KJ_SP3).140819-1213 ) +``` + diff --git a/Errors/PDB/SQL-Server-2008.md b/Errors/PDB/SQL-Server-2008.md new file mode 100644 index 00000000..2a10815a --- /dev/null +++ b/Errors/PDB/SQL-Server-2008.md @@ -0,0 +1,120 @@ +# SQL Server 2008 SP4 Security update January 6, 2018 - 10.0.6556.0 - x64 (4057114) +``` powershell +# SQL Server 2008 SP4 Security update January 6, 2018 - 10.0.6556.0 - x64 (4057114) +$outputFolder = 'c:\sqlsyms\10.0.6556.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/eaa1a756484a4f95bc6896b8529c11701/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2007.0100.6556.00 ((Katmai_SP4_QFE-OD).171228-1515 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/2155ad0fe0a045e38b33e3f36bdb6a211/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2007.0100.6556.00 ((Katmai_SP4_QFE-OD).171228-1515 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/48e9083d8d21441fb77939286bcc001d2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2007.0100.6556.00 ((Katmai_SP4_QFE-OD).171228-1515 ) +``` + +# SQL Server 2008 SP4 Security update January 6, 2018 - 10.0.6556.0 - x86 (4057114) +``` powershell +# SQL Server 2008 SP4 Security update January 6, 2018 - 10.0.6556.0 - x86 (4057114) +$outputFolder = 'c:\sqlsyms\10.0.6556.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/1401bf04646b4e409d7b7a4fc0644fa81/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2007.0100.6556.00 ((Katmai_SP4_QFE-OD).171228-1515 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/dacb0afbc1334010a573e48736ba72ad1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2007.0100.6556.00 ((Katmai_SP4_QFE-OD).171228-1515 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/bd167760b8344d3f90608a2c18cf40092/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2007.0100.6556.00 ((Katmai_SP4_QFE-OD).171228-1515 ) +``` + +# SQL Server 2008 SP4 Hotfix KB3146034 - 10.0.6547.0 - x64 (3146034) +``` powershell +# SQL Server 2008 SP4 Hotfix KB3146034 - 10.0.6547.0 - x64 (3146034) +$outputFolder = 'c:\sqlsyms\10.0.6547.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/e5191b6b180941edb5a20276f9a0384e1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2007.0100.6547.00 ((Katmai_SP4_QFE-OD).160222-1900 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/8fc01c8d34354aa088a13f9c071ebb611/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2007.0100.6547.00 ((Katmai_SP4_QFE-OD).160222-1900 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/3b1145daf61646efbfb3d93ef8948e612/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2007.0100.6547.00 ((Katmai_SP4_QFE-OD).160222-1900 ) +``` + +# SQL Server 2008 SP4 Hotfix KB3146034 - 10.0.6547.0 - x86 (3146034) +``` powershell +# SQL Server 2008 SP4 Hotfix KB3146034 - 10.0.6547.0 - x86 (3146034) +$outputFolder = 'c:\sqlsyms\10.0.6547.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/b37439c8c52c4952845b150ffd7732af1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2007.0100.6547.00 ((Katmai_SP4_QFE-OD).160222-1901 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/d1c5577343cb4ed8bbc36832eb826afc1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2007.0100.6547.00 ((Katmai_SP4_QFE-OD).160222-1901 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/5bd7009e0fcf4b74b69a23467963dfb42/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2007.0100.6547.00 ((Katmai_SP4_QFE-OD).160222-1901 ) +``` + +# SQL Server 2008 SP4 QFE for MS15-058 - 10.0.6535.0 - x64 (3045308) +``` powershell +# SQL Server 2008 SP4 QFE for MS15-058 - 10.0.6535.0 - x64 (3045308) +$outputFolder = 'c:\sqlsyms\10.0.6535.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/2e97b3df36eb4e7fb0ec16f0ba82bd031/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2007.0100.6535.00 ((Katmai_SP4_QFE-OD).150417-1943 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/9bea90cfba544af19a1cf11d034abc001/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2007.0100.6535.00 ((Katmai_SP4_QFE-OD).150417-1943 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/b579d44345e44607a12a9d0d448b7ab42/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2007.0100.6535.00 ((Katmai_SP4_QFE-OD).150417-1943 ) +``` + +# SQL Server 2008 SP4 QFE for MS15-058 - 10.0.6535.0 - x86 (3045308) +``` powershell +# SQL Server 2008 SP4 QFE for MS15-058 - 10.0.6535.0 - x86 (3045308) +$outputFolder = 'c:\sqlsyms\10.0.6535.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/33fe9f06c7b944668d174d77d64fd2051/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2007.0100.6535.00 ((Katmai_SP4_QFE-OD).150417-2008 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/688c68ac33c5460894783989531e65431/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2007.0100.6535.00 ((Katmai_SP4_QFE-OD).150417-2008 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/7b8f66e87c4c4afd995254a5b2e5083a2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2007.0100.6535.00 ((Katmai_SP4_QFE-OD).150417-2008 ) +``` + +# SQL Server 2008 SP4 Hotfix KB3034373 - 10.0.6526.0 - x64 (3034373) +``` powershell +# SQL Server 2008 SP4 Hotfix KB3034373 - 10.0.6526.0 - x64 (3034373) +$outputFolder = 'c:\sqlsyms\10.0.6526.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/85dd188f10df47c0a6b57c70ead0b5c01/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2007.0100.6526.00 ((Katmai_SP4_QFE-OD).150123-1208 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/7c4f51489d884394b902225c7f2b80891/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2007.0100.6526.00 ((Katmai_SP4_QFE-OD).150123-1208 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/422c51381bc04a7fa2b9bd7fe9b04ca32/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2007.0100.6526.00 ((Katmai_SP4_QFE-OD).150123-1208 ) +``` + +# SQL Server 2008 SP4 Hotfix KB3034373 - 10.0.6526.0 - x86 (3034373) +``` powershell +# SQL Server 2008 SP4 Hotfix KB3034373 - 10.0.6526.0 - x86 (3034373) +$outputFolder = 'c:\sqlsyms\10.0.6526.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/913da3830d16455eadff72481f3179401/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2007.0100.6526.00 ((Katmai_SP4_QFE-OD).150123-1211 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/901456d096344ca5bd6a117025a412461/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2007.0100.6526.00 ((Katmai_SP4_QFE-OD).150123-1211 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/3b31c12ff4134cc3afb773e8a830896b2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2007.0100.6526.00 ((Katmai_SP4_QFE-OD).150123-1211 ) +``` + +# SQL Server 2008 SP4 Security Update MS15-058 July 14, 2015 - 10.0.6241.0 - x64 (3045311) +``` powershell +# SQL Server 2008 SP4 Security Update MS15-058 July 14, 2015 - 10.0.6241.0 - x64 (3045311) +$outputFolder = 'c:\sqlsyms\10.0.6241.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/f667598776444a32942ee049bcb442241/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2007.0100.6241.00 ((Katmai_SP4_GDR).150417-1051 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/de19a5bdf857430d9c4a6650dd7667401/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2007.0100.6241.00 ((Katmai_SP4_GDR).150417-1051 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/8d79f55153d444be9a35cc7969cd4c702/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2007.0100.6241.00 ((Katmai_SP4_GDR).150417-1051 ) +``` + +# SQL Server 2008 SP4 Security Update MS15-058 July 14, 2015 - 10.0.6241.0 - x86 (3045311) +``` powershell +# SQL Server 2008 SP4 Security Update MS15-058 July 14, 2015 - 10.0.6241.0 - x86 (3045311) +$outputFolder = 'c:\sqlsyms\10.0.6241.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/7ad87780f3a54788a6fd32f946f1e4751/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2007.0100.6241.00 ((Katmai_SP4_GDR).150417-1052 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/257c88a2ab974c1abcb621bd9f7854ad1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2007.0100.6241.00 ((Katmai_SP4_GDR).150417-1052 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/20ee497f35de471ab067178d8fcfb3572/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2007.0100.6241.00 ((Katmai_SP4_GDR).150417-1052 ) +``` + +# SQL Server 2008 SP4 SP4 - 10.0.6000.29 - x64 (2979597) +``` powershell +# SQL Server 2008 SP4 SP4 - 10.0.6000.29 - x64 (2979597) +$outputFolder = 'c:\sqlsyms\10.0.6000.29\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/fc69079383a34f3b9338254f34b07e531/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2007.0100.6000.029 ((Katmai_SP4).140903-0405) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/116e643b4d7d48dd9c987a2570bf124b1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2007.0100.6000.029 ((Katmai_SP4).140902-2248 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/d7f4aeaf89544a098f18dbaa4405a1802/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2007.0100.6000.029 ((Katmai_SP4).140903-0405) +``` + +# SQL Server 2008 SP4 SP4 - 10.0.6000.29 - x86 (2979597) +``` powershell +# SQL Server 2008 SP4 SP4 - 10.0.6000.29 - x86 (2979597) +$outputFolder = 'c:\sqlsyms\10.0.6000.29\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/220547919ebf4ea4a9dc6ad770f2a97b1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2007.0100.6000.029 ((Katmai_SP4).140902-2247 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/8967aa50a6e147858de6bdf0ca51712b1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2007.0100.6000.029 ((Katmai_SP4).140902-2247 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/1c4ac2e980b444129c6512bc9c9377802/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2007.0100.6000.029 ((Katmai_SP4).140902-2247 ) +``` + diff --git a/Errors/PDB/SQL-Server-2012.md b/Errors/PDB/SQL-Server-2012.md new file mode 100644 index 00000000..15af7196 --- /dev/null +++ b/Errors/PDB/SQL-Server-2012.md @@ -0,0 +1,1020 @@ +# SQL Server 2012 SP4 Security update - 11.0.7493.4 - x64 (4532098) +``` powershell +# SQL Server 2012 SP4 Security update - 11.0.7493.4 - x64 (4532098) +$outputFolder = 'c:\sqlsyms\11.0.7493.4\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/480435d60ca54ce381ec0e8a0a0d76a02/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.7493.04 ((SQL11_SP4_QFE-OD).191224-1917 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/e6c9aa0810194fa6b574b7215b217af72/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.7493.04 ((SQL11_SP4_QFE-OD).191224-1917 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/7a4a97665c58401780368d29ee631ccd2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.7493.04 ((SQL11_SP4_QFE-OD).191224-1917 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/43b4e82b3c66419e8b35da8d9257b3ff2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.7493.04 ((SQL11_SP4_QFE-OD).191224-1917 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/295ba2e5d3194ca5b61b7b31d7c079c11/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.7493.04 ((SQL11_SP4_QFE-OD).191224-1917 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/ae89899ab121405083d262de6e8846961/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.7493.04 ((SQL11_SP4_QFE-OD).191224-1917 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/d20221dff4c941c087921649121052281/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.7493.04 ((SQL11_SP4_QFE-OD).191224-1917 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/b08ffbd94e4b4e17bb1e39045f524abb1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.7493.04 ((SQL11_SP4_QFE-OD).191224-1917 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/da346c631b6e46e7b56825f235d89c561/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.7493.04 ((SQL11_SP4_QFE-OD).191224-1917 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/50c405e5402b43e7a5ef91788f6ef43f2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.7493.04 ((SQL11_SP4_QFE-OD).191224-1917 ) +``` + +# SQL Server 2012 SP4 Security update - 11.0.7493.4 - x86 (4532098) +``` powershell +# SQL Server 2012 SP4 Security update - 11.0.7493.4 - x86 (4532098) +$outputFolder = 'c:\sqlsyms\11.0.7493.4\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/ba8f818630714eb7b381ec0649b061302/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.7493.04 ((SQL11_SP4_QFE-OD).191224-2006 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/7e0415dd919840948ef712d61810daec2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.7493.04 ((SQL11_SP4_QFE-OD).191224-2006 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/68d681fcf4c64f9b883f8512ccdfd05e2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.7493.04 ((SQL11_SP4_QFE-OD).191224-2006 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/30dd863e703c4fa8b9cafd898a9495cf2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.7493.04 ((SQL11_SP4_QFE-OD).191224-2006 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/de5513fd8b1c4fb6b91efe477704b14a1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.7493.04 ((SQL11_SP4_QFE-OD).191224-2006 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/96552da4ca10465c9c33b981bde24ccb1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.7493.04 ((SQL11_SP4_QFE-OD).191224-2006 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/1b99718314a84b3fa7f5d532b463f1701/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.7493.04 ((SQL11_SP4_QFE-OD).191224-2006 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/e5470f778c574450bcdfff21a91b739f1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.7493.04 ((SQL11_SP4_QFE-OD).191224-2006 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/ade3c305ff2c46cd845c19b14deb5aff1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.7493.04 ((SQL11_SP4_QFE-OD).191224-2006 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/339831825ec24abcb2fc18813066d2e82/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.7493.04 ((SQL11_SP4_QFE-OD).191224-2006 ) +``` + +# SQL Server 2012 SP4 Hotfix 4091266 - 11.0.7469.6 - x64 (4091266) +``` powershell +# SQL Server 2012 SP4 Hotfix 4091266 - 11.0.7469.6 - x64 (4091266) +$outputFolder = 'c:\sqlsyms\11.0.7469.6\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/0f91402cd2414afc9a2e81c7af9af9f32/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.7469.06 ((SQL11_PCU_Main).180228-1732 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/514d1b21c758466fa5812d26da1b58de2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.7469.06 ((SQL11_PCU_Main).180228-1732 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/398932bbfb424772b785fed83bae34442/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.7469.06 ((SQL11_PCU_Main).180228-1732 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/c7875e26c11e47b2809ce5aa66cbb7662/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.7469.06 ((SQL11_PCU_Main).180228-1732 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/9b08807bc3514172b8d1a18707f257ca1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.7469.06 ((SQL11_PCU_Main).180228-1732 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/57a1333981da48e5be28cd275e871d811/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.7469.06 ((SQL11_PCU_Main).180228-1732 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/2b1e43f05e0547cfb3217e369e0ed18d1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.7469.06 ((SQL11_PCU_Main).180228-1732 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/d244e857cc9e4109b38ae22f6fb04fe71/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.7469.06 ((SQL11_PCU_Main).180228-1732 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/94e0b5323ed6420ba2baef29da5dba1e1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.7469.06 ((SQL11_PCU_Main).180228-1732 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/64a2e4d6a3b64ea28cca819f9e247d7c2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.7469.06 ((SQL11_PCU_Main).180228-1732 ) +``` + +# SQL Server 2012 SP4 Hotfix 4091266 - 11.0.7469.6 - x86 (4091266) +``` powershell +# SQL Server 2012 SP4 Hotfix 4091266 - 11.0.7469.6 - x86 (4091266) +$outputFolder = 'c:\sqlsyms\11.0.7469.6\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/a95e440af92540b7a0216cca28c2e8b62/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.7469.06 ((SQL11_PCU_Main).180228-1732 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/db6f725509df4ae384ffdca7d0b9eae32/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.7469.06 ((SQL11_PCU_Main).180228-1732 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/ef46921b8c7b447a8c115beb669e311c2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.7469.06 ((SQL11_PCU_Main).180228-1732 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/f0fe075e9ebd4c29af2de0a8e1b1158e2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.7469.06 ((SQL11_PCU_Main).180228-1732 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/d888cccc0fc440eeab4c46a2501cd7521/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.7469.06 ((SQL11_PCU_Main).180228-1732 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/0715c52891824ecb88d15cb3786666211/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.7469.06 ((SQL11_PCU_Main).180228-1732 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/2f26128d326c4a6cbb38596802231c491/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.7469.06 ((SQL11_PCU_Main).180228-1732 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/398336b2642b40a4bf1c2b5cc2a7b6bf1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.7469.06 ((SQL11_PCU_Main).180228-1732 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/10d83224d37e4629908ef64a9724085b1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.7469.06 ((SQL11_PCU_Main).180228-1732 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/b423cb4eaac6424a9c4006d044788cc82/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.7469.06 ((SQL11_PCU_Main).180228-1732 ) +``` + +# SQL Server 2012 SP4 Security update - 11.0.7462.6 - x64 (4057116) +``` powershell +# SQL Server 2012 SP4 Security update - 11.0.7462.6 - x64 (4057116) +$outputFolder = 'c:\sqlsyms\11.0.7462.6\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/97bc282def8043728f8e03d389c56c852/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.7462.06 ((SQL11_PCU_Main).180105-2156 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/91c7c41bb798485595f5be3f1b3125e92/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.7462.06 ((SQL11_PCU_Main).180105-2156 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/c31145b788cb4a25b9afbc0907f55d722/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.7462.06 ((SQL11_PCU_Main).180105-2156 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/93e6f4ad739547b786cfddf1ead5f54f2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.7462.06 ((SQL11_PCU_Main).180105-2156 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/d33e11ce15dc404d815419cc6dcae2ec1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.7462.06 ((SQL11_PCU_Main).180105-2156 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/9bccf357c8564d61bebfd5cdaeddf9231/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.7462.06 ((SQL11_PCU_Main).180105-2156 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/a2f77318440043c2a75db65201a507911/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.7462.06 ((SQL11_PCU_Main).180105-2156 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/169fdc950daa4b918c5f998625fe01861/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.7462.06 ((SQL11_PCU_Main).180105-2156 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/73dab384b2554d8792c8540ff7a066cb1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.7462.06 ((SQL11_PCU_Main).180105-2156 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/9f5d751b247a4d8884a6c9a5e582dffa2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.7462.06 ((SQL11_PCU_Main).180105-2156 ) +``` + +# SQL Server 2012 SP4 Security update - 11.0.7462.6 - x86 (4057116) +``` powershell +# SQL Server 2012 SP4 Security update - 11.0.7462.6 - x86 (4057116) +$outputFolder = 'c:\sqlsyms\11.0.7462.6\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/31d8d73fc89d494481d3ea3bc23d664c2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.7462.06 ((SQL11_PCU_Main).180105-2153 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/dc4b8738e9c040dca6bda5c19fa15d782/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.7462.06 ((SQL11_PCU_Main).180105-2153 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/9148265be6de4d2f9cbc17085dfd2d252/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.7462.06 ((SQL11_PCU_Main).180105-2153 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/3e0a1ca4d3c343bfbb273258041819952/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.7462.06 ((SQL11_PCU_Main).180105-2153 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/cdf3c5fdc15b43f98eb1a8da3c73c7e31/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.7462.06 ((SQL11_PCU_Main).180105-2153 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/1ebe506aeb6b47b38cc5e514fff18f821/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.7462.06 ((SQL11_PCU_Main).180105-2153 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/47e45abe752b453b833d5bed81c4ce231/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.7462.06 ((SQL11_PCU_Main).180105-2153 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/837fc489e2924037a2c108fd7bf90ffa1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.7462.06 ((SQL11_PCU_Main).180105-2153 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/f6e02bcf4295487995a04701333076431/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.7462.06 ((SQL11_PCU_Main).180105-2153 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/ede3587ca5ea4080a4bf758895d0fdb82/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.7462.06 ((SQL11_PCU_Main).180105-2153 ) +``` + +# SQL Server 2012 SP4 SP4 - 11.0.7001.0 - x64 (4018073) +``` powershell +# SQL Server 2012 SP4 SP4 - 11.0.7001.0 - x64 (4018073) +$outputFolder = 'c:\sqlsyms\11.0.7001.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/d037a5a441e9428386cb7b6ccda51df82/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.7001.00 ((SQL11_PCU_Main).170815-1011 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/61a529bd489946bf98c89d9f471a16032/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.7001.00 ((SQL11_PCU_Main).170815-1011 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/0a1268b6e5ad41e6948f59c193c952d52/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.7001.00 ((SQL11_PCU_Main).170815-1011 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/ab769d65e88c454f9cf7bfb804bc3be12/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.7001.00 ((SQL11_PCU_Main).170815-1011 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/cc41b4cad8244f08ab3662e2572863e61/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.7001.00 ((SQL11_PCU_Main).170815-1011 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/b55075b250fe4c2190f26dd98b740c091/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.7001.00 ((SQL11_PCU_Main).170815-1011 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/f360c904a13349cab685811cc7eb5f1b1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.7001.00 ((SQL11_PCU_Main).170815-1011 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/90455f51040c4fccb89a9664c3cba4191/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.7001.00 ((SQL11_PCU_Main).170815-1011 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/c87b18fbc7da4990a51487628770c54e1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.7001.00 ((SQL11_PCU_Main).170815-1011 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/2d2b68a253924aeea6931cd5801d56b52/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.7001.00 ((SQL11_PCU_Main).170815-1011 ) +``` + +# SQL Server 2012 SP4 SP4 - 11.0.7001.0 - x86 (4018073) +``` powershell +# SQL Server 2012 SP4 SP4 - 11.0.7001.0 - x86 (4018073) +$outputFolder = 'c:\sqlsyms\11.0.7001.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/1f36dddd3d7d43eb9626cc5adbaa603c2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.7001.00 ((SQL11_PCU_Main).170815-1005 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/f82f4ae4a2e74ae59338143499fdfd7a2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.7001.00 ((SQL11_PCU_Main).170815-1005 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/11692631f68842a3b597ba39bef3c2432/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.7001.00 ((SQL11_PCU_Main).170815-1005 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/ab9f6918064040508165482354a196de2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.7001.00 ((SQL11_PCU_Main).170815-1005 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/52059b5d64564a1b935825899d6a09511/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.7001.00 ((SQL11_PCU_Main).170815-1005 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/7fbd676ecf644930ab812a23884186861/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.7001.00 ((SQL11_PCU_Main).170815-1005 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/79bd0035ebe24240b8b71405d0e9fc3f1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.7001.00 ((SQL11_PCU_Main).170815-1005 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/82c1e0b607b547f4a81d2dfe719c4cba1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.7001.00 ((SQL11_PCU_Main).170815-1005 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/039700e384e2462d9a74eeae3864859d1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.7001.00 ((SQL11_PCU_Main).170815-1005 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/fbc3c51cbd1149ecbd8fcfb23aeee3b62/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.7001.00 ((SQL11_PCU_Main).170815-1005 ) +``` + +# SQL Server 2012 SP3 CU9 - 11.0.6598.0 - x64 (4016762) +``` powershell +# SQL Server 2012 SP3 CU9 - 11.0.6598.0 - x64 (4016762) +$outputFolder = 'c:\sqlsyms\11.0.6598.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/109c9b322c6c41aaad2d6361ed344ad02/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.6598.00 ((SQL11_SP3_QFE-CU).170418-1648 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/e734e7142f47477eac0a02a531dffe772/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.6598.00 ((SQL11_SP3_QFE-CU).170418-1648 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/5c5a450a77764195a5f87d2aeffd8bd12/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.6598.00 ((SQL11_SP3_QFE-CU).170418-1648 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/7e4bfbdc22c1487cb147642e9d46f8c02/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.6598.00 ((SQL11_SP3_QFE-CU).170418-1648 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/bb02986cda794e5ca7cb081fc9bad8c21/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.6598.00 ((SQL11_SP3_QFE-CU).170418-1648 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/d3eeb1dd8e65453a91ac3ca57199fa231/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.6598.00 ((SQL11_SP3_QFE-CU).170418-1648 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/fd9f36440ccb405aa49a1d713b1f46431/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.6598.00 ((SQL11_SP3_QFE-CU).170418-1648 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/1e76ae5f488f4e249247bcc0a7c951c01/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.6598.00 ((SQL11_SP3_QFE-CU).170418-1648 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/c11a2afc0ae9480db528fc501f88f73a1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.6598.00 ((SQL11_SP3_QFE-CU).170418-1648 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/d82c7ee189224510a7b11cbab2acc87a2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.6598.00 ((SQL11_SP3_QFE-CU).170418-1648 ) +``` + +# SQL Server 2012 SP3 CU9 - 11.0.6598.0 - x86 (4016762) +``` powershell +# SQL Server 2012 SP3 CU9 - 11.0.6598.0 - x86 (4016762) +$outputFolder = 'c:\sqlsyms\11.0.6598.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/708b17ec74154260be962ee64c2c9f7e2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.6598.00 ((SQL11_SP3_QFE-CU).170418-1707 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/45fca01235c64d0f91cf52c1b2c7b6682/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.6598.00 ((SQL11_SP3_QFE-CU).170418-1707 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/6e4b601d5f804d759f96a435d76a062b2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.6598.00 ((SQL11_SP3_QFE-CU).170418-1707 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/b3795d33240a4a27a70c2221f1f5b91f2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.6598.00 ((SQL11_SP3_QFE-CU).170418-1707 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/f4140814836d4d5284231a6d242860381/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.6598.00 ((SQL11_SP3_QFE-CU).170418-1707 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/b3254f3a7f6f4d548b7a2587b420fb681/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.6598.00 ((SQL11_SP3_QFE-CU).170418-1707 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/d3ec35abc942485580a9d1673071e1b31/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.6598.00 ((SQL11_SP3_QFE-CU).170418-1707 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/85152ea7467b4c35971b9799e7f030831/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.6598.00 ((SQL11_SP3_QFE-CU).170418-1707 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/347f6b20b1a5478781c229edc12b2cf41/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.6598.00 ((SQL11_SP3_QFE-CU).170418-1707 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/4b8824881bc7405588c795aa867da2472/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.6598.00 ((SQL11_SP3_QFE-CU).170418-1707 ) +``` + +# SQL Server 2012 SP3 CU7 - 11.0.6579.0 - x64 (3205051) +``` powershell +# SQL Server 2012 SP3 CU7 - 11.0.6579.0 - x64 (3205051) +$outputFolder = 'c:\sqlsyms\11.0.6579.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/28783150f1ee4dbf92e0499225b7590c2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.6579.00 ((SQL11_SP3_QFE-CU).161222-1109 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/b35286f6930c49498baee55c30e567e12/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.6579.00 ((SQL11_SP3_QFE-CU).161222-1109 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/a4af12434c9a45f4af825680e48e5bc22/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.6579.00 ((SQL11_SP3_QFE-CU).161222-1109 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/2202396e27904e5db4fcd4d60aebdd772/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.6579.00 ((SQL11_SP3_QFE-CU).161222-1109 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/32a77bfd1d1b4845883d79c8419052921/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.6579.00 ((SQL11_SP3_QFE-CU).161222-1109 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/100c11aaf13440b680b44057155c2ef21/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.6579.00 ((SQL11_SP3_QFE-CU).161222-1109 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/cb2b6dce02bd40c996cd811ce13ea91a1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.6579.00 ((SQL11_SP3_QFE-CU).161222-1109 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/5c5db77e2d364209a0f61fda02088cf21/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.6579.00 ((SQL11_SP3_QFE-CU).161222-1109 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/fa9e7bd3ef9343f5b5fcca1334992d431/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.6579.00 ((SQL11_SP3_QFE-CU).161222-1109 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/c5b83c833f6a4c7281841b945028f8782/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.6579.00 ((SQL11_SP3_QFE-CU).161222-1109 ) +``` + +# SQL Server 2012 SP3 CU7 - 11.0.6579.0 - x86 (3205051) +``` powershell +# SQL Server 2012 SP3 CU7 - 11.0.6579.0 - x86 (3205051) +$outputFolder = 'c:\sqlsyms\11.0.6579.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/8a904b0b2b754631a46c28eb44dd2efe2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.6579.00 ((SQL11_SP3_QFE-CU).161222-1119 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/661d636bc116485dbf546433cff31f072/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.6579.00 ((SQL11_SP3_QFE-CU).161222-1119 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/a2bbab93772a4b8b8a4000861e06f5b12/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.6579.00 ((SQL11_SP3_QFE-CU).161222-1119 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/c8e36c6acc1d4447a68859546378d0dd2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.6579.00 ((SQL11_SP3_QFE-CU).161222-1119 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/33976bc0acee45e6a5e6d085068c93f31/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.6579.00 ((SQL11_SP3_QFE-CU).161222-1119 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/18c8de6253374d52aad36a38b127f8661/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.6579.00 ((SQL11_SP3_QFE-CU).161222-1119 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/ae64e50371214599be4a3415deb52fbf1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.6579.00 ((SQL11_SP3_QFE-CU).161222-1119 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/ff1efd45c7b64eed9b641ac980799e6b1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.6579.00 ((SQL11_SP3_QFE-CU).161222-1119 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/5d6dcb597aec4881b9ee9a7a6bf96ba71/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.6579.00 ((SQL11_SP3_QFE-CU).161222-1119 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/b2a6eff3ff774b2e82486d092883df462/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.6579.00 ((SQL11_SP3_QFE-CU).161222-1119 ) +``` + +# SQL Server 2012 SP3 CU6 - 11.0.6567.0 - x64 (3194992) +``` powershell +# SQL Server 2012 SP3 CU6 - 11.0.6567.0 - x64 (3194992) +$outputFolder = 'c:\sqlsyms\11.0.6567.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/bb6184470be14d70a6171a0abf7ff4142/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.6567.00 ((SQL11_SP3_QFE-CU).161010-1832 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/59c4ce23af154338a104308ac0cce6232/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.6567.00 ((SQL11_SP3_QFE-CU).161010-1832 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/add423f0ae3d49d195ce1edd7942d3ed2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.6567.00 ((SQL11_SP3_QFE-CU).161010-1832 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/e618e626a6594d009564091cabd9bc262/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.6567.00 ((SQL11_SP3_QFE-CU).161010-1832 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/ac3e5d1c334f413080dd816bf9d1467e1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.6567.00 ((SQL11_SP3_QFE-CU).161010-1832 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/8b09e558e267408eaeaf87a3a2ee37e71/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.6567.00 ((SQL11_SP3_QFE-CU).161010-1832 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/4f2f41869ac54e899e7ff39319663a651/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.6567.00 ((SQL11_SP3_QFE-CU).161010-1832 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/5c78860cf3644c0d89d0699bf3773bf11/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.6567.00 ((SQL11_SP3_QFE-CU).161010-1832 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/db583d5603bc474b8651922e71e401dc1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.6567.00 ((SQL11_SP3_QFE-CU).161010-1832 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/307d6d9eed7c4d5a953f485db595d2de2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.6567.00 ((SQL11_SP3_QFE-CU).161010-1832 ) +``` + +# SQL Server 2012 SP3 CU6 - 11.0.6567.0 - x86 (3194992) +``` powershell +# SQL Server 2012 SP3 CU6 - 11.0.6567.0 - x86 (3194992) +$outputFolder = 'c:\sqlsyms\11.0.6567.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/6830ed55a6d6494b80e8f5b71fd30d8d2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.6567.00 ((SQL11_SP3_QFE-CU).161010-1959 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/913bea3e2f604ac6b5f2fb46bca63fd22/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.6567.00 ((SQL11_SP3_QFE-CU).161010-1959 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/6bedeb07e9c449cdb0018a92727ced2e2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.6567.00 ((SQL11_SP3_QFE-CU).161010-1959 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/faf3de3ef8714e8a89b7e385a57510412/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.6567.00 ((SQL11_SP3_QFE-CU).161010-1959 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/c266fee436644990b265e7e9151c488f1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.6567.00 ((SQL11_SP3_QFE-CU).161010-1959 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/55260b1f426c40c997183184a77c768e1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.6567.00 ((SQL11_SP3_QFE-CU).161010-1959 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/69f53ff9d9e14a0fbb07e0e80678e3181/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.6567.00 ((SQL11_SP3_QFE-CU).161010-1959 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/4223e10e9d3546a795480e990cc148f31/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.6567.00 ((SQL11_SP3_QFE-CU).161010-1959 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/a813fa0504b6441e81a3be6f20c0bc541/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.6567.00 ((SQL11_SP3_QFE-CU).161010-1959 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/6bef5361c8b84cdfa2cdb9731708a2cb2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.6567.00 ((SQL11_SP3_QFE-CU).161010-1959 ) +``` + +# SQL Server 2012 SP3 CU5 - 11.0.6544.0 - x64 (3180915) +``` powershell +# SQL Server 2012 SP3 CU5 - 11.0.6544.0 - x64 (3180915) +$outputFolder = 'c:\sqlsyms\11.0.6544.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/b3a2c45b9cd04194ad768faff2dd480e1/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2011.0110.6544.00 ((SQL11_SP3_QFE-CU).160829-1346 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/e8b5df585c394779a2ff88a39458ebfa1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.6544.00 ((SQL11_SP3_QFE-CU).160829-1346 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/54542e47b335481cbedba3ad6aca9e9c1/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.6544.00 ((SQL11_SP3_QFE-CU).160829-1346 ) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/02526e38efd34a22892561485c3e93331/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2011.0110.6544.00 ((SQL11_SP3_QFE-CU).160829-1346 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/25eee25e365c452fafba7d762dcb5e211/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.6544.00 ((SQL11_SP3_QFE-CU).160829-1346 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/75c6111e1cc1449bad2112e15cd3302c1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.6544.00 ((SQL11_SP3_QFE-CU).160829-1346 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/d50d043ce4fe402e90a622a378ec8add1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.6544.00 ((SQL11_SP3_QFE-CU).160829-1346 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/7009006d3e944eaa82f52532647ce2651/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.6544.00 ((SQL11_SP3_QFE-CU).160829-1346 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/8e119547cbb34fddafba8c65733b36131/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.6544.00 ((SQL11_SP3_QFE-CU).160829-1346 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/3d8457edc2c348ee870e2df8e0ffb5591/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.6544.00 ((SQL11_SP3_QFE-CU).160829-1346 ) +``` + +# SQL Server 2012 SP3 CU5 - 11.0.6544.0 - x86 (3180915) +``` powershell +# SQL Server 2012 SP3 CU5 - 11.0.6544.0 - x86 (3180915) +$outputFolder = 'c:\sqlsyms\11.0.6544.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/58621a8e7f424ceaaf82b6a8621ad5ae2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.6544.00 ((SQL11_SP3_QFE-CU).160829-1356 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/b5cfcf4e10fc47c9b1c57156d868ea882/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.6544.00 ((SQL11_SP3_QFE-CU).160829-1356 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/7bacebdbc3ef47338dcba37b2d5d42012/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.6544.00 ((SQL11_SP3_QFE-CU).160829-1356 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/c5bf5f4f707a4b86bf1d9ce281f7bc142/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.6544.00 ((SQL11_SP3_QFE-CU).160829-1356 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/f662a0c9bba14a7aa62df4a06b8657271/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.6544.00 ((SQL11_SP3_QFE-CU).160829-1356 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/73b2ad756d314c55814d8d03fc8b7b6c1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.6544.00 ((SQL11_SP3_QFE-CU).160829-1356 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/c06729d83eb1457084c51e25542252781/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.6544.00 ((SQL11_SP3_QFE-CU).160829-1356 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/ee5eff6976704286b8be419395371aac1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.6544.00 ((SQL11_SP3_QFE-CU).160829-1356 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/3f5943d18bf84c9189322c1d5aca2a9a1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.6544.00 ((SQL11_SP3_QFE-CU).160829-1356 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/78d4fff0f00047728cb50cb4211c493d2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.6544.00 ((SQL11_SP3_QFE-CU).160829-1356 ) +``` + +# SQL Server 2012 SP3 CU4 - 11.0.6540.0 - x64 (3165264) +``` powershell +# SQL Server 2012 SP3 CU4 - 11.0.6540.0 - x64 (3165264) +$outputFolder = 'c:\sqlsyms\11.0.6540.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/05130a8e03694effbf4ee0a5d93d6f022/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.6540.00 ((SQL11_SP3_QFE-CU).160623-1731 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/d91b0bd2f080497d8898ca7dc13564e12/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.6540.00 ((SQL11_SP3_QFE-CU).160623-1731 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/ee95fd17ecc14e49a85fcf6d693011042/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.6540.00 ((SQL11_SP3_QFE-CU).160623-1731 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/6b39164c29804cc6b7609f81e04c8bb62/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.6540.00 ((SQL11_SP3_QFE-CU).160623-1731 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/e81c72c3de764c97b5615f32b3d10b5f1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.6540.00 ((SQL11_SP3_QFE-CU).160623-1731 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/c363526150464be9a52a234e681f31ed1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.6540.00 ((SQL11_SP3_QFE-CU).160623-1731 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/b5b55e52e8e04520a7c81e3fd8c1aeeb1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.6540.00 ((SQL11_SP3_QFE-CU).160623-1731 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/971700e9f5c24edb979e7aa0820b71981/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.6540.00 ((SQL11_SP3_QFE-CU).160623-1731 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/13788a023dd542da9822e3eea228db7b1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.6540.00 ((SQL11_SP3_QFE-CU).160623-1731 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/031265bbe1a14ada8f4078c6705f7c4c2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.6540.00 ((SQL11_SP3_QFE-CU).160623-1731 ) +``` + +# SQL Server 2012 SP3 CU4 - 11.0.6540.0 - x86 (3165264) +``` powershell +# SQL Server 2012 SP3 CU4 - 11.0.6540.0 - x86 (3165264) +$outputFolder = 'c:\sqlsyms\11.0.6540.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/7abb3b2c641e462d99e832cfaa77b5022/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.6540.00 ((SQL11_SP3_QFE-CU).160623-1729 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/a3440669ec5541c8a7aafd6b6a7e5c152/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.6540.00 ((SQL11_SP3_QFE-CU).160623-1729 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/b031eefe7864472ab762aa98e16b11142/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.6540.00 ((SQL11_SP3_QFE-CU).160623-1729 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/765547fd40cc4aef80ec1b3dd8f0a9292/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.6540.00 ((SQL11_SP3_QFE-CU).160623-1729 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/7651776a76644a30b6a8d7ecdd1d24d11/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.6540.00 ((SQL11_SP3_QFE-CU).160623-1729 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/1de5f51195b54e5eb12f2f56f6237a041/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.6540.00 ((SQL11_SP3_QFE-CU).160623-1729 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/2cc47be0bc3e4cf7b0c0aebac03b08a11/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.6540.00 ((SQL11_SP3_QFE-CU).160623-1729 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/2f3cb78d00b54698824e73ac44b2f9bc1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.6540.00 ((SQL11_SP3_QFE-CU).160623-1729 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/18bb1bb91f9a4ba78e00ea92bc40fe121/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.6540.00 ((SQL11_SP3_QFE-CU).160623-1729 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/b14e40ff51364430b7bed58f8b44cef72/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.6540.00 ((SQL11_SP3_QFE-CU).160623-1729 ) +``` + +# SQL Server 2012 SP3 CU3 - 11.0.6537.0 - x64 (3152635) +``` powershell +# SQL Server 2012 SP3 CU3 - 11.0.6537.0 - x64 (3152635) +$outputFolder = 'c:\sqlsyms\11.0.6537.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/784b2d2a11f4459784a98a777a61e39e2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.6537.00 ((SQL11_SP3_QFE-CU).160428-1744 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/41074d77469a4e0e9217c8e29cb4ed772/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.6537.00 ((SQL11_SP3_QFE-CU).160428-1744 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/a01672c248514057a59d13e89ce93b0f2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.6537.00 ((SQL11_SP3_QFE-CU).160428-1744 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/d5d1a87d5e764f29b202493cbcba3d082/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.6537.00 ((SQL11_SP3_QFE-CU).160428-1744 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/cf422a9dbb8340a5b5000ab5dbd4f4e91/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.6537.00 ((SQL11_SP3_QFE-CU).160428-1744 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/a803eeca499b45fbb53081e01c86e0571/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.6537.00 ((SQL11_SP3_QFE-CU).160428-1744 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/7335b11661aa48f298d976a2448c6f6a1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.6537.00 ((SQL11_SP3_QFE-CU).160428-1744 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/b027f13eb4994ee99ecc152c282fbb581/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.6537.00 ((SQL11_SP3_QFE-CU).160428-1744 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/c99210c7d2ff447c98494bb5c241af8c1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.6537.00 ((SQL11_SP3_QFE-CU).160428-1744 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/dcdc7cc5bfba4aa38c320285a6cdcbaa2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.6537.00 ((SQL11_SP3_QFE-CU).160428-1744 ) +``` + +# SQL Server 2012 SP3 CU3 - 11.0.6537.0 - x86 (3152635) +``` powershell +# SQL Server 2012 SP3 CU3 - 11.0.6537.0 - x86 (3152635) +$outputFolder = 'c:\sqlsyms\11.0.6537.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/87293ca873904ed2b56237e34e3e1f1a2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.6537.00 ((SQL11_SP3_QFE-CU).160428-1744 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/e43071f0910a4ea7bf86b1d5ccc3fd3a2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.6537.00 ((SQL11_SP3_QFE-CU).160428-1744 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/c8f9372146b044febc8ccce8b3c2b1c12/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.6537.00 ((SQL11_SP3_QFE-CU).160428-1744 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/0270b86f2c75487194f651d075a34e5c2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.6537.00 ((SQL11_SP3_QFE-CU).160428-1744 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/4341ceb14e534bb5924ea613956c20361/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.6537.00 ((SQL11_SP3_QFE-CU).160428-1744 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/85fe76a3ab4547f1b1cfad36f43712371/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.6537.00 ((SQL11_SP3_QFE-CU).160428-1744 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/b62e092daed64119808aa2f71fdf41051/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.6537.00 ((SQL11_SP3_QFE-CU).160428-1744 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/91e900c8fc1b4d7f81cbc2e79afbfadc1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.6537.00 ((SQL11_SP3_QFE-CU).160428-1744 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/d39bca94636a4cf0bbeffedf2073f5551/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.6537.00 ((SQL11_SP3_QFE-CU).160428-1744 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/6065f2fd7ce6477bb93ff9dd4b74897a2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.6537.00 ((SQL11_SP3_QFE-CU).160428-1744 ) +``` + +# SQL Server 2012 SP3 CU2 - 11.0.6523.0 - x64 (3137746) +``` powershell +# SQL Server 2012 SP3 CU2 - 11.0.6523.0 - x64 (3137746) +$outputFolder = 'c:\sqlsyms\11.0.6523.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/fcafe44179a349b4b1a42e17631445382/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.6523.00 ((SQL11_SP3_QFE-CU).160302-2113 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/04ab05307b834b1e93aaa5957b68ce492/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.6523.00 ((SQL11_SP3_QFE-CU).160302-2113 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/10d09d86092f400aac076647eeca36492/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.6523.00 ((SQL11_SP3_QFE-CU).160302-2113 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/af7848b84c93447291909dd6fed24bfa2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.6523.00 ((SQL11_SP3_QFE-CU).160302-2113 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/79347e6e63ee4aa7a267ddb157777b3c1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.6523.00 ((SQL11_SP3_QFE-CU).160302-2113 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/7a3302ffc3a643eab7a0eb0a777222d01/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.6523.00 ((SQL11_SP3_QFE-CU).160302-2113 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/d12619783d1247e29e210143f65ebd4f1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.6523.00 ((SQL11_SP3_QFE-CU).160302-2113 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/74204f690ddd470aa8ba6d534f4b07441/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.6523.00 ((SQL11_SP3_QFE-CU).160302-2113 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/0045a36c9f7e4dca997063b212dc62291/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.6523.00 ((SQL11_SP3_QFE-CU).160302-2113 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/86c28146977b477e8bc99340ad0107ff2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.6523.00 ((SQL11_SP3_QFE-CU).160302-2113 ) +``` + +# SQL Server 2012 SP3 CU2 - 11.0.6523.0 - x86 (3137746) +``` powershell +# SQL Server 2012 SP3 CU2 - 11.0.6523.0 - x86 (3137746) +$outputFolder = 'c:\sqlsyms\11.0.6523.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/68a1704d4c60484abdab611a4011ebd22/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.6523.00 ((SQL11_SP3_QFE-CU).160302-2116 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/2b713f51cb3a475c8a0ade5063d183c52/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.6523.00 ((SQL11_SP3_QFE-CU).160302-2116 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/a9139393e7d148949351243a6f2e60372/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.6523.00 ((SQL11_SP3_QFE-CU).160302-2116 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/84966d1d5e904eeda26c06b58e1d8dbb2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.6523.00 ((SQL11_SP3_QFE-CU).160302-2116 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/de7fcca82fa446358962e3106fa609be1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.6523.00 ((SQL11_SP3_QFE-CU).160302-2116 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/39a1b26dcdea427fb467b9aefff863f51/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.6523.00 ((SQL11_SP3_QFE-CU).160302-2116 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/c5f85db1be474d0dbf027a0374de6e9a1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.6523.00 ((SQL11_SP3_QFE-CU).160302-2116 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/49835c6b775c4d9db7d3415b2b59ca741/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.6523.00 ((SQL11_SP3_QFE-CU).160302-2116 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/d74fca8456884c6a9b58acd70da167251/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.6523.00 ((SQL11_SP3_QFE-CU).160302-2116 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/e1d2fd01359645a69447f78c6a39beda2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.6523.00 ((SQL11_SP3_QFE-CU).160302-2116 ) +``` + +# SQL Server 2012 SP3 CU1 - 11.0.6518.0 - x64 (3123299) +``` powershell +# SQL Server 2012 SP3 CU1 - 11.0.6518.0 - x64 (3123299) +$outputFolder = 'c:\sqlsyms\11.0.6518.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/a311f07702a44e019573de6bc28d9a802/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.6518.00 ((SQL11_SP3_QFE-CU).160107-1429 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/122248fa6f9643ffaa1d4b98a8b852892/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.6518.00 ((SQL11_SP3_QFE-CU).160107-1429 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/9d9fff96ee2d47fb8d4a1694bf0bc01a2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.6518.00 ((SQL11_SP3_QFE-CU).160107-1429 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/007a1b4b3ac941cab55a979ce199b3cd2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.6518.00 ((SQL11_SP3_QFE-CU).160107-1429 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/8419c4bbf0b844879129f25d50eda11d1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.6518.00 ((SQL11_SP3_QFE-CU).160107-1429 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/ab53bf1c7c5b415489b8dad9527aaef71/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.6518.00 ((SQL11_SP3_QFE-CU).160107-1429 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/f6d8f219eb804aeeb61e15c17855fa351/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.6518.00 ((SQL11_SP3_QFE-CU).160107-1429 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/d6e72bc2815a411e803c12d5a757e6c21/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.6518.00 ((SQL11_SP3_QFE-CU).160107-1429 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/5f78f36cf3c64d4d8bbf5ae5b8506a5d1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.6518.00 ((SQL11_SP3_QFE-CU).160107-1429 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/466c40a06fe8457a88ac5b2ac31bb8012/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.6518.00 ((SQL11_SP3_QFE-CU).160107-1429 ) +``` + +# SQL Server 2012 SP3 CU1 - 11.0.6518.0 - x86 (3123299) +``` powershell +# SQL Server 2012 SP3 CU1 - 11.0.6518.0 - x86 (3123299) +$outputFolder = 'c:\sqlsyms\11.0.6518.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/85e2f9abea704a94a052cfe9a6dee0572/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.6518.00 ((SQL11_SP3_QFE-CU).160107-1429 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/1522388b2b31493585a6e2b4f2624aa12/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.6518.00 ((SQL11_SP3_QFE-CU).160107-1429 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/2ada5d3381bf4c93aeb02541e200f17b2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.6518.00 ((SQL11_SP3_QFE-CU).160107-1429 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/70b02e6179e54640b5dcc09743e445ee2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.6518.00 ((SQL11_SP3_QFE-CU).160107-1429 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/92fe1e276d4f424988cce512111d09151/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.6518.00 ((SQL11_SP3_QFE-CU).160107-1429 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/a704e7ede8b04298b150daaa93ba4d8f1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.6518.00 ((SQL11_SP3_QFE-CU).160107-1429 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/9040b150117a4e44a073e50d38297c051/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.6518.00 ((SQL11_SP3_QFE-CU).160107-1429 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/2599461ed95c4636bf1b1b4467a5d1e21/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.6518.00 ((SQL11_SP3_QFE-CU).160107-1429 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/9b6afd69a5674b42b6876b28a79d8c161/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.6518.00 ((SQL11_SP3_QFE-CU).160107-1429 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/799ab84cc9fe4b8a9cff76c808c5669c2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.6518.00 ((SQL11_SP3_QFE-CU).160107-1429 ) +``` + +# SQL Server 2012 SP3 SP3 - 11.0.6020.0 - x64 (3072779) +``` powershell +# SQL Server 2012 SP3 SP3 - 11.0.6020.0 - x64 (3072779) +$outputFolder = 'c:\sqlsyms\11.0.6020.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/8c2548391c41414994a23eb9e1ffbc5d2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.6020.00 ((SQL11_PCU_Main).151020-1526 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/8bcf882af198453eae955b7af05df27a2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.6020.00 ((SQL11_PCU_Main).151020-1526 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/3811dbbc84c44f0d979c674cd571926a2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.6020.00 ((SQL11_PCU_Main).151020-1526 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/eb85f8ee377f43f9afed8cd2e9c932192/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.6020.00 ((SQL11_PCU_Main).151020-1526 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/a017c07601cf4596a671f7b35a4119bd1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.6020.00 ((SQL11_PCU_Main).151020-1526 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/b287171e30de46d48bc5e4f50d321d511/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.6020.00 ((SQL11_PCU_Main).151020-1526 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/50aca007a677401f99a7ad15b4631f101/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.6020.00 ((SQL11_PCU_Main).151020-1526 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/cebe10126c694f9089577dc49f71d20e1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.6020.00 ((SQL11_PCU_Main).151020-1526 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/ae66568baac84d068167d6a4a1cd7b001/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.6020.00 ((SQL11_PCU_Main).151020-1526 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/d7c6e98402ea495fa3da17f1aecb29ba2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.6020.00 ((SQL11_PCU_Main).151020-1526 ) +``` + +# SQL Server 2012 SP3 SP3 - 11.0.6020.0 - x86 (3072779) +``` powershell +# SQL Server 2012 SP3 SP3 - 11.0.6020.0 - x86 (3072779) +$outputFolder = 'c:\sqlsyms\11.0.6020.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/9c88c47ad634432f947247b93a4c437a2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.6020.00 ((SQL11_PCU_Main).151020-1525 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/70e38bc1d979482ab3577c81191a07892/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.6020.00 ((SQL11_PCU_Main).151020-1525 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/a71c6013ff7e4b4188afe07b47e9d5112/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.6020.00 ((SQL11_PCU_Main).151020-1525 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/fe998ea9010c43c090935a171585c9152/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.6020.00 ((SQL11_PCU_Main).151020-1525 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/1066d39f48fb4eefbd1096712687a1811/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.6020.00 ((SQL11_PCU_Main).151020-1525 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/b4529742a01b4ee88d17228b861439c21/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.6020.00 ((SQL11_PCU_Main).151020-1525 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/49a2aab10cb04420b666377d96ec5b731/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.6020.00 ((SQL11_PCU_Main).151020-1525 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/5894cb69e99141c1b730209ff772dcb81/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.6020.00 ((SQL11_PCU_Main).151020-1525 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/21ae50d9944c4af2b2868123b95b46591/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.6020.00 ((SQL11_PCU_Main).151020-1525 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/12ddb13831544b28b5f8a4c017d0efa92/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.6020.00 ((SQL11_PCU_Main).151020-1525 ) +``` + +# SQL Server 2012 SP2 CU16 - 11.0.5678.0 - x64 (3205054) +``` powershell +# SQL Server 2012 SP2 CU16 - 11.0.5678.0 - x64 (3205054) +$outputFolder = 'c:\sqlsyms\11.0.5678.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/db25800662db4aa5abc2fe3b1dfa40892/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5678.00 ((SQL11_SP2_QFE-CU).161216-1503 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/c2962322b56545e18fdd1947d7a3f5552/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5678.00 ((SQL11_SP2_QFE-CU).161216-1503 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/26e55d51a2524f8f9c3eb14a9c0a5e7f2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5678.00 ((SQL11_SP2_QFE-CU).161216-1503 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/3f7c15db3e80428d842dc6577dbe957b2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5678.00 ((SQL11_SP2_QFE-CU).161216-1503 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/102484c88a7a454e94a5b6fd7baf00a11/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5678.00 ((SQL11_SP2_QFE-CU).161216-1503 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/6ccba8f0e4194a70a33c5969a18ee7a41/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5678.00 ((SQL11_SP2_QFE-CU).161216-1503 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/5006d5458a6049588ec4c1e0043b13a61/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5678.00 ((SQL11_SP2_QFE-CU).161216-1503 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/c30cda3d5e9f47378676888347f958991/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5678.00 ((SQL11_SP2_QFE-CU).161216-1503 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/8979dfe9d46a474a9c4ceba886d148071/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5678.00 ((SQL11_SP2_QFE-CU).161216-1503 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/a62693b04bed4018829db79c6e9014242/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5678.00 ((SQL11_SP2_QFE-CU).161216-1503 ) +``` + +# SQL Server 2012 SP2 CU16 - 11.0.5678.0 - x86 (3205054) +``` powershell +# SQL Server 2012 SP2 CU16 - 11.0.5678.0 - x86 (3205054) +$outputFolder = 'c:\sqlsyms\11.0.5678.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/c7c7b2fbe65140d48fbfb488363088822/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5678.00 ((SQL11_SP2_QFE-CU).161216-1502 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/b4a31b7568c54b6db1e29cfd4a8c62a12/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5678.00 ((SQL11_SP2_QFE-CU).161216-1502 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/05099346226d439f95d2dc50d23f84042/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5678.00 ((SQL11_SP2_QFE-CU).161216-1502 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/b1228bc7d3284c2bb2716e659b542b5f2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5678.00 ((SQL11_SP2_QFE-CU).161216-1502 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/e3c2403ccac246f7945b28cf1636d68b1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5678.00 ((SQL11_SP2_QFE-CU).161216-1502 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/f9706bb17f8b42128c9a74895ba068091/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5678.00 ((SQL11_SP2_QFE-CU).161216-1502 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/6aad5ebf336a4352be93b0cd1283f3901/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5678.00 ((SQL11_SP2_QFE-CU).161216-1502 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/7ce1f1a9129c489e9358e13dbd8dd6d51/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5678.00 ((SQL11_SP2_QFE-CU).161216-1502 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/08ec37d9396e469a97fa1884e4f3126b1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5678.00 ((SQL11_SP2_QFE-CU).161216-1502 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/cf639729d8724367a1e99d7dce200cc82/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5678.00 ((SQL11_SP2_QFE-CU).161216-1502 ) +``` + +# SQL Server 2012 SP2 CU15 - 11.0.5676.0 - x64 (3205416) +``` powershell +# SQL Server 2012 SP2 CU15 - 11.0.5676.0 - x64 (3205416) +$outputFolder = 'c:\sqlsyms\11.0.5676.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/dd1ba68516834e3eac8754e0c3f763a62/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5676.00 ((SQL11_SP2_QFE-CU).161010-1819 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/d4489a41a7864f41a583d818941820bb2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5676.00 ((SQL11_SP2_QFE-CU).161010-1819 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/96ba3b4dada540baae72f7ac5d372c562/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5676.00 ((SQL11_SP2_QFE-CU).161010-1819 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/58ff259b5717420199bdca05ad6475fa2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5676.00 ((SQL11_SP2_QFE-CU).161010-1819 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/243641435747432bb7cb32747fbb096e1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5676.00 ((SQL11_SP2_QFE-CU).161010-1819 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/d972cc8d2f0c47ec8f219ea7d4152cca1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5676.00 ((SQL11_SP2_QFE-CU).161010-1819 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/5b9529c4d43b4f79ae09b990a453ef2e1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5676.00 ((SQL11_SP2_QFE-CU).161010-1819 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/1e8ddd5ae37c49c98e758b3fd246d4971/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5676.00 ((SQL11_SP2_QFE-CU).161010-1819 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/06783190c3eb47438d51e209b2b15b4a1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5676.00 ((SQL11_SP2_QFE-CU).161010-1819 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/acab102088fb4de3aea8154c3d3073c22/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5676.00 ((SQL11_SP2_QFE-CU).161010-1819 ) +``` + +# SQL Server 2012 SP2 CU15 - 11.0.5676.0 - x86 (3205416) +``` powershell +# SQL Server 2012 SP2 CU15 - 11.0.5676.0 - x86 (3205416) +$outputFolder = 'c:\sqlsyms\11.0.5676.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/c5dce76c002d40228af8b7f4334c43382/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5676.00 ((SQL11_SP2_QFE-CU).161010-1819 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/f9ca6e1c1c5a48509ef17541f440110d2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5676.00 ((SQL11_SP2_QFE-CU).161010-1819 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/a65a7dbefb534977862075b5592cbea22/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5676.00 ((SQL11_SP2_QFE-CU).161010-1819 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/2d77fbddcd3c461788cbbc876813d8672/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5676.00 ((SQL11_SP2_QFE-CU).161010-1819 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/3350d6c06cda4237b5522c0ce229d61e1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5676.00 ((SQL11_SP2_QFE-CU).161010-1819 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/08912861adab4657b566a71ce625b5df1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5676.00 ((SQL11_SP2_QFE-CU).161010-1819 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/591d683835904ed6936cc8c15d53bb271/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5676.00 ((SQL11_SP2_QFE-CU).161010-1819 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/beb991341db6464ba3e901e618e4141c1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5676.00 ((SQL11_SP2_QFE-CU).161010-1819 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/01e137606c424aaea4b7ad65fda59f4a1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5676.00 ((SQL11_SP2_QFE-CU).161010-1819 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/afaeeb6537af486eba72087380814b682/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5676.00 ((SQL11_SP2_QFE-CU).161010-1819 ) +``` + +# SQL Server 2012 SP2 CU14 - 11.0.5657.0 - x64 (3180914) +``` powershell +# SQL Server 2012 SP2 CU14 - 11.0.5657.0 - x64 (3180914) +$outputFolder = 'c:\sqlsyms\11.0.5657.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/25d44c4a218a45e69440f64a6c2f39022/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5657.00 ((SQL11_SP2_QFE-CU).160825-1743 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/4ef82375cf4e42a8be639daea082a4c52/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5657.00 ((SQL11_SP2_QFE-CU).160825-1743 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/ca2d467f8210454ea0b0f9e80185f22a2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5657.00 ((SQL11_SP2_QFE-CU).160825-1743 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/d89b853ec00c4ef4a2ff7439eebe952c2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5657.00 ((SQL11_SP2_QFE-CU).160825-1743 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/87f21dcc1cd04ac3b90b4a6ae1e428201/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5657.00 ((SQL11_SP2_QFE-CU).160825-1743 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/e5104d3be08248348393b672b2a9bb0a1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5657.00 ((SQL11_SP2_QFE-CU).160825-1743 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/ac3edf92e6ec4a12bb6533025087bf2f1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5657.00 ((SQL11_SP2_QFE-CU).160825-1743 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/821c2909862a40bdb68783eb23929cc31/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5657.00 ((SQL11_SP2_QFE-CU).160825-1743 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/d1c8cae724694f6bb2962cdc83f4329e1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5657.00 ((SQL11_SP2_QFE-CU).160825-1743 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/a4a3c0bd71ad4f85bb1e8b97eb7b18862/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5657.00 ((SQL11_SP2_QFE-CU).160825-1743 ) +``` + +# SQL Server 2012 SP2 CU14 - 11.0.5657.0 - x86 (3180914) +``` powershell +# SQL Server 2012 SP2 CU14 - 11.0.5657.0 - x86 (3180914) +$outputFolder = 'c:\sqlsyms\11.0.5657.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/ce78955c784c48afa622c25baf31d45b2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5657.00 ((SQL11_SP2_QFE-CU).160825-1749 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/213855c2ec884f97896f2de644073c0e2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5657.00 ((SQL11_SP2_QFE-CU).160825-1749 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/6aba2304025c482694789dfa59caa53d2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5657.00 ((SQL11_SP2_QFE-CU).160825-1749 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/140309b667144067ab36b0dbd619c6592/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5657.00 ((SQL11_SP2_QFE-CU).160825-1749 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/c3de962144364bee8d4f28ef8a9244911/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5657.00 ((SQL11_SP2_QFE-CU).160825-1749 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/1ceb4d2de2a44439a8704ea70320c65e1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5657.00 ((SQL11_SP2_QFE-CU).160825-1749 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/73272f461ea94ba19eab4f80bad006f01/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5657.00 ((SQL11_SP2_QFE-CU).160825-1749 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/4326574b01f6436a833579f838b757e21/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5657.00 ((SQL11_SP2_QFE-CU).160825-1749 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/8b38568a4a9f49c8b3aec36e8b5a71f41/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5657.00 ((SQL11_SP2_QFE-CU).160825-1749 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/bf3d3e6661b04901834ca05fc19a44352/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5657.00 ((SQL11_SP2_QFE-CU).160825-1749 ) +``` + +# SQL Server 2012 SP2 CU13 - 11.0.5655.0 - x64 (3165266) +``` powershell +# SQL Server 2012 SP2 CU13 - 11.0.5655.0 - x64 (3165266) +$outputFolder = 'c:\sqlsyms\11.0.5655.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/a433571fbd0c41f5ac4d33283de127002/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5655.00 ((SQL11_SP2_QFE-CU).160705-1418 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/960013cc86c5408f9808f8378e2da08a2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5655.00 ((SQL11_SP2_QFE-CU).160705-1418 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/171ddb83c0474edf824711de922e0a172/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5655.00 ((SQL11_SP2_QFE-CU).160705-1418 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/4747e8ca27484a8199bb39b14f211c302/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5655.00 ((SQL11_SP2_QFE-CU).160705-1418 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/69db5fdaa93f408890a49893da554dbb1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5655.00 ((SQL11_SP2_QFE-CU).160705-1418 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/2e74440521ea4986a0b4eb23a776f3d01/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5655.00 ((SQL11_SP2_QFE-CU).160705-1418 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/8b3231d270724bdc997c398a178833891/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5655.00 ((SQL11_SP2_QFE-CU).160705-1418 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/a730d9127fc74a9b9ab5c74334bebfe71/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5655.00 ((SQL11_SP2_QFE-CU).160705-1418 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/9c5081d580624480aab3f8894169a9581/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5655.00 ((SQL11_SP2_QFE-CU).160705-1418 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/519331463ede472796ee00b4dbd637042/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5655.00 ((SQL11_SP2_QFE-CU).160705-1418 ) +``` + +# SQL Server 2012 SP2 CU13 - 11.0.5655.0 - x86 (3165266) +``` powershell +# SQL Server 2012 SP2 CU13 - 11.0.5655.0 - x86 (3165266) +$outputFolder = 'c:\sqlsyms\11.0.5655.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/a40567d01f594052a94636f0cd569c541/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2011.0110.5655.00 ((SQL11_SP2_QFE-CU).160705-1417 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/6f33217e9aa04118a60392866667a4dd1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5655.00 ((SQL11_SP2_QFE-CU).160705-1417 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/a082374fd27f42d8aeb194286aa2f6051/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5655.00 ((SQL11_SP2_QFE-CU).160705-1417 ) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/8877e5f396644ace9da54a50dd1d9e621/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2011.0110.5655.00 ((SQL11_SP2_QFE-CU).160705-1417 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/28f1fa69afaf411b9febdf147cd1175a1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5655.00 ((SQL11_SP2_QFE-CU).160705-1417 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/3d0122e1b8b845c3a2e8aba23fe95f521/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5655.00 ((SQL11_SP2_QFE-CU).160705-1417 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/4ba3538fcd764fc18b0042deb7c698781/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5655.00 ((SQL11_SP2_QFE-CU).160705-1417 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/d06fc9adef414529902a650201013aa21/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5655.00 ((SQL11_SP2_QFE-CU).160705-1417 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/0f5b5abc62a743e3bbd0782075ef62371/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5655.00 ((SQL11_SP2_QFE-CU).160705-1417 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/67f36d2c92b743e5aff3dc36ae129fc41/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5655.00 ((SQL11_SP2_QFE-CU).160705-1417 ) +``` + +# SQL Server 2012 SP2 CU12 - 11.0.5649.0 - x64 (3152637) +``` powershell +# SQL Server 2012 SP2 CU12 - 11.0.5649.0 - x64 (3152637) +$outputFolder = 'c:\sqlsyms\11.0.5649.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/3b91a33f51794e3caa45dae0a72e3c9e2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5649.00 ((SQL11_SP2_QFE-CU).160424-0952 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/8981f04bfc6b49b1bc366fdbba7ac9bc2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5649.00 ((SQL11_SP2_QFE-CU).160424-0952 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/ff6907a9682d4b2c8211be8b09ca3cb42/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5649.00 ((SQL11_SP2_QFE-CU).160424-0952 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/b7f62a1ca0024f608c64c70ab25f49e32/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5649.00 ((SQL11_SP2_QFE-CU).160424-0952 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/20533819d052436b9f11657e00a25c3e1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5649.00 ((SQL11_SP2_QFE-CU).160424-0952 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/4aad9e292bf548faae06ff8ae1d430b31/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5649.00 ((SQL11_SP2_QFE-CU).160424-0952 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/0fa56d3b36df453db62d14d6baf90bb41/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5649.00 ((SQL11_SP2_QFE-CU).160424-0952 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/454c0beb41f946d99f097261b0177c841/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5649.00 ((SQL11_SP2_QFE-CU).160424-0952 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/c8f5be043d814c118f23709c4a1ad1181/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5649.00 ((SQL11_SP2_QFE-CU).160424-0952 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/44f0c5b99ab343e28ab8711fa9bb2a272/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5649.00 ((SQL11_SP2_QFE-CU).160424-0952 ) +``` + +# SQL Server 2012 SP2 CU12 - 11.0.5649.0 - x86 (3152637) +``` powershell +# SQL Server 2012 SP2 CU12 - 11.0.5649.0 - x86 (3152637) +$outputFolder = 'c:\sqlsyms\11.0.5649.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/0a81fe91a80c4005abc46c2263f09c4c2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5649.00 ((SQL11_SP2_QFE-CU).160424-1132 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/e3044265c315485f8812fef56a7e73b72/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5649.00 ((SQL11_SP2_QFE-CU).160424-1132 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/334ddc7a968042d58e7f62f9a365c1852/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5649.00 ((SQL11_SP2_QFE-CU).160424-1132 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/76854cf991784573858a7b60962f93232/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5649.00 ((SQL11_SP2_QFE-CU).160424-1132 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/d1dde76542a9427ebecb65f2468b91ce1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5649.00 ((SQL11_SP2_QFE-CU).160424-1132 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/29d1f01b3bb84da780dddb33213dbcf31/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5649.00 ((SQL11_SP2_QFE-CU).160424-1132 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/9de157e8d6f54db7b98a7502b94577641/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5649.00 ((SQL11_SP2_QFE-CU).160424-1132 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/e8541edbbfc0410d9b82e6ab78fc2ef01/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5649.00 ((SQL11_SP2_QFE-CU).160424-1132 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/f31f3117b463455688edb8b0f8163a401/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5649.00 ((SQL11_SP2_QFE-CU).160424-1132 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/e3318525756c429c81667cb043abadba2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5649.00 ((SQL11_SP2_QFE-CU).160424-1132 ) +``` + +# SQL Server 2012 SP2 CU11 - 11.0.5646.0 - x64 (3137745) +``` powershell +# SQL Server 2012 SP2 CU11 - 11.0.5646.0 - x64 (3137745) +$outputFolder = 'c:\sqlsyms\11.0.5646.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/cd7a679d23ce4318ae4f9bd42021a1712/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5646.00 ((SQL11_SP2_QFE-CU).160226-1734 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/90d74a8ca29a4f30944f5fdfaba0c83c2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5646.00 ((SQL11_SP2_QFE-CU).160226-1734 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/14a616d4d2fe48f293fdb04ccae512bd2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5646.00 ((SQL11_SP2_QFE-CU).160226-1734 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/a91a9c36928443ab880573c213736a0b2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5646.00 ((SQL11_SP2_QFE-CU).160226-1734 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/40dd4867eec84f79bc2e0b16c8a88f121/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5646.00 ((SQL11_SP2_QFE-CU).160226-1734 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/3a605746326140df8f9996070fe654b11/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5646.00 ((SQL11_SP2_QFE-CU).160226-1734 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/c9718e636e7c4b4e8c0353b5a5a9deae1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5646.00 ((SQL11_SP2_QFE-CU).160226-1734 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/eb2f543f9569417e9664bdae69d903ac1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5646.00 ((SQL11_SP2_QFE-CU).160226-1734 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/f16396e855d64f2b9db73963a1f31e591/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5646.00 ((SQL11_SP2_QFE-CU).160226-1734 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/856db9275d4b49bea827cbdd41a9afe42/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5646.00 ((SQL11_SP2_QFE-CU).160226-1734 ) +``` + +# SQL Server 2012 SP2 CU11 - 11.0.5646.0 - x86 (3137745) +``` powershell +# SQL Server 2012 SP2 CU11 - 11.0.5646.0 - x86 (3137745) +$outputFolder = 'c:\sqlsyms\11.0.5646.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/1747440228a742e590232cb45d5be3b72/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5646.00 ((SQL11_SP2_QFE-CU).160226-1735 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/95cfc60f73d24ed7b89a90a7ebbbaeef2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5646.00 ((SQL11_SP2_QFE-CU).160226-1735 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/0c6c10d175a6457d8d7c6ffad717539d2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5646.00 ((SQL11_SP2_QFE-CU).160226-1735 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/05b4ccc988ff4e5ebcc0702b5833f2db2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5646.00 ((SQL11_SP2_QFE-CU).160226-1735 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/5452aac59a3148ee8502ba3f365c7f501/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5646.00 ((SQL11_SP2_QFE-CU).160226-1735 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/018af0e7122742feb5a7332e671946771/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5646.00 ((SQL11_SP2_QFE-CU).160226-1735 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/8b0d9d31c92147c2a83d337704ddd4641/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5646.00 ((SQL11_SP2_QFE-CU).160226-1735 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/56d0425cc87a4fcbb066efb003b8f9fc1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5646.00 ((SQL11_SP2_QFE-CU).160226-1735 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/ee1d6435917a4f9885af79e50b4d37321/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5646.00 ((SQL11_SP2_QFE-CU).160226-1735 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/6fa82e53cc59482a9fa430a99730f6222/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5646.00 ((SQL11_SP2_QFE-CU).160226-1735 ) +``` + +# SQL Server 2012 SP2 CU10 - 11.0.5644.2 - x64 (3120313) +``` powershell +# SQL Server 2012 SP2 CU10 - 11.0.5644.2 - x64 (3120313) +$outputFolder = 'c:\sqlsyms\11.0.5644.2\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/d8768549cb5345399f4fe1cea88794752/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5644.02 ((SQL11_SP2_QFE-CU).160107-2337 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/2cfeaeeffde843899bf0085a1fe229fc2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5644.02 ((SQL11_SP2_QFE-CU).160107-2337 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/9255e9211d0f41edb184f4c128e449062/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5644.02 ((SQL11_SP2_QFE-CU).160107-2337 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/1f9672b7fd7e4c04a13e4623c116288c2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5644.02 ((SQL11_SP2_QFE-CU).160107-2337 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/65527fa7b46a4ba48843ac5ca4f6c91a1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5644.02 ((SQL11_SP2_QFE-CU).160107-2337 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/aec37a7322154ab0a71d747d9318ad461/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5644.02 ((SQL11_SP2_QFE-CU).160107-2337 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/3c1d262015bf4d089e3dd11a7735ce971/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5644.02 ((SQL11_SP2_QFE-CU).160107-2337 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/998be39e1a234448be37b1e13fe86d7e1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5644.02 ((SQL11_SP2_QFE-CU).160107-2337 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/9ce5afd549134784a502ca2c56a422ea1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5644.02 ((SQL11_SP2_QFE-CU).160107-2337 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/e3a30191df804683ace74857f09b14582/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5644.02 ((SQL11_SP2_QFE-CU).160107-2337 ) +``` + +# SQL Server 2012 SP2 CU10 - 11.0.5644.2 - x86 (3120313) +``` powershell +# SQL Server 2012 SP2 CU10 - 11.0.5644.2 - x86 (3120313) +$outputFolder = 'c:\sqlsyms\11.0.5644.2\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/7826cfcc93bd484fabcb123fb93136b72/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5644.02 ((SQL11_SP2_QFE-CU).160107-2309 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/030e8e2257cc4ca6a2e48a05ce239b412/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5644.02 ((SQL11_SP2_QFE-CU).160107-2309 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/94778bf7d845444cb650904ec51e75442/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5644.02 ((SQL11_SP2_QFE-CU).160107-2309 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/7b2d129b95e040ebbb027cef893c7f332/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5644.02 ((SQL11_SP2_QFE-CU).160107-2309 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/d7c79fd24b5e456dad7ec1547ddc46821/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5644.02 ((SQL11_SP2_QFE-CU).160107-2309 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/ba92ea50bd6a44f28a8fd9559f5394d81/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5644.02 ((SQL11_SP2_QFE-CU).160107-2309 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/c0db7d5acd534245b1bd9c10c425335f1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5644.02 ((SQL11_SP2_QFE-CU).160107-2309 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/d7942859fe6849968b3b484e5c17a03b1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5644.02 ((SQL11_SP2_QFE-CU).160107-2309 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/7f570e9d52e1447ab60d9b9fa8354e761/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5644.02 ((SQL11_SP2_QFE-CU).160107-2309 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/dbd7a81924634685b9cffd5c3cb533a62/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5644.02 ((SQL11_SP2_QFE-CU).160107-2309 ) +``` + +# SQL Server 2012 SP2 CU9 - 11.0.5641.0 - x64 (3098512) +``` powershell +# SQL Server 2012 SP2 CU9 - 11.0.5641.0 - x64 (3098512) +$outputFolder = 'c:\sqlsyms\11.0.5641.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/a521723dc40a41ae90e5d3f588fa0ccf2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5641.00 ((SQL11_SP2_QFE-CU).151020-1624 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/8321e31318604a69993a346d0006baa02/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5641.00 ((SQL11_SP2_QFE-CU).151020-1624 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/9d8402c7dd2a49b0b16ed33e0a4beb322/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5641.00 ((SQL11_SP2_QFE-CU).151020-1624 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/00ebaef66b3e4232a2e59b4cb1b0f0de2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5641.00 ((SQL11_SP2_QFE-CU).151020-1624 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/b1d05b1c84dd431a8f41ffb65bb657021/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5641.00 ((SQL11_SP2_QFE-CU).151020-1624 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/22bc0604c1d54b8c8d826ee74708cc431/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5641.00 ((SQL11_SP2_QFE-CU).151020-1624 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/6aa02f4cf90e431e96f5ed3610a5c8561/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5641.00 ((SQL11_SP2_QFE-CU).151020-1624 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/19b09216c02f4f79954d0bc4dd86deb31/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5641.00 ((SQL11_SP2_QFE-CU).151020-1624 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/63f7a395d7c345f182d3cb93ce1065f61/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5641.00 ((SQL11_SP2_QFE-CU).151020-1624 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/33a6114f99434ff0b67b421c6ba8bf872/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5641.00 ((SQL11_SP2_QFE-CU).151020-1624 ) +``` + +# SQL Server 2012 SP2 CU9 - 11.0.5641.0 - x86 (3098512) +``` powershell +# SQL Server 2012 SP2 CU9 - 11.0.5641.0 - x86 (3098512) +$outputFolder = 'c:\sqlsyms\11.0.5641.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/90707b52346e4f2081ee4b57991465f02/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5641.00 ((SQL11_SP2_QFE-CU).151020-1623 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/dadbef50fe024e9fa2ab29facd23364e2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5641.00 ((SQL11_SP2_QFE-CU).151020-1623 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/848be43da62b4654962c76ac0817f4d52/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5641.00 ((SQL11_SP2_QFE-CU).151020-1623 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/d3ead1ac747046bf95ce1fb24d26414b2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5641.00 ((SQL11_SP2_QFE-CU).151020-1623 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/6d4960a06b9e449189135a1f8cfe486d1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5641.00 ((SQL11_SP2_QFE-CU).151020-1623 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/fc7864bea8ae4450af4c100b03106cbc1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5641.00 ((SQL11_SP2_QFE-CU).151020-1623 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/ab2ca7efbd604bc2a98d334a6e8e85051/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5641.00 ((SQL11_SP2_QFE-CU).151020-1623 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/1aaa39cfe07242669c6f1fd909a40e141/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5641.00 ((SQL11_SP2_QFE-CU).151020-1623 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/8987ad9ed15145209fc028ceae4267041/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5641.00 ((SQL11_SP2_QFE-CU).151020-1623 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/9166856bbe0d4752b138d4aef51afa7f2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5641.00 ((SQL11_SP2_QFE-CU).151020-1623 ) +``` + +# SQL Server 2012 SP2 CU8 - 11.0.5634.1 - x64 (3082561) +``` powershell +# SQL Server 2012 SP2 CU8 - 11.0.5634.1 - x64 (3082561) +$outputFolder = 'c:\sqlsyms\11.0.5634.1\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/61ef98bf0c944d27bdcdcbe956a71f532/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5634.01 ((SQL11_SP2_QFE-CU).150903-1845 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/e32a770828b441ea83876963f8915c642/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5634.01 ((SQL11_SP2_QFE-CU).150903-1845 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/82d71733ddda4f63b0c0c587bea3e5b52/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5634.01 ((SQL11_SP2_QFE-CU).150903-1845 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/3d8d115280c343e79ffda9d5e13914ca2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5634.01 ((SQL11_SP2_QFE-CU).150903-1845 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/df6d6664b8b343b5822f404ca1c71e961/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5634.01 ((SQL11_SP2_QFE-CU).150903-1845 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/afdf9896ee5f454da131c41d186ed2381/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5634.01 ((SQL11_SP2_QFE-CU).150903-1845 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/d24c170faa1d4b66a72dee2f6905bda41/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5634.01 ((SQL11_SP2_QFE-CU).150903-1845 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/6be320158f64485fb39edc54657cc9691/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5634.01 ((SQL11_SP2_QFE-CU).150903-1845 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/4a7653322ccd491db5e3319fe11fd1e11/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5634.01 ((SQL11_SP2_QFE-CU).150903-1845 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/ff7b48cc7d4845009f4219b2ea8ed7af2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5634.01 ((SQL11_SP2_QFE-CU).150903-1845 ) +``` + +# SQL Server 2012 SP2 CU8 - 11.0.5634.1 - x86 (3082561) +``` powershell +# SQL Server 2012 SP2 CU8 - 11.0.5634.1 - x86 (3082561) +$outputFolder = 'c:\sqlsyms\11.0.5634.1\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/eaf68945f2a744b49102874620c553442/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5634.01 ((SQL11_SP2_QFE-CU).150903-1831 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/62d91f546d724970a297824753b247a62/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5634.01 ((SQL11_SP2_QFE-CU).150903-1831 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/0cee6b19c69a45a79cc9ba2576d203802/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5634.01 ((SQL11_SP2_QFE-CU).150903-1831 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/3595e13882f2488dad33b5b42b6de7022/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5634.01 ((SQL11_SP2_QFE-CU).150903-1831 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/5d1ce58362004146a03b9a203f716bcc1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5634.01 ((SQL11_SP2_QFE-CU).150903-1831 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/7ec8ca29f61b41c99ebc77df6f3641dc1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5634.01 ((SQL11_SP2_QFE-CU).150903-1831 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/32f2862ef89d49b29bfa4935a8cb5da81/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5634.01 ((SQL11_SP2_QFE-CU).150903-1831 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/64249ed7e3394edfa60825e07327feab1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5634.01 ((SQL11_SP2_QFE-CU).150903-1831 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/41763cddfdd84bdeae6a9d2f7f93a23a1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5634.01 ((SQL11_SP2_QFE-CU).150903-1831 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/839d3b40fcbb4c94b8bc3b9e91581f962/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5634.01 ((SQL11_SP2_QFE-CU).150903-1831 ) +``` + +# SQL Server 2012 SP2 CU7 - 11.0.5623.0 - x64 (3072100) +``` powershell +# SQL Server 2012 SP2 CU7 - 11.0.5623.0 - x64 (3072100) +$outputFolder = 'c:\sqlsyms\11.0.5623.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/ae8dca071dd14b8588f8c1e8355750c42/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5623.00 ((SQL11_SP2_QFE-CU).150709-1152 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/e7c57dfa80174541b048819804823b642/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5623.00 ((SQL11_SP2_QFE-CU).150709-1152 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/ff4277e6a21e48fb9e04cc4e2c80ba0f2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5623.00 ((SQL11_SP2_QFE-CU).150709-1152 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/88abae217a834ae18b5754feecda13012/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5623.00 ((SQL11_SP2_QFE-CU).150709-1152 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/7d92e63eb71a45809ce78c14ffaf09d81/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5623.00 ((SQL11_SP2_QFE-CU).150709-1152 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/b5fb3509642c4690a5c45749035333051/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5623.00 ((SQL11_SP2_QFE-CU).150709-1152 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/8072e1fb97424fdc98269196785f7fbe1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5623.00 ((SQL11_SP2_QFE-CU).150709-1152 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/fca6c8e72e5e42ecb99207f194bef9191/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5623.00 ((SQL11_SP2_QFE-CU).150709-1152 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/31bac03868374db896288d1c1a856bf91/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5623.00 ((SQL11_SP2_QFE-CU).150709-1152 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/48708388ca2f4e6c9c9a286887fc6bda2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5623.00 ((SQL11_SP2_QFE-CU).150709-1152 ) +``` + +# SQL Server 2012 SP2 CU7 - 11.0.5623.0 - x86 (3072100) +``` powershell +# SQL Server 2012 SP2 CU7 - 11.0.5623.0 - x86 (3072100) +$outputFolder = 'c:\sqlsyms\11.0.5623.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/473e800d9eeb4e4097e87652ab5aaa052/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5623.00 ((SQL11_SP2_QFE-CU).150709-1156 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/19adc0aa5e1249238e244b5ba9e0f2492/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5623.00 ((SQL11_SP2_QFE-CU).150709-1156 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/58fc60e3bbd5448bb466dc8f753683b62/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5623.00 ((SQL11_SP2_QFE-CU).150709-1156 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/49c28e17e982469bb1092e77901d168b2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5623.00 ((SQL11_SP2_QFE-CU).150709-1156 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/cc65b11dda20409a8879339d384bd9491/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5623.00 ((SQL11_SP2_QFE-CU).150709-1156 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/1a58faf830674e18a3aeb22c4f0818211/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5623.00 ((SQL11_SP2_QFE-CU).150709-1156 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/49fd8984505e468590ca91dda1dc99d41/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5623.00 ((SQL11_SP2_QFE-CU).150709-1156 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/3ba93675da7c476c979fd0b7cecbbdab1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5623.00 ((SQL11_SP2_QFE-CU).150709-1156 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/3d6472408ed74f41bb58f30027ba9e421/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5623.00 ((SQL11_SP2_QFE-CU).150709-1156 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/ee5bb2170a2347978420200f22fb85592/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5623.00 ((SQL11_SP2_QFE-CU).150709-1156 ) +``` + +# SQL Server 2012 SP2 CU6 - 11.0.5592.0 - x64 (3052468) +``` powershell +# SQL Server 2012 SP2 CU6 - 11.0.5592.0 - x64 (3052468) +$outputFolder = 'c:\sqlsyms\11.0.5592.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/a9e46f8055ae4cb5aa344fb96e73ca7e2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5592.00 ((SQL11_SP2_QFE-CU).150417-1509 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/cf97aed844944105b2d8ed9a933dc1522/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5592.00 ((SQL11_SP2_QFE-CU).150417-1509 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/d3bcd6c8911b48a491bcf8e18841ba3b2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5592.00 ((SQL11_SP2_QFE-CU).150417-1509 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/92ea2d549256436c83154e05e769d26f2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5592.00 ((SQL11_SP2_QFE-CU).150417-1509 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/0ddbf5e6c62c483eab519b300e41aa131/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5592.00 ((SQL11_SP2_QFE-CU).150417-1509 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/253e36a0d02942189ed1205210163d8a1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5592.00 ((SQL11_SP2_QFE-CU).150417-1509 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/ae5a1adb5bf94b38b3ebb35270da6bb71/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5592.00 ((SQL11_SP2_QFE-CU).150417-1509 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/11acb1f2f7cf4498a3a8594014e4a5491/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5592.00 ((SQL11_SP2_QFE-CU).150417-1509 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/7ff78655e62d42d3862242c04816400d1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5592.00 ((SQL11_SP2_QFE-CU).150417-1509 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/c68000bb1ce7439ca573a54d17c73ab52/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5592.00 ((SQL11_SP2_QFE-CU).150417-1509 ) +``` + +# SQL Server 2012 SP2 CU6 - 11.0.5592.0 - x86 (3052468) +``` powershell +# SQL Server 2012 SP2 CU6 - 11.0.5592.0 - x86 (3052468) +$outputFolder = 'c:\sqlsyms\11.0.5592.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/90b88bf18b2b483bbb76862b88cce4032/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5592.00 ((SQL11_SP2_QFE-CU).150417-1510 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/ade94be306d74bdea416c6d4efd8d8482/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5592.00 ((SQL11_SP2_QFE-CU).150417-1510 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/fc93e429e1454118b9be2831ac8539602/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5592.00 ((SQL11_SP2_QFE-CU).150417-1510 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/27a72ca6e4604cc8bdd4b0362751e82e2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5592.00 ((SQL11_SP2_QFE-CU).150417-1510 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/7aa7de50535a41d4b28f1437981bb3401/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5592.00 ((SQL11_SP2_QFE-CU).150417-1510 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/73f81b7d9c4240de8339ad241becf98f1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5592.00 ((SQL11_SP2_QFE-CU).150417-1510 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/4b749317568942e383ee42a9eb2cf1f41/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5592.00 ((SQL11_SP2_QFE-CU).150417-1510 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/3c59c6073f7d48df91b7abd1828db0c51/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5592.00 ((SQL11_SP2_QFE-CU).150417-1510 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/7f22862851fc4bdca72990a66edb51991/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5592.00 ((SQL11_SP2_QFE-CU).150417-1510 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/e36a38ed3a6146fbaf6216025b206d802/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5592.00 ((SQL11_SP2_QFE-CU).150417-1510 ) +``` + +# SQL Server 2012 SP2 CU5 - 11.0.5582.0 - x64 (3037255) +``` powershell +# SQL Server 2012 SP2 CU5 - 11.0.5582.0 - x64 (3037255) +$outputFolder = 'c:\sqlsyms\11.0.5582.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/8badafbcc6334b139d67b83c61e1ad632/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5582.00 ((SQL11_SP2_QFE-CU).150227-1800 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/c736d839f6f54501a94ccd22ec14d3552/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5582.00 ((SQL11_SP2_QFE-CU).150227-1800 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/d4ed0467cc1944e19589685f554793482/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5582.00 ((SQL11_SP2_QFE-CU).150227-1800 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/4534514aec274addb9f4bacefda3799e2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5582.00 ((SQL11_SP2_QFE-CU).150227-1800 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/556a0a2b1d5d4757aac0242c56f798551/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5582.00 ((SQL11_SP2_QFE-CU).150227-1800 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/3cceaa5cf5684811a0386e715a6aecca1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5582.00 ((SQL11_SP2_QFE-CU).150227-1800 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/b1bc02bf82844ba886d35e2f3dadd38d1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5582.00 ((SQL11_SP2_QFE-CU).150227-1800 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/f4538786cdca4eb789acedeb918639401/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5582.00 ((SQL11_SP2_QFE-CU).150227-1800 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/8358c5a13ecf438890f62b23d94a30f51/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5582.00 ((SQL11_SP2_QFE-CU).150227-1800 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/ae3adbf271aa479fb5256880e575fed22/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5582.00 ((SQL11_SP2_QFE-CU).150227-1800 ) +``` + +# SQL Server 2012 SP2 CU5 - 11.0.5582.0 - x86 (3037255) +``` powershell +# SQL Server 2012 SP2 CU5 - 11.0.5582.0 - x86 (3037255) +$outputFolder = 'c:\sqlsyms\11.0.5582.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/3a47214af54f43b494f0ea53b36d1a3a2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5582.00 ((SQL11_SP2_QFE-CU).150227-1813 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/8b32b6454ee742eb98916880e92325292/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5582.00 ((SQL11_SP2_QFE-CU).150227-1813 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/9bd5f790568b408fa093d1ac93ad5dd92/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5582.00 ((SQL11_SP2_QFE-CU).150227-1813 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/9920c94073c94b9b9334cfac3233e2e92/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5582.00 ((SQL11_SP2_QFE-CU).150227-1813 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/7bd272d1179e4fbd92b9c5863a0133791/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5582.00 ((SQL11_SP2_QFE-CU).150227-1813 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/0ddb45c56e3b41d99a71af72332e241f1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5582.00 ((SQL11_SP2_QFE-CU).150227-1813 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/c3ba2ddbe9f143788b703f9d2d8c7a2c1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5582.00 ((SQL11_SP2_QFE-CU).150227-1813 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/ecce36e5bb034047998a2bd085889c841/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5582.00 ((SQL11_SP2_QFE-CU).150227-1813 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/cb343262158a462f92b23f68d2ae7ac21/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5582.00 ((SQL11_SP2_QFE-CU).150227-1813 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/5a1bf2e1647e44f0815b022eb13ff9232/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5582.00 ((SQL11_SP2_QFE-CU).150227-1813 ) +``` + +# SQL Server 2012 SP2 CU4 - 11.0.5569.0 - x64 (3007556) +``` powershell +# SQL Server 2012 SP2 CU4 - 11.0.5569.0 - x64 (3007556) +$outputFolder = 'c:\sqlsyms\11.0.5569.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/362c792ee0e84038a70ca60e9d73670d2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5569.00 ((SQL11_SP2_QFE-CU).150109-1123 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/a0ca918076554d4c933045287d5096ed2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5569.00 ((SQL11_SP2_QFE-CU).150109-1123 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/77c344284abe4a1886d727f7552e9c952/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5569.00 ((SQL11_SP2_QFE-CU).150109-1123 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/a30fa17e3c414464afa91913f0833c122/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5569.00 ((SQL11_SP2_QFE-CU).150109-1123 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/7fc8dd4807bb420fbc055771e64b95321/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5569.00 ((SQL11_SP2_QFE-CU).150109-1123 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/183074ed7e6a4bb9a13c48ad2a00c3411/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5569.00 ((SQL11_SP2_QFE-CU).150109-1123 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/3984af0d59e8459d83be5e3215e151b91/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5569.00 ((SQL11_SP2_QFE-CU).150109-1123 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/79ebc6f96e85467090f16ccd6efa5f6a1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5569.00 ((SQL11_SP2_QFE-CU).150109-1123 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/384a0f1d64a749e9bac4a0b0d8d203d91/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5569.00 ((SQL11_SP2_QFE-CU).150109-1123 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/99ebd3f774364d7cbd4679ed474886ae2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5569.00 ((SQL11_SP2_QFE-CU).150109-1123 ) +``` + +# SQL Server 2012 SP2 CU4 - 11.0.5569.0 - x86 (3007556) +``` powershell +# SQL Server 2012 SP2 CU4 - 11.0.5569.0 - x86 (3007556) +$outputFolder = 'c:\sqlsyms\11.0.5569.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/0f05bf5e3ab14d13a90d394d10fb3ee32/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5569.00 ((SQL11_SP2_QFE-CU).150109-1126 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/0467323f452c4c889bb8c03eb9245e482/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5569.00 ((SQL11_SP2_QFE-CU).150109-1126 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/8d05289fe8d740979420b0fd5a7676e92/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5569.00 ((SQL11_SP2_QFE-CU).150109-1126 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/29ae6e87132b46b4b78e7965ea7ada3c2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5569.00 ((SQL11_SP2_QFE-CU).150109-1126 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/9fa2ee33584d4ed78ec81f31b1b600481/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5569.00 ((SQL11_SP2_QFE-CU).150109-1126 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/405d1f73f6c94e88a32c71a53ecd1e8e1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5569.00 ((SQL11_SP2_QFE-CU).150109-1126 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/0db139cf45c246d3913b3c3605ec2f651/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5569.00 ((SQL11_SP2_QFE-CU).150109-1126 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/50b739fdeaea477589c02536e8cab5cf1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5569.00 ((SQL11_SP2_QFE-CU).150109-1126 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/ccb38bba52fa4568bc85256b6039d9531/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5569.00 ((SQL11_SP2_QFE-CU).150109-1126 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/3f9b337dac5a40559d2c1d53f33b4dd62/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5569.00 ((SQL11_SP2_QFE-CU).150109-1126 ) +``` + +# SQL Server 2012 SP2 CU3 - 11.0.5556.0 - x64 (3002049) +``` powershell +# SQL Server 2012 SP2 CU3 - 11.0.5556.0 - x64 (3002049) +$outputFolder = 'c:\sqlsyms\11.0.5556.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/d1a00b8b404a457b9d366e7db692612c2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5556.00 ((SQL11_SP2_QFE-CU).141031-1640 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/caa84e0b43e5423dabd502cf51fcef3a2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5556.00 ((SQL11_SP2_QFE-CU).141031-1640 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/692932d983ac4d0cb8b4c5280484f7ee2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5556.00 ((SQL11_SP2_QFE-CU).141031-1640 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/eb5aa259e39446cd8eaf7e75c20ccad22/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5556.00 ((SQL11_SP2_QFE-CU).141031-1640 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/0d5bd32496a14c1db5d2bf51ac4c1e0a1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5556.00 ((SQL11_SP2_QFE-CU).141031-1640 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/c25697387b484c97b22b5f447bb3ac1f1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5556.00 ((SQL11_SP2_QFE-CU).141031-1640 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/ad1f8b1a883a4339a75f54c8dc57fdb31/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5556.00 ((SQL11_SP2_QFE-CU).141031-1640 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/22376adfcdfb44f5af969adecba164911/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5556.00 ((SQL11_SP2_QFE-CU).141031-1640 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/931ba4aa04ce4f42a0fc4d464091f18a1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5556.00 ((SQL11_SP2_QFE-CU).141031-1640 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/ce308e7fe1024a62ac491cf474cec82c2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5556.00 ((SQL11_SP2_QFE-CU).141031-1640 ) +``` + +# SQL Server 2012 SP2 CU3 - 11.0.5556.0 - x86 (3002049) +``` powershell +# SQL Server 2012 SP2 CU3 - 11.0.5556.0 - x86 (3002049) +$outputFolder = 'c:\sqlsyms\11.0.5556.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/5918d9b7678849c49bbb3f5da4e3a0282/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5556.00 ((SQL11_SP2_QFE-CU).141031-1639 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/00b4161353c44d8e8a3f856e666b09162/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5556.00 ((SQL11_SP2_QFE-CU).141031-1639 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/dd70fb9e4d4e45d2b05ab68c33586bdf2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5556.00 ((SQL11_SP2_QFE-CU).141031-1639 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/8a3d1406ad4b4d81a996bc92df9ebcfe2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5556.00 ((SQL11_SP2_QFE-CU).141031-1639 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/de2557533cb84d6c8fb44bd721bc09ca1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5556.00 ((SQL11_SP2_QFE-CU).141031-1639 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/99a6e3ff0cb84daa83b2c919ac45bf3f1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5556.00 ((SQL11_SP2_QFE-CU).141031-1639 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/d8c9218704ce483ea64cb50ae2bc08f11/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5556.00 ((SQL11_SP2_QFE-CU).141031-1639 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/5ffe4b28d77f4236b72eba2f4c36c4901/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5556.00 ((SQL11_SP2_QFE-CU).141031-1639 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/87cd133d6de14b83a0fc51fd0c6731731/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5556.00 ((SQL11_SP2_QFE-CU).141031-1639 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/750a2c62762c42a5bd832b7334954b822/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5556.00 ((SQL11_SP2_QFE-CU).141031-1639 ) +``` + +# SQL Server 2012 SP2 CU2 - 11.0.5548.0 - x64 (2983175) +``` powershell +# SQL Server 2012 SP2 CU2 - 11.0.5548.0 - x64 (2983175) +$outputFolder = 'c:\sqlsyms\11.0.5548.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/99205f110e104780bcd50b13b8b2ef602/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5548.00 ((SQL11_SP2_QFE-CU).140906-1703 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/cae73ab941a5449bb04d577b8ac0ee2e2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5548.00 ((SQL11_SP2_QFE-CU).140906-1703 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/5b7ccbfa58b54a8d80d9fe76d86eead32/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5548.00 ((SQL11_SP2_QFE-CU).140906-1703 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/35f5dd06512c4dae8339badc7b32f1a02/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5548.00 ((SQL11_SP2_QFE-CU).140906-1703 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/07c56b468964456996e7fffcc033ba561/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5548.00 ((SQL11_SP2_QFE-CU).140906-1703 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/f8b575102d5e4845bb73a4713fbd27281/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5548.00 ((SQL11_SP2_QFE-CU).140906-1703 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/f48d51269e1a44bf917c04e47fd3497f1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5548.00 ((SQL11_SP2_QFE-CU).140906-1703 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/380cdbf633f94b8e9f7a15c4a0f05e9c1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5548.00 ((SQL11_SP2_QFE-CU).140906-1703 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/a10eeceb16684e2f97e7bf5b048556ae1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5548.00 ((SQL11_SP2_QFE-CU).140906-1703 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/c7371ee128084547b8cc44cf23daf6322/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5548.00 ((SQL11_SP2_QFE-CU).140906-1703 ) +``` + +# SQL Server 2012 SP2 CU2 - 11.0.5548.0 - x86 (2983175) +``` powershell +# SQL Server 2012 SP2 CU2 - 11.0.5548.0 - x86 (2983175) +$outputFolder = 'c:\sqlsyms\11.0.5548.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/3e037ba29b3e4225ae410c337d79bd8c2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5548.00 ((SQL11_SP2_QFE-CU).140906-1802 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/b45cf018f0f54771a95e71eaaa28a88e2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5548.00 ((SQL11_SP2_QFE-CU).140906-1802 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/a76a804ec0ba4b76ba58f380668012da2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5548.00 ((SQL11_SP2_QFE-CU).140906-1802 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/54c5a385aba743edb15be3e62a137c832/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5548.00 ((SQL11_SP2_QFE-CU).140906-1802 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/3165959521524b8eaed9ece7ff68571d1/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5548.00 ((SQL11_SP2_QFE-CU).140906-1802 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/1a52c14e68fa418188349ed428ed814a1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5548.00 ((SQL11_SP2_QFE-CU).140906-1802 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/c4534dd553ae4e1da2fdbb4df151981c1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5548.00 ((SQL11_SP2_QFE-CU).140906-1802 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/a6e6cca281ff419291ad2ce6e8c536881/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5548.00 ((SQL11_SP2_QFE-CU).140906-1802 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/01e271d3affe4c5197beedb3189b46541/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5548.00 ((SQL11_SP2_QFE-CU).140906-1802 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/9d08d936dc3f4b259d73b86191fcd0d32/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5548.00 ((SQL11_SP2_QFE-CU).140906-1802 ) +``` + +# SQL Server 2012 SP2 CU1 - 11.0.5532.0 - x64 (2976982) +``` powershell +# SQL Server 2012 SP2 CU1 - 11.0.5532.0 - x64 (2976982) +$outputFolder = 'c:\sqlsyms\11.0.5532.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/cbf110ac14d94a8cb27f29d7def6e2832/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5532.00 ((SQL11_SP2_QFE-CU).140714-1446 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/5ef74be1c5314aa38320fa24e34e51c72/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5532.00 ((SQL11_SP2_QFE-CU).140714-1446 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/ffb5d83cafba46faa6816b8e6491c4b12/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5532.00 ((SQL11_SP2_QFE-CU).140714-1446 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/5078a04f329147b7978220b06bb870192/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5532.00 ((SQL11_SP2_QFE-CU).140714-1446 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/d7952e1acc294862bda55dd7e4d3e8211/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5532.00 ((SQL11_SP2_QFE-CU).140714-1446 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/5a95d568bac94867b8e0840fd91e50c51/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5532.00 ((SQL11_SP2_QFE-CU).140714-1446 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/6639b1da0ba34639811d5bec9aff80371/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5532.00 ((SQL11_SP2_QFE-CU).140714-1446 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/a8c29cbda99e41fe8e103298736b6a4b1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5532.00 ((SQL11_SP2_QFE-CU).140714-1446 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/da3edb6b439f4e028581352ace87953f1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5532.00 ((SQL11_SP2_QFE-CU).140714-1446 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/427d00997e8b428bbb7a3e5258acb0f72/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5532.00 ((SQL11_SP2_QFE-CU).140714-1446 ) +``` + +# SQL Server 2012 SP2 CU1 - 11.0.5532.0 - x86 (2976982) +``` powershell +# SQL Server 2012 SP2 CU1 - 11.0.5532.0 - x86 (2976982) +$outputFolder = 'c:\sqlsyms\11.0.5532.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/35685e9861dd48aaae7cc5b16bd328122/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5532.00 ((SQL11_SP2_QFE-CU).140714-1449 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/894411a3cde84440964e7d15e54a42f22/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5532.00 ((SQL11_SP2_QFE-CU).140714-1449 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/b8e311cfe83844efbfa836d7edd0a4c92/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5532.00 ((SQL11_SP2_QFE-CU).140714-1449 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/4dde9c04fa9e48aa8dd99f6253ddde802/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5532.00 ((SQL11_SP2_QFE-CU).140714-1449 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/bc9c1b0188ad4c4694e3fc2b2cc003f51/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5532.00 ((SQL11_SP2_QFE-CU).140714-1449 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/f4e0f97f61954596a55a9127841a84ad1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5532.00 ((SQL11_SP2_QFE-CU).140714-1449 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/27494563474d41a9b38acc20ae538cae1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5532.00 ((SQL11_SP2_QFE-CU).140714-1449 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/3c69ca79dab742ffa5fd044f1300bbe11/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5532.00 ((SQL11_SP2_QFE-CU).140714-1449 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/4081f3e32c334fb8b9164529b87ccf601/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5532.00 ((SQL11_SP2_QFE-CU).140714-1449 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/4b32834628184e4fa4f9848fa401a19c2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5532.00 ((SQL11_SP2_QFE-CU).140714-1449 ) +``` + +# SQL Server 2012 SP2 SP2 - 11.0.5058.0 - x64 (2958429) +``` powershell +# SQL Server 2012 SP2 SP2 - 11.0.5058.0 - x64 (2958429) +$outputFolder = 'c:\sqlsyms\11.0.5058.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/ee0459385983426284e7a607384e4bf62/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5058.00 ((SQL11_PCU_Main).140514-1820 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/fbafcdb326434a41a09d549fbf6e8f062/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5058.00 ((SQL11_PCU_Main).140514-1820 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/587ed8597e30437a8028d1ee025c75d12/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5058.00 ((SQL11_PCU_Main).140514-1820 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/d7a22e5762bd4c94bc2c0af2fc63a1372/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5058.00 ((SQL11_PCU_Main).140514-1820 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/017fa06efaf641d4bba760a5258be5741/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5058.00 ((SQL11_PCU_Main).140514-1820 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/32a91c0b60204fffa1374cf3492a88a01/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5058.00 ((SQL11_PCU_Main).140514-1820 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/0452878b0b30401f814aab0fa4ac74661/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5058.00 ((SQL11_PCU_Main).140514-1820 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/389e963e00f040079eff7b8e2ccc3c911/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5058.00 ((SQL11_PCU_Main).140514-1820 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/0ef93093d4ea4f9d90a21e79f602919d1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5058.00 ((SQL11_PCU_Main).140514-1820 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/12ec0b5836ca41429c5bce95a1653eaf2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5058.00 ((SQL11_PCU_Main).140514-1820 ) +``` + +# SQL Server 2012 SP2 SP2 - 11.0.5058.0 - x86 (2958429) +``` powershell +# SQL Server 2012 SP2 SP2 - 11.0.5058.0 - x86 (2958429) +$outputFolder = 'c:\sqlsyms\11.0.5058.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/9a6c2fb9f9ad46b7b240b1cd3f7782312/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2011.0110.5058.00 ((SQL11_PCU_Main).140514-1623 ) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/1c6fd82d91f84e9b9ebca1a6a1bfb80d2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2011.0110.5058.00 ((SQL11_PCU_Main).140514-1623 ) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/c7c06ee472184be7a264d1450b683ef52/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2011.0110.5058.00 ((SQL11_PCU_Main).140514-1623 ) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/004a42376b6e41af95b7280c65021add2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2011.0110.5058.00 ((SQL11_PCU_Main).140514-1623 ) +if (-not (Test-Path "$outputFolder\SqlAccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlAccess.pdb/15004f64c18c48e1b5b1573836f2a7931/SqlAccess.pdb' -OutFile "$outputFolder\SqlAccess.pdb" } # File version 2011.0110.5058.00 ((SQL11_PCU_Main).140514-1623 ) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/d5064f709c6f4124a7423ab6fa0ed7f71/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2011.0110.5058.00 ((SQL11_PCU_Main).140514-1623 ) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/74570a2c5655462e859fe5f6358603ef1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2011.0110.5058.00 ((SQL11_PCU_Main).140514-1623 ) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/895b174b37d9498496b464b2600219a31/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2011.0110.5058.00 ((SQL11_PCU_Main).140514-1623 ) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/366970ac611340e4bd1e6c244d2b30e71/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2011.0110.5058.00 ((SQL11_PCU_Main).140514-1623 ) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/a4ca976e0f84491eafe73b3195b39c6a2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2011.0110.5058.00 ((SQL11_PCU_Main).140514-1623 ) +``` + diff --git a/Errors/PDB/SQL-Server-2014.md b/Errors/PDB/SQL-Server-2014.md new file mode 100644 index 00000000..38963da2 --- /dev/null +++ b/Errors/PDB/SQL-Server-2014.md @@ -0,0 +1,1650 @@ +# SQL Server 2014 SP3 Security update - 12.0.6372.1 - x64 (KB4535288) +``` powershell +# SQL Server 2014 SP3 Security update - 12.0.6372.1 - x64 (KB4535288) +$outputFolder = 'c:\sqlsyms\12.0.6372.1\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/58e64a3a589647efb0962ea0b54a4f802/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.6372.01 ((SQL14_SP3_QFE-OD).191212-1438) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/4c0bcc7afda04998a4cb7e0bfdb736792/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.6372.01 ((SQL14_SP3_QFE-OD).191212-1438) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/7c6006d90ec04c61ba245a22fba604112/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.6372.01 ((SQL14_SP3_QFE-OD).191212-1438) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/34148353e4e245728f03ab52442361702/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.6372.01 ((SQL14_SP3_QFE-OD).191212-1438) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/fdbeff4d6d474008a694cd69c38acff72/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.6372.01 ((SQL14_SP3_QFE-OD).191212-1438) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/e82e0bf323c44a328f1dff97e18643ea2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.6372.01 ((SQL14_SP3_QFE-OD).191212-1438) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/ee0aebf1bb054cf7bf1a02b9967cb1941/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.6372.01 ((SQL14_SP3_QFE-OD).191212-1438) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/37659ab76c0746f59df1383528780d091/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.6372.01 ((SQL14_SP3_QFE-OD).191212-1438) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/d5b8297e63ee412bacb678e15142c6e61/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.6372.01 ((SQL14_SP3_QFE-OD).191212-1438) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/e541cd3097054c21bae4d0f56206a5d81/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.6372.01 ((SQL14_SP3_QFE-OD).191212-1438) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/9d8cfaa7d57c414eb326f3d248345f4a2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.6372.01 ((SQL14_SP3_QFE-OD).191212-1438) +``` + +# SQL Server 2014 SP3 Security update - 12.0.6372.1 - x86 (KB4535288) +``` powershell +# SQL Server 2014 SP3 Security update - 12.0.6372.1 - x86 (KB4535288) +$outputFolder = 'c:\sqlsyms\12.0.6372.1\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/293ea0a0c7424b899d5bcd915253d8671/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.6372.01 ((SQL14_SP3_QFE-OD).191212-1438) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/bcf38756effd4ebc810aa6e146c6a1bf1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.6372.01 ((SQL14_SP3_QFE-OD).191212-1438) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/a59d30393cae4117a8fb17f54e1b6fff1/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.6372.01 ((SQL14_SP3_QFE-OD).191212-1438) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/19fe1f9fe3c84751a09fb1916c1d1ab31/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.6372.01 ((SQL14_SP3_QFE-OD).191212-1438) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/ed1d0cdedb2247d9b67ba5b7df4247ad2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.6372.01 ((SQL14_SP3_QFE-OD).191212-1438) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/f3647da71cd84c81a409357f4e3823b01/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.6372.01 ((SQL14_SP3_QFE-OD).191212-1438) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/1e54810c09ff4222889ac0220924754a1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.6372.01 ((SQL14_SP3_QFE-OD).191212-1438) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/eb15a63849fd464484aadb058f6cceee1/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.6372.01 ((SQL14_SP3_QFE-OD).191212-1438) +``` + +# SQL Server 2014 SP3 CU4 - 12.0.6329.1 - x64 (KB4500181) +``` powershell +# SQL Server 2014 SP3 CU4 - 12.0.6329.1 - x64 (KB4500181) +$outputFolder = 'c:\sqlsyms\12.0.6329.1\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/d8fb694123ba4677bee6145b83b62cff2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.6329.01 ((SQL14_SP3_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/1b6e19734d074c9890f13ff5ea5d4c912/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.6329.01 ((SQL14_SP3_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/f95e3773af054cc7a3bf4b6085f6c1d12/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.6329.01 ((SQL14_SP3_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/84e90c67c25b46419a58c11eea0a9a4a2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.6329.01 ((SQL14_SP3_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/1e7f7c728a8f41049e73e89d313fcf852/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.6329.01 ((SQL14_SP3_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/4f2b4eda1143444bb7963507c9f9ea232/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.6329.01 ((SQL14_SP3_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/530c0de276fb40ceab73fb117b038d601/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.6329.01 ((SQL14_SP3_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/d6708b4bf5854985b6fa2ef0d44508a11/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.6329.01 ((SQL14_SP3_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/6c202059075a4fab90806f205caa070a1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.6329.01 ((SQL14_SP3_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/63a4742459624df0938bf06b948771ad1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.6329.01 ((SQL14_SP3_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/0f334a75cf294a6aa2be0b46f824b4902/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.6329.01 ((SQL14_SP3_QFE-CU).190720-2034) +``` + +# SQL Server 2014 SP3 CU4 - 12.0.6329.1 - x86 (KB4500181) +``` powershell +# SQL Server 2014 SP3 CU4 - 12.0.6329.1 - x86 (KB4500181) +$outputFolder = 'c:\sqlsyms\12.0.6329.1\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/890448d8cb7045b393f8d1e2414899681/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.6329.01 ((SQL14_SP3_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/54428dd07fed4d92a44af191b64b93931/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.6329.01 ((SQL14_SP3_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/1b72f20b65754e08a1b1afa6a1afa4111/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.6329.01 ((SQL14_SP3_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/648fb8d142124a79ba2427d7afa6e0b11/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.6329.01 ((SQL14_SP3_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/494b3def7c474707a36f396d3376c4862/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.6329.01 ((SQL14_SP3_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/1fffeae543a04025affdb7835ea77d271/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.6329.01 ((SQL14_SP3_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/f5d000569d74429ea2403fa65f7e782d1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.6329.01 ((SQL14_SP3_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/37ed1fbf4c114534bc53be649d38a4931/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.6329.01 ((SQL14_SP3_QFE-CU).190720-2034) +``` + +# SQL Server 2014 SP3 CU3 - 12.0.6259.0 - x64 (KB4491539) +``` powershell +# SQL Server 2014 SP3 CU3 - 12.0.6259.0 - x64 (KB4491539) +$outputFolder = 'c:\sqlsyms\12.0.6259.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/509f1673a650493eaf6e0609be36b3492/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.6259.00 ((SQL14_SP3_QFE-CU).190401-2139) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/9d0ed648ab3943148311d78972c4dcdf2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.6259.00 ((SQL14_SP3_QFE-CU).190401-2139) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/93f36eaccaf74bb49b33f830aa6225302/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.6259.00 ((SQL14_SP3_QFE-CU).190401-2139) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/59a4d543c0184372b51935541c2900152/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.6259.00 ((SQL14_SP3_QFE-CU).190401-2139) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/1836c6d5c554455c8b477142ba1c27552/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.6259.00 ((SQL14_SP3_QFE-CU).190401-2139) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/aefccb0a87ff43b6aa36c438baf6d1c42/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.6259.00 ((SQL14_SP3_QFE-CU).190401-2139) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/aa90299262cb4b118067c2df8703c9b91/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.6259.00 ((SQL14_SP3_QFE-CU).190401-2139) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/806e98d642074181978524533a9ef6531/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.6259.00 ((SQL14_SP3_QFE-CU).190401-2139) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/afbaa234358740998f706fd39e87a54e1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.6259.00 ((SQL14_SP3_QFE-CU).190401-2139) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/dd07d2aa7b2d4a528ffb3446711c9f321/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.6259.00 ((SQL14_SP3_QFE-CU).190401-2139) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/9a8dc77df3fc40f0a74375aa505eccfa2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.6259.00 ((SQL14_SP3_QFE-CU).190401-2139) +``` + +# SQL Server 2014 SP3 CU3 - 12.0.6259.0 - x86 (KB4491539) +``` powershell +# SQL Server 2014 SP3 CU3 - 12.0.6259.0 - x86 (KB4491539) +$outputFolder = 'c:\sqlsyms\12.0.6259.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/eb6a68e1d0a24f9a9334f21aa15921651/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.6259.00 ((SQL14_SP3_QFE-CU).190401-2139) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/e70ca276fe4043b19187d6d11dc8b8191/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.6259.00 ((SQL14_SP3_QFE-CU).190401-2139) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/6961ef7185e6403b8f45a2f02afaf21d1/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.6259.00 ((SQL14_SP3_QFE-CU).190401-2139) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/43b2f5430e244bfdbebf88fe85f6c9dc1/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.6259.00 ((SQL14_SP3_QFE-CU).190401-2139) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/549544362bc8490f9d315b111ae5b6952/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.6259.00 ((SQL14_SP3_QFE-CU).190401-2139) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/ce9855d8b6af4d45a14edb618dae86be1/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.6259.00 ((SQL14_SP3_QFE-CU).190401-2139) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/1c741bb277204482be593a294bc80dc71/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.6259.00 ((SQL14_SP3_QFE-CU).190401-2139) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/48abe955b32c43c2a8d38d8a0b706de51/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.6259.00 ((SQL14_SP3_QFE-CU).190401-2139) +``` + +# SQL Server 2014 SP3 CU2 - 12.0.6214.1 - x64 (KB4482960) +``` powershell +# SQL Server 2014 SP3 CU2 - 12.0.6214.1 - x64 (KB4482960) +$outputFolder = 'c:\sqlsyms\12.0.6214.1\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/10e693af20a345548cab5cc0d5bb9e5f2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.6214.01 ((SQL14_SP3_QFE-CU).190202-0024) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/277e791468d84fd3ac5134bfcb8b00292/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.6214.01 ((SQL14_SP3_QFE-CU).190202-0024) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/8c63860792c440eb997bbc9c3da54eb72/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.6214.01 ((SQL14_SP3_QFE-CU).190202-0024) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/860593c8a27d4f609d1f139775b445862/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.6214.01 ((SQL14_SP3_QFE-CU).190202-0024) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/0170e47e2ba046e0b2726300345d4dfc2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.6214.01 ((SQL14_SP3_QFE-CU).190202-0024) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/cf29ef995a5545ed8f8af7ddd180b7802/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.6214.01 ((SQL14_SP3_QFE-CU).190202-0024) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/4d1d0ae8debb488496086b48820cae8c1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.6214.01 ((SQL14_SP3_QFE-CU).190202-0024) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/a3671b7f7c5a457186f91951c24bae1c1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.6214.01 ((SQL14_SP3_QFE-CU).190202-0024) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/d7cc5f9c29834c34ac417d1237cc631c1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.6214.01 ((SQL14_SP3_QFE-CU).190202-0024) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/187d57d685f644f79c937544e990dbb81/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.6214.01 ((SQL14_SP3_QFE-CU).190202-0024) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/5c5e9a47919c4d6884d480d8f1c2d0762/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.6214.01 ((SQL14_SP3_QFE-CU).190202-0024) +``` + +# SQL Server 2014 SP3 CU2 - 12.0.6214.1 - x86 (KB4482960) +``` powershell +# SQL Server 2014 SP3 CU2 - 12.0.6214.1 - x86 (KB4482960) +$outputFolder = 'c:\sqlsyms\12.0.6214.1\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/754b0cc922a745aa8602712ee9aa1db11/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.6214.01 ((SQL14_SP3_QFE-CU).190202-0024) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/3841b412fc874fb99ca1f27156227aba1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.6214.01 ((SQL14_SP3_QFE-CU).190202-0024) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/ed56dba006f74b929b23cac11986d8d51/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.6214.01 ((SQL14_SP3_QFE-CU).190202-0024) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/ec53723220f14149a92352787915d8cf1/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.6214.01 ((SQL14_SP3_QFE-CU).190202-0024) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/a13d5a4be3234606bcfdbdfbf99ca8352/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.6214.01 ((SQL14_SP3_QFE-CU).190202-0024) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/f3338a3416cc4c9faa6f0f2dd08873761/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.6214.01 ((SQL14_SP3_QFE-CU).190202-0024) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/b113633a9a3f4819b125a6fd84cc4b2f1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.6214.01 ((SQL14_SP3_QFE-CU).190202-0024) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/40e7e956e6b64b3390093d7fed7996711/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.6214.01 ((SQL14_SP3_QFE-CU).190202-0024) +``` + +# SQL Server 2014 SP3 CU1 - 12.0.6205.1 - x64 (KB4470220) +``` powershell +# SQL Server 2014 SP3 CU1 - 12.0.6205.1 - x64 (KB4470220) +$outputFolder = 'c:\sqlsyms\12.0.6205.1\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/d81e66c5bbd8441aa42d3120f29de3942/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.6205.01 ((SQL14_SP3_QFE-CU).181130-0218) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/531883113186498cba06afb246bd12172/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.6205.01 ((SQL14_SP3_QFE-CU).181130-0218) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/093905727fd6498fac8991daed83fcde2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.6205.01 ((SQL14_SP3_QFE-CU).181130-0218) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/810559511add437f9da77ec6c227c3fb2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.6205.01 ((SQL14_SP3_QFE-CU).181130-0218) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/fff69d6bafab400fbafb9bfdd6fb52ff2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.6205.01 ((SQL14_SP3_QFE-CU).181130-0218) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/5cac176280bf4ab2af8033571dac19112/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.6205.01 ((SQL14_SP3_QFE-CU).181130-0218) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/b6bdfa6c96e74ef5ae6996e1733a432f1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.6205.01 ((SQL14_SP3_QFE-CU).181130-0218) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/8be7ae0b97464e56889d44760e5991771/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.6205.01 ((SQL14_SP3_QFE-CU).181130-0218) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/452b00505e9c4459877311b2a5296de01/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.6205.01 ((SQL14_SP3_QFE-CU).181130-0218) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/aa1470bb4a5c4687aef9d015e876685d1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.6205.01 ((SQL14_SP3_QFE-CU).181130-0218) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/2fe2b89405d644e8859b099da8827acb2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.6205.01 ((SQL14_SP3_QFE-CU).181130-0218) +``` + +# SQL Server 2014 SP3 CU1 - 12.0.6205.1 - x86 (KB4470220) +``` powershell +# SQL Server 2014 SP3 CU1 - 12.0.6205.1 - x86 (KB4470220) +$outputFolder = 'c:\sqlsyms\12.0.6205.1\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/cbcf0fbe53e54dacab354777d0dd5c2f1/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.6205.01 ((SQL14_SP3_QFE-CU).181130-0218) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/4f2576c7baa640d894aa0bf5d12fcf5f1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.6205.01 ((SQL14_SP3_QFE-CU).181130-0218) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/ac9f63e413d74fc5b1685806550265ae1/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.6205.01 ((SQL14_SP3_QFE-CU).181130-0218) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/fd21a26df72c47e29b96652c800806001/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.6205.01 ((SQL14_SP3_QFE-CU).181130-0218) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/75e51827bfcf435bae782ec8b7a4e3d82/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.6205.01 ((SQL14_SP3_QFE-CU).181130-0218) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/1a1dabe18df94874ba8bf28b429a8e6e1/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.6205.01 ((SQL14_SP3_QFE-CU).181130-0218) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/6cc29ac330c64c0a97461b778a1ba63d1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.6205.01 ((SQL14_SP3_QFE-CU).181130-0218) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/64addefbdce84bdd97198a54d80939e71/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.6205.01 ((SQL14_SP3_QFE-CU).181130-0218) +``` + +# SQL Server 2014 SP3 SP3 - 12.0.6024.0 - x64 (KB4022619) +``` powershell +# SQL Server 2014 SP3 SP3 - 12.0.6024.0 - x64 (KB4022619) +$outputFolder = 'c:\sqlsyms\12.0.6024.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/41b862dddc464a7e8fb435d80ef36d452/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.6024.00 ((SQL14_PCU_Main).180907-0056) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/8bc7a14bc8374bd0a9bcba71d608c2ef2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.6024.00 ((SQL14_PCU_Main).180907-0056) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/d1b5af4c4bcb41aebdae55654c0abc172/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.6024.00 ((SQL14_PCU_Main).180907-0056) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/a84fba616c964fdb849bb61878d368312/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.6024.00 ((SQL14_PCU_Main).180907-0056) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/cd96b0931624429a8b38b968078fad6c2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.6024.00 ((SQL14_PCU_Main).180907-0056) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/5e9cea18178c471b98c01da45892cc142/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.6024.00 ((SQL14_PCU_Main).180907-0056) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/c9163d437f9e473a91690d6a7fae07531/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.6024.00 ((SQL14_PCU_Main).180907-0056) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/f97a0a9518ea47d3ad13d09e1c6cbc8e1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.6024.00 ((SQL14_PCU_Main).180907-0056) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/1915e0ba4f764b49806e8bcefe9bdd351/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.6024.00 ((SQL14_PCU_Main).180907-0056) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/9b9535d5b46442d7a75246220c243ad91/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.6024.00 ((SQL14_PCU_Main).180907-0056) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/15291da2ad56424ab3f1a7e97809ec602/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.6024.00 ((SQL14_PCU_Main).180907-0056) +``` + +# SQL Server 2014 SP3 SP3 - 12.0.6024.0 - x86 (KB4022619) +``` powershell +# SQL Server 2014 SP3 SP3 - 12.0.6024.0 - x86 (KB4022619) +$outputFolder = 'c:\sqlsyms\12.0.6024.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/63c453d94e884e719f71611dd86e41f71/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.6024.00 ((SQL14_PCU_Main).180907-0056) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/6b94239f60d04638ac56d2d915054ae11/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.6024.00 ((SQL14_PCU_Main).180907-0056) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/d2bd8b4899db4627a49dcf39f275681a1/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.6024.00 ((SQL14_PCU_Main).180907-0056) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/e42c910a8207417ebfe95904c7aca3c01/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.6024.00 ((SQL14_PCU_Main).180907-0056) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/65c5722bca2e4384b8abdd8e7f57d00b2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.6024.00 ((SQL14_PCU_Main).180907-0056) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/f0ce2870ba1c4a759c01ee8c9366fa5d1/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.6024.00 ((SQL14_PCU_Main).180907-0056) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/b1c25cca32ca4d6391442eb096c2e71b1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.6024.00 ((SQL14_PCU_Main).180907-0056) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/370cc1865d654a908a912aca9de0156d1/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.6024.00 ((SQL14_PCU_Main).180907-0056) +``` + +# SQL Server 2014 SP2 CU18 - 12.0.5687.1 - x64 (KB4500180) +``` powershell +# SQL Server 2014 SP2 CU18 - 12.0.5687.1 - x64 (KB4500180) +$outputFolder = 'c:\sqlsyms\12.0.5687.1\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/bc12ecf9b0b543b196f0b7ed938283452/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.5687.01 ((SQL14_SP2_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/1b75aed94f92493dbba724cdc1f7c36d2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5687.01 ((SQL14_SP2_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/ff83ee2c46a7487686e8e1130887ced12/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5687.01 ((SQL14_SP2_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/b1044002158745fa8df8cce82b12f6ae2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.5687.01 ((SQL14_SP2_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/e8b1bf15c88342efbc82d32362ea64702/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5687.01 ((SQL14_SP2_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/e6d23fe6f42648418edc7c96c8619fd12/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5687.01 ((SQL14_SP2_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/abbcda6f1fb844bab401cd2ec5ec95471/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.5687.01 ((SQL14_SP2_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/f1f51c0ee2bb40dea8c9cc16917f52981/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.5687.01 ((SQL14_SP2_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/1d23807267c543f9a3fe48d69ef3d13e1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.5687.01 ((SQL14_SP2_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/801dddbf3b0849d9b0b1d15219dadad81/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5687.01 ((SQL14_SP2_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/e53cbbfca1d94580b8d4a7d511bb56e22/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5687.01 ((SQL14_SP2_QFE-CU).190720-2034) +``` + +# SQL Server 2014 SP2 CU18 - 12.0.5687.1 - x86 (KB4500180) +``` powershell +# SQL Server 2014 SP2 CU18 - 12.0.5687.1 - x86 (KB4500180) +$outputFolder = 'c:\sqlsyms\12.0.5687.1\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/1f1ebd01257f4aa5861d1ba6bd5eef381/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.5687.01 ((SQL14_SP2_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/b7fdb65668ae43cbac516c04d7fcddfb1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5687.01 ((SQL14_SP2_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/f4b5dc917b9a4b578e83a63c98914bdb1/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5687.01 ((SQL14_SP2_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/dd4f41c29b454453b9dadd60a3cf988e1/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.5687.01 ((SQL14_SP2_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/a8c3b381308647ab9a765b681f92e08f2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5687.01 ((SQL14_SP2_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/77dc64a2c02c41c3921c183c76ca39d51/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5687.01 ((SQL14_SP2_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/afe089cbd86947c6b1fe8796ded5a75e1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5687.01 ((SQL14_SP2_QFE-CU).190720-2034) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/897c55ca4ff84510ae2c1ac75f918e771/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5687.01 ((SQL14_SP2_QFE-CU).190720-2034) +``` + +# SQL Server 2014 SP2 CU17 - 12.0.5632.1 - x64 (KB4491540) +``` powershell +# SQL Server 2014 SP2 CU17 - 12.0.5632.1 - x64 (KB4491540) +$outputFolder = 'c:\sqlsyms\12.0.5632.1\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/7cec2abd211d44449ec0f3e94e1a78202/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.5632.01 ((SQL14_SP2_QFE-CU).190401-2109) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/093aba20ce644768bb722dfc74216a672/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5632.01 ((SQL14_SP2_QFE-CU).190401-2109) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/429635c72df34811b063bfbdc4fd30d72/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5632.01 ((SQL14_SP2_QFE-CU).190401-2109) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/3e544ec2f85b4e27b3d23c8316125f262/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.5632.01 ((SQL14_SP2_QFE-CU).190401-2109) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/f5e5a5a404464f80b46f6449a2dfa6a02/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5632.01 ((SQL14_SP2_QFE-CU).190401-2109) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/b5f8b9ae3a364402ac1b8bab1c3732512/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5632.01 ((SQL14_SP2_QFE-CU).190401-2109) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/cf46f2edea064dae95f6a457ba1ae1ef1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.5632.01 ((SQL14_SP2_QFE-CU).190401-2109) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/8a0ea19b90b84d7799d99bb3b751399d1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.5632.01 ((SQL14_SP2_QFE-CU).190401-2109) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/fa60812c91384eaf82bd97d59a2ff4e61/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.5632.01 ((SQL14_SP2_QFE-CU).190401-2109) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/310541c655dc434c9d834d1a6a196cfd1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5632.01 ((SQL14_SP2_QFE-CU).190401-2109) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/2de8f5bc87ff4a8390a0f454faf810282/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5632.01 ((SQL14_SP2_QFE-CU).190401-2109) +``` + +# SQL Server 2014 SP2 CU17 - 12.0.5632.1 - x86 (KB4491540) +``` powershell +# SQL Server 2014 SP2 CU17 - 12.0.5632.1 - x86 (KB4491540) +$outputFolder = 'c:\sqlsyms\12.0.5632.1\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/748fe7f884084be6bd64e1e9448d0ffe1/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.5632.01 ((SQL14_SP2_QFE-CU).190401-2109) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/545779f8eb8547d4abdd811f28c7f3f61/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5632.01 ((SQL14_SP2_QFE-CU).190401-2109) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/36d26ada3cf949229fda088acadabd831/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5632.01 ((SQL14_SP2_QFE-CU).190401-2109) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/478b047f2f8044b7b33aeded194ebfee1/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.5632.01 ((SQL14_SP2_QFE-CU).190401-2109) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/0466eb809cbe4386b49402ad9004229d2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5632.01 ((SQL14_SP2_QFE-CU).190401-2109) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/066f353a8df34b8c8bc789d6e27c5a321/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5632.01 ((SQL14_SP2_QFE-CU).190401-2109) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/6ac1205c109b49ae850f9ded968ffecb1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5632.01 ((SQL14_SP2_QFE-CU).190401-2109) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/eed60d89729949198006ca2352abf51f1/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5632.01 ((SQL14_SP2_QFE-CU).190401-2109) +``` + +# SQL Server 2014 SP2 CU16 - 12.0.5626.1 - x64 (KB4482967) +``` powershell +# SQL Server 2014 SP2 CU16 - 12.0.5626.1 - x64 (KB4482967) +$outputFolder = 'c:\sqlsyms\12.0.5626.1\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/7090b9b360f644bda3ac44b853a206d82/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.5626.01 ((SQL14_SP2_QFE-CU).190208-0024) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/6c9e5d6da1dd488d89eb0ae333b1c5eb2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5626.01 ((SQL14_SP2_QFE-CU).190208-0024) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/ea9b053430534dfc8f0dce4807a484682/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5626.01 ((SQL14_SP2_QFE-CU).190208-0024) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/98a4a92f370d402188b910a7435ba3f72/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.5626.01 ((SQL14_SP2_QFE-CU).190208-0024) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/d535d53ebf624bb29f5557ffbf0a5efc2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5626.01 ((SQL14_SP2_QFE-CU).190208-0024) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/54f79487ed6d40ea86bbcc67ff82b6e82/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5626.01 ((SQL14_SP2_QFE-CU).190208-0024) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/ea86d5e8467f4f289207290bec941f7a1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.5626.01 ((SQL14_SP2_QFE-CU).190208-0024) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/1d2496b66ea54f22851739b58fcd1d371/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.5626.01 ((SQL14_SP2_QFE-CU).190208-0024) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/70eb1fd8363e42419e5e5ee4a23d7af31/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.5626.01 ((SQL14_SP2_QFE-CU).190208-0024) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/0ceb3b389ce54506b0198b62af03a7a81/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5626.01 ((SQL14_SP2_QFE-CU).190208-0024) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/44cde1fe0341418cabb84df6877e072f2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5626.01 ((SQL14_SP2_QFE-CU).190208-0024) +``` + +# SQL Server 2014 SP2 CU16 - 12.0.5626.1 - x86 (KB4482967) +``` powershell +# SQL Server 2014 SP2 CU16 - 12.0.5626.1 - x86 (KB4482967) +$outputFolder = 'c:\sqlsyms\12.0.5626.1\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/b78052c424754a1e9f08450f02cf15261/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.5626.01 ((SQL14_SP2_QFE-CU).190208-0024) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/273a5267830d42a7aa3f38a52bc210cb1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5626.01 ((SQL14_SP2_QFE-CU).190208-0024) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/5256c66a20844f00876972b91c7606d01/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5626.01 ((SQL14_SP2_QFE-CU).190208-0024) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/f755234510654e88b5a922721ea8f8071/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.5626.01 ((SQL14_SP2_QFE-CU).190208-0024) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/dcbe2aea271c41d08af7f2ee653651c72/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5626.01 ((SQL14_SP2_QFE-CU).190208-0024) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/2c2f8b012a19446b80ca5f21ca91700c1/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5626.01 ((SQL14_SP2_QFE-CU).190208-0024) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/e59649446ebc4f07a5aa23edc78b5af11/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5626.01 ((SQL14_SP2_QFE-CU).190208-0024) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/d0b73290904841ca94d10ec14ad456ab1/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5626.01 ((SQL14_SP2_QFE-CU).190208-0024) +``` + +# SQL Server 2014 SP2 CU15 - 12.0.5605.1 - x64 (KB4469137) +``` powershell +# SQL Server 2014 SP2 CU15 - 12.0.5605.1 - x64 (KB4469137) +$outputFolder = 'c:\sqlsyms\12.0.5605.1\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/117240f0c59848f8afe7069fadb2be382/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.5605.01 ((SQL14_SP2_QFE-CU).181130-0132) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/876f1d479cf34b3cbcef15246fff9b2b2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5605.01 ((SQL14_SP2_QFE-CU).181130-0132) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/3204a130bbab4542902c7a8a2d83fa512/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5605.01 ((SQL14_SP2_QFE-CU).181130-0132) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/9d04ea3232d645d88d2918112a86965b2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.5605.01 ((SQL14_SP2_QFE-CU).181130-0132) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/271f77960efa4e848183c41e045ed28b2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5605.01 ((SQL14_SP2_QFE-CU).181130-0132) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/05287b373d6848818fed57489cb723882/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5605.01 ((SQL14_SP2_QFE-CU).181130-0132) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/37871400f6ba41cb87953ea6dee1679b1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.5605.01 ((SQL14_SP2_QFE-CU).181130-0132) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/a150b67635d9449e9cb1e54dc04057091/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.5605.01 ((SQL14_SP2_QFE-CU).181130-0132) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/729bc522263b44bf9d76c05c86d60aa71/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.5605.01 ((SQL14_SP2_QFE-CU).181130-0132) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/0efb398f50ac46a095e3db1d063494b71/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5605.01 ((SQL14_SP2_QFE-CU).181130-0132) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/8c1f27f1610d4083b6cfc03d8464e9702/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5605.01 ((SQL14_SP2_QFE-CU).181130-0132) +``` + +# SQL Server 2014 SP2 CU15 - 12.0.5605.1 - x86 (KB4469137) +``` powershell +# SQL Server 2014 SP2 CU15 - 12.0.5605.1 - x86 (KB4469137) +$outputFolder = 'c:\sqlsyms\12.0.5605.1\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/b80aa4d26d824d51a1b2821b3bd3c9df1/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.5605.01 ((SQL14_SP2_QFE-CU).181130-0132) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/a167e470217c45f8990402872693763c1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5605.01 ((SQL14_SP2_QFE-CU).181130-0132) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/8624d05eb3114058bb16484bb5b270f41/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5605.01 ((SQL14_SP2_QFE-CU).181130-0132) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/fbacb139597e46f5b710e865a66de6401/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.5605.01 ((SQL14_SP2_QFE-CU).181130-0132) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/5de0309257254890b30958eddac74d692/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5605.01 ((SQL14_SP2_QFE-CU).181130-0132) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/7c97495f85d545ec97e160ec95e08a051/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5605.01 ((SQL14_SP2_QFE-CU).181130-0132) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/8a2c37cc83db491095f9452840c70a5e1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5605.01 ((SQL14_SP2_QFE-CU).181130-0132) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/0ed0bd2de748480cae7a6fb8c9c720eb1/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5605.01 ((SQL14_SP2_QFE-CU).181130-0132) +``` + +# SQL Server 2014 SP2 CU14 - 12.0.5600.1 - x64 (KB4459860) +``` powershell +# SQL Server 2014 SP2 CU14 - 12.0.5600.1 - x64 (KB4459860) +$outputFolder = 'c:\sqlsyms\12.0.5600.1\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/2438e40ce685447eac9e01d2173b146d2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.5600.01 ((SQL14_SP2_QFE-CU).180927-2111) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/93a50030edc54ab2805e7324b5c5867e2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5600.01 ((SQL14_SP2_QFE-CU).180927-2111) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/b0b41b9743964fe2874cf90433ef7c9a2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5600.01 ((SQL14_SP2_QFE-CU).180927-2111) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/5e129aa1bde341ef9cd43882060582eb2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.5600.01 ((SQL14_SP2_QFE-CU).180927-2111) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/250c631ea1f249fdabc901273e8f7c452/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5600.01 ((SQL14_SP2_QFE-CU).180927-2111) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/e6f37c85e8004bfc8c74ccba69e5ce642/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5600.01 ((SQL14_SP2_QFE-CU).180927-2111) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/73600a8dc74945059ccf2d99ca8a377b1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.5600.01 ((SQL14_SP2_QFE-CU).180927-2111) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/c357ccbf716b47e29b48073179a6a2a81/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.5600.01 ((SQL14_SP2_QFE-CU).180927-2111) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/f925b1c9695d4dd28360ceb7e2976a581/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.5600.01 ((SQL14_SP2_QFE-CU).180927-2111) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/8ae4a300b56c475095d8ec409dbc31221/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5600.01 ((SQL14_SP2_QFE-CU).180927-2111) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/1b685a50036e4af388ff9f1fab8a795f2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5600.01 ((SQL14_SP2_QFE-CU).180927-2111) +``` + +# SQL Server 2014 SP2 CU14 - 12.0.5600.1 - x86 (KB4459860) +``` powershell +# SQL Server 2014 SP2 CU14 - 12.0.5600.1 - x86 (KB4459860) +$outputFolder = 'c:\sqlsyms\12.0.5600.1\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/c6575e4e12d94e4ba30764806d0577061/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.5600.01 ((SQL14_SP2_QFE-CU).180927-2111) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/61c9b48dd8af443780ba4556f948816d1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5600.01 ((SQL14_SP2_QFE-CU).180927-2111) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/88e4973a9b8548909a0ab9b691936ed31/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5600.01 ((SQL14_SP2_QFE-CU).180927-2111) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/62a1d5b32fc9473daeb6a9e21b76bf101/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.5600.01 ((SQL14_SP2_QFE-CU).180927-2111) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/ceebbde0de164cf985ce91e4e28d96862/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5600.01 ((SQL14_SP2_QFE-CU).180927-2111) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/5963ceed5f9b435d853a2c11315f11521/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5600.01 ((SQL14_SP2_QFE-CU).180927-2111) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/5cc038bc384c45578d1485fb3370f81c1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5600.01 ((SQL14_SP2_QFE-CU).180927-2111) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/441a2d9da7a2414f999efcac59e8da3d1/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5600.01 ((SQL14_SP2_QFE-CU).180927-2111) +``` + +# SQL Server 2014 SP2 CU13 - 12.0.5590.1 - x64 (KB4456287) +``` powershell +# SQL Server 2014 SP2 CU13 - 12.0.5590.1 - x64 (KB4456287) +$outputFolder = 'c:\sqlsyms\12.0.5590.1\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/f22828ad8cd143b98690f3d5308405a72/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.5590.01 ((SQL14_SP2_QFE-CU).180801-0048) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/38f99ac2329e4ee1a630dd928660bf8c2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5590.01 ((SQL14_SP2_QFE-CU).180801-0048) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/26704fbb534d46b49653205984de35ca2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5590.01 ((SQL14_SP2_QFE-CU).180801-0048) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/b9bbf018d2d24d3088f300f40de6569f2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.5590.01 ((SQL14_SP2_QFE-CU).180801-0048) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/7760942524a04b989b969dc6db24bba12/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5590.01 ((SQL14_SP2_QFE-CU).180801-0048) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/4d0c5e89bcee412c9100b8d694214c402/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5590.01 ((SQL14_SP2_QFE-CU).180801-0048) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/17b16aabe9944c3a83febffb78cbd6811/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.5590.01 ((SQL14_SP2_QFE-CU).180801-0048) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/c9216aed6e7645d39c0825a977c5a6f31/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.5590.01 ((SQL14_SP2_QFE-CU).180801-0048) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/9d9eadc9e8f8484eb83eb557687c059f1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.5590.01 ((SQL14_SP2_QFE-CU).180801-0048) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/3d021aaa04a8473abb5965725950c4ab1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5590.01 ((SQL14_SP2_QFE-CU).180801-0048) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/407d631b6e454fd0b0c041c33c345fd22/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5590.01 ((SQL14_SP2_QFE-CU).180801-0048) +``` + +# SQL Server 2014 SP2 CU13 - 12.0.5590.1 - x86 (KB4456287) +``` powershell +# SQL Server 2014 SP2 CU13 - 12.0.5590.1 - x86 (KB4456287) +$outputFolder = 'c:\sqlsyms\12.0.5590.1\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/33e588094276460b8038432fad3db2661/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.5590.01 ((SQL14_SP2_QFE-CU).180801-0048) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/629dce7389c24992a825468bd5191eae1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5590.01 ((SQL14_SP2_QFE-CU).180801-0048) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/5b493a35686047f1ba71f7ce7b3a90751/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5590.01 ((SQL14_SP2_QFE-CU).180801-0048) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/f7a83574ae43421b8468a07d493246ef1/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.5590.01 ((SQL14_SP2_QFE-CU).180801-0048) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/f158728bc8404e1aa43fe38433e4e6f82/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5590.01 ((SQL14_SP2_QFE-CU).180801-0048) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/1f241b8adf9748bca47525e287ae42451/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5590.01 ((SQL14_SP2_QFE-CU).180801-0048) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/bc679557623041a48db99e6ab3c27f691/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5590.01 ((SQL14_SP2_QFE-CU).180801-0048) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/f6f9e9d0148d47d7ad3abfc75f8bb31b1/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5590.01 ((SQL14_SP2_QFE-CU).180801-0048) +``` + +# SQL Server 2014 SP2 CU12 - 12.0.5589.7 - x64 (KB4130489) +``` powershell +# SQL Server 2014 SP2 CU12 - 12.0.5589.7 - x64 (KB4130489) +$outputFolder = 'c:\sqlsyms\12.0.5589.7\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/9cf25aee69fe4936b6d5dbc0a2864e562/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.5589.07 ((SQL14_SP2_QFE-CU).180609-1032) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/56bc64bb80724cbe9e73e3baf373ac5e2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5589.07 ((SQL14_SP2_QFE-CU).180609-1032) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/bfd1994080f84d2b832dc738a74466d62/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5589.07 ((SQL14_SP2_QFE-CU).180609-1032) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/c4b5a5ca9822464386d76070dc0b16c52/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.5589.07 ((SQL14_SP2_QFE-CU).180609-1032) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/69363948fbbe4b37a1942a397c28ac9a2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5589.07 ((SQL14_SP2_QFE-CU).180609-1032) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/7d1172991d104f70985859b8f5c1ca122/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5589.07 ((SQL14_SP2_QFE-CU).180609-1032) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/2ba38b2b5dc84ea29ba150f79b52c9b31/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.5589.07 ((SQL14_SP2_QFE-CU).180609-1032) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/f7947a9995b34b38bffe3a086f9ed3341/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.5589.07 ((SQL14_SP2_QFE-CU).180609-1032) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/d97a5e01a698460d9641e2017990f2ba1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.5589.07 ((SQL14_SP2_QFE-CU).180609-1032) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/bf808d6229bd4fe69562c672359a61b81/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5589.07 ((SQL14_SP2_QFE-CU).180609-1032) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/5abf57238fc44199bc9b494c7391a94a2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5589.07 ((SQL14_SP2_QFE-CU).180609-1032) +``` + +# SQL Server 2014 SP2 CU12 - 12.0.5589.7 - x86 (KB4130489) +``` powershell +# SQL Server 2014 SP2 CU12 - 12.0.5589.7 - x86 (KB4130489) +$outputFolder = 'c:\sqlsyms\12.0.5589.7\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/a17e4ed617604e1f93cb7043a7b061af1/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.5589.07 ((SQL14_SP2_QFE-CU).180609-1032) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/f1d22c428ec941b3ab6cf84b970013d21/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5589.07 ((SQL14_SP2_QFE-CU).180609-1032) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/3df9de6f254540598dd9da4852d8797d1/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5589.07 ((SQL14_SP2_QFE-CU).180609-1032) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/8a70299c32844f529bf7af758400e1a61/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.5589.07 ((SQL14_SP2_QFE-CU).180609-1032) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/c8053d2959e24d70bc2820ef3d183c4a2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5589.07 ((SQL14_SP2_QFE-CU).180609-1032) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/a2e7016632da4d79a7ffc36ec94956c21/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5589.07 ((SQL14_SP2_QFE-CU).180609-1032) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/0dd5355ca33a4d49a27401e7bed2e4241/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5589.07 ((SQL14_SP2_QFE-CU).180609-1032) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/bb53084f1e9c448db50e72d30284890d1/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5589.07 ((SQL14_SP2_QFE-CU).180609-1032) +``` + +# SQL Server 2014 SP2 CU11 - 12.0.5579.0 - x64 (KB4077063) +``` powershell +# SQL Server 2014 SP2 CU11 - 12.0.5579.0 - x64 (KB4077063) +$outputFolder = 'c:\sqlsyms\12.0.5579.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/0aea57c255f340f6b268422d36c9b5462/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.5579.00 ((SQL14_SP2_QFE-CU).180221-1111) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/8f7a73cfc7ae40b69cedfb56c478c8a42/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5579.00 ((SQL14_SP2_QFE-CU).180221-1111) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/6f3a59d764d34c1c9506c1cbb799ce282/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5579.00 ((SQL14_SP2_QFE-CU).180221-1111) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/5e23ac5ca0a441cea1043b92cc7db19d2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.5579.00 ((SQL14_SP2_QFE-CU).180221-1111) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/90418b6bc2dd41469db8c20a64cd6b082/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5579.00 ((SQL14_SP2_QFE-CU).180221-1111) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/4355cf52f7e54f1abd0d6545276e31242/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5579.00 ((SQL14_SP2_QFE-CU).180221-1111) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/6eacc2b3b2b54beba5e1e47ccf312c691/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.5579.00 ((SQL14_SP2_QFE-CU).180221-1111) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/43312b84f24d461582340aa0d3706e0f1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.5579.00 ((SQL14_SP2_QFE-CU).180221-1111) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/f88d3bc891cf4a66a06ab20db6a2f4111/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.5579.00 ((SQL14_SP2_QFE-CU).180221-1111) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/1a52dc5348f24ec98371fc0191786fa31/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5579.00 ((SQL14_SP2_QFE-CU).180221-1111) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/f9963e6eb1a34e019caf757ff0bdf2762/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5579.00 ((SQL14_SP2_QFE-CU).180221-1111) +``` + +# SQL Server 2014 SP2 CU11 - 12.0.5579.0 - x86 (KB4077063) +``` powershell +# SQL Server 2014 SP2 CU11 - 12.0.5579.0 - x86 (KB4077063) +$outputFolder = 'c:\sqlsyms\12.0.5579.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/2a38a3f0f77b410b8ab96959ec07f43f1/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.5579.00 ((SQL14_SP2_QFE-CU).180221-1111) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/ad85bbc382b94bc4b6d28c94bea7b09f1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5579.00 ((SQL14_SP2_QFE-CU).180221-1111) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/2c9ba43db9924d71be6599ef2ddfb6fa1/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5579.00 ((SQL14_SP2_QFE-CU).180221-1111) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/8b5208e65b4d420884a73dca82dfb5c61/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.5579.00 ((SQL14_SP2_QFE-CU).180221-1111) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/fd4511ab526d47b7ae5f18fa15dcb2ee2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5579.00 ((SQL14_SP2_QFE-CU).180221-1111) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/ace3687338a64ee99b1ddad95e5b5a611/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5579.00 ((SQL14_SP2_QFE-CU).180221-1111) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/ae50d44983714260bc12cb539b3ae6481/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5579.00 ((SQL14_SP2_QFE-CU).180221-1111) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/6524dc9692f44f0a954ebc34fba6566e1/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5579.00 ((SQL14_SP2_QFE-CU).180221-1111) +``` + +# SQL Server 2014 SP2 CU10 - 12.0.5571.0 - x64 (KB4052725) +``` powershell +# SQL Server 2014 SP2 CU10 - 12.0.5571.0 - x64 (KB4052725) +$outputFolder = 'c:\sqlsyms\12.0.5571.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/1f838ce4d2314a679d95f581ba5cfca72/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.5571.00 ((SQL14_SP2_QFE-CU).180110-1458) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/eb5287194386470bb6ed9be5cfa913032/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5571.00 ((SQL14_SP2_QFE-CU).180110-1458) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/187bfc99dd6142ed912b9b0a16971ba92/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5571.00 ((SQL14_SP2_QFE-CU).180110-1458) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/4a0d1ac8b530440581e5ee96278215352/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.5571.00 ((SQL14_SP2_QFE-CU).180110-1458) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/2a491b79a3534daaba1fdaee3ef28d412/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5571.00 ((SQL14_SP2_QFE-CU).180110-1458) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/88fe4b4b23a64afd804553959161691a2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5571.00 ((SQL14_SP2_QFE-CU).180110-1458) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/1dd40e165b074b0784aa0fa5c7225ce11/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.5571.00 ((SQL14_SP2_QFE-CU).180110-1458) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/42629264c38e41829734aca5e2c32b851/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.5571.00 ((SQL14_SP2_QFE-CU).180110-1458) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/9ff125ff36e841719e28e54c59d81e8a1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.5571.00 ((SQL14_SP2_QFE-CU).180110-1458) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/195069bf1697410789e1c320dcff547e1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5571.00 ((SQL14_SP2_QFE-CU).180110-1458) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/4ea18a049c454b7fab49fa3af4d747652/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5571.00 ((SQL14_SP2_QFE-CU).180110-1458) +``` + +# SQL Server 2014 SP2 CU10 - 12.0.5571.0 - x86 (KB4052725) +``` powershell +# SQL Server 2014 SP2 CU10 - 12.0.5571.0 - x86 (KB4052725) +$outputFolder = 'c:\sqlsyms\12.0.5571.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/7388785bb378492eae7399ead30a62bd1/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.5571.00 ((SQL14_SP2_QFE-CU).180110-1458) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/9ae111fc7f1b45789253f4d3910106c81/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5571.00 ((SQL14_SP2_QFE-CU).180110-1458) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/655a1096c0074f94b7ffbbf9b233ea5a1/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5571.00 ((SQL14_SP2_QFE-CU).180110-1458) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/cf11f8ed6ff04de7b823930a8451701b1/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.5571.00 ((SQL14_SP2_QFE-CU).180110-1458) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/273a0ff6e91b4a8da2bee5298a5dd61f2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5571.00 ((SQL14_SP2_QFE-CU).180110-1458) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/fa6377a396864fb2918b6a596d4beb711/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5571.00 ((SQL14_SP2_QFE-CU).180110-1458) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/464ae4327e2f4dc3b17e8f3a771ff18c1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5571.00 ((SQL14_SP2_QFE-CU).180110-1458) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/7cb655624af24ccc85f4389fb0c901241/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5571.00 ((SQL14_SP2_QFE-CU).180110-1458) +``` + +# SQL Server 2014 SP2 CU9 - 12.0.5563.0 - x64 (KB4055557) +``` powershell +# SQL Server 2014 SP2 CU9 - 12.0.5563.0 - x64 (KB4055557) +$outputFolder = 'c:\sqlsyms\12.0.5563.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/b9c9830b1bcc4092bd2bb4f51bf81cf52/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.5563.00 ((SQL14_SP2_QFE-CU).171207-0002) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/7032c53e91934abdbf6bad9fac99066c2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5563.00 ((SQL14_SP2_QFE-CU).171207-0002) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/bbfb8d689ab34f56b443d662c7b9336e2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5563.00 ((SQL14_SP2_QFE-CU).171207-0002) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/1143c59b5fee4cb9a86a2fa2978285562/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.5563.00 ((SQL14_SP2_QFE-CU).171207-0002) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/a5dfb5b4a0c041539cd6312fd52d8b2c2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5563.00 ((SQL14_SP2_QFE-CU).171207-0002) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/d0d7ae41d21e404694ddef3b58b555102/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5563.00 ((SQL14_SP2_QFE-CU).171207-0002) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/03fd2ef25c1540819c499476aa797f5a1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.5563.00 ((SQL14_SP2_QFE-CU).171207-0002) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/ffa799b2d4d2478186b883fe71edf34e1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.5563.00 ((SQL14_SP2_QFE-CU).171207-0002) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/a56ee479b9024d47bde320de941d1ad81/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.5563.00 ((SQL14_SP2_QFE-CU).171207-0002) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/0917fd5803fe42e9b8fcdbac6b428edb1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5563.00 ((SQL14_SP2_QFE-CU).171207-0002) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/d194fc1a9c914898b99235221a474a522/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5563.00 ((SQL14_SP2_QFE-CU).171207-0002) +``` + +# SQL Server 2014 SP2 CU9 - 12.0.5563.0 - x86 (KB4055557) +``` powershell +# SQL Server 2014 SP2 CU9 - 12.0.5563.0 - x86 (KB4055557) +$outputFolder = 'c:\sqlsyms\12.0.5563.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/06301e600c9448b49312e41cc75d51401/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.5563.00 ((SQL14_SP2_QFE-CU).171207-0002) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/3d79c403b6534fa3a1850e0f8e5cb71b1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5563.00 ((SQL14_SP2_QFE-CU).171207-0002) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/13d944a09a6b4075bec01634bb3c5ba61/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5563.00 ((SQL14_SP2_QFE-CU).171207-0002) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/57fbfa47c5064fdfbaa81ce84725cfd91/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.5563.00 ((SQL14_SP2_QFE-CU).171207-0002) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/fe70fe593a974da09e5170edc376b0622/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5563.00 ((SQL14_SP2_QFE-CU).171207-0002) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/cbecde3234164a3c871dd3a45649152b1/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5563.00 ((SQL14_SP2_QFE-CU).171207-0002) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/06186cc6b2eb40dab968c484987b96c41/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5563.00 ((SQL14_SP2_QFE-CU).171207-0002) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/3fa4e4db8ea34b0a86118d3b83e1a1721/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5563.00 ((SQL14_SP2_QFE-CU).171207-0002) +``` + +# SQL Server 2014 SP2 CU8 - 12.0.5557.0 - x64 (KB4037356) +``` powershell +# SQL Server 2014 SP2 CU8 - 12.0.5557.0 - x64 (KB4037356) +$outputFolder = 'c:\sqlsyms\12.0.5557.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/e7152ca5bb5641cabadc516f5de4448e2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.5557.00 ((SQL14_SP2_QFE-CU).171003-1352) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/976df45212de41739cfb5401b5395f032/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5557.00 ((SQL14_SP2_QFE-CU).171003-1352) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/d5029367d82748b08723648d64ea340c2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5557.00 ((SQL14_SP2_QFE-CU).171003-1352) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/1095950d7a964eca94e27667eec14dd22/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.5557.00 ((SQL14_SP2_QFE-CU).171003-1352) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/0b310c825aca4a7abef7b902667467e62/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5557.00 ((SQL14_SP2_QFE-CU).171003-1352) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/96dbb1b774234407bbfaa17da1e2538a2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5557.00 ((SQL14_SP2_QFE-CU).171003-1352) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/6aa802a2e06f497b86358cfbef459f031/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.5557.00 ((SQL14_SP2_QFE-CU).171003-1352) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/2d7ae65a5e784e3e9c8e06a697a64b6b1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.5557.00 ((SQL14_SP2_QFE-CU).171003-1352) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/f23892f30b094ded9d4b88ca2aab338b1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.5557.00 ((SQL14_SP2_QFE-CU).171003-1352) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/e7dfaaf012694a6db4eae23dc3b319e31/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5557.00 ((SQL14_SP2_QFE-CU).171003-1352) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/0d6e87edec3d4a5bb55a6f86db91f3112/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5557.00 ((SQL14_SP2_QFE-CU).171003-1352) +``` + +# SQL Server 2014 SP2 CU8 - 12.0.5557.0 - x86 (KB4037356) +``` powershell +# SQL Server 2014 SP2 CU8 - 12.0.5557.0 - x86 (KB4037356) +$outputFolder = 'c:\sqlsyms\12.0.5557.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/1c82caaaa09e48eba283def9ee6a77041/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.5557.00 ((SQL14_SP2_QFE-CU).171003-1352) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/981f442e7b8a4ff4b016c222f897ec1e1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5557.00 ((SQL14_SP2_QFE-CU).171003-1352) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/bd794c7b740e447cbff73748980a6f1b1/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5557.00 ((SQL14_SP2_QFE-CU).171003-1352) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/383f44422d364daab6360a0dbd8961481/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.5557.00 ((SQL14_SP2_QFE-CU).171003-1352) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/7e546ae16c48449396f2a6c30dc8d35b2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5557.00 ((SQL14_SP2_QFE-CU).171003-1352) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/4daecbd75bfd4b6f9af8fce5ec09aa9d1/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5557.00 ((SQL14_SP2_QFE-CU).171003-1352) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/9fa6bf9d3fb54bb98a5f0124bfb3e14e1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5557.00 ((SQL14_SP2_QFE-CU).171003-1352) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/d04a9e96c37045e98b5c7b3b8b81096d1/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5557.00 ((SQL14_SP2_QFE-CU).171003-1352) +``` + +# SQL Server 2014 SP2 CU5 - 12.0.5546.0 - x64 (KB4013098) +``` powershell +# SQL Server 2014 SP2 CU5 - 12.0.5546.0 - x64 (KB4013098) +$outputFolder = 'c:\sqlsyms\12.0.5546.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/50741efef953472e93c9c4449641b7b12/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.5546.00 ((SQL14_SP2_QFE-CU).170403-1355) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/eba63b27a035483d8aa8328a1ae4e5032/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5546.00 ((SQL14_SP2_QFE-CU).170403-1355) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/5cf0fb086a51465eae2224c47d6929a12/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5546.00 ((SQL14_SP2_QFE-CU).170403-1355) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/e261efec946a49d8bd60ad2d2d0d4f412/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.5546.00 ((SQL14_SP2_QFE-CU).170403-1355) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/4e1c24324a24404db55cab70549295842/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5546.00 ((SQL14_SP2_QFE-CU).170403-1355) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/b4f8f667b3d14a67b4d6603088e655742/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5546.00 ((SQL14_SP2_QFE-CU).170403-1355) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/236b638fded8473898894137c7838d5c1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.5546.00 ((SQL14_SP2_QFE-CU).170403-1355) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/7ac0b64a624249d9b29869bc24c71bb91/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.5546.00 ((SQL14_SP2_QFE-CU).170403-1355) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/dab7c2d4a1d74357a7e35e4823c201241/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.5546.00 ((SQL14_SP2_QFE-CU).170403-1355) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/6ba2f0c99aac4edfb5f1154130a28aff1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5546.00 ((SQL14_SP2_QFE-CU).170403-1355) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/d4afa77c6b874237bef59d288e3502712/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5546.00 ((SQL14_SP2_QFE-CU).170403-1355) +``` + +# SQL Server 2014 SP2 CU5 - 12.0.5546.0 - x86 (KB4013098) +``` powershell +# SQL Server 2014 SP2 CU5 - 12.0.5546.0 - x86 (KB4013098) +$outputFolder = 'c:\sqlsyms\12.0.5546.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/7cc57429e0ec49fbbb5a7e0bde3ed2f51/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.5546.00 ((SQL14_SP2_QFE-CU).170403-1355) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/0b763c98cd3540cc87fbae90dd4d293e1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5546.00 ((SQL14_SP2_QFE-CU).170403-1355) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/faebc6f4ea6f4aa9b51dd320a99cdf6a1/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5546.00 ((SQL14_SP2_QFE-CU).170403-1355) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/df2f1f29a7ee42209c3d1083a539cdab1/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.5546.00 ((SQL14_SP2_QFE-CU).170403-1355) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/4e548597f1554021a96df9a125e321c12/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5546.00 ((SQL14_SP2_QFE-CU).170403-1355) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/1c1ab29dd2684425be41d15d14f82eda1/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5546.00 ((SQL14_SP2_QFE-CU).170403-1355) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/52aa8ba5e2dc47a3b05441a95feaaad41/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5546.00 ((SQL14_SP2_QFE-CU).170403-1355) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/41250386e94f4b749067a8bdf653fad31/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5546.00 ((SQL14_SP2_QFE-CU).170403-1355) +``` + +# SQL Server 2014 SP2 CU4 - 12.0.5540.0 - x64 (KB4010394) +``` powershell +# SQL Server 2014 SP2 CU4 - 12.0.5540.0 - x64 (KB4010394) +$outputFolder = 'c:\sqlsyms\12.0.5540.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/327f327fa575417cafb328a77700579b2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.5540.00 ((SQL14_SP2_QFE-CU).170126-2112) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/b33973d4b2b84e898cf5fdbcc0cbfdda2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5540.00 ((SQL14_SP2_QFE-CU).170126-2112) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/7c3b4d37cd874b8b9046197faa764b8a2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5540.00 ((SQL14_SP2_QFE-CU).170126-2112) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/5c620c62165d4d6c929c48fbf285ecee2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.5540.00 ((SQL14_SP2_QFE-CU).170126-2112) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/573e711ad5ff4306afcf4ead17f3ccd32/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5540.00 ((SQL14_SP2_QFE-CU).170126-2112) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/134dec74500e4623ac8395fd0f7b39002/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5540.00 ((SQL14_SP2_QFE-CU).170126-2112) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/efafa5fc3ed741138011d67be2e0956e1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.5540.00 ((SQL14_SP2_QFE-CU).170126-2112) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/322ab5e1bdb44d00b01fadf709cedb591/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.5540.00 ((SQL14_SP2_QFE-CU).170126-2112) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/2e34b42cd60244c18d4d932740df1fba1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.5540.00 ((SQL14_SP2_QFE-CU).170126-2112) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/5fa1d5a4f5184d8a96340d50ca49b8f91/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5540.00 ((SQL14_SP2_QFE-CU).170126-2112) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/15a01dcd6514423dabf05a79ddbc260c2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5540.00 ((SQL14_SP2_QFE-CU).170126-2112) +``` + +# SQL Server 2014 SP2 CU4 - 12.0.5540.0 - x86 (KB4010394) +``` powershell +# SQL Server 2014 SP2 CU4 - 12.0.5540.0 - x86 (KB4010394) +$outputFolder = 'c:\sqlsyms\12.0.5540.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/3b24410a96fc4557937d8680025104781/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.5540.00 ((SQL14_SP2_QFE-CU).170126-2112) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/de2cbe9a066b4ca683edb111b07e98fe1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5540.00 ((SQL14_SP2_QFE-CU).170126-2112) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/65d8e8258a7d425b919ff886fef2a46e1/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5540.00 ((SQL14_SP2_QFE-CU).170126-2112) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/a55b0dba79c145579d868184299943121/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.5540.00 ((SQL14_SP2_QFE-CU).170126-2112) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/a45a2e2de940478cb4da26c83ed480c02/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5540.00 ((SQL14_SP2_QFE-CU).170126-2112) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/91505e4ffbab42b0bb9fce392119d2a31/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5540.00 ((SQL14_SP2_QFE-CU).170126-2112) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/51b204af39e4418e8e436b505def119d1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5540.00 ((SQL14_SP2_QFE-CU).170126-2112) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/c8cdb62c1d024e1ebcd1167ea4e408fd1/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5540.00 ((SQL14_SP2_QFE-CU).170126-2112) +``` + +# SQL Server 2014 SP2 CU3 - 12.0.5538.0 - x64 (KB3204388) +``` powershell +# SQL Server 2014 SP2 CU3 - 12.0.5538.0 - x64 (KB3204388) +$outputFolder = 'c:\sqlsyms\12.0.5538.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/3b2ec8a276c44fdc906942cd4a1f69182/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.5538.00 ((SQL14_SP2_QFE-CU).161215-1705) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/a2983d6c8beb482197eea282afd09f502/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5538.00 ((SQL14_SP2_QFE-CU).161215-1705) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/f15dfc2d86f545358f47d7963137b3772/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5538.00 ((SQL14_SP2_QFE-CU).161215-1705) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/51c7e960bc594a57948755163fc43a492/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.5538.00 ((SQL14_SP2_QFE-CU).161215-1705) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/d11bb61c53bf4b68a2c3ba2527bd73bc2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5538.00 ((SQL14_SP2_QFE-CU).161215-1705) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/bd27195567bb4bf8a03bb27ceec1b7432/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5538.00 ((SQL14_SP2_QFE-CU).161215-1705) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/e48b584befcc4a70adb8046bcf451a2e1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.5538.00 ((SQL14_SP2_QFE-CU).161215-1705) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/b580840b77684d8a8f6eda6fc85965451/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.5538.00 ((SQL14_SP2_QFE-CU).161215-1705) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/94c127c2d37e4e489484c51a03884ac11/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.5538.00 ((SQL14_SP2_QFE-CU).161215-1705) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/7ccaba5c7002409fa220d36307fc2b8b1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5538.00 ((SQL14_SP2_QFE-CU).161215-1705) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/8e5ff8ec981943338edc6cd886bd8fb82/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5538.00 ((SQL14_SP2_QFE-CU).161215-1705) +``` + +# SQL Server 2014 SP2 CU3 - 12.0.5538.0 - x86 (KB3204388) +``` powershell +# SQL Server 2014 SP2 CU3 - 12.0.5538.0 - x86 (KB3204388) +$outputFolder = 'c:\sqlsyms\12.0.5538.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/baa30c554cb44fa09d0bdfbed39e5a791/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.5538.00 ((SQL14_SP2_QFE-CU).161215-1705) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/3dd488b8d441453dbd8745f0a544e7a61/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5538.00 ((SQL14_SP2_QFE-CU).161215-1705) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/47108c8b37424ae8851820cfe82c9e121/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5538.00 ((SQL14_SP2_QFE-CU).161215-1705) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/b8d1890d88e746a998e86b2f3c74364c1/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.5538.00 ((SQL14_SP2_QFE-CU).161215-1705) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/848570152cb8402aa9d6fada8beb0c202/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5538.00 ((SQL14_SP2_QFE-CU).161215-1705) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/dde9b5fc95434bcdaf74b851a180a39a1/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5538.00 ((SQL14_SP2_QFE-CU).161215-1705) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/f57e00c99b1542da9050e3c79e4fc0751/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5538.00 ((SQL14_SP2_QFE-CU).161215-1705) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/ad0a17bd74a343c68885438c5a1667261/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5538.00 ((SQL14_SP2_QFE-CU).161215-1705) +``` + +# SQL Server 2014 SP2 CU2 - 12.0.5522.0 - x64 (KB3188778) +``` powershell +# SQL Server 2014 SP2 CU2 - 12.0.5522.0 - x64 (KB3188778) +$outputFolder = 'c:\sqlsyms\12.0.5522.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/85619806cd0c4d7f80b7d9c39ec0c55d2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.5522.00 ((SQL14_PCU_main).160921-2323) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/b7c764dde62d4501ad899b44155266f42/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5522.00 ((SQL14_PCU_main).160921-2323) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/42c45987637146d9b0b6a18b3c16b4ed2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5522.00 ((SQL14_PCU_main).160921-2323) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/a0718d2fb2484e6a9690d00a513a7ec22/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.5522.00 ((SQL14_PCU_main).160921-2323) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/925f17833290448e8a4a1981956919f72/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5522.00 ((SQL14_PCU_main).160921-2323) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/f8b1d43023e94a69ad0ebdbdef8184262/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5522.00 ((SQL14_PCU_main).160921-2323) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/cec32d3f65ae45e8a01456021c1965331/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.5522.00 ((SQL14_PCU_main).160921-2323) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/e5b418e31d1e4c7288dce466806e4a651/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.5522.00 ((SQL14_PCU_main).160921-2323) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/e0a453b334904529a2b117ea1654e0071/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.5522.00 ((SQL14_PCU_main).160921-2323) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/46ca775ce2b347cf9a0497239589b9891/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5522.00 ((SQL14_PCU_main).160921-2323) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/944350d206c94698a2d2836213aa3cd42/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5522.00 ((SQL14_PCU_main).160921-2323) +``` + +# SQL Server 2014 SP2 CU2 - 12.0.5522.0 - x86 (KB3188778) +``` powershell +# SQL Server 2014 SP2 CU2 - 12.0.5522.0 - x86 (KB3188778) +$outputFolder = 'c:\sqlsyms\12.0.5522.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/84f5af3698d149afa148b2a0cd3f4f581/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.5522.00 ((SQL14_PCU_main).160921-2323) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/213e8207dbe444d0909729961a287bd11/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5522.00 ((SQL14_PCU_main).160921-2323) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/4bc737f7ee4c42ddabdc2dbd286531231/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5522.00 ((SQL14_PCU_main).160921-2323) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/b288a2b59dc74ac7b41ab91de6c4fc761/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.5522.00 ((SQL14_PCU_main).160921-2323) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/ffa4bbede27e459680aa2c3492dc76de2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5522.00 ((SQL14_PCU_main).160921-2323) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/cff1f891748b4e46975bff972020c88d1/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5522.00 ((SQL14_PCU_main).160921-2323) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/68063a6d27944efc9b396708c391443a1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5522.00 ((SQL14_PCU_main).160921-2323) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/50ee2c4f4dba45cbabed0418e30529771/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5522.00 ((SQL14_PCU_main).160921-2323) +``` + +# SQL Server 2014 SP2 CU1 - 12.0.5511.0 - x64 (KB3178925) +``` powershell +# SQL Server 2014 SP2 CU1 - 12.0.5511.0 - x64 (KB3178925) +$outputFolder = 'c:\sqlsyms\12.0.5511.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/955297012f084a879c084982baeb90802/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.5511.00 ((SQL14_PCU_main).160819-1335) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/6c97245a05ce4bb99d73b38531d5c1fd2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5511.00 ((SQL14_PCU_main).160819-1335) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/115b0bf758864697975c5a790169856e2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5511.00 ((SQL14_PCU_main).160819-1335) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/512c482f3fb045bda66e04e34964fb3a2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.5511.00 ((SQL14_PCU_main).160819-1335) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/f769c28a891e437a9c794fc1ec7472752/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5511.00 ((SQL14_PCU_main).160819-1335) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/f143a40c5a8440bf8478537feeee5d642/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5511.00 ((SQL14_PCU_main).160819-1335) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/b17b7a8868cb42579bae8551a8c7e0591/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.5511.00 ((SQL14_PCU_main).160819-1335) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/e2182fd204d84ab99011cccd1949e9c11/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.5511.00 ((SQL14_PCU_main).160819-1335) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/27105a4614ac45c2ae4efbf8702e3afc1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.5511.00 ((SQL14_PCU_main).160819-1335) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/40b6d2eebb0d495ca7712c349427f5de1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5511.00 ((SQL14_PCU_main).160819-1335) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/5f5f15692fa448e79427eb55f742b9512/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5511.00 ((SQL14_PCU_main).160819-1335) +``` + +# SQL Server 2014 SP2 CU1 - 12.0.5511.0 - x86 (KB3178925) +``` powershell +# SQL Server 2014 SP2 CU1 - 12.0.5511.0 - x86 (KB3178925) +$outputFolder = 'c:\sqlsyms\12.0.5511.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/7cfba95f3823488aac2461a3e97e896f1/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.5511.00 ((SQL14_PCU_main).160819-1335) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/da9e2bc4951043bd81090ae40dede7a11/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5511.00 ((SQL14_PCU_main).160819-1335) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/aeff84391a5b452fbfcde0f4a892c5a11/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5511.00 ((SQL14_PCU_main).160819-1335) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/5939ac9c2ded4145bcf7770744fd2bce1/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.5511.00 ((SQL14_PCU_main).160819-1335) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/29a54a98b892439391394e42b0b5db512/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5511.00 ((SQL14_PCU_main).160819-1335) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/ed2df1c1d06e4545bdf23aaaaf209acc1/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5511.00 ((SQL14_PCU_main).160819-1335) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/e1cccd08ad4847b7b40a5d54d95e458e1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5511.00 ((SQL14_PCU_main).160819-1335) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/8ca704ad75a147c083468e8128a8d1c71/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5511.00 ((SQL14_PCU_main).160819-1335) +``` + +# SQL Server 2014 SP2 SP2 - 12.0.5000.0 - x64 (KB3171021) +``` powershell +# SQL Server 2014 SP2 SP2 - 12.0.5000.0 - x64 (KB3171021) +$outputFolder = 'c:\sqlsyms\12.0.5000.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/9b03bed67fb8409cb0790cc7b223dad92/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.5000.00 ((SQL14_PCU_main).160617-1804) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/d06bb22769e2403894634bf47dced50d2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5000.00 ((SQL14_PCU_main).160617-1804) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/4505a8d6fda14645ba80e4c411ed63512/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5000.00 ((SQL14_PCU_main).160617-1804) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/421f256c2b694c9f997cc27b691db8e82/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.5000.00 ((SQL14_PCU_main).160617-1804) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/581e38dca5b2499ea574ffc0173d6bb12/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5000.00 ((SQL14_PCU_main).160617-1804) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/ca529b22f161423c9266aa03928136612/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5000.00 ((SQL14_PCU_main).160617-1804) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/16d952f37ecc4c839f06fc3f0a8e858b1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.5000.00 ((SQL14_PCU_main).160617-1804) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/49e9ae321a004d859a4844a1881682fd1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.5000.00 ((SQL14_PCU_main).160617-1804) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/e2bbf32382d24e16a4567c49dffedc1a1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.5000.00 ((SQL14_PCU_main).160617-1804) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/bdcaa196c0824ba38ddec076b5fd89521/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5000.00 ((SQL14_PCU_main).160617-1804) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/cc3cd23e34174332ae8778d4e4b7991f2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5000.00 ((SQL14_PCU_main).160617-1804) +``` + +# SQL Server 2014 SP2 SP2 - 12.0.5000.0 - x86 (KB3171021) +``` powershell +# SQL Server 2014 SP2 SP2 - 12.0.5000.0 - x86 (KB3171021) +$outputFolder = 'c:\sqlsyms\12.0.5000.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/3520a09c560647b0be4af33b838bb70f1/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.5000.00 ((SQL14_PCU_main).160617-1804) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/d0a102b60e2d4138a7435f98d7305ed21/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.5000.00 ((SQL14_PCU_main).160617-1804) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/739a59d06bce47de8b1bf3d77899ba601/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.5000.00 ((SQL14_PCU_main).160617-1804) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/34d38d0ff9ad490cb7c02c96ee741a651/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.5000.00 ((SQL14_PCU_main).160617-1804) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/16e45d5242524db7a022a600e0a58bd12/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.5000.00 ((SQL14_PCU_main).160617-1804) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/3105a463134247deb442c42904dd6af61/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.5000.00 ((SQL14_PCU_main).160617-1804) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/f54482c3160047a0bffd5ee829fc930c1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.5000.00 ((SQL14_PCU_main).160617-1804) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/4ef9cb8fd3c141bcb4f1af7c26cbf7571/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.5000.00 ((SQL14_PCU_main).160617-1804) +``` + +# SQL Server 2014 SP1 CU12 - 12.0.4511.0 - x64 (KB4017793) +``` powershell +# SQL Server 2014 SP1 CU12 - 12.0.4511.0 - x64 (KB4017793) +$outputFolder = 'c:\sqlsyms\12.0.4511.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/5194020c2bb54e35b975fb4b822687822/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.4511.00 ((SQL14_SP1_QFE-CU).170330-2026) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/c3e92c0187324b64902b44eb0d2e42ed2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4511.00 ((SQL14_SP1_QFE-CU).170330-2026) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/828309d8e65a4661bef26612e6c66da12/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4511.00 ((SQL14_SP1_QFE-CU).170330-2026) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/d17b6b1b84b74212b072a8b5bdd573b92/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.4511.00 ((SQL14_SP1_QFE-CU).170330-2026) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/15ed0973c9214f76b84dce1924c47f2c2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4511.00 ((SQL14_SP1_QFE-CU).170330-2026) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/5347b58cfec447408dea4ef359a7fee82/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4511.00 ((SQL14_SP1_QFE-CU).170330-2026) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/63966ccc66c6484197a1c5472f9ffba61/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.4511.00 ((SQL14_SP1_QFE-CU).170330-2026) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/15bee1647bc8463e9222aae1c310334a1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.4511.00 ((SQL14_SP1_QFE-CU).170330-2026) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/b8e0b1f00b4c47c3817d8d3211bd97eb1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.4511.00 ((SQL14_SP1_QFE-CU).170330-2026) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/7f74ffbfb5634301908b7c0a815e1e811/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4511.00 ((SQL14_SP1_QFE-CU).170330-2026) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/c0bb53c9d4624637846157dcba6945322/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4511.00 ((SQL14_SP1_QFE-CU).170330-2026) +``` + +# SQL Server 2014 SP1 CU12 - 12.0.4511.0 - x86 (KB4017793) +``` powershell +# SQL Server 2014 SP1 CU12 - 12.0.4511.0 - x86 (KB4017793) +$outputFolder = 'c:\sqlsyms\12.0.4511.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/1716ba550f704b47be04801c46ddd2271/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.4511.00 ((SQL14_SP1_QFE-CU).170330-2026) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/b07fe01e0c1d4fafadf3b3ae1198b23c1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4511.00 ((SQL14_SP1_QFE-CU).170330-2026) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/5b2e3ff1f9ea426bb60c065573ba35851/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4511.00 ((SQL14_SP1_QFE-CU).170330-2026) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/06525a5e3eb34b839bfc1af702354c0f1/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.4511.00 ((SQL14_SP1_QFE-CU).170330-2026) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/5b0356ce9df44d3ebc3aaf4752c4dbc42/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4511.00 ((SQL14_SP1_QFE-CU).170330-2026) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/cfe4d232673d4feca1536f22af5d7da01/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4511.00 ((SQL14_SP1_QFE-CU).170330-2026) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/1638c8bafaa4484f8115dc810f65688c1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4511.00 ((SQL14_SP1_QFE-CU).170330-2026) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/0cb40d6a5aee4627a803997293d2bc9f1/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4511.00 ((SQL14_SP1_QFE-CU).170330-2026) +``` + +# SQL Server 2014 SP1 CU11 - 12.0.4502.0 - x64 (KB4010392) +``` powershell +# SQL Server 2014 SP1 CU11 - 12.0.4502.0 - x64 (KB4010392) +$outputFolder = 'c:\sqlsyms\12.0.4502.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/6511e1af7762429a824f8d9413f8185b2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.4502.00 ((SQL14_SP1_QFE-CU).170126-2035) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/0855528f0c094a8d9ddaa082dc6273892/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4502.00 ((SQL14_SP1_QFE-CU).170126-2035) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/2d502c894cf145449e35bb27b9e723632/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4502.00 ((SQL14_SP1_QFE-CU).170126-2035) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/4e718d4e6aaa4267a812e7a96d96e4192/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.4502.00 ((SQL14_SP1_QFE-CU).170126-2035) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/e3bc90eb56494cef8d0bb1c27630e7e82/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4502.00 ((SQL14_SP1_QFE-CU).170126-2035) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/79e86271788b4ad8a73585aca0712a572/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4502.00 ((SQL14_SP1_QFE-CU).170126-2035) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/74b685c445be4b0abc1e40a39b1ce15e1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.4502.00 ((SQL14_SP1_QFE-CU).170126-2035) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/fdad2621c0fd4be18f295ef7666f71541/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.4502.00 ((SQL14_SP1_QFE-CU).170126-2035) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/fead2b11478e4f16957015b1c716dbf51/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.4502.00 ((SQL14_SP1_QFE-CU).170126-2035) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/2fef4d7e355741078263ba0359236cb51/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4502.00 ((SQL14_SP1_QFE-CU).170126-2035) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/baa3f42ceb4441f0a0362400473a45a32/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4502.00 ((SQL14_SP1_QFE-CU).170126-2035) +``` + +# SQL Server 2014 SP1 CU11 - 12.0.4502.0 - x86 (KB4010392) +``` powershell +# SQL Server 2014 SP1 CU11 - 12.0.4502.0 - x86 (KB4010392) +$outputFolder = 'c:\sqlsyms\12.0.4502.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/05c3adbed7b94c678abd5818fb1df1981/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.4502.00 ((SQL14_SP1_QFE-CU).170126-2035) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/4e38ef962bd44249a4374f46e4918e491/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4502.00 ((SQL14_SP1_QFE-CU).170126-2035) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/1f790bbb27d94e7d8f76905be4ea8a8a1/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4502.00 ((SQL14_SP1_QFE-CU).170126-2035) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/118dcefd951242c2b376ce23b8ca149d1/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.4502.00 ((SQL14_SP1_QFE-CU).170126-2035) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/16bba5c457c24f71816590513599284d2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4502.00 ((SQL14_SP1_QFE-CU).170126-2035) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/1c2171f6e4c942a78d884a965ca2c2311/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4502.00 ((SQL14_SP1_QFE-CU).170126-2035) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/b2e5cdea0e254b88aec4f52ff7d81bce1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4502.00 ((SQL14_SP1_QFE-CU).170126-2035) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/22ff6b3197a54e6d8e424fb153ee85291/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4502.00 ((SQL14_SP1_QFE-CU).170126-2035) +``` + +# SQL Server 2014 SP1 CU10 - 12.0.4491.0 - x64 (KB3204399) +``` powershell +# SQL Server 2014 SP1 CU10 - 12.0.4491.0 - x64 (KB3204399) +$outputFolder = 'c:\sqlsyms\12.0.4491.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/9d45c0ca9ff84210bd26d27a1db957b32/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.4491.00 ((SQL14_SP1_QFE-CU).161209-1421) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/fed498da893e422cac5e804b2b7a4c242/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4491.00 ((SQL14_SP1_QFE-CU).161209-1421) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/2ad37367352148f6979dfdc99264bead2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4491.00 ((SQL14_SP1_QFE-CU).161209-1421) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/9d0d6af6a3844491ba66db3b3a0e41992/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.4491.00 ((SQL14_SP1_QFE-CU).161209-1421) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/cdb4ecf4e5554b98963cfc8713f18def2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4491.00 ((SQL14_SP1_QFE-CU).161209-1421) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/f524bcc24a0a4a09aeac95cdd7ff44cc2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4491.00 ((SQL14_SP1_QFE-CU).161209-1421) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/018fb92048554db0b8ce8d938f36c1af1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.4491.00 ((SQL14_SP1_QFE-CU).161209-1421) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/6f4088e11c2141038659ad6f5d75d67e1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.4491.00 ((SQL14_SP1_QFE-CU).161209-1421) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/ef95d5619182441cba33ee5fcc0db2a11/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.4491.00 ((SQL14_SP1_QFE-CU).161209-1421) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/e6bbf5f834c248888873d9a1a9644be91/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4491.00 ((SQL14_SP1_QFE-CU).161209-1421) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/ed041be3c310451d8c409219c552e7f32/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4491.00 ((SQL14_SP1_QFE-CU).161209-1421) +``` + +# SQL Server 2014 SP1 CU10 - 12.0.4491.0 - x86 (KB3204399) +``` powershell +# SQL Server 2014 SP1 CU10 - 12.0.4491.0 - x86 (KB3204399) +$outputFolder = 'c:\sqlsyms\12.0.4491.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/d2366262dd7941978da45d5e683f7c101/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.4491.00 ((SQL14_SP1_QFE-CU).161209-1421) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/d800a487ae16476aad1a1d3a6000b3d81/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4491.00 ((SQL14_SP1_QFE-CU).161209-1421) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/47e138b038f94533b40e4cda75009dd11/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4491.00 ((SQL14_SP1_QFE-CU).161209-1421) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/ea65c57da53241919f6b2c099baddf6b1/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.4491.00 ((SQL14_SP1_QFE-CU).161209-1421) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/300035b8a93d4361bb955f88c14a9ec02/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4491.00 ((SQL14_SP1_QFE-CU).161209-1421) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/5d479ce08c8f4a3189fc00cb7d96396f1/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4491.00 ((SQL14_SP1_QFE-CU).161209-1421) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/8b12d29053264fc798fb8b7312f457a61/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4491.00 ((SQL14_SP1_QFE-CU).161209-1421) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/40548e898f644819908b614970e763f51/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4491.00 ((SQL14_SP1_QFE-CU).161209-1421) +``` + +# SQL Server 2014 SP1 CU9 - 12.0.4474.0 - x64 (KB3186964) +``` powershell +# SQL Server 2014 SP1 CU9 - 12.0.4474.0 - x64 (KB3186964) +$outputFolder = 'c:\sqlsyms\12.0.4474.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/ed3eb06f842543d287a3f4b7976a290e2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.4474.00 ((SQL14_SP1_QFE-CU).160921-2215) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/f68fd847991e45efb467567f043365c92/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4474.00 ((SQL14_SP1_QFE-CU).160921-2215) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/f39da543554a46fa9f66356d10ae25ba2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4474.00 ((SQL14_SP1_QFE-CU).160921-2215) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/4e632d1dba694b07b1420d42203131fb2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.4474.00 ((SQL14_SP1_QFE-CU).160921-2215) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/e6b6452458da4bfb90b095db670835ba2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4474.00 ((SQL14_SP1_QFE-CU).160921-2215) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/459d7854b8b442f7a7d16164e13d223e2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4474.00 ((SQL14_SP1_QFE-CU).160921-2215) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/dbbebce79710422da003b9b362db90471/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.4474.00 ((SQL14_SP1_QFE-CU).160921-2215) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/039cb07174774ae984a6c127254d699b1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.4474.00 ((SQL14_SP1_QFE-CU).160921-2215) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/cd5d4f223a81432b9a94c70f090bdbfa1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.4474.00 ((SQL14_SP1_QFE-CU).160921-2215) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/587aafcade5c4befb8a21f74a0472f991/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4474.00 ((SQL14_SP1_QFE-CU).160921-2215) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/40263aec90934578b565fd5738ab0fe82/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4474.00 ((SQL14_SP1_QFE-CU).160921-2215) +``` + +# SQL Server 2014 SP1 CU9 - 12.0.4474.0 - x86 (KB3186964) +``` powershell +# SQL Server 2014 SP1 CU9 - 12.0.4474.0 - x86 (KB3186964) +$outputFolder = 'c:\sqlsyms\12.0.4474.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/a2983e7c5b434d9fbc6828950649cd531/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.4474.00 ((SQL14_SP1_QFE-CU).160921-2215) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/814705e58f2a452282645ab653b330771/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4474.00 ((SQL14_SP1_QFE-CU).160921-2215) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/d29ed6114bab459499a99eb2aa5c9d901/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4474.00 ((SQL14_SP1_QFE-CU).160921-2215) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/5577ca7998974f91a2830c9130544b4b1/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.4474.00 ((SQL14_SP1_QFE-CU).160921-2215) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/f5a4f8db221443c88c6c01c2097d5f012/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4474.00 ((SQL14_SP1_QFE-CU).160921-2215) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/8addcf093cf549e5b363e7bc4c1ff3d21/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4474.00 ((SQL14_SP1_QFE-CU).160921-2215) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/7ab2c10294bc42ba84947f929ef553501/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4474.00 ((SQL14_SP1_QFE-CU).160921-2215) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/9256f9eed09947189e79d8d088a780771/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4474.00 ((SQL14_SP1_QFE-CU).160921-2215) +``` + +# SQL Server 2014 SP1 CU8 - 12.0.4468.0 - x64 (KB3174038) +``` powershell +# SQL Server 2014 SP1 CU8 - 12.0.4468.0 - x64 (KB3174038) +$outputFolder = 'c:\sqlsyms\12.0.4468.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/3d92fd2a73794d07b455ae4e5889a5132/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.4468.00 ((SQL14_SP1_QFE-CU).160807-1306) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/b3729fa94bef405fb2cb87260238c9f42/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4468.00 ((SQL14_SP1_QFE-CU).160807-1306) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/5ce178c1c5d64b0c87dfe545697274d42/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4468.00 ((SQL14_SP1_QFE-CU).160807-1306) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/3cad76e8bd284c3d843ddf72eebdeb6f2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.4468.00 ((SQL14_SP1_QFE-CU).160807-1306) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/690748ff94a84fe2a84415950be20d8b2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4468.00 ((SQL14_SP1_QFE-CU).160807-1306) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/c96238046bc24361b06e16837730d61a2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4468.00 ((SQL14_SP1_QFE-CU).160807-1306) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/2a89258be7de4ce9b48dbb73a55d324d1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.4468.00 ((SQL14_SP1_QFE-CU).160807-1306) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/95e6fa8b9aee433684c70867ff60a4e61/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.4468.00 ((SQL14_SP1_QFE-CU).160807-1306) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/0c553a702c974f208644a405b541f85c1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.4468.00 ((SQL14_SP1_QFE-CU).160807-1306) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/db5a292a8769461583541a15ebe202611/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4468.00 ((SQL14_SP1_QFE-CU).160807-1306) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/13c47c3e18bb421fa3249689a54a71102/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4468.00 ((SQL14_SP1_QFE-CU).160807-1306) +``` + +# SQL Server 2014 SP1 CU8 - 12.0.4468.0 - x86 (KB3174038) +``` powershell +# SQL Server 2014 SP1 CU8 - 12.0.4468.0 - x86 (KB3174038) +$outputFolder = 'c:\sqlsyms\12.0.4468.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/65f204610ef64b91a0fd8794150b94291/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.4468.00 ((SQL14_SP1_QFE-CU).160807-1306) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/1a01ea9849824b6c9d89022a9165081d1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4468.00 ((SQL14_SP1_QFE-CU).160807-1306) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/acfc80b3b2b14e0e8c44bb5638a59e011/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4468.00 ((SQL14_SP1_QFE-CU).160807-1306) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/a1112b3c01de49d3bf7df61d9421bb671/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.4468.00 ((SQL14_SP1_QFE-CU).160807-1306) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/d3657353614f4ee8adb22730dcb9dd0f2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4468.00 ((SQL14_SP1_QFE-CU).160807-1306) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/633bdb5f043c4d5eb8ab475398f1d6b31/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4468.00 ((SQL14_SP1_QFE-CU).160807-1306) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/8142bc3f8c344dd2a3f6a5f9b8accbc91/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4468.00 ((SQL14_SP1_QFE-CU).160807-1306) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/d5882b2e79e648a880c48dbf9aa04b751/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4468.00 ((SQL14_SP1_QFE-CU).160807-1306) +``` + +# SQL Server 2014 SP1 CU7 - 12.0.4459.0 - x64 (KB3162659) +``` powershell +# SQL Server 2014 SP1 CU7 - 12.0.4459.0 - x64 (KB3162659) +$outputFolder = 'c:\sqlsyms\12.0.4459.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/9e6af119e0f34e8284af02aeb6c2aed32/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.4459.00 ((SQL14_SP1_QFE-CU).160527-1445) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/2be68cda7aca40769bedc7911c47199e2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4459.00 ((SQL14_SP1_QFE-CU).160527-1445) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/51a3a33ea06c4b6fa7ba5f3a872f475b2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4459.00 ((SQL14_SP1_QFE-CU).160527-1445) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/e90c807a4c35455a820c37c0d50b4b232/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.4459.00 ((SQL14_SP1_QFE-CU).160527-1445) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/b61b9c7dcab24b45922994aca824ef672/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4459.00 ((SQL14_SP1_QFE-CU).160527-1445) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/619dd10c6677476c9b9d849815196fa32/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4459.00 ((SQL14_SP1_QFE-CU).160527-1445) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/433c6e1e9a8945498db235a0b52cde5e1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.4459.00 ((SQL14_SP1_QFE-CU).160527-1445) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/fa3d2944dc8846d3bcc61c2e7ee065281/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.4459.00 ((SQL14_SP1_QFE-CU).160527-1445) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/58c10d6cf94142c985df4771e46cb2371/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.4459.00 ((SQL14_SP1_QFE-CU).160527-1445) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/a27d505e013f4048877030aa5e518ea51/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4459.00 ((SQL14_SP1_QFE-CU).160527-1445) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/f27d6b48d60d41b685ab306cdd9a51ac2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4459.00 ((SQL14_SP1_QFE-CU).160527-1445) +``` + +# SQL Server 2014 SP1 CU7 - 12.0.4459.0 - x86 (KB3162659) +``` powershell +# SQL Server 2014 SP1 CU7 - 12.0.4459.0 - x86 (KB3162659) +$outputFolder = 'c:\sqlsyms\12.0.4459.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/6fff44d1682f4a9495ec0d87165558441/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.4459.00 ((SQL14_SP1_QFE-CU).160527-1445) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/92d19dff78a545049ba60ecbb778e1b81/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4459.00 ((SQL14_SP1_QFE-CU).160527-1445) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/ad454e7f63754f3f8ea5182420e1a95c1/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4459.00 ((SQL14_SP1_QFE-CU).160527-1445) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/9228212f994f44d5b53f3ab7dd3356cc1/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.4459.00 ((SQL14_SP1_QFE-CU).160527-1445) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/8578316b4f5d4354a53ec2cfd55481022/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4459.00 ((SQL14_SP1_QFE-CU).160527-1445) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/bd487adc6b904a848c1231663606b3f31/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4459.00 ((SQL14_SP1_QFE-CU).160527-1445) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/1832bee682d6478cadcc049a8e7f667c1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4459.00 ((SQL14_SP1_QFE-CU).160527-1445) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/274a8b7eca104af493f554023e54b1511/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4459.00 ((SQL14_SP1_QFE-CU).160527-1445) +``` + +# SQL Server 2014 SP1 CU6 - 12.0.4457.0 - x64 (KB3167392) +``` powershell +# SQL Server 2014 SP1 CU6 - 12.0.4457.0 - x64 (KB3167392) +$outputFolder = 'c:\sqlsyms\12.0.4457.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/0d205c1fa08b4e30be8d57b0b66f7aad2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.4457.00 ((SQL14_SP_QFE-OD).160526-2301) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/ca933e39df4a4a06877ec27e0ca8635c2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4457.00 ((SQL14_SP_QFE-OD).160526-2301) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/73bb9ef1b6d444949ec88857e9ad1a282/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4457.00 ((SQL14_SP_QFE-OD).160526-2301) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/8405542cc1254c03a666cb742da51ea72/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.4457.00 ((SQL14_SP_QFE-OD).160526-2301) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/95315aebcf874ef0bb34618350d666432/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4457.00 ((SQL14_SP_QFE-OD).160526-2301) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/c6bebcd7804e461f9efd30cabf8e8f8a2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4457.00 ((SQL14_SP_QFE-OD).160526-2301) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/79d2d1bdc00b4d4eba2870d71a3dd2d61/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.4457.00 ((SQL14_SP_QFE-OD).160526-2301) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/a8ccc254a9e6493295a6bca4bfaa61401/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.4457.00 ((SQL14_SP_QFE-OD).160526-2301) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/fae429df4a7f4b2fb2654331aed0ac171/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.4457.00 ((SQL14_SP_QFE-OD).160526-2301) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/b950a8b8c82d4963b5c9dd17c8d278d41/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4457.00 ((SQL14_SP_QFE-OD).160526-2301) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/f44520516b3d4f4eba97077627392c722/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4457.00 ((SQL14_SP_QFE-OD).160526-2301) +``` + +# SQL Server 2014 SP1 CU6 - 12.0.4457.0 - x86 (KB3167392) +``` powershell +# SQL Server 2014 SP1 CU6 - 12.0.4457.0 - x86 (KB3167392) +$outputFolder = 'c:\sqlsyms\12.0.4457.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/e20a40c355fc4e44a73ebc5e6f9aedff1/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.4457.00 ((SQL14_SP_QFE-OD).160526-2301) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/46bbfbc5d91f42e49d4787fdb099ac611/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4457.00 ((SQL14_SP_QFE-OD).160526-2301) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/4fc6d961f7114c9b99d7a889580a49451/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4457.00 ((SQL14_SP_QFE-OD).160526-2301) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/205de64132184b59aae89e227e12d54d1/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.4457.00 ((SQL14_SP_QFE-OD).160526-2301) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/10f36fe6efa44624bd46211d0d8cb4202/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4457.00 ((SQL14_SP_QFE-OD).160526-2301) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/349d89ce6e074117afa7cf153ccc510c1/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4457.00 ((SQL14_SP_QFE-OD).160526-2301) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/b0785ae48497462bac6fd725dfb8517f1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4457.00 ((SQL14_SP_QFE-OD).160526-2301) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/71d4f69079d846b192583ae1293d14c91/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4457.00 ((SQL14_SP_QFE-OD).160526-2301) +``` + +# SQL Server 2014 SP1 CU6 (Deprecated) - 12.0.4449.0 - x64 (KB3144524) +``` powershell +# SQL Server 2014 SP1 CU6 (Deprecated) - 12.0.4449.0 - x64 (KB3144524) +$outputFolder = 'c:\sqlsyms\12.0.4449.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/541dc558cad74e0694256b9a79761f922/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.4449.00 ((SQL14_SP1_QFE-CU).160413-1153) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/8a5052b8ff7345599f6f242cf4f3e09f2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4449.00 ((SQL14_SP1_QFE-CU).160413-1153) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/8a62d7af769a4f2c864d2b808ab81dfe2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4449.00 ((SQL14_SP1_QFE-CU).160413-1153) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/251fdfd9e8454621b19032d327a2fbbf2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.4449.00 ((SQL14_SP1_QFE-CU).160413-1153) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/6cf73332314548c29f5d02b19d98963b2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4449.00 ((SQL14_SP1_QFE-CU).160413-1153) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/55742e7e85204da4818d8a730a2f70852/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4449.00 ((SQL14_SP1_QFE-CU).160413-1153) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/1a20c516b71c4ee9a74d40cd5b3597631/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.4449.00 ((SQL14_SP1_QFE-CU).160413-1153) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/db864229a8b14fce99322d74a808b8d61/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.4449.00 ((SQL14_SP1_QFE-CU).160413-1153) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/db0d700ed8dd45349808c9c8078f7c1d1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.4449.00 ((SQL14_SP1_QFE-CU).160413-1153) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/42213ff00a944645a6752810210b9c4f1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4449.00 ((SQL14_SP1_QFE-CU).160413-1153) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/bba4a2d05f6b4a7da8cb248ae45a322a2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4449.00 ((SQL14_SP1_QFE-CU).160413-1153) +``` + +# SQL Server 2014 SP1 CU6 (Deprecated) - 12.0.4449.0 - x86 (KB3144524) +``` powershell +# SQL Server 2014 SP1 CU6 (Deprecated) - 12.0.4449.0 - x86 (KB3144524) +$outputFolder = 'c:\sqlsyms\12.0.4449.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/ff6fa640813246d6b61408f766f2ba301/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.4449.00 ((SQL14_SP1_QFE-CU).160413-1153) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/79a658164e2e44e482bca7933ae40daf1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4449.00 ((SQL14_SP1_QFE-CU).160413-1153) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/9871f564b21d489591a9d62997125cfe1/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4449.00 ((SQL14_SP1_QFE-CU).160413-1153) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/b12da1e6770a4cb7819bae2c4d8ab0fb1/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.4449.00 ((SQL14_SP1_QFE-CU).160413-1153) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/326123b149634674bdb729d1f67111da2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4449.00 ((SQL14_SP1_QFE-CU).160413-1153) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/dc4d9c2424574034b47f8c3f62d96cee1/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4449.00 ((SQL14_SP1_QFE-CU).160413-1153) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/011a3a3c5ee64a52bbfbb132c3c067011/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4449.00 ((SQL14_SP1_QFE-CU).160413-1153) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/5867019c5089413eb07654da21ad9eb21/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4449.00 ((SQL14_SP1_QFE-CU).160413-1153) +``` + +# SQL Server 2014 SP1 CU5 - 12.0.4439.1 - x64 (KB3130926) +``` powershell +# SQL Server 2014 SP1 CU5 - 12.0.4439.1 - x64 (KB3130926) +$outputFolder = 'c:\sqlsyms\12.0.4439.1\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/8c05af1cd714431692715e7c894227922/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.4439.01 ((SQL14_SP1_QFE-CU).160215-1104) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/9d7930b2b40d4a76882ff6e932d114ea2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4439.01 ((SQL14_SP1_QFE-CU).160215-1104) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/3620205f1aa146fc8fb261528826e9252/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4439.01 ((SQL14_SP1_QFE-CU).160215-1104) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/a4841e65bbea49e8b8fb034d059b1f3a2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.4439.01 ((SQL14_SP1_QFE-CU).160215-1104) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/51bd4d350e134a0788e8e5082f7b5df22/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4439.01 ((SQL14_SP1_QFE-CU).160215-1104) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/040e2fe727c3407584cf8ec849b8ec752/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4439.01 ((SQL14_SP1_QFE-CU).160215-1104) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/ee405fe12c294db58642f2aaab531b541/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.4439.01 ((SQL14_SP1_QFE-CU).160215-1104) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/19c41b55d37f49c9a1ae06318c57e8d11/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.4439.01 ((SQL14_SP1_QFE-CU).160215-1104) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/b4b47d122cc049cbb8f6781a308dda711/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.4439.01 ((SQL14_SP1_QFE-CU).160215-1104) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/a1181e9122f6449b8283138dbe7117171/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4439.01 ((SQL14_SP1_QFE-CU).160215-1104) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/748dfbd824714b7784555b943be771552/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4439.01 ((SQL14_SP1_QFE-CU).160215-1104) +``` + +# SQL Server 2014 SP1 CU5 - 12.0.4439.1 - x86 (KB3130926) +``` powershell +# SQL Server 2014 SP1 CU5 - 12.0.4439.1 - x86 (KB3130926) +$outputFolder = 'c:\sqlsyms\12.0.4439.1\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/98b4120a06c3471f972576543f15ac971/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.4439.01 ((SQL14_SP1_QFE-CU).160215-1104) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/dd78d54baaeb4fcfa8ec3adac01727ee1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4439.01 ((SQL14_SP1_QFE-CU).160215-1104) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/0e9fc78f89ab4d5297fc3ade50fa39f51/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4439.01 ((SQL14_SP1_QFE-CU).160215-1104) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/71a0972911d64d6d89202a102f4e36331/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.4439.01 ((SQL14_SP1_QFE-CU).160215-1104) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/e8f53d675d904f2ab71e74b2619f6f612/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4439.01 ((SQL14_SP1_QFE-CU).160215-1104) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/0ccdcf5f1baa43bb8fe10be379928bc21/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4439.01 ((SQL14_SP1_QFE-CU).160215-1104) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/b4cea174690147acad1b103353feaad01/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4439.01 ((SQL14_SP1_QFE-CU).160215-1104) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/da27c83c09ec4ebfb0df22b5746adc711/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4439.01 ((SQL14_SP1_QFE-CU).160215-1104) +``` + +# SQL Server 2014 SP1 CU4 - 12.0.4436.0 - x64 (KB3106660) +``` powershell +# SQL Server 2014 SP1 CU4 - 12.0.4436.0 - x64 (KB3106660) +$outputFolder = 'c:\sqlsyms\12.0.4436.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/362a8410d21b4d39ac0e7a02cc9c2c372/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.4436.00 ((SQL14_SP1_QFE-CU).151202-1517) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/681476d84d7d40f186d3ea82a2661c672/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4436.00 ((SQL14_SP1_QFE-CU).151202-1517) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/a31f385046b54b9cbaf08c4df972c6782/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4436.00 ((SQL14_SP1_QFE-CU).151202-1517) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/8a3fe11c189b4435bcbe953f4841d99f2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.4436.00 ((SQL14_SP1_QFE-CU).151202-1517) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/8f68c8d3545c49e8b83079bc84c6e2842/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4436.00 ((SQL14_SP1_QFE-CU).151202-1517) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/f08834e6067d4b98acb3b60090b4ba292/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4436.00 ((SQL14_SP1_QFE-CU).151202-1517) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/1d1d583c3f204024a1c6247dfce1af251/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.4436.00 ((SQL14_SP1_QFE-CU).151202-1517) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/bf369e60da5943c5ac4ecd1c83e9c1491/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.4436.00 ((SQL14_SP1_QFE-CU).151202-1517) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/6fe2ce101a564db2a580f3f85176f0681/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.4436.00 ((SQL14_SP1_QFE-CU).151202-1517) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/e1afd1f24c8a44f1a734bd1c4a10eaf51/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4436.00 ((SQL14_SP1_QFE-CU).151202-1517) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/5aa7af725caf4fe38f52515b787d4c4d2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4436.00 ((SQL14_SP1_QFE-CU).151202-1517) +``` + +# SQL Server 2014 SP1 CU4 - 12.0.4436.0 - x86 (KB3106660) +``` powershell +# SQL Server 2014 SP1 CU4 - 12.0.4436.0 - x86 (KB3106660) +$outputFolder = 'c:\sqlsyms\12.0.4436.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/e3278cf94d974d73a099dd3541f1430b1/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.4436.00 ((SQL14_SP1_QFE-CU).151202-1517) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/65cc2740001e4389a652c81d662ff4a31/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4436.00 ((SQL14_SP1_QFE-CU).151202-1517) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/1215ee0470bf46c1bcd1ddfa35951f911/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4436.00 ((SQL14_SP1_QFE-CU).151202-1517) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/737570a73e254326826ad1c811c340671/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.4436.00 ((SQL14_SP1_QFE-CU).151202-1517) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/50cf83342da94fbeaee4f79bd16973ab2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4436.00 ((SQL14_SP1_QFE-CU).151202-1517) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/df2f947c30e4454b9e568b53ca4dd8c51/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4436.00 ((SQL14_SP1_QFE-CU).151202-1517) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/3e240bb821c44d9d8ab1e59638d2bf351/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4436.00 ((SQL14_SP1_QFE-CU).151202-1517) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/28a61563540846d5a4c6c1b9f58e6b9c1/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4436.00 ((SQL14_SP1_QFE-CU).151202-1517) +``` + +# SQL Server 2014 SP1 CU3 - 12.0.4427.24 - x64 (KB3094221) +``` powershell +# SQL Server 2014 SP1 CU3 - 12.0.4427.24 - x64 (KB3094221) +$outputFolder = 'c:\sqlsyms\12.0.4427.24\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/8b612bab70d84b87bc09f27e4886aeb32/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.4427.24 ((SQL14_SP1_QFE-CU).151010-1609) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/dd15f98e38c244fc99b4ea43e149751a2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4427.24 ((SQL14_SP1_QFE-CU).151010-1609) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/cfee366445fd45cb90c9a47537129e772/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4427.24 ((SQL14_SP1_QFE-CU).151010-1609) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/da33ddc66f9843f38802e386e21a23d92/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.4427.24 ((SQL14_SP1_QFE-CU).151010-1609) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/5d78955b0a444fa8a0829509864abdcf2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4427.24 ((SQL14_SP1_QFE-CU).151010-1609) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/d625926716ac4a4ab6d395e0717eee292/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4427.24 ((SQL14_SP1_QFE-CU).151010-1609) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/f7bfed5a7b9c4b0a89c2351606f6dabd1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.4427.24 ((SQL14_SP1_QFE-CU).151010-1609) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/2829cd5018b94524a05d17c0aba940a51/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.4427.24 ((SQL14_SP1_QFE-CU).151010-1609) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/28ce7b1a2fe64c1bae7180a1ab1d4b841/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.4427.24 ((SQL14_SP1_QFE-CU).151010-1609) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/2ab9eea24838455ebedc0b4bfca780651/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4427.24 ((SQL14_SP1_QFE-CU).151010-1609) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/d1da515568304cada52f5ca07d32c56f2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4427.24 ((SQL14_SP1_QFE-CU).151010-1609) +``` + +# SQL Server 2014 SP1 CU3 - 12.0.4427.24 - x86 (KB3094221) +``` powershell +# SQL Server 2014 SP1 CU3 - 12.0.4427.24 - x86 (KB3094221) +$outputFolder = 'c:\sqlsyms\12.0.4427.24\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/3ef0e0f2fe2b43ac93875b3b3925fc6e1/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.4427.24 ((SQL14_SP1_QFE-CU).151010-1609) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/e630387bc0da4378a384f2f0381a70361/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4427.24 ((SQL14_SP1_QFE-CU).151010-1609) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/195f5a4a374443d7aba2b2bee84e34891/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4427.24 ((SQL14_SP1_QFE-CU).151010-1609) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/f7d1027c3648472896a7f5d88da4c9d21/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.4427.24 ((SQL14_SP1_QFE-CU).151010-1609) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/9e81862bb11447788e4a5248fb8a067e2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4427.24 ((SQL14_SP1_QFE-CU).151010-1609) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/5a5b0039a4474b42bb55ccb3ca6127721/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4427.24 ((SQL14_SP1_QFE-CU).151010-1609) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/d656086d4f4b422580baf43047ee17da1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4427.24 ((SQL14_SP1_QFE-CU).151010-1609) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/ac149317d5054708a94ca8aa8cef2fb41/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4427.24 ((SQL14_SP1_QFE-CU).151010-1609) +``` + +# SQL Server 2014 SP1 CU2 - 12.0.4422.0 - x64 (KB3075950) +``` powershell +# SQL Server 2014 SP1 CU2 - 12.0.4422.0 - x64 (KB3075950) +$outputFolder = 'c:\sqlsyms\12.0.4422.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/cc4b19123a7e4b00bc327dc0d8c0535a2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.4422.00 ((SQL14_SP1_QFE-CU).150727-1536) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/685f3f3dd9bf40a384bc3b34b5e0ec382/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4422.00 ((SQL14_SP1_QFE-CU).150727-1536) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/132245b6e07d4ed0b8a037f372c07a1c2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4422.00 ((SQL14_SP1_QFE-CU).150727-1536) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/f2d5c201fa064580a88c8620fcf528942/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.4422.00 ((SQL14_SP1_QFE-CU).150727-1536) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/3c213b3e4cac475c986f38788ee7ae812/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4422.00 ((SQL14_SP1_QFE-CU).150727-1536) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/9833540f5dd84c07bfa7aa07e35878c82/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4422.00 ((SQL14_SP1_QFE-CU).150727-1536) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/703a0ff035d8421093c5873ca70254021/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.4422.00 ((SQL14_SP1_QFE-CU).150727-1536) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/a70c6bd99bbb44129002fe32794a1a491/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.4422.00 ((SQL14_SP1_QFE-CU).150727-1536) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/3b2cc6000a1e46aa8ad7be339858e1871/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.4422.00 ((SQL14_SP1_QFE-CU).150727-1536) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/6e69bdfbde834092882537afb0164ee41/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4422.00 ((SQL14_SP1_QFE-CU).150727-1536) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/d6bbc455ed6d43fca5b6c541fd9840a82/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4422.00 ((SQL14_SP1_QFE-CU).150727-1536) +``` + +# SQL Server 2014 SP1 CU2 - 12.0.4422.0 - x86 (KB3075950) +``` powershell +# SQL Server 2014 SP1 CU2 - 12.0.4422.0 - x86 (KB3075950) +$outputFolder = 'c:\sqlsyms\12.0.4422.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/3e6e97436d7947efba0199c077de575e1/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.4422.00 ((SQL14_SP1_QFE-CU).150727-1536) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/8f1c6ef392a94f7280e4551d787bde0e1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4422.00 ((SQL14_SP1_QFE-CU).150727-1536) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/802091eeae1040b9929300673cf1e6cc1/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4422.00 ((SQL14_SP1_QFE-CU).150727-1536) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/7cf486d748c648a993d8fee09d470ed01/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.4422.00 ((SQL14_SP1_QFE-CU).150727-1536) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/77421fe01c504798bd84ff1111394ed02/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4422.00 ((SQL14_SP1_QFE-CU).150727-1536) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/bce992e7e4704168967f6b792d2c92161/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4422.00 ((SQL14_SP1_QFE-CU).150727-1536) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/10d2fbe0372a465a984499f610117b671/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4422.00 ((SQL14_SP1_QFE-CU).150727-1536) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/8132ccd977ac49b9b82d21e453c9d7db1/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4422.00 ((SQL14_SP1_QFE-CU).150727-1536) +``` + +# SQL Server 2014 SP1 SP1 - 12.0.4100.1 - x64 (KB3058865) +``` powershell +# SQL Server 2014 SP1 SP1 - 12.0.4100.1 - x64 (KB3058865) +$outputFolder = 'c:\sqlsyms\12.0.4100.1\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/0b3969cc9d1c42209d848cdd6619deb22/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.4100.01 ((SQL14_PCU_main).150420-1653) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/cb126849ce004b6fb8128a91ca87d5de2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4100.01 ((SQL14_PCU_main).150420-1653) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/3b28768245824b4e9dbe603fd491e2852/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4100.01 ((SQL14_PCU_main).150420-1653) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/b7ffc8fe9e2f4b15b44e40b4afd2ea012/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.4100.01 ((SQL14_PCU_main).150420-1653) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/08ffbabfdc4a4926bc16c8522c9bbc322/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4100.01 ((SQL14_PCU_main).150420-1653) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/3b87272344ce49a79745b7c63a7e20182/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4100.01 ((SQL14_PCU_main).150420-1653) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/4fedbb6d132d4ed49a566bcd7212408d1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.4100.01 ((SQL14_PCU_main).150420-1653) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/c333820aef364ad2b93a5bcc5a1c66101/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.4100.01 ((SQL14_PCU_main).150420-1653) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/1a18e036793145c8a9d1ab124a2607e41/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.4100.01 ((SQL14_PCU_main).150420-1653) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/63dadaf018f1419f8a4dbbd6bc1dc14a1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4100.01 ((SQL14_PCU_main).150420-1653) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/ab6196f20a154ace825cff70fd87b6092/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4100.01 ((SQL14_PCU_main).150420-1653) +``` + +# SQL Server 2014 SP1 SP1 - 12.0.4100.1 - x86 (KB3058865) +``` powershell +# SQL Server 2014 SP1 SP1 - 12.0.4100.1 - x86 (KB3058865) +$outputFolder = 'c:\sqlsyms\12.0.4100.1\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/0865f069e71245ca8bfa3d606b60c1621/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.4100.01 ((SQL14_PCU_main).150420-1653) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/e489ada097d74198927ef538fd8927a41/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.4100.01 ((SQL14_PCU_main).150420-1653) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/5bea9870e6614f7e83671000e406de331/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.4100.01 ((SQL14_PCU_main).150420-1653) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/68a3418eaba04db5b35c3ab2cc4a67681/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.4100.01 ((SQL14_PCU_main).150420-1653) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/295830323d5343efad5c418d4e6dddb72/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.4100.01 ((SQL14_PCU_main).150420-1653) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/a3aeeef5442b49b4abf8d50de9edab181/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.4100.01 ((SQL14_PCU_main).150420-1653) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/1ea104008bc644218268d19341eecd741/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.4100.01 ((SQL14_PCU_main).150420-1653) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/e36eebbe2905446fbf814c89dee44df71/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.4100.01 ((SQL14_PCU_main).150420-1653) +``` + +# SQL Server 2014 RTM CU14 - 12.0.2569.0 - x64 (KB3158271) +``` powershell +# SQL Server 2014 RTM CU14 - 12.0.2569.0 - x64 (KB3158271) +$outputFolder = 'c:\sqlsyms\12.0.2569.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/539b0c025c174d6698c4969ee00d608a2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.2569.00 ((SQL14_RTM_QFE-CU).160527-1418) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/da89f627ad2346c38a7e801fed26a28d2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2569.00 ((SQL14_RTM_QFE-CU).160527-1418) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/50637ed0c6714c5c99da521077e3e5c32/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2569.00 ((SQL14_RTM_QFE-CU).160527-1418) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/01a3ff5e96cd40d5a8f1ab8f127009522/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.2569.00 ((SQL14_RTM_QFE-CU).160527-1418) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/05af9fc52b03405a9cb80cbd73c60a692/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2569.00 ((SQL14_RTM_QFE-CU).160527-1418) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/a803366e7b534798ab18db7ab2f059602/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2569.00 ((SQL14_RTM_QFE-CU).160527-1418) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/bee70081bce04d9e9a4d9145f820ec5f1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.2569.00 ((SQL14_RTM_QFE-CU).160527-1418) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/097922796c7443deaaebb689165db0c81/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.2569.00 ((SQL14_RTM_QFE-CU).160527-1418) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/fc8453414c104e1992d469013988d78d1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.2569.00 ((SQL14_RTM_QFE-CU).160527-1418) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/4cc60f940e164516ba060e2ec7a9085d1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2569.00 ((SQL14_RTM_QFE-CU).160527-1418) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/167b796ce1b84bd6aab8a050c0507d842/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2569.00 ((SQL14_RTM_QFE-CU).160527-1418) +``` + +# SQL Server 2014 RTM CU14 - 12.0.2569.0 - x86 (KB3158271) +``` powershell +# SQL Server 2014 RTM CU14 - 12.0.2569.0 - x86 (KB3158271) +$outputFolder = 'c:\sqlsyms\12.0.2569.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/759d2b26ff5346bd861ce3f29f45bec81/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.2569.00 ((SQL14_RTM_QFE-CU).160527-1418) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/78d8fd90a81d424b9a11cff7694359be1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2569.00 ((SQL14_RTM_QFE-CU).160527-1418) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/10adc5ffc4504f70bea9ace99b83d4811/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2569.00 ((SQL14_RTM_QFE-CU).160527-1418) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/d5d8a1b7129843e992a5cc7ac48d8cdc1/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.2569.00 ((SQL14_RTM_QFE-CU).160527-1418) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/88e10155378342d28c551097e352cddc2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2569.00 ((SQL14_RTM_QFE-CU).160527-1418) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/a51778462d5b483bb0f7c56f35e1b3881/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2569.00 ((SQL14_RTM_QFE-CU).160527-1418) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/63daa87222644774b370021497f13aae1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2569.00 ((SQL14_RTM_QFE-CU).160527-1418) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/2e5c327356dd422e8df429052b8e1de21/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2569.00 ((SQL14_RTM_QFE-CU).160527-1418) +``` + +# SQL Server 2014 RTM CU13 - 12.0.2568.0 - x64 (KB3144517) +``` powershell +# SQL Server 2014 RTM CU13 - 12.0.2568.0 - x64 (KB3144517) +$outputFolder = 'c:\sqlsyms\12.0.2568.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/de53ea6dfde743f18cadc0b0d43042492/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.2568.00 ((SQL14_RTM_QFE-CU).160330-1726) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/dd5ba486f24344ad8405ff37e26b4e1f2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2568.00 ((SQL14_RTM_QFE-CU).160330-1726) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/93d02eddd4a34a3dbbecfeb54abf9a1d2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2568.00 ((SQL14_RTM_QFE-CU).160330-1726) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/c9fd07c3fc294f1da6e434f006522b152/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.2568.00 ((SQL14_RTM_QFE-CU).160330-1726) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/a032aa8c1f9c4768a7f44c6e724c25542/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2568.00 ((SQL14_RTM_QFE-CU).160330-1726) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/c244f112481946d78890457e4e7ee5a72/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2568.00 ((SQL14_RTM_QFE-CU).160330-1726) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/64efea4a66a242fe84610bdea54e47fd1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.2568.00 ((SQL14_RTM_QFE-CU).160330-1726) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/d1faf0f81672488e975d5cbff4f5f4c51/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.2568.00 ((SQL14_RTM_QFE-CU).160330-1726) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/d6ba17eeb5534b6c8f09b7bd7a9d87ef1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.2568.00 ((SQL14_RTM_QFE-CU).160330-1726) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/7b633a8ab9664ffaa16dff394ebc5d331/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2568.00 ((SQL14_RTM_QFE-CU).160330-1726) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/5e921cfba868494fa153b17f0d1fda992/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2568.00 ((SQL14_RTM_QFE-CU).160330-1726) +``` + +# SQL Server 2014 RTM CU13 - 12.0.2568.0 - x86 (KB3144517) +``` powershell +# SQL Server 2014 RTM CU13 - 12.0.2568.0 - x86 (KB3144517) +$outputFolder = 'c:\sqlsyms\12.0.2568.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/f4ce9bbe9cd94155a053957fc6e89a171/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.2568.00 ((SQL14_RTM_QFE-CU).160330-1726) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/e3272664d7ac4280889108adaa8fa4081/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2568.00 ((SQL14_RTM_QFE-CU).160330-1726) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/b3d91828d7c04aef9f0a597390b6e3f01/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2568.00 ((SQL14_RTM_QFE-CU).160330-1726) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/7f73aff2ab6146b59f7cba467bfe64071/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.2568.00 ((SQL14_RTM_QFE-CU).160330-1726) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/5db522686f8c42f58a7a6cb449f772d32/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2568.00 ((SQL14_RTM_QFE-CU).160330-1726) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/d5748e2f6f7043058e5bbd55bacb3b4f1/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2568.00 ((SQL14_RTM_QFE-CU).160330-1726) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/5958ca20c2cd4e2e855fe49509dd0e7c1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2568.00 ((SQL14_RTM_QFE-CU).160330-1726) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/310e33c9d39046199259897860543ef81/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2568.00 ((SQL14_RTM_QFE-CU).160330-1726) +``` + +# SQL Server 2014 RTM CU12 - 12.0.2564.0 - x64 (KB3130923) +``` powershell +# SQL Server 2014 RTM CU12 - 12.0.2564.0 - x64 (KB3130923) +$outputFolder = 'c:\sqlsyms\12.0.2564.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/ac2576ff05574d0895c27ddeafbe5c8c2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.2564.00 ((SQL14_RTM_QFE-CU).160204-1937) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/24cf73afb18b44e98f4ba0ac01281e232/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2564.00 ((SQL14_RTM_QFE-CU).160204-1937) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/05ca53d70a0d46c78025be9f7379f3f02/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2564.00 ((SQL14_RTM_QFE-CU).160204-1937) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/e478a5c24cc047cdaa62614b9d6bd3052/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.2564.00 ((SQL14_RTM_QFE-CU).160204-1937) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/eb2d01edd0b143d3a8cf1c8a5ebea4972/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2564.00 ((SQL14_RTM_QFE-CU).160204-1937) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/16cdbd70f47b48cf908a13007767df1a2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2564.00 ((SQL14_RTM_QFE-CU).160204-1937) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/9f3ca7a2feee48a1998590fec323b2e91/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.2564.00 ((SQL14_RTM_QFE-CU).160204-1937) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/3ebf546ee388483abdb7dab6effd82d21/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.2564.00 ((SQL14_RTM_QFE-CU).160204-1937) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/a2f68300ade4407fb71d87f30a77fc111/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.2564.00 ((SQL14_RTM_QFE-CU).160204-1937) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/cc7dd6966b7e43d99c7c23447f95542f1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2564.00 ((SQL14_RTM_QFE-CU).160204-1937) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/f0308e1404e542b2a920139701283a252/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2564.00 ((SQL14_RTM_QFE-CU).160204-1937) +``` + +# SQL Server 2014 RTM CU12 - 12.0.2564.0 - x86 (KB3130923) +``` powershell +# SQL Server 2014 RTM CU12 - 12.0.2564.0 - x86 (KB3130923) +$outputFolder = 'c:\sqlsyms\12.0.2564.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/17b9f26230cd4187a439851dc2b15e5a1/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.2564.00 ((SQL14_RTM_QFE-CU).160204-1937) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/df46ff7b155e49048c088afde27092b21/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2564.00 ((SQL14_RTM_QFE-CU).160204-1937) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/1849c8c7f5774787a047b5c3105a4f861/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2564.00 ((SQL14_RTM_QFE-CU).160204-1937) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/1e704748340e45ad8c1e5bc9b08a77281/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.2564.00 ((SQL14_RTM_QFE-CU).160204-1937) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/c3e4dde16a9a427ea900174c72dfb9e82/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2564.00 ((SQL14_RTM_QFE-CU).160204-1937) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/6c5d715625174c2c94d325757fa8d1e81/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2564.00 ((SQL14_RTM_QFE-CU).160204-1937) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/fa23d7c84b444dcd8b619046b60b65421/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2564.00 ((SQL14_RTM_QFE-CU).160204-1937) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/29ba1ceeca2744fe84f8d852530d27f71/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2564.00 ((SQL14_RTM_QFE-CU).160204-1937) +``` + +# SQL Server 2014 RTM CU11 - 12.0.2560.0 - x64 (KB3106659) +``` powershell +# SQL Server 2014 RTM CU11 - 12.0.2560.0 - x64 (KB3106659) +$outputFolder = 'c:\sqlsyms\12.0.2560.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/71ccee0526474342a5891a30d552962b2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.2560.00 ((SQL14_RTM_QFE-CU).151130-1922) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/3919239c1e00493990334a7288fcb7962/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2560.00 ((SQL14_RTM_QFE-CU).151130-1922) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/756b21da38ee46d0984b1188544092342/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2560.00 ((SQL14_RTM_QFE-CU).151130-1922) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/d028137b7daa4438bc7be686320a64fe2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.2560.00 ((SQL14_RTM_QFE-CU).151130-1922) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/781c50f9c2c44642b355a47de65574b82/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2560.00 ((SQL14_RTM_QFE-CU).151130-1922) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/a0aff51dd9904d55a4fcce650e40a9762/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2560.00 ((SQL14_RTM_QFE-CU).151130-1922) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/9293a8099c4d4f49bc6b0543846b03791/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.2560.00 ((SQL14_RTM_QFE-CU).151130-1922) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/fa5b0015e66a4fb286899631f60591021/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.2560.00 ((SQL14_RTM_QFE-CU).151130-1922) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/56f5dd0eb56e420b92dcd5f59b05ef9c1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.2560.00 ((SQL14_RTM_QFE-CU).151130-1922) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/64b1f742fbcb4e2eb3f2e1dc05b70ea61/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2560.00 ((SQL14_RTM_QFE-CU).151130-1922) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/8ec5a23b411344a6b1fb5a9dfc8d1c752/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2560.00 ((SQL14_RTM_QFE-CU).151130-1922) +``` + +# SQL Server 2014 RTM CU11 - 12.0.2560.0 - x86 (KB3106659) +``` powershell +# SQL Server 2014 RTM CU11 - 12.0.2560.0 - x86 (KB3106659) +$outputFolder = 'c:\sqlsyms\12.0.2560.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/a90e6d303f4345efaedba859da66d0e21/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.2560.00 ((SQL14_RTM_QFE-CU).151130-1922) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/64473f2a9c0243d08ad2cebd7e62f0ac1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2560.00 ((SQL14_RTM_QFE-CU).151130-1922) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/eb1f9c11c81140199ee680f02d407a3c1/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2560.00 ((SQL14_RTM_QFE-CU).151130-1922) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/5b6c3b54f0234bb2be975c25092ba4851/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.2560.00 ((SQL14_RTM_QFE-CU).151130-1922) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/286b5c4590a94a3bb3da0360ecd0e9c72/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2560.00 ((SQL14_RTM_QFE-CU).151130-1922) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/ce4f67214c154f52ad60711ba933ad3d1/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2560.00 ((SQL14_RTM_QFE-CU).151130-1922) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/aec11813c97e4e44bdb233dd821866191/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2560.00 ((SQL14_RTM_QFE-CU).151130-1922) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/bd25689f8fa549398c347993c1fba4851/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2560.00 ((SQL14_RTM_QFE-CU).151130-1922) +``` + +# SQL Server 2014 RTM CU10 - 12.0.2556.4 - x64 (KB3094220) +``` powershell +# SQL Server 2014 RTM CU10 - 12.0.2556.4 - x64 (KB3094220) +$outputFolder = 'c:\sqlsyms\12.0.2556.4\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/a06b30032d9f4505a3c8f000010f8e4a2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.2556.04 ((SQL14_RTM_QFE-CU).150925-1720) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/e48e96adf3df44b481c69001d428659f2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2556.04 ((SQL14_RTM_QFE-CU).150925-1720) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/a1d6b6fd3e564262ae281bf794e96bd72/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2556.04 ((SQL14_RTM_QFE-CU).150925-1720) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/038d25c7c8644a3395f40f40f36382c62/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.2556.04 ((SQL14_RTM_QFE-CU).150925-1720) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/cfb6dad33e5f4582bb467ca8f85d4a162/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2556.04 ((SQL14_RTM_QFE-CU).150925-1720) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/98e46a54759c4bdfbab7383aa518630a2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2556.04 ((SQL14_RTM_QFE-CU).150925-1720) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/76f05d07a3e9414f80f50c6442eea7931/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.2556.04 ((SQL14_RTM_QFE-CU).150925-1720) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/1383af48c8034eebb40e2851e1a44a1c1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.2556.04 ((SQL14_RTM_QFE-CU).150925-1720) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/f3b781e181fe41d98402118e16e3f7601/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.2556.04 ((SQL14_RTM_QFE-CU).150925-1720) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/d0f7a6c9e839447fbf537b344c12efae1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2556.04 ((SQL14_RTM_QFE-CU).150925-1720) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/6f9cb7b79b0f4b7eb215793a66b2ef942/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2556.04 ((SQL14_RTM_QFE-CU).150925-1720) +``` + +# SQL Server 2014 RTM CU10 - 12.0.2556.4 - x86 (KB3094220) +``` powershell +# SQL Server 2014 RTM CU10 - 12.0.2556.4 - x86 (KB3094220) +$outputFolder = 'c:\sqlsyms\12.0.2556.4\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/9c806d9ee5a84c898f8421b5380b95e31/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.2556.04 ((SQL14_RTM_QFE-CU).150925-1720) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/b69a5dcf43574aa79661d3e85b9daf3b1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2556.04 ((SQL14_RTM_QFE-CU).150925-1720) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/97d553cffeff4762b0266da68f578fba1/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2556.04 ((SQL14_RTM_QFE-CU).150925-1720) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/d79a773caeba4ac59f6882c36b1f356c1/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.2556.04 ((SQL14_RTM_QFE-CU).150925-1720) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/f646c10572b24eaaadbae323b7abd2782/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2556.04 ((SQL14_RTM_QFE-CU).150925-1720) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/38dc9d399d6b41a69f084603941b4de21/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2556.04 ((SQL14_RTM_QFE-CU).150925-1720) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/3960118c1cbe4a29af87cc01706ce2641/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2556.04 ((SQL14_RTM_QFE-CU).150925-1720) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/7e7fd36e795447998d8a574e0de7c1871/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2556.04 ((SQL14_RTM_QFE-CU).150925-1720) +``` + +# SQL Server 2014 RTM CU9 - 12.0.2553.0 - x64 (KB3075949) +``` powershell +# SQL Server 2014 RTM CU9 - 12.0.2553.0 - x64 (KB3075949) +$outputFolder = 'c:\sqlsyms\12.0.2553.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/4d240a39c8904928a18106632f6553402/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.2553.00 ((SQL14_RTM_QFE-CU).150727-1511) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/a7035a6ff90d479b9919516f8a75c6f92/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2553.00 ((SQL14_RTM_QFE-CU).150727-1511) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/90c16352697346c4adc344d5bcbef4ec2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2553.00 ((SQL14_RTM_QFE-CU).150727-1511) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/c4b7ea36a9ed41e28a86daf39605b1332/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.2553.00 ((SQL14_RTM_QFE-CU).150727-1511) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/afdf18a69a2247a69f8775fb26ba35842/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2553.00 ((SQL14_RTM_QFE-CU).150727-1511) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/531f254bc1634a668690bfa78ac1c9642/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2553.00 ((SQL14_RTM_QFE-CU).150727-1511) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/a0a41504488d42e0889c7aec0d470a201/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.2553.00 ((SQL14_RTM_QFE-CU).150727-1511) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/8f66e9d5591841f585146e18e861ba1e1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.2553.00 ((SQL14_RTM_QFE-CU).150727-1511) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/7b7dadea82424ddb940d8bcb1ced7a461/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.2553.00 ((SQL14_RTM_QFE-CU).150727-1511) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/19ab0699fbdf4c26b2c48e3206ac53ca1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2553.00 ((SQL14_RTM_QFE-CU).150727-1511) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/eceabbbb5b7a43e49511f7e3b3064b472/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2553.00 ((SQL14_RTM_QFE-CU).150727-1511) +``` + +# SQL Server 2014 RTM CU9 - 12.0.2553.0 - x86 (KB3075949) +``` powershell +# SQL Server 2014 RTM CU9 - 12.0.2553.0 - x86 (KB3075949) +$outputFolder = 'c:\sqlsyms\12.0.2553.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/d56eacfc22cb4f8ebfb7ed4457b60f311/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.2553.00 ((SQL14_RTM_QFE-CU).150727-1511) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/2dd16123a37f485dae76965defe7f15e1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2553.00 ((SQL14_RTM_QFE-CU).150727-1511) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/569970ff8be84c0b9f067365e4a00c3b1/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2553.00 ((SQL14_RTM_QFE-CU).150727-1511) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/17dd6df3096b4d0199d1035815c1d8881/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.2553.00 ((SQL14_RTM_QFE-CU).150727-1511) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/594a78c1c2204ba1a183b4127c462a3e2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2553.00 ((SQL14_RTM_QFE-CU).150727-1511) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/6446039fddc749d3a1583d2472405cf21/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2553.00 ((SQL14_RTM_QFE-CU).150727-1511) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/6f805634dddd401994ea5e31420c30281/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2553.00 ((SQL14_RTM_QFE-CU).150727-1511) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/8d3747171962416d957f2f4a2a5dc8701/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2553.00 ((SQL14_RTM_QFE-CU).150727-1511) +``` + +# SQL Server 2014 RTM CU8 - 12.0.2546.0 - x64 (KB3067836) +``` powershell +# SQL Server 2014 RTM CU8 - 12.0.2546.0 - x64 (KB3067836) +$outputFolder = 'c:\sqlsyms\12.0.2546.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/1869491de3c641a18e49984e36c254472/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.2546.00 ((SQL14_RTM_QFE-CU).150606-0007) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/23feec68725245cba986d45a86d87c3f2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2546.00 ((SQL14_RTM_QFE-CU).150606-0007) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/21db9cb621534d9e9be8f5c03e7091c52/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2546.00 ((SQL14_RTM_QFE-CU).150606-0007) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/8575334bb55240b5a1f44608bf3eda9b2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.2546.00 ((SQL14_RTM_QFE-CU).150606-0007) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/aeb2b040245c4f408ba6cfba7376190a2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2546.00 ((SQL14_RTM_QFE-CU).150606-0007) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/bfffb5bc7a3044ebb54ab848cdfeb7632/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2546.00 ((SQL14_RTM_QFE-CU).150606-0007) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/6e2e2a0675164fe8a3ade4ecae7ac20c1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.2546.00 ((SQL14_RTM_QFE-CU).150606-0007) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/dde786dd2d5b4cdca67f2653dafdb4d91/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.2546.00 ((SQL14_RTM_QFE-CU).150606-0007) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/20f66d85e7d54ab797a4802c4e642b431/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.2546.00 ((SQL14_RTM_QFE-CU).150606-0007) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/281a067206bb4599bf54b71128337a161/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2546.00 ((SQL14_RTM_QFE-CU).150606-0007) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/a7596bb350534cfc874c588a8c31dccc2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2546.00 ((SQL14_RTM_QFE-CU).150606-0007) +``` + +# SQL Server 2014 RTM CU8 - 12.0.2546.0 - x86 (KB3067836) +``` powershell +# SQL Server 2014 RTM CU8 - 12.0.2546.0 - x86 (KB3067836) +$outputFolder = 'c:\sqlsyms\12.0.2546.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/a902edbf6d6e45a5bdb96d88b3d8b9eb1/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.2546.00 ((SQL14_RTM_QFE-CU).150606-0007) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/91f4ba068591426395fba9cf46b9fe3b1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2546.00 ((SQL14_RTM_QFE-CU).150606-0007) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/a3454c90a9ec423abaab7718704766c41/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2546.00 ((SQL14_RTM_QFE-CU).150606-0007) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/6648b0c58be2467c85d16b826474f8e71/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.2546.00 ((SQL14_RTM_QFE-CU).150606-0007) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/57dad04962d6454e8ee40edafdd2a7382/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2546.00 ((SQL14_RTM_QFE-CU).150606-0007) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/9b2bcdfb948342728b8154e042fa2aab1/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2546.00 ((SQL14_RTM_QFE-CU).150606-0007) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/9291ad53019f4d93b0a31996c43797fb1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2546.00 ((SQL14_RTM_QFE-CU).150606-0007) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/6aaa6f308fc649d8b2982b6ae4cb77c71/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2546.00 ((SQL14_RTM_QFE-CU).150606-0007) +``` + +# SQL Server 2014 RTM CU7 - 12.0.2495.0 - x64 (KB3046038) +``` powershell +# SQL Server 2014 RTM CU7 - 12.0.2495.0 - x64 (KB3046038) +$outputFolder = 'c:\sqlsyms\12.0.2495.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/892a317818044f39a181616fc087af5d2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.2495.00 ((SQL14_RTM_QFE-CU).150331-0856) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/3f9503803aac4aaf9068cf713da94fcc2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2495.00 ((SQL14_RTM_QFE-CU).150331-0856) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/7b4cb4924f874c2c9a01962d7bebb4322/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2495.00 ((SQL14_RTM_QFE-CU).150331-0856) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/f953a26136a349b4bc7123c9b57674cb2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.2495.00 ((SQL14_RTM_QFE-CU).150331-0856) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/5b04b86cb1df4377852dcdfbaa579d6a2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2495.00 ((SQL14_RTM_QFE-CU).150331-0856) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/68b76d2800ca4d67a20176b8080792622/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2495.00 ((SQL14_RTM_QFE-CU).150331-0856) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/8ed3b76470a54f71a22fe04ec4aa07971/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.2495.00 ((SQL14_RTM_QFE-CU).150331-0856) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/ac765b05370f4dd39bc3dab2c9c5b0881/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.2495.00 ((SQL14_RTM_QFE-CU).150331-0856) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/868f36d33dea4cdd80d7ac95d51becb61/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.2495.00 ((SQL14_RTM_QFE-CU).150331-0856) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/e750975049a44a5ca167527370ef01171/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2495.00 ((SQL14_RTM_QFE-CU).150331-0856) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/76a12fa76ee2455086cf3afd914b939b2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2495.00 ((SQL14_RTM_QFE-CU).150331-0856) +``` + +# SQL Server 2014 RTM CU7 - 12.0.2495.0 - x86 (KB3046038) +``` powershell +# SQL Server 2014 RTM CU7 - 12.0.2495.0 - x86 (KB3046038) +$outputFolder = 'c:\sqlsyms\12.0.2495.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/b723d38841c74cb09e79d2eeadffc2ab1/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.2495.00 ((SQL14_RTM_QFE-CU).150331-0856) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/0f90d520883c490f9d0815f7a6211e701/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2495.00 ((SQL14_RTM_QFE-CU).150331-0856) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/bc6b474d28164912bd70a0e0087e35261/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2495.00 ((SQL14_RTM_QFE-CU).150331-0856) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/c32b08605905479daa5521248a294c091/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.2495.00 ((SQL14_RTM_QFE-CU).150331-0856) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/96046540101444be821ef103aa4e0f982/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2495.00 ((SQL14_RTM_QFE-CU).150331-0856) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/710e00b267c04ae1bc850a013edee5231/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2495.00 ((SQL14_RTM_QFE-CU).150331-0856) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/982821e1f1a348c4845b7a31dd0a43ce1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2495.00 ((SQL14_RTM_QFE-CU).150331-0856) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/d8c2b98f2dd94438849861c279784cfb1/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2495.00 ((SQL14_RTM_QFE-CU).150331-0856) +``` + +# SQL Server 2014 RTM CU6 - 12.0.2480.0 - x64 (KB3031047) +``` powershell +# SQL Server 2014 RTM CU6 - 12.0.2480.0 - x64 (KB3031047) +$outputFolder = 'c:\sqlsyms\12.0.2480.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/dbacb5b0cfd24693ae42ddf04ab4b27c2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.2480.00 ((SQL14_RTM_QFE-CU).150128-1755) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/31d5b80990d64e0fb25cb5327135bf492/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2480.00 ((SQL14_RTM_QFE-CU).150128-1755) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/ff523ac683ae46a2b355c15b4ac022eb2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2480.00 ((SQL14_RTM_QFE-CU).150128-1755) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/edbd5ea4bbe04d47b93025254094b02d2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.2480.00 ((SQL14_RTM_QFE-CU).150128-1755) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/4929c9ecd1704cf8a7821dc901f6d92f2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2480.00 ((SQL14_RTM_QFE-CU).150128-1755) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/1c0f8135f2934a5ca84ebff15f88b6aa2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2480.00 ((SQL14_RTM_QFE-CU).150128-1755) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/3ab1423a6b7f48d1a942c5df2fd242b61/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.2480.00 ((SQL14_RTM_QFE-CU).150128-1755) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/c9aa7a554ed94d15b35740ffe04036c01/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.2480.00 ((SQL14_RTM_QFE-CU).150128-1755) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/95947070310e43e2accbc93c08f222241/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.2480.00 ((SQL14_RTM_QFE-CU).150128-1755) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/0d379c00cf81409587f1a4c9f95f77dd1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2480.00 ((SQL14_RTM_QFE-CU).150128-1755) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/ec96151a8358494bb84329e05aaf78e02/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2480.00 ((SQL14_RTM_QFE-CU).150128-1755) +``` + +# SQL Server 2014 RTM CU6 - 12.0.2480.0 - x86 (KB3031047) +``` powershell +# SQL Server 2014 RTM CU6 - 12.0.2480.0 - x86 (KB3031047) +$outputFolder = 'c:\sqlsyms\12.0.2480.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/9b22a94162d74004a82810c2c3710a3f1/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.2480.00 ((SQL14_RTM_QFE-CU).150128-1755) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/ececdbe975594116b9e388e6c9f8a80f1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2480.00 ((SQL14_RTM_QFE-CU).150128-1755) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/9f41e051cb014f8d9fec6e44e9b721131/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2480.00 ((SQL14_RTM_QFE-CU).150128-1755) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/2ffeb57130c84f8fa3d69df7de71eb681/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.2480.00 ((SQL14_RTM_QFE-CU).150128-1755) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/7d7d89e6640645beb6306cbf2444ee662/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2480.00 ((SQL14_RTM_QFE-CU).150128-1755) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/22336473e39548f99831e8d061b7831b1/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2480.00 ((SQL14_RTM_QFE-CU).150128-1755) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/b16a9fdb9f8546788b04a5d80b2bae261/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2480.00 ((SQL14_RTM_QFE-CU).150128-1755) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/2c1a8c9a1b8c44e283868f97d75481e01/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2480.00 ((SQL14_RTM_QFE-CU).150128-1755) +``` + +# SQL Server 2014 RTM CU5 - 12.0.2456.0 - x64 (KB3011055) +``` powershell +# SQL Server 2014 RTM CU5 - 12.0.2456.0 - x64 (KB3011055) +$outputFolder = 'c:\sqlsyms\12.0.2456.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/eb8a93e72a794e8b9f5e5319cfc523682/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.2456.00 ((SQL14_RTM_QFE-CU).141211-1636) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/53f31818f69145f48eee069d0d23fbd12/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2456.00 ((SQL14_RTM_QFE-CU).141211-1636) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/6e2939b1a6c747c79606f27572d2167d2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2456.00 ((SQL14_RTM_QFE-CU).141211-1636) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/133c13f037d542e68e5d1fb06ae6e8042/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.2456.00 ((SQL14_RTM_QFE-CU).141211-1636) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/1afa777fdd2643e8b7eaa7faa9b6b5fa2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2456.00 ((SQL14_RTM_QFE-CU).141211-1636) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/19634392d50f4dcab91217f04a415f482/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2456.00 ((SQL14_RTM_QFE-CU).141211-1636) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/8fbc290a832848ffb96d30114d63ed611/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.2456.00 ((SQL14_RTM_QFE-CU).141211-1636) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/291765ae21a741eda736cb1cbcea5de51/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.2456.00 ((SQL14_RTM_QFE-CU).141211-1636) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/7b53fe2f993e41209ea93c774deed22f1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.2456.00 ((SQL14_RTM_QFE-CU).141211-1636) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/214c250884534e1aa0185e6bef362a521/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2456.00 ((SQL14_RTM_QFE-CU).141211-1636) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/9b95a106672640318876b62eb49ce32b2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2456.00 ((SQL14_RTM_QFE-CU).141211-1636) +``` + +# SQL Server 2014 RTM CU5 - 12.0.2456.0 - x86 (KB3011055) +``` powershell +# SQL Server 2014 RTM CU5 - 12.0.2456.0 - x86 (KB3011055) +$outputFolder = 'c:\sqlsyms\12.0.2456.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/b845d2f2afb44859904e1c51ea2df77c1/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.2456.00 ((SQL14_RTM_QFE-CU).141211-1636) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/93ab40244d4b4108b3e1e5e507a841f81/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2456.00 ((SQL14_RTM_QFE-CU).141211-1636) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/3bd2da20bc3d42df9bda66521f4763141/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2456.00 ((SQL14_RTM_QFE-CU).141211-1636) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/301c79ece27a4a4ea90a4026b151273d1/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.2456.00 ((SQL14_RTM_QFE-CU).141211-1636) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/15d84d064320486d8f0aa9c175e73ff72/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2456.00 ((SQL14_RTM_QFE-CU).141211-1636) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/677fc25409af4e5cb079fc220a507a281/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2456.00 ((SQL14_RTM_QFE-CU).141211-1636) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/c99783448e224e5ead440e48808f3a371/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2456.00 ((SQL14_RTM_QFE-CU).141211-1636) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/3ee8df660b704120a5769fe486d912b91/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2456.00 ((SQL14_RTM_QFE-CU).141211-1636) +``` + +# SQL Server 2014 RTM CU4 - 12.0.2430.0 - x64 (KB2999197) +``` powershell +# SQL Server 2014 RTM CU4 - 12.0.2430.0 - x64 (KB2999197) +$outputFolder = 'c:\sqlsyms\12.0.2430.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/8ed2ab1b64c64cd6b53be5ba2940d1a42/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.2430.00 ((SQL14_RTM_QFE-CU).141015-1502) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/1d8587b3f0eb464f8da9733cc91606862/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2430.00 ((SQL14_RTM_QFE-CU).141015-1502) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/21f00ed9f1534ee39faf557af2efe0b22/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2430.00 ((SQL14_RTM_QFE-CU).141015-1502) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/0999d6303e144ea494c2befc049f4f052/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.2430.00 ((SQL14_RTM_QFE-CU).141015-1502) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/f21b42e831e3406796f8341329a2109c2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2430.00 ((SQL14_RTM_QFE-CU).141015-1502) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/6ea90b282987428e950c06ca61b48d022/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2430.00 ((SQL14_RTM_QFE-CU).141015-1502) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/72b8a33dcd5a4c199f48947510111e4f1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.2430.00 ((SQL14_RTM_QFE-CU).141015-1502) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/c3f38698f3db4272bbf911928e3a71c91/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.2430.00 ((SQL14_RTM_QFE-CU).141015-1502) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/c9e0caaa8d11431aadaff0f8fc85c2041/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.2430.00 ((SQL14_RTM_QFE-CU).141015-1502) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/f98a21da91c24cfdb165f8f2c1a4019d1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2430.00 ((SQL14_RTM_QFE-CU).141015-1502) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/3863b99a65d94c2f9aba257ddb80519c2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2430.00 ((SQL14_RTM_QFE-CU).141015-1502) +``` + +# SQL Server 2014 RTM CU4 - 12.0.2430.0 - x86 (KB2999197) +``` powershell +# SQL Server 2014 RTM CU4 - 12.0.2430.0 - x86 (KB2999197) +$outputFolder = 'c:\sqlsyms\12.0.2430.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/c842b82043f14b56bbdaf6f3daf8c9361/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.2430.00 ((SQL14_RTM_QFE-CU).141015-1502) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/bd6cc732c1a04a70949c746ad7c75bfc1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2430.00 ((SQL14_RTM_QFE-CU).141015-1502) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/5e255a6c840c4135afd13947b885a0bc1/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2430.00 ((SQL14_RTM_QFE-CU).141015-1502) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/bf46680cb561413d92bf308f29ed422d1/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.2430.00 ((SQL14_RTM_QFE-CU).141015-1502) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/c2a06041e7e2494889e753f9633f49ad2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2430.00 ((SQL14_RTM_QFE-CU).141015-1502) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/b6b6b351ea9b4ddc8d275499e307dc371/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2430.00 ((SQL14_RTM_QFE-CU).141015-1502) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/d44e146dd57b4e84bd689c2dc23f38a21/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2430.00 ((SQL14_RTM_QFE-CU).141015-1502) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/0bad01bb555b4a9a9fb58bba8dbdee961/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2430.00 ((SQL14_RTM_QFE-CU).141015-1502) +``` + +# SQL Server 2014 RTM CU3 - 12.0.2402.0 - x64 (KB2984923) +``` powershell +# SQL Server 2014 RTM CU3 - 12.0.2402.0 - x64 (KB2984923) +$outputFolder = 'c:\sqlsyms\12.0.2402.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/74853044551f42dc87b5388cb869e80e2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.2402.00 ((SQL14_RTM_QFE-CU).140813-1032) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/b95f32db724a460eb6eef6e130b837262/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2402.00 ((SQL14_RTM_QFE-CU).140813-1032) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/ea34d76c06f34b6cb7b0908f0746c0782/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2402.00 ((SQL14_RTM_QFE-CU).140813-1032) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/b0d9d6294e034a73afeeee938172760b2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.2402.00 ((SQL14_RTM_QFE-CU).140813-1032) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/bf41580581a9420fb851f76ec3afb75a2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2402.00 ((SQL14_RTM_QFE-CU).140813-1032) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/f96bf02390534634bdc1e8d623c2d33a2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2402.00 ((SQL14_RTM_QFE-CU).140813-1032) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/f822ab6d65fc431cb5ab54b0ee8e3d4e1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.2402.00 ((SQL14_RTM_QFE-CU).140813-1032) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/7b77a2193e4f4891b0f34f9cda87f7b11/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.2402.00 ((SQL14_RTM_QFE-CU).140813-1032) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/5ef94f8c3ac34e8494fe1807ea68107b1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.2402.00 ((SQL14_RTM_QFE-CU).140813-1032) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/70d73245215e4eb1968511982957b5a51/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2402.00 ((SQL14_RTM_QFE-CU).140813-1032) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/56ece3cd49754bf8b5aea9068ca1858a2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2402.00 ((SQL14_RTM_QFE-CU).140813-1032) +``` + +# SQL Server 2014 RTM CU3 - 12.0.2402.0 - x86 (KB2984923) +``` powershell +# SQL Server 2014 RTM CU3 - 12.0.2402.0 - x86 (KB2984923) +$outputFolder = 'c:\sqlsyms\12.0.2402.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/0232dbfdd56b459fb96c006f563d2f6c1/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.2402.00 ((SQL14_RTM_QFE-CU).140813-1032) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/0d331b541b294e44a065cae4384077da1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2402.00 ((SQL14_RTM_QFE-CU).140813-1032) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/1fdf9f2c4cd74c4c99eaf0b33fb615271/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2402.00 ((SQL14_RTM_QFE-CU).140813-1032) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/1f461bef6f764833badbfb63717c6ca21/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.2402.00 ((SQL14_RTM_QFE-CU).140813-1032) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/8dde3944f69a481aa12e39b50dc1387e2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2402.00 ((SQL14_RTM_QFE-CU).140813-1032) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/fc462491d53f4437bbf3b53c21a2d19b1/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2402.00 ((SQL14_RTM_QFE-CU).140813-1032) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/3abaa853cdfd43538b656cf6b8ed08f41/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2402.00 ((SQL14_RTM_QFE-CU).140813-1032) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/c1fcff98a6144ea89585dbf7506c49c31/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2402.00 ((SQL14_RTM_QFE-CU).140813-1032) +``` + +# SQL Server 2014 RTM CU2 - 12.0.2370.0 - x64 (KB2967546) +``` powershell +# SQL Server 2014 RTM CU2 - 12.0.2370.0 - x64 (KB2967546) +$outputFolder = 'c:\sqlsyms\12.0.2370.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/00fe9a5483574e96ba85d4e14743c8cf2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.2370.00 ((SQL14_RTM_QFE-CU).140621-1135) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/c0cd8d60c1ac4687a1f529cca07230152/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2370.00 ((SQL14_RTM_QFE-CU).140621-1135) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/a3e0e381d1dc4ba2abefa830fb5908072/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2370.00 ((SQL14_RTM_QFE-CU).140621-1135) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/abf0ec3c6c1f49efb5ad08dbf408ef8e2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.2370.00 ((SQL14_RTM_QFE-CU).140621-1135) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/2709a8f9d5804dc695ad1b95124e3c732/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2370.00 ((SQL14_RTM_QFE-CU).140621-1135) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/27958e94f9a14900b53db20d28600db82/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2370.00 ((SQL14_RTM_QFE-CU).140621-1135) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/af790770d88f4c40a2b39623e71a4dab1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.2370.00 ((SQL14_RTM_QFE-CU).140621-1135) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/d4ac25f2460744f992933ca2b332429e1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.2370.00 ((SQL14_RTM_QFE-CU).140621-1135) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/21a099f1ea704e979734421be237b3751/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.2370.00 ((SQL14_RTM_QFE-CU).140621-1135) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/28d76d0753dc4ed1b8a26d6a8820df5e1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2370.00 ((SQL14_RTM_QFE-CU).140621-1135) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/021ad6b05b234d8484546842381e7d652/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2370.00 ((SQL14_RTM_QFE-CU).140621-1135) +``` + +# SQL Server 2014 RTM CU2 - 12.0.2370.0 - x86 (KB2967546) +``` powershell +# SQL Server 2014 RTM CU2 - 12.0.2370.0 - x86 (KB2967546) +$outputFolder = 'c:\sqlsyms\12.0.2370.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/efa900c9c1eb4134a444a4adf16505551/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.2370.00 ((SQL14_RTM_QFE-CU).140621-1135) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/7e9bd6b6dc8f41448ceaad495e2da09a1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2370.00 ((SQL14_RTM_QFE-CU).140621-1135) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/1866d12aa39c485397ac98c9edfb88101/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2370.00 ((SQL14_RTM_QFE-CU).140621-1135) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/3cd6a9cb42774008ad553c1ff1b647d91/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.2370.00 ((SQL14_RTM_QFE-CU).140621-1135) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/9c6ed829937f4036b7fabcff7173cdab2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2370.00 ((SQL14_RTM_QFE-CU).140621-1135) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/6f14e9defc694da98c58fd58d3a358481/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2370.00 ((SQL14_RTM_QFE-CU).140621-1135) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/54dbf7bb6af447298c7637a9ada989ac1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2370.00 ((SQL14_RTM_QFE-CU).140621-1135) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/1e3ffb2e704744d6a73cfb79cb38619f1/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2370.00 ((SQL14_RTM_QFE-CU).140621-1135) +``` + +# SQL Server 2014 RTM CU1 - 12.0.2342.0 - x64 (KB2931693) +``` powershell +# SQL Server 2014 RTM CU1 - 12.0.2342.0 - x64 (KB2931693) +$outputFolder = 'c:\sqlsyms\12.0.2342.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/57c252c885d8450b93688037679d5db22/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2014.0120.2342.00 ((SQL14_RTM_QFE-CU).140404-1739) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/a35c73537ad64f2ab17ad8ef76ceeb4c2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2342.00 ((SQL14_RTM_QFE-CU).140404-1739) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/550f9e5b95f44c42a77d2f32154b77eb2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2342.00 ((SQL14_RTM_QFE-CU).140404-1739) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/b97e3ca52a8e4182992f891a812e911d2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2014.0120.2342.00 ((SQL14_RTM_QFE-CU).140404-1739) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/65b8869fb0b44abfaf9f3635bb4c694f2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2342.00 ((SQL14_RTM_QFE-CU).140404-1739) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/9e454a85cdba496dbb47c8aeb1d5c66b2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2342.00 ((SQL14_RTM_QFE-CU).140404-1739) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/ba6cba69141549d4b828b2e3a8e69b981/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2014.0120.2342.00 ((SQL14_RTM_QFE-CU).140404-1739) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/fe5ab059d8de48b6b74bd26c7c0015ca1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2014.0120.2342.00 ((SQL14_RTM_QFE-CU).140404-1739) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/318b9d34af1d4e1780ef5277e5a5a8741/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2014.0120.2342.00 ((SQL14_RTM_QFE-CU).140404-1739) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/8f42604977cd4be4a8c3d12f390048cf1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2342.00 ((SQL14_RTM_QFE-CU).140404-1739) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/5460fb87c3d54751906607c8a455f81a2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2342.00 ((SQL14_RTM_QFE-CU).140404-1739) +``` + +# SQL Server 2014 RTM CU1 - 12.0.2342.0 - x86 (KB2931693) +``` powershell +# SQL Server 2014 RTM CU1 - 12.0.2342.0 - x86 (KB2931693) +$outputFolder = 'c:\sqlsyms\12.0.2342.0\x86' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/74815ec15b4c4e5db8b41b9f77197a431/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2014.0120.2342.00 ((SQL14_RTM_QFE-CU).140404-1739) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/33e87393cabf44a381d3b0d5f7d36efe1/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2014.0120.2342.00 ((SQL14_RTM_QFE-CU).140404-1739) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/e84e6950792046a9ad837c8451c0bab41/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2014.0120.2342.00 ((SQL14_RTM_QFE-CU).140404-1739) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/2369cc5ed5334d2587d538a1075230d01/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2014.0120.2342.00 ((SQL14_RTM_QFE-CU).140404-1739) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/6982bb0a3859490eae0d8885cc0dd1322/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2014.0120.2342.00 ((SQL14_RTM_QFE-CU).140404-1739) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/5d24211092fb49aaa62c76ee12da579f1/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2014.0120.2342.00 ((SQL14_RTM_QFE-CU).140404-1739) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/c98e147056fd4ad9bc50de8c6705590a1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2014.0120.2342.00 ((SQL14_RTM_QFE-CU).140404-1739) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/76992783851b4654be2bd359dc53bc831/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2014.0120.2342.00 ((SQL14_RTM_QFE-CU).140404-1739) +``` + diff --git a/Errors/PDB/SQL-Server-2016.md b/Errors/PDB/SQL-Server-2016.md new file mode 100644 index 00000000..4acae0e8 --- /dev/null +++ b/Errors/PDB/SQL-Server-2016.md @@ -0,0 +1,699 @@ +# SQL Server 2016 SP2 CU13 - 13.0.5820.21 - x64 (KB4549825) +``` powershell +# SQL Server 2016 SP2 CU13 - 13.0.5820.21 - x64 (KB4549825) +$outputFolder = 'c:\sqlsyms\13.0.5820.21\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/e6a5231d69314339a622dec94dcdd7d32/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0131.5820.21 ((SQL16_SP2_QFE-CU).200522-0642) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/96c764d747bf420b9996befef7475c9a2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0131.5820.21 ((SQL16_SP2_QFE-CU).200522-0642) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/9ee1aa873d2d4b778e6a54459fd7914d2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0131.5820.21 ((SQL16_SP2_QFE-CU).200522-0642) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/e09ce83a1ee54955a5e6406176a389362/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0131.5820.21 ((SQL16_SP2_QFE-CU).200522-0642) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/62fe14b4c3604a3fb403bb7e22940c362/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0131.5820.21 ((SQL16_SP2_QFE-CU).200522-0642) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/7221bd8eef08483c81a4a857dd6587d82/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0131.5820.21 ((SQL16_SP2_QFE-CU).200522-0642) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/aa95581843cc476f8b86d487e4f708f51/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0131.5820.21 ((SQL16_SP2_QFE-CU).200522-0642) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/22bf33591a704ff09291525ac1d00d191/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0131.5820.21 ((SQL16_SP2_QFE-CU).200522-0642) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/8f4b1832517446938ef926263aab57cf1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0131.5820.21 ((SQL16_SP2_QFE-CU).200522-0642) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/f8668e661315449497cea566e51c83131/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0131.5820.21 ((SQL16_SP2_QFE-CU).200522-0642) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/2633f57463f64221a5ebeff75ed2100d2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0131.5820.21 ((SQL16_SP2_QFE-CU).200522-0642) +``` + +# SQL Server 2016 SP2 CU12 - 13.0.5698.0 - x64 (KB4536648) +``` powershell +# SQL Server 2016 SP2 CU12 - 13.0.5698.0 - x64 (KB4536648) +$outputFolder = 'c:\sqlsyms\13.0.5698.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/0271f8481dae4e9493e450b8dc796bc02/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0131.5698.00 ((SQL16_SP2_QFE-CU).200215-0125) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/641b2f06bbc146b38bc05e9b58e36d0f2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0131.5698.00 ((SQL16_SP2_QFE-CU).200215-0125) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/72307bde192a4c319454098c20cb912b2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0131.5698.00 ((SQL16_SP2_QFE-CU).200215-0125) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/bcd4e428d7c94039b4955ed076e7a3682/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0131.5698.00 ((SQL16_SP2_QFE-CU).200215-0125) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/92812c2e4617474db8111c7804eda4f92/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0131.5698.00 ((SQL16_SP2_QFE-CU).200215-0125) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/5a323ebb0fbc4248b605abd7c0654b2c2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0131.5698.00 ((SQL16_SP2_QFE-CU).200215-0125) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/d3cd4e59ac0046c1a6f61aafb00e2c4c1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0131.5698.00 ((SQL16_SP2_QFE-CU).200215-0125) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/20e8d53a37e1427cb93fa7cafe5f27aa1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0131.5698.00 ((SQL16_SP2_QFE-CU).200215-0125) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/d0bcad819dcc4842929e81a1e9ecb59e1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0131.5698.00 ((SQL16_SP2_QFE-CU).200215-0125) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/98ebdb42d04440ba9295070f88407f6a1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0131.5698.00 ((SQL16_SP2_QFE-CU).200215-0125) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/0148f923aea94af19053f99ba79996682/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0131.5698.00 ((SQL16_SP2_QFE-CU).200215-0125) +``` + +# SQL Server 2016 SP2 CU11 - 13.0.5598.27 - x64 (KB4527378) +``` powershell +# SQL Server 2016 SP2 CU11 - 13.0.5598.27 - x64 (KB4527378) +$outputFolder = 'c:\sqlsyms\13.0.5598.27\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/430ef93c7b564dc2a93647e6e1fafc8c2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0131.5598.27 ((SQL16_SP2_QFE-CU).191127-1657) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/79015e09729743128701ee4f66f24fe92/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0131.5598.27 ((SQL16_SP2_QFE-CU).191127-1657) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/c4b83e706a594c56b9f509cd06c33b762/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0131.5598.27 ((SQL16_SP2_QFE-CU).191127-1657) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/f137caf5bd854030935dcf93b62eeaeb2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0131.5598.27 ((SQL16_SP2_QFE-CU).191127-1657) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/832f21f9f07244ca8ae43ecb5f76fb9d2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0131.5598.27 ((SQL16_SP2_QFE-CU).191127-1657) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/1aefde25bf814c2197bd09f7f58513292/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0131.5598.27 ((SQL16_SP2_QFE-CU).191127-1657) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/380b9e486b1643008a409f775f7c8a411/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0131.5598.27 ((SQL16_SP2_QFE-CU).191127-1657) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/001fd9d68d3c4dae8e89c2402fa889021/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0131.5598.27 ((SQL16_SP2_QFE-CU).191127-1657) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/75ccea7cdb124f4a8ececf21620e312f1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0131.5598.27 ((SQL16_SP2_QFE-CU).191127-1657) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/8a1a47fa116541d3bf3428149ba6b3bb1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0131.5598.27 ((SQL16_SP2_QFE-CU).191127-1657) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/186252fbc0884d24b6fe231af0759a352/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0131.5598.27 ((SQL16_SP2_QFE-CU).191127-1657) +``` + +# SQL Server 2016 SP2 CU10 - 13.0.5492.2 - x64 (KB4524334) +``` powershell +# SQL Server 2016 SP2 CU10 - 13.0.5492.2 - x64 (KB4524334) +$outputFolder = 'c:\sqlsyms\13.0.5492.2\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/70ecf5dbd5ef45d58df538eeb5e739b42/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0131.5492.02 ((SQL16_SP2_QFE-CU).191004-1836) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/63e1be959b6b450b974b7736342adbfa2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0131.5492.02 ((SQL16_SP2_QFE-CU).191004-1836) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/bf2a1e4b8d03428aacfea5d795e2425b2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0131.5492.02 ((SQL16_SP2_QFE-CU).191004-1836) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/fd96f94072a141758a4cbea2812690a12/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0131.5492.02 ((SQL16_SP2_QFE-CU).191004-1836) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/4048059f80d943babfc3f6c28cbaea1f2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0131.5492.02 ((SQL16_SP2_QFE-CU).191004-1836) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/bb191544f6184394adf2c918affc041f2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0131.5492.02 ((SQL16_SP2_QFE-CU).191004-1836) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/d5895ca6c7dc4374b010a96739da4bc21/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0131.5492.02 ((SQL16_SP2_QFE-CU).191004-1836) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/801fb6f15a7f4965acaabfab3e987d9c1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0131.5492.02 ((SQL16_SP2_QFE-CU).191004-1836) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/c3151df89b1c457dabf76e34c04f1bb71/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0131.5492.02 ((SQL16_SP2_QFE-CU).191004-1836) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/6f298cba9ac5443cb1450d8082c0c3011/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0131.5492.02 ((SQL16_SP2_QFE-CU).191004-1836) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/006c2ae04bf045c0a9b5effd267136ad2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0131.5492.02 ((SQL16_SP2_QFE-CU).191004-1836) +``` + +# SQL Server 2016 SP2 CU8 - 13.0.5426.0 - x64 (KB4505830) +``` powershell +# SQL Server 2016 SP2 CU8 - 13.0.5426.0 - x64 (KB4505830) +$outputFolder = 'c:\sqlsyms\13.0.5426.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/18b397dfe9034092a48167ec1ec5ea0b2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0131.5426.00 ((SQL16_SP2_QFE-CU).190721-2038) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/132b5e0d712b4464be80ed12e1e5505e2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0131.5426.00 ((SQL16_SP2_QFE-CU).190721-2038) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/db48420d121b42899a92f0d23dc57ad22/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0131.5426.00 ((SQL16_SP2_QFE-CU).190721-2038) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/d5acd14328d4434abea6af32ef61536a2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0131.5426.00 ((SQL16_SP2_QFE-CU).190721-2038) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/32d9395ab3de4e75a7e11a1d23cb5e822/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0131.5426.00 ((SQL16_SP2_QFE-CU).190721-2038) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/c010f16083f14fab9a85dd2d21893a302/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0131.5426.00 ((SQL16_SP2_QFE-CU).190721-2038) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/9dfd9945902246ccb7d504ba4d348f461/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0131.5426.00 ((SQL16_SP2_QFE-CU).190721-2038) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/331c42cbf74a420e81faba8d2c85a3cf1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0131.5426.00 ((SQL16_SP2_QFE-CU).190721-2038) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/7acfbd3f08164c9aa7b501bf677cb43c1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0131.5426.00 ((SQL16_SP2_QFE-CU).190721-2038) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/d604a24250b64ca6a926842ec51546ad1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0131.5426.00 ((SQL16_SP2_QFE-CU).190721-2038) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/1e0e6f6d8afd403bbb31684416b9314e2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0131.5426.00 ((SQL16_SP2_QFE-CU).190721-2038) +``` + +# SQL Server 2016 SP2 Hotfix for SP2 CU7 - 13.0.5343.1 - x64 (4508636) +``` powershell +# SQL Server 2016 SP2 Hotfix for SP2 CU7 - 13.0.5343.1 - x64 (4508636) +$outputFolder = 'c:\sqlsyms\13.0.5343.1\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/e4884387ee894c14b9ba32a55b1e4ed72/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0131.5343.01 ((SQL16_SP2_QFE-OD).190614-1944) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/5504c31fbc484a04960c330f5520df7a2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0131.5343.01 ((SQL16_SP2_QFE-OD).190614-1944) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/b4414980247d436abdf4cf4c43f5023f2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0131.5343.01 ((SQL16_SP2_QFE-OD).190614-1944) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/47b47fc8b89d47d5a82297cf24630ca02/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0131.5343.01 ((SQL16_SP2_QFE-OD).190614-1944) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/72d0f73f142c4d1f9c2be9ce5c5f9a7b2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0131.5343.01 ((SQL16_SP2_QFE-OD).190614-1944) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/66bd5fc8cd934353b7fa1b2db5d1e5382/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0131.5343.01 ((SQL16_SP2_QFE-OD).190614-1944) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/5e06fd5a624848ff9a02a71ddf0c11481/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0131.5343.01 ((SQL16_SP2_QFE-OD).190614-1944) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/ca29126933fd43f7bcc35106076ac2471/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0131.5343.01 ((SQL16_SP2_QFE-OD).190614-1944) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/25e8c49501a8498a86d2a13ab329b3ea1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0131.5343.01 ((SQL16_SP2_QFE-OD).190614-1944) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/ccd4f61a1ae7416b9caecb49e46c96ca1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0131.5343.01 ((SQL16_SP2_QFE-OD).190614-1944) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/9dd288e031a2402dbad6f68c468a1f662/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0131.5343.01 ((SQL16_SP2_QFE-OD).190614-1944) +``` + +# SQL Server 2016 SP2 CU7 - 13.0.5337.0 - x64 (KB4495256) +``` powershell +# SQL Server 2016 SP2 CU7 - 13.0.5337.0 - x64 (KB4495256) +$outputFolder = 'c:\sqlsyms\13.0.5337.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/19f0728b189a437db61f6d0a59378c2f2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0131.5337.00 ((SQL16_SP2_QFE-CU).190516-0131) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/27a0893b43494606b4da007056d14b8f2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0131.5337.00 ((SQL16_SP2_QFE-CU).190516-0131) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/53f66882dcc948a5ab43ccf35f8c62172/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0131.5337.00 ((SQL16_SP2_QFE-CU).190516-0131) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/26528819a67f4c9793cdb2c6b6d25f022/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0131.5337.00 ((SQL16_SP2_QFE-CU).190516-0131) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/f6d28fb6f5ac469a828b160544679d362/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0131.5337.00 ((SQL16_SP2_QFE-CU).190516-0131) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/956090e1037945b2928f4f605b52ded32/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0131.5337.00 ((SQL16_SP2_QFE-CU).190516-0131) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/55ab1c4583324e4181dc2d13638a270c1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0131.5337.00 ((SQL16_SP2_QFE-CU).190516-0131) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/4a5ef712546c4ea593b3919fc8e9be3c1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0131.5337.00 ((SQL16_SP2_QFE-CU).190516-0131) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/b29f002c7c8546f399a8818e0f01340f1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0131.5337.00 ((SQL16_SP2_QFE-CU).190516-0131) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/decb2afdf5ad41c48644e8ee74024d501/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0131.5337.00 ((SQL16_SP2_QFE-CU).190516-0131) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/e272bf31dd404e02800badc8605d29702/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0131.5337.00 ((SQL16_SP2_QFE-CU).190516-0131) +``` + +# SQL Server 2016 SP2 CU6 - 13.0.5292.0 - x64 (KB4488536) +``` powershell +# SQL Server 2016 SP2 CU6 - 13.0.5292.0 - x64 (KB4488536) +$outputFolder = 'c:\sqlsyms\13.0.5292.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/950cfd27fb154e0fa81f5171d3a9e72c2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0131.5292.00 ((SQL16_SP2_QFE-CU).190311-2257) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/f4e8c4a23f0e4300b84aff830703780e2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0131.5292.00 ((SQL16_SP2_QFE-CU).190311-2257) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/98e48204764e43beb5a7512730a309542/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0131.5292.00 ((SQL16_SP2_QFE-CU).190311-2257) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/2c6f6ddf2326442bbf1d71142d177eb12/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0131.5292.00 ((SQL16_SP2_QFE-CU).190311-2257) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/e677182deae14a179afc8d4cd0de3e682/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0131.5292.00 ((SQL16_SP2_QFE-CU).190311-2257) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/705ca25058a944e6ab3c1ab89d77de3c2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0131.5292.00 ((SQL16_SP2_QFE-CU).190311-2257) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/6b45c84e9e8e4450ac26bdc614b491da1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0131.5292.00 ((SQL16_SP2_QFE-CU).190311-2257) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/1f44e38a066b4c9aad14b90ea547e5f11/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0131.5292.00 ((SQL16_SP2_QFE-CU).190311-2257) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/bcf044a5cfc64d03be7cdf8df023bd2d1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0131.5292.00 ((SQL16_SP2_QFE-CU).190311-2257) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/dad251dee8644e4dbf61bedbcf9a06bf1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0131.5292.00 ((SQL16_SP2_QFE-CU).190311-2257) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/d6c736e277fd4baf8e88d3b6d27cff362/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0131.5292.00 ((SQL16_SP2_QFE-CU).190311-2257) +``` + +# SQL Server 2016 SP2 CU5 - 13.0.5264.1 - x64 (KB4475776) +``` powershell +# SQL Server 2016 SP2 CU5 - 13.0.5264.1 - x64 (KB4475776) +$outputFolder = 'c:\sqlsyms\13.0.5264.1\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/0bae10a1491645f8a97b697fe565dd332/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0131.5264.01 ((SQL16_SP2_QFE-CU).190110-1506) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/85a6f0d21b0a4d8f96d6aa8049a1c8892/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0131.5264.01 ((SQL16_SP2_QFE-CU).190110-1506) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/f5b7a81e036a4be3bc7c1858909869802/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0131.5264.01 ((SQL16_SP2_QFE-CU).190110-1506) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/e8f4359ed540405ebf50b2593e54434b2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0131.5264.01 ((SQL16_SP2_QFE-CU).190110-1506) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/73d85290046448bdbcc3ede97dfc234b2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0131.5264.01 ((SQL16_SP2_QFE-CU).190110-1506) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/81dc5887677b47be879138df0c3009b12/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0131.5264.01 ((SQL16_SP2_QFE-CU).190110-1506) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/97818e2e150f41d4a1b3882e98aee44e1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0131.5264.01 ((SQL16_SP2_QFE-CU).190110-1506) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/fcb62686788c4edab5fbbb3586fa70641/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0131.5264.01 ((SQL16_SP2_QFE-CU).190110-1506) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/e3d3a5d84aa04e1c95a508d1a2a121ca1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0131.5264.01 ((SQL16_SP2_QFE-CU).190110-1506) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/8f3f2c17b925463ab3be306a8bfbf6191/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0131.5264.01 ((SQL16_SP2_QFE-CU).190110-1506) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/21046a92c3c344459925db3348bed5402/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0131.5264.01 ((SQL16_SP2_QFE-CU).190110-1506) +``` + +# SQL Server 2016 SP2 CU4 - 13.0.5233.0 - x64 (KB4464106) +``` powershell +# SQL Server 2016 SP2 CU4 - 13.0.5233.0 - x64 (KB4464106) +$outputFolder = 'c:\sqlsyms\13.0.5233.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/f1595ec49d654c548b60b5b8640881562/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0131.5233.00 ((SQL16_SP2_QFE-CU).181102-1539) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/8d1e052738ed4834ac1162b8970bf0532/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0131.5233.00 ((SQL16_SP2_QFE-CU).181102-1539) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/9b29b84d1daa4cb690c91697520de38a2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0131.5233.00 ((SQL16_SP2_QFE-CU).181102-1539) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/7975964f1eb7477988fd520d142465bf2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0131.5233.00 ((SQL16_SP2_QFE-CU).181102-1539) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/1be684f3c3984a379a6438f8c36fbb4a2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0131.5233.00 ((SQL16_SP2_QFE-CU).181102-1539) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/17bc4cfd173e428fb9eae9da392a49682/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0131.5233.00 ((SQL16_SP2_QFE-CU).181102-1539) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/87146b12ed3649fa9968b622bb55394e1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0131.5233.00 ((SQL16_SP2_QFE-CU).181102-1539) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/f428b375b3ac4ef38be75a3d7affd27b1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0131.5233.00 ((SQL16_SP2_QFE-CU).181102-1539) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/624caa45728c42819a84a8a89279d3471/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0131.5233.00 ((SQL16_SP2_QFE-CU).181102-1539) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/1f8acdfa201f4b3fb8fd8b64013b32be1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0131.5233.00 ((SQL16_SP2_QFE-CU).181102-1539) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/45097423fa97421fb2c60e85d141580c2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0131.5233.00 ((SQL16_SP2_QFE-CU).181102-1539) +``` + +# SQL Server 2016 SP2 CU3 - 13.0.5216.0 - x64 (KB4458871) +``` powershell +# SQL Server 2016 SP2 CU3 - 13.0.5216.0 - x64 (KB4458871) +$outputFolder = 'c:\sqlsyms\13.0.5216.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/f9c66f15cdc3472da5b316372a3cd0c62/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0131.5216.00 ((SQL16_SP2_QFE-CU).180913-2138) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/4eb925dc9f414f4293fb048931c1d1d12/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0131.5216.00 ((SQL16_SP2_QFE-CU).180913-2138) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/2aaea59f054945b1948f09a286af4aa22/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0131.5216.00 ((SQL16_SP2_QFE-CU).180913-2138) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/d9a41e1b050741a9915c9f2f68841b662/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0131.5216.00 ((SQL16_SP2_QFE-CU).180913-2138) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/127cbf6e83634f56858c143daccdf3472/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0131.5216.00 ((SQL16_SP2_QFE-CU).180913-2138) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/8cd3001646bb4bee9fa7b29c4e3c424d2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0131.5216.00 ((SQL16_SP2_QFE-CU).180913-2138) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/cef124fae1224970a283718094129ec41/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0131.5216.00 ((SQL16_SP2_QFE-CU).180913-2138) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/3428a25be3a1405bb9e935aa5e5a5f921/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0131.5216.00 ((SQL16_SP2_QFE-CU).180913-2138) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/86edaf9016ec43d49af82793f7361d011/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0131.5216.00 ((SQL16_SP2_QFE-CU).180913-2138) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/25fb6b2428844941bc633974f50616bc1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0131.5216.00 ((SQL16_SP2_QFE-CU).180913-2138) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/df83d51fbc304a579684e3c308750cba2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0131.5216.00 ((SQL16_SP2_QFE-CU).180913-2138) +``` + +# SQL Server 2016 SP2 CU2 + Security Update - 13.0.5201.2 - x64 (KB4458621) +``` powershell +# SQL Server 2016 SP2 CU2 + Security Update - 13.0.5201.2 - x64 (KB4458621) +$outputFolder = 'c:\sqlsyms\13.0.5201.2\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/048d5147a1fb4e80b787588ffc9fc1e62/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0131.5201.02 ((SQL16_SP2_QFE-CU).180818-0710) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/a75b883c7cf144338e088ca1afe44c472/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0131.5201.02 ((SQL16_SP2_QFE-CU).180818-0710) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/fadd356647c4454191fdf160228f57e72/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0131.5201.02 ((SQL16_SP2_QFE-CU).180818-0710) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/55d8b0e99a7446308229c50cefdd930e2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0131.5201.02 ((SQL16_SP2_QFE-CU).180818-0710) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/f7a6fc258016430597598d515e0a483f2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0131.5201.02 ((SQL16_SP2_QFE-CU).180818-0710) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/8f9e0659b5514f89b3cac5bdcfc7e3882/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0131.5201.02 ((SQL16_SP2_QFE-CU).180818-0710) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/ecb9fb39a89c4e59b3daad0b525fa9b71/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0131.5201.02 ((SQL16_SP2_QFE-CU).180818-0710) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/9ecba208484247eaa0a0e2d43c3bbb5d1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0131.5201.02 ((SQL16_SP2_QFE-CU).180818-0710) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/d05ba204ab6d4176bfa45358d8bc42121/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0131.5201.02 ((SQL16_SP2_QFE-CU).180818-0710) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/41df1265eeed4d5086844d85018088bf1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0131.5201.02 ((SQL16_SP2_QFE-CU).180818-0710) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/8360d2c4f315435cb1a449b1ebe4a68a2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0131.5201.02 ((SQL16_SP2_QFE-CU).180818-0710) +``` + +# SQL Server 2016 SP2 CU2 - 13.0.5153.0 - x64 (KB4340355) +``` powershell +# SQL Server 2016 SP2 CU2 - 13.0.5153.0 - x64 (KB4340355) +$outputFolder = 'c:\sqlsyms\13.0.5153.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/fddc412a5dcb40429eda4fb2f4fb09572/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0131.5153.00 ((SQL16_SP2_QFE-CU).180628-1652) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/dd1807b4810a4aee89a261e957c2d8f92/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0131.5153.00 ((SQL16_SP2_QFE-CU).180628-1652) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/0e02593224ce4b00a8ae88c15f7554822/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0131.5153.00 ((SQL16_SP2_QFE-CU).180628-1652) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/7f96e1cef4e24bd58ce1bfb0097d7bd62/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0131.5153.00 ((SQL16_SP2_QFE-CU).180628-1652) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/cbb698692191446e8e63cbb247cb4abe2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0131.5153.00 ((SQL16_SP2_QFE-CU).180628-1652) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/ce4e0c0acef54b2e889a6e92ce618f3b2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0131.5153.00 ((SQL16_SP2_QFE-CU).180628-1652) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/8b8a156300244f6d998e9518bf3655741/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0131.5153.00 ((SQL16_SP2_QFE-CU).180628-1652) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/f332d042c9ba422c8fb4dadb8ad6bd601/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0131.5153.00 ((SQL16_SP2_QFE-CU).180628-1652) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/f507bb1cdc6b4c46b06676fde5cdf8c71/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0131.5153.00 ((SQL16_SP2_QFE-CU).180628-1652) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/9689d6f86afc4da78d5cfb3bfbe5950b1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0131.5153.00 ((SQL16_SP2_QFE-CU).180628-1652) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/bb2788ca8bc24a8cac395d4371de62422/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0131.5153.00 ((SQL16_SP2_QFE-CU).180628-1652) +``` + +# SQL Server 2016 SP2 CU1 - 13.0.5149.0 - x64 (KB4135048) +``` powershell +# SQL Server 2016 SP2 CU1 - 13.0.5149.0 - x64 (KB4135048) +$outputFolder = 'c:\sqlsyms\13.0.5149.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/6d9698a353374e5c938b2acb7ee7ed362/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0131.5149.00 ((SQL16_SP2_QFE-CU).180519-0907) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/37faf9a6bc2b4d16a8d962d486092a302/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0131.5149.00 ((SQL16_SP2_QFE-CU).180519-0907) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/271e230238254765bcd979679d6b56982/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0131.5149.00 ((SQL16_SP2_QFE-CU).180519-0907) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/9f9dc614a58242c2a85acc563e431db62/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0131.5149.00 ((SQL16_SP2_QFE-CU).180519-0907) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/bf258f9a750546b6a8b936b4970b7eca2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0131.5149.00 ((SQL16_SP2_QFE-CU).180519-0907) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/b896f5579e09485e9d9eec87d67b676f2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0131.5149.00 ((SQL16_SP2_QFE-CU).180519-0907) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/3cd9ede70ebf4e4185992fe4fa65b2d61/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0131.5149.00 ((SQL16_SP2_QFE-CU).180519-0907) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/f31fd9f5e3ef4fe096cf59903c387f4b1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0131.5149.00 ((SQL16_SP2_QFE-CU).180519-0907) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/762df1defe62466280d87d81794865c61/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0131.5149.00 ((SQL16_SP2_QFE-CU).180519-0907) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/72d4af7f134e4cb49edcccf5f4cf383f1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0131.5149.00 ((SQL16_SP2_QFE-CU).180519-0907) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/c5ce87b693a14696b7df5cb69aee3d442/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0131.5149.00 ((SQL16_SP2_QFE-CU).180519-0907) +``` + +# SQL Server 2016 SP2 SP2 - 13.0.5026.0 - x64 (KB4052908) +``` powershell +# SQL Server 2016 SP2 SP2 - 13.0.5026.0 - x64 (KB4052908) +$outputFolder = 'c:\sqlsyms\13.0.5026.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/efc619ab5524425aa224c623beaf4a662/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0131.5026.00 ((SQL16_PCU_Main).180318-0835) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/104358b4c4b04eec8a75e36af274c29f2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0131.5026.00 ((SQL16_PCU_Main).180318-0835) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/cae1133e7ab54002a38c876e49559d222/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0131.5026.00 ((SQL16_PCU_Main).180318-0835) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/8f07285b69314e478c481af6c60aa28e2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0131.5026.00 ((SQL16_PCU_Main).180318-0835) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/c390e4f8204e4d87a76a44032594be0d2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0131.5026.00 ((SQL16_PCU_Main).180318-0835) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/4f2f9273fda643d4a2dfd31a67e93a0e2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0131.5026.00 ((SQL16_PCU_Main).180318-0835) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/7866454b831848c5b5de93b2b03fb8491/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0131.5026.00 ((SQL16_PCU_Main).180318-0835) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/445daee2af1a43f295208380348074031/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0131.5026.00 ((SQL16_PCU_Main).180318-0835) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/6c004a1c95204734b6cef4f8511617421/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0131.5026.00 ((SQL16_PCU_Main).180318-0835) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/a6047d2982024452905f1fff97fa11421/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0131.5026.00 ((SQL16_PCU_Main).180318-0835) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/ee2324e08c3e4f42acf1572a9cb62d9e2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0131.5026.00 ((SQL16_PCU_Main).180318-0835) +``` + +# SQL Server 2016 SP1 CU15 - 13.0.4574.0 - x64 (KB4495257) +``` powershell +# SQL Server 2016 SP1 CU15 - 13.0.4574.0 - x64 (KB4495257) +$outputFolder = 'c:\sqlsyms\13.0.4574.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/da14e7ceb24d4c2890b2bde9a03778e52/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.4574.00 ((SQL16_SP1_QFE-CU).190427-1658) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/d0dc0e05673549c39349963e9c6115eb2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.4574.00 ((SQL16_SP1_QFE-CU).190427-1658) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/003624ea1e0642a58b9040c5811ecc372/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.4574.00 ((SQL16_SP1_QFE-CU).190427-1658) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/c408c0723f014e5f90286bc7c822f7142/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.4574.00 ((SQL16_SP1_QFE-CU).190427-1658) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/205c4da00f5c4795a18730dd162b0e5c2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.4574.00 ((SQL16_SP1_QFE-CU).190427-1658) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/7d0210ad6c38483d82d5a673f656490b2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.4574.00 ((SQL16_SP1_QFE-CU).190427-1658) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/e5157d95993b4804b14b3ba28ac25a4e1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0130.4574.00 ((SQL16_SP1_QFE-CU).190427-1658) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/6c807a6e0bfe4a3d8ddbebb9c5df94b21/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0130.4574.00 ((SQL16_SP1_QFE-CU).190427-1658) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/04e55a9040ff4d5a901fb9edb3f714ba1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0130.4574.00 ((SQL16_SP1_QFE-CU).190427-1658) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/0d0627accf6849419318444c37eb8fb61/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.4574.00 ((SQL16_SP1_QFE-CU).190427-1658) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/16d8c4351bdc40ac9997dfc601968a8e2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.4574.00 ((SQL16_SP1_QFE-CU).190427-1658) +``` + +# SQL Server 2016 SP1 CU14 - 13.0.4560.0 - x64 (KB4488535) +``` powershell +# SQL Server 2016 SP1 CU14 - 13.0.4560.0 - x64 (KB4488535) +$outputFolder = 'c:\sqlsyms\13.0.4560.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/6a1934433512464b8b8ed905ad930ee62/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.4560.00 ((SQL16_SP1_QFE-CU).190312-0204) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/4d031e02b20c495c8581a9a757ae5fad2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.4560.00 ((SQL16_SP1_QFE-CU).190312-0204) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/fe7ef391534148c79622e391200336c42/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.4560.00 ((SQL16_SP1_QFE-CU).190312-0204) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/55eb1336f7f74ba48038b7c00dd46a0d2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.4560.00 ((SQL16_SP1_QFE-CU).190312-0204) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/cf41b9625c804b5c8cbc1a77ebc6330b2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.4560.00 ((SQL16_SP1_QFE-CU).190312-0204) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/9179e43956784d1ebdbffe52d6a40c5e2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.4560.00 ((SQL16_SP1_QFE-CU).190312-0204) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/c5be83b1f16440bc8f708236c273c2051/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0130.4560.00 ((SQL16_SP1_QFE-CU).190312-0204) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/15a13e10244142eb9d45aff1353423771/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0130.4560.00 ((SQL16_SP1_QFE-CU).190312-0204) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/a7b733870ad24fdfae1196da3201bee41/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0130.4560.00 ((SQL16_SP1_QFE-CU).190312-0204) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/33d27befeb5c4432830896ac70de90501/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.4560.00 ((SQL16_SP1_QFE-CU).190312-0204) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/9d0d577195464804b2e7e408f64f87d32/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.4560.00 ((SQL16_SP1_QFE-CU).190312-0204) +``` + +# SQL Server 2016 SP1 CU13 - 13.0.4550.1 - x64 (KB4475775) +``` powershell +# SQL Server 2016 SP1 CU13 - 13.0.4550.1 - x64 (KB4475775) +$outputFolder = 'c:\sqlsyms\13.0.4550.1\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/a9a4c14c343f48969f80364f590898602/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.4550.01 ((SQL16_SP1_QFE-CU).190110-1903) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/12140f43a3c84dc99114f1db9d63442b2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.4550.01 ((SQL16_SP1_QFE-CU).190110-1903) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/2485f60633124761be7e478491159c092/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.4550.01 ((SQL16_SP1_QFE-CU).190110-1903) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/4d617c540beb4fc59140e9f8547c57962/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.4550.01 ((SQL16_SP1_QFE-CU).190110-1903) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/c3061b6d621e4d1081838f523ef808d62/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.4550.01 ((SQL16_SP1_QFE-CU).190110-1903) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/22da8e8de40543f8aa01fb1b02a60e5c2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.4550.01 ((SQL16_SP1_QFE-CU).190110-1903) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/1a8accfb14c14072a4929654c400f8491/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0130.4550.01 ((SQL16_SP1_QFE-CU).190110-1903) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/c765c8f7785e4598b640f828d81fd9851/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0130.4550.01 ((SQL16_SP1_QFE-CU).190110-1903) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/30268bd8d01d40d0be47fb9ce30522021/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0130.4550.01 ((SQL16_SP1_QFE-CU).190110-1903) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/4c1f27348acd463dbe00df9477d840c51/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.4550.01 ((SQL16_SP1_QFE-CU).190110-1903) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/5c4f7f0fbb6a42689720fe6353a343e92/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.4550.01 ((SQL16_SP1_QFE-CU).190110-1903) +``` + +# SQL Server 2016 SP1 CU12 - 13.0.4541.0 - x64 (KB4464343) +``` powershell +# SQL Server 2016 SP1 CU12 - 13.0.4541.0 - x64 (KB4464343) +$outputFolder = 'c:\sqlsyms\13.0.4541.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/d3080f42570f4bf0a4a837a8895ca7902/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.4541.00 ((SQL16_SP1_QFE-CU).181026-1658) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/4dce2e3f19f74c31b5a6ac2af6a9d8262/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.4541.00 ((SQL16_SP1_QFE-CU).181026-1658) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/18954e55372343d5a4d6681895c263ea2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.4541.00 ((SQL16_SP1_QFE-CU).181026-1658) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/9aac7f2866b540b4ab2c1b9ac9e577a72/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.4541.00 ((SQL16_SP1_QFE-CU).181026-1658) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/8093743906d24ebbbaf34109d536867b2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.4541.00 ((SQL16_SP1_QFE-CU).181026-1658) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/c7333000708848b794283812c1bb4c1f2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.4541.00 ((SQL16_SP1_QFE-CU).181026-1658) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/c1238bf343b747f7b8b337f438942c711/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0130.4541.00 ((SQL16_SP1_QFE-CU).181026-1658) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/7f07d29b92d74e038aec8d7d0dd4b36b1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0130.4541.00 ((SQL16_SP1_QFE-CU).181026-1658) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/98c1ec14b1674f1c86ddd4ceb6ccf6fa1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0130.4541.00 ((SQL16_SP1_QFE-CU).181026-1658) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/06a0750893f44304ad32a17a180927f21/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.4541.00 ((SQL16_SP1_QFE-CU).181026-1658) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/7162e87a93b346bba5752ed81f9b57202/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.4541.00 ((SQL16_SP1_QFE-CU).181026-1658) +``` + +# SQL Server 2016 SP1 CU11 - 13.0.4528.0 - x64 (KB4459676) +``` powershell +# SQL Server 2016 SP1 CU11 - 13.0.4528.0 - x64 (KB4459676) +$outputFolder = 'c:\sqlsyms\13.0.4528.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/49f484665e944b7b955f47ac457f6f132/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.4528.00 ((SQL16_SP1_QFE-CU).180830-2114) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/db189aef1bba4446a2162ff54266b4ce2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.4528.00 ((SQL16_SP1_QFE-CU).180830-2114) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/e1bc1af368224105abe4120dbdb73f832/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.4528.00 ((SQL16_SP1_QFE-CU).180830-2114) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/33537b3dbc714ad39948f5a027e02e042/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.4528.00 ((SQL16_SP1_QFE-CU).180830-2114) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/d4a5c566de5f4e8cbc0724155e6897252/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.4528.00 ((SQL16_SP1_QFE-CU).180830-2114) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/6abb1e2ee2324531a59ef3e3532c7a012/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.4528.00 ((SQL16_SP1_QFE-CU).180830-2114) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/af8f4fe9f42b47208ffae42cd1cd846d1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0130.4528.00 ((SQL16_SP1_QFE-CU).180830-2114) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/2da374ada649478aa35648edc58188811/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0130.4528.00 ((SQL16_SP1_QFE-CU).180830-2114) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/f073ed383da5472da181faca36520b1e1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0130.4528.00 ((SQL16_SP1_QFE-CU).180830-2114) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/9f53ea00e8104275af6dbf64e1b6a3591/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.4528.00 ((SQL16_SP1_QFE-CU).180830-2114) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/2dc4533ebfec420a88bcb188833b50db2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.4528.00 ((SQL16_SP1_QFE-CU).180830-2114) +``` + +# SQL Server 2016 SP1 CU10 + Security Update - 13.0.4522.0 - x64 (KB4293808) +``` powershell +# SQL Server 2016 SP1 CU10 + Security Update - 13.0.4522.0 - x64 (KB4293808) +$outputFolder = 'c:\sqlsyms\13.0.4522.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/2c80618f9f82487ba2385a9cc3ddf88f2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.4522.00 ((SQL16_SP1_QFE-CU).180717-2208) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/0fae990bea634884b2bb03ef48ae0f9c2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.4522.00 ((SQL16_SP1_QFE-CU).180717-2208) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/744610eb2fed4fe28992cb1051af89f52/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.4522.00 ((SQL16_SP1_QFE-CU).180717-2208) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/231b6d23fea44f0e9978b2903e55f98c2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.4522.00 ((SQL16_SP1_QFE-CU).180717-2208) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/9ebc1faac19940a2913209dedfe0a8fb2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.4522.00 ((SQL16_SP1_QFE-CU).180717-2208) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/920fc8ef2b144b92b9e500f34c7a71292/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.4522.00 ((SQL16_SP1_QFE-CU).180717-2208) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/0f4ea0db1e374ab5aa9c527249a56a5b1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0130.4522.00 ((SQL16_SP1_QFE-CU).180717-2208) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/48c8d8e079b5402da40b9db2b50d98381/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0130.4522.00 ((SQL16_SP1_QFE-CU).180717-2208) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/332f649e9f7a4444b0e7f810cfe46daf1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0130.4522.00 ((SQL16_SP1_QFE-CU).180717-2208) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/306b24badfce478b88e7cc9bf4f158ba1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.4522.00 ((SQL16_SP1_QFE-CU).180717-2208) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/1900f69e405d454783d12534bc3e62232/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.4522.00 ((SQL16_SP1_QFE-CU).180717-2208) +``` + +# SQL Server 2016 SP1 CU10 - 13.0.4514.0 - x64 (KB4341569) +``` powershell +# SQL Server 2016 SP1 CU10 - 13.0.4514.0 - x64 (KB4341569) +$outputFolder = 'c:\sqlsyms\13.0.4514.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/eba3127f55a6490b925ac53a6af5ef262/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.4514.00 ((SQL16_SP1_QFE-CU).180622-1535) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/c36664a87ee44edc82989935ce8fa1ad2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.4514.00 ((SQL16_SP1_QFE-CU).180622-1535) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/7b867a51f536452a95636acf588d0cef2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.4514.00 ((SQL16_SP1_QFE-CU).180622-1535) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/4f050afd2b5b4cacb6ff7c302f5ce5c72/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.4514.00 ((SQL16_SP1_QFE-CU).180622-1535) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/e4ce24f005df4299b285c9da1050c01e2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.4514.00 ((SQL16_SP1_QFE-CU).180622-1535) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/ad7c0ab9750744a9985d59afa1474dda2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.4514.00 ((SQL16_SP1_QFE-CU).180622-1535) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/6a522b1480b54288a132ac67e8da49e51/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0130.4514.00 ((SQL16_SP1_QFE-CU).180622-1535) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/e63e19d43fb24d81b84c1208c96984ac1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0130.4514.00 ((SQL16_SP1_QFE-CU).180622-1535) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/7f5068607ec14c409d9d04c56ac9e1731/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0130.4514.00 ((SQL16_SP1_QFE-CU).180622-1535) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/0e87037690c64c06ac41a9db319a970f1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.4514.00 ((SQL16_SP1_QFE-CU).180622-1535) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/0840ef6023a7422f90acbfc2bfe60dfe2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.4514.00 ((SQL16_SP1_QFE-CU).180622-1535) +``` + +# SQL Server 2016 SP1 CU9 - 13.0.4502.0 - x64 (KB4100997) +``` powershell +# SQL Server 2016 SP1 CU9 - 13.0.4502.0 - x64 (KB4100997) +$outputFolder = 'c:\sqlsyms\13.0.4502.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/ee6e6cc4172f49ca87933514afe4929b2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.4502.00 ((SQL16_SP1_QFE-CU).180514-1334) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/2676f65ef4f14e1c9a6b62a9d1522fe82/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.4502.00 ((SQL16_SP1_QFE-CU).180514-1334) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/7dfceb96c58c453ba4e3d8a1ca78615d2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.4502.00 ((SQL16_SP1_QFE-CU).180514-1334) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/7f8a037059454eba99b698a776696daa2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.4502.00 ((SQL16_SP1_QFE-CU).180514-1334) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/334ffbfb732c4fc79e4e3513e5027a3d2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.4502.00 ((SQL16_SP1_QFE-CU).180514-1334) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/b561f4e3c38e4562b7972ea695cffc4c2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.4502.00 ((SQL16_SP1_QFE-CU).180514-1334) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/cf91d9718d41483bb4606f54896f9c3e1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0130.4502.00 ((SQL16_SP1_QFE-CU).180514-1334) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/fca548701ad64b9eb0f58be2ab0dccf11/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0130.4502.00 ((SQL16_SP1_QFE-CU).180514-1334) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/5cc13763d5064b6d97d9f1cc1ecaa20c1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0130.4502.00 ((SQL16_SP1_QFE-CU).180514-1334) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/beda030e12954da6a9eba8922683f73e1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.4502.00 ((SQL16_SP1_QFE-CU).180514-1334) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/2a17dec666134d14a64d767ef4aebe202/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.4502.00 ((SQL16_SP1_QFE-CU).180514-1334) +``` + +# SQL Server 2016 SP1 CU8 - 13.0.4474.0 - x64 (KB4077064) +``` powershell +# SQL Server 2016 SP1 CU8 - 13.0.4474.0 - x64 (KB4077064) +$outputFolder = 'c:\sqlsyms\13.0.4474.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/bad09995ed274e949232badd3f3d7aa82/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.4474.00 ((SQL16_SP1_QFE-CU).180224-1012) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/ddf784b88c44464fbbef4a3c309436392/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.4474.00 ((SQL16_SP1_QFE-CU).180224-1012) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/04aab3b7206c46a9b777313cc33d57402/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.4474.00 ((SQL16_SP1_QFE-CU).180224-1012) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/ef2f100c08554e4398658ca191205f162/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.4474.00 ((SQL16_SP1_QFE-CU).180224-1012) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/4b20376587754240a8157ec3f5c827102/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.4474.00 ((SQL16_SP1_QFE-CU).180224-1012) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/61506f0f9d5240c18416dae8f808755e2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.4474.00 ((SQL16_SP1_QFE-CU).180224-1012) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/7e93929a70af49a98c0d3a9d10d24d841/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0130.4474.00 ((SQL16_SP1_QFE-CU).180224-1012) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/e66b4e3643c94f26862bcdbcae4df7901/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0130.4474.00 ((SQL16_SP1_QFE-CU).180224-1012) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/48c28f25191a4ee0b7a4810e6c0f29f71/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0130.4474.00 ((SQL16_SP1_QFE-CU).180224-1012) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/ea990dbdb39247fbbd083d2de5f867d71/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.4474.00 ((SQL16_SP1_QFE-CU).180224-1012) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/0d79a37d6dda4c28aa9dea14724f12f52/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.4474.00 ((SQL16_SP1_QFE-CU).180224-1012) +``` + +# SQL Server 2016 SP1 CU7 - 13.0.4466.4 - x64 (KB4057119) +``` powershell +# SQL Server 2016 SP1 CU7 - 13.0.4466.4 - x64 (KB4057119) +$outputFolder = 'c:\sqlsyms\13.0.4466.4\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/4fb77886edcf4e9d89fac79ebf7d1fea2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.4466.04 ((SQL16_SP1_QFE-CU).171222-1041) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/04bc3e5a0e4f471e9b96d67c5e3f36df2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.4466.04 ((SQL16_SP1_QFE-CU).171222-1041) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/75cbabc14dbe4b78b399b0e5f88a97092/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.4466.04 ((SQL16_SP1_QFE-CU).171222-1041) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/c68cc2cb6c074e39881a844eec9778f82/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.4466.04 ((SQL16_SP1_QFE-CU).171222-1041) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/bf98529869b64e518f5afd9c0c5079c82/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.4466.04 ((SQL16_SP1_QFE-CU).171222-1041) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/9215ec6a12bf4d20a9e6798034e2036e2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.4466.04 ((SQL16_SP1_QFE-CU).171222-1041) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/33d2f4d2ce9c4e3ebb58b76dd1c289a81/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0130.4466.04 ((SQL16_SP1_QFE-CU).171222-1041) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/7aa9d469ad5e42b8b414338158cf15b41/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0130.4466.04 ((SQL16_SP1_QFE-CU).171222-1041) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/f86b9c579a474a3fac7812d34b52bf221/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0130.4466.04 ((SQL16_SP1_QFE-CU).171222-1041) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/893d1525c26945cf827a45f9b043e5eb1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.4466.04 ((SQL16_SP1_QFE-CU).171222-1041) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/c583e52b9d604d4da427ceb43ab482252/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.4466.04 ((SQL16_SP1_QFE-CU).171222-1041) +``` + +# SQL Server 2016 SP1 CU6 - 13.0.4457.0 - x64 (KB4037354) +``` powershell +# SQL Server 2016 SP1 CU6 - 13.0.4457.0 - x64 (KB4037354) +$outputFolder = 'c:\sqlsyms\13.0.4457.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/db2fe36302c64a1a86813d0549b22b012/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.4457.00 ((SQL16_SP1_QFE-CU).171108-1347) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/9cdf1937cd024f1e82060b74e9e60e512/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.4457.00 ((SQL16_SP1_QFE-CU).171108-1347) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/046a40a60ddc486086561319f5387e142/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.4457.00 ((SQL16_SP1_QFE-CU).171108-1347) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/2547dc27f1324d3fbb7daad4793c6cf12/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.4457.00 ((SQL16_SP1_QFE-CU).171108-1347) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/1a145eacaf05435abe69b319f8277b9c2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.4457.00 ((SQL16_SP1_QFE-CU).171108-1347) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/90a48bebb7f84ca9884ca115fa7ed9c32/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.4457.00 ((SQL16_SP1_QFE-CU).171108-1347) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/3daff9d0abe941b08003e61197ce4ede1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0130.4457.00 ((SQL16_SP1_QFE-CU).171108-1347) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/9bb39bd5bd404d9b8693d476a4976c381/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0130.4457.00 ((SQL16_SP1_QFE-CU).171108-1347) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/b76a518cfcad45f5bc36600f200d8df51/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0130.4457.00 ((SQL16_SP1_QFE-CU).171108-1347) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/5028c6a5a3bf40fb893b7034820c6ea81/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.4457.00 ((SQL16_SP1_QFE-CU).171108-1347) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/853cc6b85b6049bb8e28d35007644cf22/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.4457.00 ((SQL16_SP1_QFE-CU).171108-1347) +``` + +# SQL Server 2016 SP1 CU5 - 13.0.4451.0 - x64 (KB4040714) +``` powershell +# SQL Server 2016 SP1 CU5 - 13.0.4451.0 - x64 (KB4040714) +$outputFolder = 'c:\sqlsyms\13.0.4451.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/0adf0efaa0674d52b42ede2653b2bc792/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.4451.00 ((SQL16_SP1_QFE-CU).170905-1437) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/9c9bc2d7227d4a44826cc162dc9364782/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.4451.00 ((SQL16_SP1_QFE-CU).170905-1437) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/00a5c9de969c45918756df4cfd8c6f682/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.4451.00 ((SQL16_SP1_QFE-CU).170905-1437) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/01e048da3e0c4ca4bdf473066c7cf6c62/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.4451.00 ((SQL16_SP1_QFE-CU).170905-1437) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/bc8c89cf69be4fd3a3364dcb0a72dca52/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.4451.00 ((SQL16_SP1_QFE-CU).170905-1437) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/360009d4947e4ac08be932e3f16b2ccb2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.4451.00 ((SQL16_SP1_QFE-CU).170905-1437) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/8a5bedd54909459eb41b76521723683b1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.4451.00 ((SQL16_SP1_QFE-CU).170905-1437) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/57c8fa0d82c643d290ab9530b788e4d42/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.4451.00 ((SQL16_SP1_QFE-CU).170905-1437) +``` + +# SQL Server 2016 SP1 CU4 - 13.0.4446.0 - x64 (KB4024305) +``` powershell +# SQL Server 2016 SP1 CU4 - 13.0.4446.0 - x64 (KB4024305) +$outputFolder = 'c:\sqlsyms\13.0.4446.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/c880090278d9483faab63d7472a628ba2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.4446.00 ((SQL16_SP1_QFE-CU).170716-1734) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/ea6d107876b848c990276c5164f78e222/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.4446.00 ((SQL16_SP1_QFE-CU).170716-1734) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/d41f27d7505149d2a9d14483961593b92/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.4446.00 ((SQL16_SP1_QFE-CU).170716-1734) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/92e8bee376394dcb8a2a52800b39f5092/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.4446.00 ((SQL16_SP1_QFE-CU).170716-1734) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/149150e4cdbf4baf80620e32ef97fc012/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.4446.00 ((SQL16_SP1_QFE-CU).170716-1734) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/6cd22e703a544fac840bae7b3ab83c132/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.4446.00 ((SQL16_SP1_QFE-CU).170716-1734) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/76b434a7b537413da49b849be7bbd2b91/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0130.4446.00 ((SQL16_SP1_QFE-CU).170716-1734) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/eaaa9a9973f6411495bf3d00bb06f8f11/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0130.4446.00 ((SQL16_SP1_QFE-CU).170716-1734) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/b8813f5978cf4a3dba90881436bb77f71/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0130.4446.00 ((SQL16_SP1_QFE-CU).170716-1734) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/0a7f20ebf1024eaf8a1ffd2b239bfa4e1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.4446.00 ((SQL16_SP1_QFE-CU).170716-1734) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/eab3cf5200994d3eb10eaa1a884a3ef12/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.4446.00 ((SQL16_SP1_QFE-CU).170716-1734) +``` + +# SQL Server 2016 SP1 CU3 - 13.0.4435.0 - x64 (KB4019916) +``` powershell +# SQL Server 2016 SP1 CU3 - 13.0.4435.0 - x64 (KB4019916) +$outputFolder = 'c:\sqlsyms\13.0.4435.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/8fe09624812049058da82aa8f1dd66f22/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.4435.00 ((SQL16_SP1_QFE-CU).170427-1707) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/558322e65c7e4b328939747b49d560902/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.4435.00 ((SQL16_SP1_QFE-CU).170427-1707) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/470aff4a91ac4921b55a2172551f7bf12/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.4435.00 ((SQL16_SP1_QFE-CU).170427-1707) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/3149ea1cf3e144a595628fffafeb88fd2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.4435.00 ((SQL16_SP1_QFE-CU).170427-1707) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/0d9fe1a60fe342c1a1ce09de7ccdbd2a2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.4435.00 ((SQL16_SP1_QFE-CU).170427-1707) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/225b08e74e474943bc4e1122946cbf532/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.4435.00 ((SQL16_SP1_QFE-CU).170427-1707) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/de75b23f05c440f9a563565af615e1391/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0130.4435.00 ((SQL16_SP1_QFE-CU).170427-1707) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/08b0902123f545b6bbbcd419f6f8cb5b1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0130.4435.00 ((SQL16_SP1_QFE-CU).170427-1707) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/cc9c2fb0544943e48eb8e300255313191/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0130.4435.00 ((SQL16_SP1_QFE-CU).170427-1707) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/320d5955652048e78f2fc910d1eef2d51/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.4435.00 ((SQL16_SP1_QFE-CU).170427-1707) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/ded87b2c33dd49fd93d4daed66d9092f2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.4435.00 ((SQL16_SP1_QFE-CU).170427-1707) +``` + +# SQL Server 2016 SP1 CU2 - 13.0.4422.0 - x64 (KB4013106) +``` powershell +# SQL Server 2016 SP1 CU2 - 13.0.4422.0 - x64 (KB4013106) +$outputFolder = 'c:\sqlsyms\13.0.4422.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/cb638c12b4674d87ac7357f16e8ad0c32/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.4422.00 ((SQL16_SP1_QFE-CU).170306-1319) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/6cf52c50743545e3b6a49ff43d1379152/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.4422.00 ((SQL16_SP1_QFE-CU).170306-1319) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/bc808d257868486f8231cded7542228e2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.4422.00 ((SQL16_SP1_QFE-CU).170306-1319) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/be2f8736bbab4e6d9dddd5e2ee23c5ce2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.4422.00 ((SQL16_SP1_QFE-CU).170306-1319) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/7a42c58c49904f169a5aff489be7369b2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.4422.00 ((SQL16_SP1_QFE-CU).170306-1319) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/997d7a6a523843b08a2ae10c5d75534d2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.4422.00 ((SQL16_SP1_QFE-CU).170306-1319) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/c2b0f4c16c5a4e509441c8338aa5ec1c1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0130.4422.00 ((SQL16_SP1_QFE-CU).170306-1319) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/28f240977ff44072aa8e8b2a7d60ba641/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0130.4422.00 ((SQL16_SP1_QFE-CU).170306-1319) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/270d0aa365954e83ae7d1df1408d6d9a1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0130.4422.00 ((SQL16_SP1_QFE-CU).170306-1319) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/3b16a7b538974a81bf76596ef78cb3381/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.4422.00 ((SQL16_SP1_QFE-CU).170306-1319) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/65b28e59df5346238c2bb00123ee4d2b2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.4422.00 ((SQL16_SP1_QFE-CU).170306-1319) +``` + +# SQL Server 2016 SP1 CU1 - 13.0.4411.0 - x64 (KB3208177) +``` powershell +# SQL Server 2016 SP1 CU1 - 13.0.4411.0 - x64 (KB3208177) +$outputFolder = 'c:\sqlsyms\13.0.4411.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/268a89d9ed10413ba41fe54bf2d75b1e2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.4411.00 ((SQL16_SP1_QFE-CU).170106-1315) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/c9ead68f28c24061a124762b8351b6f82/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.4411.00 ((SQL16_SP1_QFE-CU).170106-1315) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/74b5f464baac4a9484c931946ae5b68f2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.4411.00 ((SQL16_SP1_QFE-CU).170106-1315) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/3c313be76f2444939a67caf043f53d7f2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.4411.00 ((SQL16_SP1_QFE-CU).170106-1315) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/84c8f12c82c44a1392d6f65ef1a318b52/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.4411.00 ((SQL16_SP1_QFE-CU).170106-1315) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/549f12f6d342442cb72a078cabc0b0362/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.4411.00 ((SQL16_SP1_QFE-CU).170106-1315) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/e2fa7e5dba454b9b88a2a1d96b467fd01/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0130.4411.00 ((SQL16_SP1_QFE-CU).170106-1315) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/751d83a8390f4faba2ebd6aafac7f1d51/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0130.4411.00 ((SQL16_SP1_QFE-CU).170106-1315) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/1b95571d967d4731b5e72ed855f469111/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0130.4411.00 ((SQL16_SP1_QFE-CU).170106-1315) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/2821e0a9f1074075bdda62de3e7008c61/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.4411.00 ((SQL16_SP1_QFE-CU).170106-1315) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/826a7546f2db4f3089d413578a2cdf882/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.4411.00 ((SQL16_SP1_QFE-CU).170106-1315) +``` + +# SQL Server 2016 SP1 SP1 - 13.0.4001.0 - x64 (KB3182545) +``` powershell +# SQL Server 2016 SP1 SP1 - 13.0.4001.0 - x64 (KB3182545) +$outputFolder = 'c:\sqlsyms\13.0.4001.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/1d3fa75eb35540e287b2e012d69785df2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.4001.00 ((SQL16_PCU_Main).161028-1734) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/d38058f49e7c4d62970677e4315f1f1c2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.4001.00 ((SQL16_PCU_Main).161028-1734) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/cb9e5b8e0483423cb122da4ad87534d52/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.4001.00 ((SQL16_PCU_Main).161028-1734) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/13cb00e6ed4d46789fadceb55abddfe92/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.4001.00 ((SQL16_PCU_Main).161028-1734) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/c6d08b108b154f8b8431f090dbaab1c92/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.4001.00 ((SQL16_PCU_Main).161028-1734) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/c1220065fb9e4e61919175ac9792a2bc2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.4001.00 ((SQL16_PCU_Main).161028-1734) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/f0fd3061c4be4486b3308828ea99276e1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0130.4001.00 ((SQL16_PCU_Main).161028-1734) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/f53682311a4e427ba43cc7908850cf9d1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0130.4001.00 ((SQL16_PCU_Main).161028-1734) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/f42433ff7c4b4c52b53875da10d4684e1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0130.4001.00 ((SQL16_PCU_Main).161028-1734) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/961e76a609b04a7c935cd8ad827f23381/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.4001.00 ((SQL16_PCU_Main).161028-1734) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/e6e24f9a081b42e3b9e22e1f6414b9b22/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.4001.00 ((SQL16_PCU_Main).161028-1734) +``` + +# SQL Server 2016 RTM CU9 - 13.0.2216.0 - x64 (KB4037357) +``` powershell +# SQL Server 2016 RTM CU9 - 13.0.2216.0 - x64 (KB4037357) +$outputFolder = 'c:\sqlsyms\13.0.2216.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/2c007938542145638d786ebdc67c1c9b2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.2216.00 ((SQL16_RTM_QFE-CU).171109-1343) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/b6c9ba6727b14530bf871a406d0724802/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.2216.00 ((SQL16_RTM_QFE-CU).171109-1343) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/477e9070b1e642a9b166ef3b07e1687b2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.2216.00 ((SQL16_RTM_QFE-CU).171109-1343) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/8946accd7bb14ec18499ee4c4e5e53812/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.2216.00 ((SQL16_RTM_QFE-CU).171109-1343) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/57cbeb8f33464fb69f691482ce8de8d42/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.2216.00 ((SQL16_RTM_QFE-CU).171109-1343) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/abd45d29f555480fadf1990a92e34b252/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.2216.00 ((SQL16_RTM_QFE-CU).171109-1343) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/ff1fa69bac4f4a6ea28eea880c69588e1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0130.2216.00 ((SQL16_RTM_QFE-CU).171109-1343) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/f56e5624d87b4a708ca9f6667aba68a71/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0130.2216.00 ((SQL16_RTM_QFE-CU).171109-1343) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/1ca1e6c22cb548b296414dc80c64f4ef1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0130.2216.00 ((SQL16_RTM_QFE-CU).171109-1343) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/0842b22e9ff84f00bfb066e5a557d3051/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.2216.00 ((SQL16_RTM_QFE-CU).171109-1343) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/e7ba978114ac4b5b9c032b8f1e1be2222/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.2216.00 ((SQL16_RTM_QFE-CU).171109-1343) +``` + +# SQL Server 2016 RTM CU8 - 13.0.2213.0 - x64 (KB4040713) +``` powershell +# SQL Server 2016 RTM CU8 - 13.0.2213.0 - x64 (KB4040713) +$outputFolder = 'c:\sqlsyms\13.0.2213.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/7a0af19f84774e599332cd0db1f1278a2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.2213.00 ((SQL16_RTM_QFE-CU).170905-1430) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/f70df0f1cf3d45b5988d87fa813fe74b2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.2213.00 ((SQL16_RTM_QFE-CU).170905-1430) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/f3809f64b9a8419ea5fa8f35a32197452/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.2213.00 ((SQL16_RTM_QFE-CU).170905-1430) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/7faa03153e474bcc9d8205a253de66df2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.2213.00 ((SQL16_RTM_QFE-CU).170905-1430) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/96aa656777b0457e9b21ebda6ec38f1e2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.2213.00 ((SQL16_RTM_QFE-CU).170905-1430) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/64c55c4c8b894ec191c9a512d64d05932/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.2213.00 ((SQL16_RTM_QFE-CU).170905-1430) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/2610adf0ecd04828af0815caf79e19351/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0130.2213.00 ((SQL16_RTM_QFE-CU).170905-1430) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/901b0c2906cb48e99fb09e1e8cbe9e751/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0130.2213.00 ((SQL16_RTM_QFE-CU).170905-1430) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/e47bab9e66704c33be9edb1c3468aee41/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0130.2213.00 ((SQL16_RTM_QFE-CU).170905-1430) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/07f0e5afd4634724b92cd6d5ac50fbcc1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.2213.00 ((SQL16_RTM_QFE-CU).170905-1430) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/e8186d9274b8415c90bea6dbee62765d2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.2213.00 ((SQL16_RTM_QFE-CU).170905-1430) +``` + +# SQL Server 2016 RTM CU6 - 13.0.2204.0 - x64 (KB4019914) +``` powershell +# SQL Server 2016 RTM CU6 - 13.0.2204.0 - x64 (KB4019914) +$outputFolder = 'c:\sqlsyms\13.0.2204.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/cfb9f1f67ed94f2ca6ce13a87b281a912/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.2204.00 ((SQL16_RTM_QFE-CU).170420-2326) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/e319d277318a43f7bdbfaf7c09e8ea0d2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.2204.00 ((SQL16_RTM_QFE-CU).170420-2326) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/f85c7c7fbcfe4fe2bfde5a9d3faaede92/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.2204.00 ((SQL16_RTM_QFE-CU).170420-2326) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/0bbbf57d7cc6413fbdade7dd8e806f682/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.2204.00 ((SQL16_RTM_QFE-CU).170420-2326) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/10777de046a746f1b118cfcc17d06c2b2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.2204.00 ((SQL16_RTM_QFE-CU).170420-2326) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/0152302a8c624ace9201fe5842e87e012/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.2204.00 ((SQL16_RTM_QFE-CU).170420-2326) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/3b988c8fe7f04e3f974a275a0eeeeb0b1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0130.2204.00 ((SQL16_RTM_QFE-CU).170420-2326) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/b7d84e7993fb4451b2cd97adae2171001/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0130.2204.00 ((SQL16_RTM_QFE-CU).170420-2326) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/c6b1fbc9d12d414b906f7be297838d8a1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0130.2204.00 ((SQL16_RTM_QFE-CU).170420-2326) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/788729ffd2354809b96f60469725732e1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.2204.00 ((SQL16_RTM_QFE-CU).170420-2326) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/0e8610c36c354d36986910b6ef9f99f12/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.2204.00 ((SQL16_RTM_QFE-CU).170420-2326) +``` + +# SQL Server 2016 RTM CU4 - 13.0.2193.0 - x64 (KB3205052) +``` powershell +# SQL Server 2016 RTM CU4 - 13.0.2193.0 - x64 (KB3205052) +$outputFolder = 'c:\sqlsyms\13.0.2193.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/29fff1570c614d079dd399bb465245ba2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.2193.00 ((SQL16_RTM_QFE-CU).170106-1104) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/51387eb8f90f4726aa9df7dd8a937c432/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.2193.00 ((SQL16_RTM_QFE-CU).170106-1104) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/bf13531c7d694d729c441c09b114ba5a2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.2193.00 ((SQL16_RTM_QFE-CU).170106-1104) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/37c497fe00574995b2275c82bd5448222/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.2193.00 ((SQL16_RTM_QFE-CU).170106-1104) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/db92e29b6d7a40a8b447c044382186f52/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.2193.00 ((SQL16_RTM_QFE-CU).170106-1104) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/c564d1d1af464ec4b23625bc349021e82/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.2193.00 ((SQL16_RTM_QFE-CU).170106-1104) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/d83d9a08a6304475973f8c1527e9a18b1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0130.2193.00 ((SQL16_RTM_QFE-CU).170106-1104) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/c9179764a88745b6b27d0340adfe00da1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0130.2193.00 ((SQL16_RTM_QFE-CU).170106-1104) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/0a6f9df489884c5aae89b04a707f77991/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0130.2193.00 ((SQL16_RTM_QFE-CU).170106-1104) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/db44013b2c72466ea3f22c14bdedc55f1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.2193.00 ((SQL16_RTM_QFE-CU).170106-1104) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/0e65448c6e524b05b5e23432481867792/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.2193.00 ((SQL16_RTM_QFE-CU).170106-1104) +``` + +# SQL Server 2016 RTM CU3 - 13.0.2186.6 - x64 (KB3205413) +``` powershell +# SQL Server 2016 RTM CU3 - 13.0.2186.6 - x64 (KB3205413) +$outputFolder = 'c:\sqlsyms\13.0.2186.6\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/2ff2ffcd1aec4430a320031a5b39932a2/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.2186.06 ((SQL16_RTM_QFE-CU).161031-1738) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/7a54654444b3498ea417d266f13be4852/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.2186.06 ((SQL16_RTM_QFE-CU).161031-1738) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/9554edfa9c98497691f273323bcb95cc2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.2186.06 ((SQL16_RTM_QFE-CU).161031-1738) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/c8625b8816e14ab5b1ff2831407f971f2/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.2186.06 ((SQL16_RTM_QFE-CU).161031-1738) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/3293fd4acafd48539b54f36145afa5a62/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.2186.06 ((SQL16_RTM_QFE-CU).161031-1738) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/2581ec9c9a2d477fb3e3b1d87b7a7db42/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.2186.06 ((SQL16_RTM_QFE-CU).161031-1738) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/dcb6d2efe1284ce697e4291b198fccce1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0130.2186.06 ((SQL16_RTM_QFE-CU).161031-1738) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/38d5d0c4e3e94a128f0e8e61535485481/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0130.2186.06 ((SQL16_RTM_QFE-CU).161031-1738) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/f198f8dfc2304e189df71ef4b47851fb1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0130.2186.06 ((SQL16_RTM_QFE-CU).161031-1738) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/9535038ce47847eca6d1a33db6a7497b1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.2186.06 ((SQL16_RTM_QFE-CU).161031-1738) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/f4a805d2b05c4cf0ac5538e5c9d3ef122/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.2186.06 ((SQL16_RTM_QFE-CU).161031-1738) +``` + +# SQL Server 2016 RTM CU2 - 13.0.2164.0 - x64 (KB3182270) +``` powershell +# SQL Server 2016 RTM CU2 - 13.0.2164.0 - x64 (KB3182270) +$outputFolder = 'c:\sqlsyms\13.0.2164.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/940eac419c934059b710be37641e39112/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.2164.00 ((SQL16_RTM_QFE-CU).160909-1949) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/61e79d07815549199699608cf3ebd8a22/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.2164.00 ((SQL16_RTM_QFE-CU).160909-1949) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/0b0fe3a447d74fec8396a46cbcf4ade42/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.2164.00 ((SQL16_RTM_QFE-CU).160909-1949) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/7aee76c9772241c4abab13ba1d825bc02/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.2164.00 ((SQL16_RTM_QFE-CU).160909-1949) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/fc8265399db44d05bb66cf0c53d3a9132/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.2164.00 ((SQL16_RTM_QFE-CU).160909-1949) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/43431b47b3c242f2a76e2d5ca301d0372/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.2164.00 ((SQL16_RTM_QFE-CU).160909-1949) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/956fcfce5bc348a9abe7db682dc7a85e1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0130.2164.00 ((SQL16_RTM_QFE-CU).160909-1949) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/6dc828b4ac564e199c26106da4394a591/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0130.2164.00 ((SQL16_RTM_QFE-CU).160909-1949) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/6e06587843f44870abfb873c263bdd581/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0130.2164.00 ((SQL16_RTM_QFE-CU).160909-1949) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/3717f27071594c5e976040c9e18032df1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.2164.00 ((SQL16_RTM_QFE-CU).160909-1949) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/8c33d4ecd80a4de683073c4e36fe87242/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.2164.00 ((SQL16_RTM_QFE-CU).160909-1949) +``` + +# SQL Server 2016 RTM CU1 - 13.0.2149.0 - x64 (KB3164674) +``` powershell +# SQL Server 2016 RTM CU1 - 13.0.2149.0 - x64 (KB3164674) +$outputFolder = 'c:\sqlsyms\13.0.2149.0\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\sqldk.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqldk.pdb/175d1d9f3e3f4aa5b25e8defb354e9282/sqldk.pdb' -OutFile "$outputFolder\sqldk.pdb" } # File version 2015.0130.2149.00 ((SQL16_RTM_QFE-CU).160711-2134) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/c887519f85984f93a45d804fbd9efa7c2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2015.0130.2149.00 ((SQL16_RTM_QFE-CU).160711-2134) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/52a90f506b934a63bee7f9acb3ecbd592/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2015.0130.2149.00 ((SQL16_RTM_QFE-CU).160711-2134) +if (-not (Test-Path "$outputFolder\sqltses.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqltses.pdb/9285360a585b4659a9178b94d54195e52/sqltses.pdb' -OutFile "$outputFolder\sqltses.pdb" } # File version 2015.0130.2149.00 ((SQL16_RTM_QFE-CU).160711-2134) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/431d7cd65d56492084619a4f2be7de342/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2015.0130.2149.00 ((SQL16_RTM_QFE-CU).160711-2134) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/a4c480d343034344a88ac1b39f672b152/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2015.0130.2149.00 ((SQL16_RTM_QFE-CU).160711-2134) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/501ffaaba03a405c942a3636f744d86f1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2015.0130.2149.00 ((SQL16_RTM_QFE-CU).160711-2134) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/df614cefd0a64503b3f9a8b8e28d62ab1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2015.0130.2149.00 ((SQL16_RTM_QFE-CU).160711-2134) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/7f75cde05cd84c74b27b97fde6200cf21/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2015.0130.2149.00 ((SQL16_RTM_QFE-CU).160711-2134) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/986ce3d6b4334bacb5c924134d2883971/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2015.0130.2149.00 ((SQL16_RTM_QFE-CU).160711-2134) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/d67b0283c81c4a93b4d4ede2af0cec522/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2015.0130.2149.00 ((SQL16_RTM_QFE-CU).160711-2134) +``` + diff --git a/Errors/PDB/SQL-Server-2017.md b/Errors/PDB/SQL-Server-2017.md new file mode 100644 index 00000000..2eac5632 --- /dev/null +++ b/Errors/PDB/SQL-Server-2017.md @@ -0,0 +1,522 @@ +# SQL Server 2017 RTM CU21 - 14.0.3335.7 - x64 (KB4557397) +``` powershell +# SQL Server 2017 RTM CU21 - 14.0.3335.7 - x64 (KB4557397) +$outputFolder = 'c:\sqlsyms\14.0.3335.7\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/eb5a565f1039423ab57f1b0c07f2cf062/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3335.07 ((SQL17_RTM_QFE-CU).200613-0316) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/a95c4feb63e24e859cc3ea84c66738362/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3335.07 ((SQL17_RTM_QFE-CU).200613-0316) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/15abf4bc294f43439f8d26bcc081b7852/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3335.07 ((SQL17_RTM_QFE-CU).200613-0316) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/0b714c2255d248be8e2772ed2614c3252/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3335.07 ((SQL17_RTM_QFE-CU).200613-0316) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/cfa406dc3e6f44fbaecf3bb7bfef85403/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3335.07 ((SQL17_RTM_QFE-CU).200613-0316) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/74e2955f444d4a999afc17aebfc101b62/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3335.07 ((SQL17_RTM_QFE-CU).200613-0316) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/e2a53588492542619e2df6eb2f15fbd81/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3335.07 ((SQL17_RTM_QFE-CU).200613-0316) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/0611eac031eb43e1ba9b7df173a4baaf1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3335.07 ((SQL17_RTM_QFE-CU).200613-0316) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/bee1e0c4ebf047f58848229e8e8080301/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3335.07 ((SQL17_RTM_QFE-CU).200613-0316) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/0f83d02887a64bb38055cec85d9816351/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3335.07 ((SQL17_RTM_QFE-CU).200613-0316) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/ebf1bd99202241e49994b70abd89b06c2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3335.07 ((SQL17_RTM_QFE-CU).200613-0316) +``` + +# SQL Server 2017 RTM CU20 - 14.0.3294.2 - x64 (KB4541283) +``` powershell +# SQL Server 2017 RTM CU20 - 14.0.3294.2 - x64 (KB4541283) +$outputFolder = 'c:\sqlsyms\14.0.3294.2\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/bee1fad8fac344258a08781c73e86ed52/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3294.02 ((SQL17_RTM_QFE-CU).200313-2113) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/2a5c5b4ca34b4406b4458d69ac3e4cae2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3294.02 ((SQL17_RTM_QFE-CU).200313-2113) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/3875b7d16696416f9301c11cef45b20d2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3294.02 ((SQL17_RTM_QFE-CU).200313-2113) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/b50d619829294819a0b07403e79e9ded2/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3294.02 ((SQL17_RTM_QFE-CU).200313-2113) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/32ca1afe76d247de8ddeb0b8bed119763/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3294.02 ((SQL17_RTM_QFE-CU).200313-2113) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/b33c89a9f1bf48dab0da20e1e1f14b372/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3294.02 ((SQL17_RTM_QFE-CU).200313-2113) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/13f6629965894b1a898d22a6075e9d321/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3294.02 ((SQL17_RTM_QFE-CU).200313-2113) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/c56991f0bbb44efd9550bdb640b930921/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3294.02 ((SQL17_RTM_QFE-CU).200313-2113) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/c57fd569df0c4b71827c8a73da6ff82f1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3294.02 ((SQL17_RTM_QFE-CU).200313-2113) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/120c44132c254546a280305c87974fd41/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3294.02 ((SQL17_RTM_QFE-CU).200313-2113) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/2187f716c3254ca882a146416b6231d92/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3294.02 ((SQL17_RTM_QFE-CU).200313-2113) +``` + +# SQL Server 2017 RTM CU19 - 14.0.3281.6 - x64 (KB4535007) +``` powershell +# SQL Server 2017 RTM CU19 - 14.0.3281.6 - x64 (KB4535007) +$outputFolder = 'c:\sqlsyms\14.0.3281.6\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/77d53ce9ab0d4543b6625be66af453422/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3281.06 ((SQL17_RTM_QFE-CU).200124-0352) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/e19ffa5d57f24259a2a98fdd90289e152/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3281.06 ((SQL17_RTM_QFE-CU).200124-0352) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/f421b91603c34ba99b30746fd8059d772/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3281.06 ((SQL17_RTM_QFE-CU).200124-0352) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/672558a3b8504bb0b1dd7bcd11f9c84a2/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3281.06 ((SQL17_RTM_QFE-CU).200124-0352) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/1e174cf6018a4087be3d9fb563fe1b633/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3281.06 ((SQL17_RTM_QFE-CU).200124-0352) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/971fc73e739647b8998f3a158cdeee4f2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3281.06 ((SQL17_RTM_QFE-CU).200124-0352) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/84c15d654b424537b1947ac49c2bffef1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3281.06 ((SQL17_RTM_QFE-CU).200124-0352) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/b69205eb69a8423dbec803e670916fe51/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3281.06 ((SQL17_RTM_QFE-CU).200124-0352) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/7eec0edeb9f9430c9958d3a06448b6c21/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3281.06 ((SQL17_RTM_QFE-CU).200124-0352) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/2a200d24c4da4a678c4ebe925100e6e41/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3281.06 ((SQL17_RTM_QFE-CU).200124-0352) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/e13e064b30614472be3ba2d950f0a78b2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3281.06 ((SQL17_RTM_QFE-CU).200124-0352) +``` + +# SQL Server 2017 RTM CU18 - 14.0.3257.3 - x64 (KB4527377) +``` powershell +# SQL Server 2017 RTM CU18 - 14.0.3257.3 - x64 (KB4527377) +$outputFolder = 'c:\sqlsyms\14.0.3257.3\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/0cf29846f3c24e78ad6c68ffc23c958b2/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3257.03 ((SQL17_RTM_QFE-CU).191116-0848) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/edc4c7b44f9842f5ba869f71b5d409d72/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3257.03 ((SQL17_RTM_QFE-CU).191116-0848) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/e9b9a716dd8a4c80a1cde404d18ca8142/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3257.03 ((SQL17_RTM_QFE-CU).191116-0848) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/ee0cc71e1a194e49bbb83839ce3b7f342/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3257.03 ((SQL17_RTM_QFE-CU).191116-0848) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/18f1fdf24e1c4a2b8a647f005476ea353/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3257.03 ((SQL17_RTM_QFE-CU).191116-0848) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/92014d8cf1724ba281afe5be39449fce2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3257.03 ((SQL17_RTM_QFE-CU).191116-0848) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/88d125cb6c734230bda07306dc5a44971/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3257.03 ((SQL17_RTM_QFE-CU).191116-0848) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/4f77a328940e448e97c9bb6e817b34c71/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3257.03 ((SQL17_RTM_QFE-CU).191116-0848) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/2572674dae244c15af96c8fb8dbc76891/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3257.03 ((SQL17_RTM_QFE-CU).191116-0848) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/ae6fdf41e3a34796a31096c15ffe09b71/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3257.03 ((SQL17_RTM_QFE-CU).191116-0848) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/46d8ae1b2f884ce8bd9bbf46c2a5a54e2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3257.03 ((SQL17_RTM_QFE-CU).191116-0848) +``` + +# SQL Server 2017 RTM CU17 - 14.0.3238.1 - x64 (KB4515579) +``` powershell +# SQL Server 2017 RTM CU17 - 14.0.3238.1 - x64 (KB4515579) +$outputFolder = 'c:\sqlsyms\14.0.3238.1\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/5e50e02ad0cf43da8949c7caa26c49f92/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3238.01 ((SQLServer2017-CU14).190913-2228) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/fdb5ae5d994745f5b29bd9e5a44cfbac2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3238.01 ((SQLServer2017-CU14).190913-2228) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/c4ff40dd1b834161b04985c7e21556dc2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3238.01 ((SQLServer2017-CU14).190913-2228) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/4bef8588459043f89f045f2cb9956e342/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3238.01 ((SQLServer2017-CU14).190913-2228) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/4bf28ededa384502a61929dae625e0833/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3238.01 ((SQLServer2017-CU14).190913-2228) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/ac756fec0f804ed4b6bc3fecccb7ed152/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3238.01 ((SQLServer2017-CU14).190913-2228) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/2d58e76525314e67b7158d5b971973471/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3238.01 ((SQLServer2017-CU14).190913-2228) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/41ff67e8d1d94d7782771b2ceb7d91461/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3238.01 ((SQLServer2017-CU14).190913-2228) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/3567f1e7bd304700a1315891a9bffcf21/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3238.01 ((SQLServer2017-CU14).190913-2228) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/74418625e16d46dea9c4dabf1f3c97711/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3238.01 ((SQLServer2017-CU14).190913-2228) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/c3a61d285faa4b848c2ad7e7b02c54742/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3238.01 ((SQLServer2017-CU14).190913-2228) +``` + +# SQL Server 2017 RTM CU16 - 14.0.3223.3 - x64 (KB4508218) +``` powershell +# SQL Server 2017 RTM CU16 - 14.0.3223.3 - x64 (KB4508218) +$outputFolder = 'c:\sqlsyms\14.0.3223.3\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/cc2cb01a74b84342bad196721c4b229a2/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3223.03 ((SQLServer2017-CU14).190712-2335) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/b6830a8a29e746f7a9e334bbc16f73cd2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3223.03 ((SQLServer2017-CU14).190712-2335) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/d4be23dadfa94b4eaedf98e747a35f7a2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3223.03 ((SQLServer2017-CU14).190712-2335) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/60134c9480e24546b6dfcfa95981db792/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3223.03 ((SQLServer2017-CU14).190712-2335) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/942175c9b9254c3a8143db7613f4720e3/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3223.03 ((SQLServer2017-CU14).190712-2335) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/3d22f9effe75470b9cb73b22e30ee0042/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3223.03 ((SQLServer2017-CU14).190712-2335) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/d172da872f4f42faa859e1e262d8f1fe1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3223.03 ((SQLServer2017-CU14).190712-2335) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/2945c675b7f4457892e17485e328b6e11/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3223.03 ((SQLServer2017-CU14).190712-2335) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/05671d5db5a04a3e87f616b6a172e64e1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3223.03 ((SQLServer2017-CU14).190712-2335) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/3ba3e96155514539bf263e91196a59591/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3223.03 ((SQLServer2017-CU14).190712-2335) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/238777599d2342ada234a90d46ae10cd2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3223.03 ((SQLServer2017-CU14).190712-2335) +``` + +# SQL Server 2017 RTM CU15+GDR - 14.0.3192.2 - x64 (KB4505225) +``` powershell +# SQL Server 2017 RTM CU15+GDR - 14.0.3192.2 - x64 (KB4505225) +$outputFolder = 'c:\sqlsyms\14.0.3192.2\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/122fc135abf24465ba9e6be0a6274eb32/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3192.02 ((SQLServer2017-CU14).190615-0703) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/207221dfd01a4ecda2e45a5be4afa8342/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3192.02 ((SQLServer2017-CU14).190615-0703) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/7f9c184f5b2944cc8c1bdba07670f8412/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3192.02 ((SQLServer2017-CU14).190615-0703) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/9559bc0f3b5e4cef8a84ce08601fe3df2/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3192.02 ((SQLServer2017-CU14).190615-0703) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/24b12b3f43be4a27a4139c39849ef5e33/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3192.02 ((SQLServer2017-CU14).190615-0703) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/efd30261c88042a2a49e19b21f90ef002/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3192.02 ((SQLServer2017-CU14).190615-0703) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/cb6a1cd50b654d0a8474f4ed74255e6c1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3192.02 ((SQLServer2017-CU14).190615-0703) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/139c16954bd04111a21c3d8e834e5ea41/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3192.02 ((SQLServer2017-CU14).190615-0703) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/e0243d6070c94969a2aabfc1c32fb0a61/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3192.02 ((SQLServer2017-CU14).190615-0703) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/439bff18122840658f0e9240ffda29301/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3192.02 ((SQLServer2017-CU14).190615-0703) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/107813d2dfe94332aec5cba570dfa4082/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3192.02 ((SQLServer2017-CU14).190615-0703) +``` + +# SQL Server 2017 RTM Hotfix for CU15 - 14.0.3164.1 - x64 (4506633) +``` powershell +# SQL Server 2017 RTM Hotfix for CU15 - 14.0.3164.1 - x64 (4506633) +$outputFolder = 'c:\sqlsyms\14.0.3164.1\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/5f0e68f3162641ad8d035c501c0b697c2/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3164.01 ((SQLServer2017-CU15-OD).190529-2332) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/f90eacadd1904231a7dc6326c4ab53af2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3164.01 ((SQLServer2017-CU15-OD).190529-2332) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/7ef8fc8b0ed04a9f9dc7872b2ddb5bdb2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3164.01 ((SQLServer2017-CU15-OD).190529-2332) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/05f95c5ac74d4eb599b922c69dbc39c12/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3164.01 ((SQLServer2017-CU15-OD).190529-2332) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/6775b239a8fe440ba6bdae93bfcb524c3/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3164.01 ((SQLServer2017-CU15-OD).190529-2332) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/2be30f46dc9c414aa6ec8855811226fa2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3164.01 ((SQLServer2017-CU15-OD).190529-2332) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/6c08af17cbcc4ae6b47b9b000ba2df9f1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3164.01 ((SQLServer2017-CU15-OD).190529-2332) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/1f39d18ce9124de3a8af1fb9bf3b16b21/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3164.01 ((SQLServer2017-CU15-OD).190529-2332) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/beef7d8475d8486bb1acf9603c370d9b1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3164.01 ((SQLServer2017-CU15-OD).190529-2332) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/3c4f56edb20a4d7f903ea7985ee392551/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3164.01 ((SQLServer2017-CU15-OD).190529-2332) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/e5610121ea0b430ba050cfd7de9a55a72/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3164.01 ((SQLServer2017-CU15-OD).190529-2332) +``` + +# SQL Server 2017 RTM CU15 - 14.0.3162.1 - x64 (KB4498951) +``` powershell +# SQL Server 2017 RTM CU15 - 14.0.3162.1 - x64 (KB4498951) +$outputFolder = 'c:\sqlsyms\14.0.3162.1\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/1dfc724617524d0b81e6c9bfe5a3fa922/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3162.01 ((SQLServer2017-CU14).190516-0147) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/5b6770d3a2954ad38fcf61d69b2406f62/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3162.01 ((SQLServer2017-CU14).190516-0147) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/d912ea3687524101b23bc88c89be16062/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3162.01 ((SQLServer2017-CU14).190516-0147) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/7e76c3114d2445fb957c7e2f8d395b722/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3162.01 ((SQLServer2017-CU14).190516-0147) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/f5a9dd15f9e0443cbabb7b93f9d76b233/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3162.01 ((SQLServer2017-CU14).190516-0147) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/e5f4295c75c6451a885b0d60309760772/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3162.01 ((SQLServer2017-CU14).190516-0147) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/ba6e8c729b7f41a7b6863e2c11cd13561/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3162.01 ((SQLServer2017-CU14).190516-0147) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/1b3d232725c54f5dbd6e80715545efad1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3162.01 ((SQLServer2017-CU14).190516-0147) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/67e2b8702fa745f88d74d149c65524b81/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3162.01 ((SQLServer2017-CU14).190516-0147) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/1b81dfc91133481ab49da77d8e57f3c61/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3162.01 ((SQLServer2017-CU14).190516-0147) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/d7da732da1224c3dbbf571c85cdf65532/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3162.01 ((SQLServer2017-CU14).190516-0147) +``` + +# SQL Server 2017 RTM CU14+GDR - 14.0.3103.1 - x64 (KB4494352) +``` powershell +# SQL Server 2017 RTM CU14+GDR - 14.0.3103.1 - x64 (KB4494352) +$outputFolder = 'c:\sqlsyms\14.0.3103.1\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/3d4403b9c1644b51ae4e8518d6ce10852/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3103.01 ((SQLServer2017-CU14).190323-0508) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/dd1cd60ea219405ba26b3549a087d7cd2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3103.01 ((SQLServer2017-CU14).190323-0508) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/d8204dcd590548d0886483894461e2712/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3103.01 ((SQLServer2017-CU14).190323-0508) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/b5b369edbeb54c34929c63aaeef0c56a2/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3103.01 ((SQLServer2017-CU14).190323-0508) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/6e83a97d29fa45dcad8a1531728528103/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3103.01 ((SQLServer2017-CU14).190323-0508) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/201a31638edb45cea8fc7e3089c1b8bb2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3103.01 ((SQLServer2017-CU14).190323-0508) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/ccbb2144f26d47ecb0117313489d42d71/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3103.01 ((SQLServer2017-CU14).190323-0508) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/8e895540bc1b48b1ac1056481e757a001/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3103.01 ((SQLServer2017-CU14).190323-0508) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/02e0af9b69b241f4a9f63962d2f7b3e51/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3103.01 ((SQLServer2017-CU14).190323-0508) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/55a7586e0a684168944bc84d8b3f3a7b1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3103.01 ((SQLServer2017-CU14).190323-0508) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/13efe2857d1f407d8c3eafab072d28812/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3103.01 ((SQLServer2017-CU14).190323-0508) +``` + +# SQL Server 2017 RTM CU14 - 14.0.3076.1 - x64 (KB4484710) +``` powershell +# SQL Server 2017 RTM CU14 - 14.0.3076.1 - x64 (KB4484710) +$outputFolder = 'c:\sqlsyms\14.0.3076.1\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/9dc4b5b9129b4d90aca76c656a8a7cdb2/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3076.01 ((SQLServer2017-CU14).190313-0159) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/12a634d42b0a466fa8892f030ec414cf2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3076.01 ((SQLServer2017-CU14).190313-0159) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/5a0ee5562cf744fe87b6f8f0e66342a62/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3076.01 ((SQLServer2017-CU14).190313-0159) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/a9e9815a726f4f658305f67cbcb7ba432/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3076.01 ((SQLServer2017-CU14).190313-0159) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/7b7b6d8bbf4e4baba8437e4623514f163/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3076.01 ((SQLServer2017-CU14).190313-0159) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/74bda280c8e8462b879a8d1c6684d8b32/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3076.01 ((SQLServer2017-CU14).190313-0159) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/d9b0c3d63a0d48ce80d7ae4e6bd2faae1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3076.01 ((SQLServer2017-CU14).190313-0159) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/fb39d136087c4150905913a5a901dd081/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3076.01 ((SQLServer2017-CU14).190313-0159) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/4a46951e68434ecd93a667401da5c63c1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3076.01 ((SQLServer2017-CU14).190313-0159) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/ed48cfbb0bcb463b8ca48ab657da16221/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3076.01 ((SQLServer2017-CU14).190313-0159) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/8505782dfd8c4d589bb569f27dda72282/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3076.01 ((SQLServer2017-CU14).190313-0159) +``` + +# SQL Server 2017 RTM CU13 - 14.0.3048.4 - x64 (KB4466404) +``` powershell +# SQL Server 2017 RTM CU13 - 14.0.3048.4 - x64 (KB4466404) +$outputFolder = 'c:\sqlsyms\14.0.3048.4\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/db7d37e644684c76aca6244566f04ddb2/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3048.04 ((SQLServer2017-CU13).181130-2004) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/deb451448a184a019d15fbecb4b3dbd42/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3048.04 ((SQLServer2017-CU13).181130-2004) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/154b616962204fc98ab8ba2ac0944fd62/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3048.04 ((SQLServer2017-CU13).181130-2004) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/a8ea1f9fa4a8417b901a2e9c1108cd532/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3048.04 ((SQLServer2017-CU13).181130-2004) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/162006a3c04048a5b3c3bd6db4d37d5c3/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3048.04 ((SQLServer2017-CU13).181130-2004) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/254e81f1cf6d407188805d66c3fc8a002/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3048.04 ((SQLServer2017-CU13).181130-2004) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/6ad53123fe984297bf11178b0f6833b61/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3048.04 ((SQLServer2017-CU13).181130-2004) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/64e83552a4324544b14f7ad910d6dbd31/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3048.04 ((SQLServer2017-CU13).181130-2004) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/2750700543774a219883ff4fd8f9b1c71/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3048.04 ((SQLServer2017-CU13).181130-2004) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/045b89b9000c427aa2d7eb19476ead711/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3048.04 ((SQLServer2017-CU13).181130-2004) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/bb0704a30a134cc8a0436285de13449b2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3048.04 ((SQLServer2017-CU13).181130-2004) +``` + +# SQL Server 2017 RTM CU12 - 14.0.3045.24 - x64 (KB4464082) +``` powershell +# SQL Server 2017 RTM CU12 - 14.0.3045.24 - x64 (KB4464082) +$outputFolder = 'c:\sqlsyms\14.0.3045.24\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/e1a278df9008417880471554645ffe0e2/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3045.24 ((SQLServer2017-CU12).181019-0539) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/0f960e0b699d427db586034ed7b0fdef2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3045.24 ((SQLServer2017-CU12).181019-0539) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/3901620f11594833aa71280f8375f0be2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3045.24 ((SQLServer2017-CU12).181019-0539) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/9cfe911d498646b8ae4f2f50a9d067a42/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3045.24 ((SQLServer2017-CU12).181019-0539) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/27ed7bd2e8a7400e886335247c98a3073/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3045.24 ((SQLServer2017-CU12).181019-0539) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/9ab679cc975b4b1ba1d15706afd6450a2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3045.24 ((SQLServer2017-CU12).181019-0539) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/d2812bf323f14d81a9b099908c9ffff61/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3045.24 ((SQLServer2017-CU12).181019-0539) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/6615c4c7be0c407697ca045825239c131/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3045.24 ((SQLServer2017-CU12).181019-0539) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/196df91bf910437c9fd9acfa2117826f1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3045.24 ((SQLServer2017-CU12).181019-0539) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/6cc447fe65eb4c59aa455ccbf9b251a91/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3045.24 ((SQLServer2017-CU12).181019-0539) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/5cc64f878ee841aab5448338015a5c952/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3045.24 ((SQLServer2017-CU12).181019-0539) +``` + +# SQL Server 2017 RTM CU11 - 14.0.3038.14 - x64 (KB4462262) +``` powershell +# SQL Server 2017 RTM CU11 - 14.0.3038.14 - x64 (KB4462262) +$outputFolder = 'c:\sqlsyms\14.0.3038.14\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/33fb5fb0d73a441090eb718412270dbd2/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3038.14 ((SQLServer2017-CU11).180914-1944) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/c9ed01ded3264172a6a840a1510a9e082/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3038.14 ((SQLServer2017-CU11).180914-1944) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/58093a59f19b4a3398ce13fe13ed92ab2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3038.14 ((SQLServer2017-CU11).180914-1944) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/93188b40fdeb4d9b84f1b0825df6e5402/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3038.14 ((SQLServer2017-CU11).180914-1944) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/652be97b165947e18523339f10380c3e3/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3038.14 ((SQLServer2017-CU11).180914-1944) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/056712b91a6b43a98b8ddb86e19d07832/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3038.14 ((SQLServer2017-CU11).180914-1944) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/767d4249b3b342ccb953f3ff28a3477b1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3038.14 ((SQLServer2017-CU11).180914-1944) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/eec4e581cc1e4e9289b0ff1027f761c21/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3038.14 ((SQLServer2017-CU11).180914-1944) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/95f766b77d5340cf91e4237c1b5cb1d11/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3038.14 ((SQLServer2017-CU11).180914-1944) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/3da659532f314c3d971b21293e4fbf911/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3038.14 ((SQLServer2017-CU11).180914-1944) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/4ecd8c32a3744a72b86f59e40106e58f2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3038.14 ((SQLServer2017-CU11).180914-1944) +``` + +# SQL Server 2017 RTM CU10 - 14.0.3037.1 - x64 (KB4342123) +``` powershell +# SQL Server 2017 RTM CU10 - 14.0.3037.1 - x64 (KB4342123) +$outputFolder = 'c:\sqlsyms\14.0.3037.1\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/bd9f49c63360495684146dfce60449ca2/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3037.01 ((SQLServer2017-CU10).180727-1609) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/a7ac68d2a55042d4b014d983ca4dc5652/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3037.01 ((SQLServer2017-CU10).180727-1609) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/89f5a5f6f6cb46308ee263616e47a1e52/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3037.01 ((SQLServer2017-CU10).180727-1609) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/73b2fdabd985459abcf4b906d49acabe2/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3037.01 ((SQLServer2017-CU10).180727-1609) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/1914abc38f5c4d259a75f0d60f99fb503/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3037.01 ((SQLServer2017-CU10).180727-1609) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/c440983f340f41279499f51c06f0796a2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3037.01 ((SQLServer2017-CU10).180727-1609) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/e67f311e495e452cba574599785f478f1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3037.01 ((SQLServer2017-CU10).180727-1609) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/007f32ffc751482cab8cce28fae4eaae1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3037.01 ((SQLServer2017-CU10).180727-1609) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/d1e4131926fb4197a56f62d1aec4b0891/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3037.01 ((SQLServer2017-CU10).180727-1609) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/04067943d1b14ed58777d6bc6307223c1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3037.01 ((SQLServer2017-CU10).180727-1609) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/7726181ee6a44f1bb557e413279dd4ab2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3037.01 ((SQLServer2017-CU10).180727-1609) +``` + +# SQL Server 2017 RTM CU9 + GDR - 14.0.3035.2 - x64 (KB4293805) +``` powershell +# SQL Server 2017 RTM CU9 + GDR - 14.0.3035.2 - x64 (KB4293805) +$outputFolder = 'c:\sqlsyms\14.0.3035.2\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/2cd60104c58545f8930beb63ebc961542/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3035.02 ((SQLServer2017-CU9-GDR).180707-0051) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/0960eef2f5f74555a6bc0201f30b2dd32/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3035.02 ((SQLServer2017-CU9-GDR).180707-0051) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/c48a041fc73742acb92a2483901e3e232/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3035.02 ((SQLServer2017-CU9-GDR).180707-0051) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/97b1e169ef954a2fa0624d2da36be4712/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3035.02 ((SQLServer2017-CU9-GDR).180707-0051) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/04a742d9881d40f69a5b7d65befc114c3/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3035.02 ((SQLServer2017-CU9-GDR).180707-0051) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/a91a2cb72c0b4147ac810d5c0fb0b1822/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3035.02 ((SQLServer2017-CU9-GDR).180707-0051) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/17e84ac011b740de94a0e096713ed7061/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3035.02 ((SQLServer2017-CU9-GDR).180707-0051) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/89f68be128904de1aa86fcb9815538161/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3035.02 ((SQLServer2017-CU9-GDR).180707-0051) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/f2c0eb19ab6b47609637f59efac0a5c71/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3035.02 ((SQLServer2017-CU9-GDR).180707-0051) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/0f67bd671bda40e7b9498d504d67d9c71/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3035.02 ((SQLServer2017-CU9-GDR).180707-0051) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/2fed6d1f4fc74711a8088b94f98d10062/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3035.02 ((SQLServer2017-CU9-GDR).180707-0051) +``` + +# SQL Server 2017 RTM CU9 - 14.0.3030.27 - x64 (KB4341265) +``` powershell +# SQL Server 2017 RTM CU9 - 14.0.3030.27 - x64 (KB4341265) +$outputFolder = 'c:\sqlsyms\14.0.3030.27\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/66034bb7692f47b68d91508392748a702/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3030.27 ((SQLServer2017-CU9).180630-0026) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/cd0f72d319dd45b48226d59a0a4d1b942/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3030.27 ((SQLServer2017-CU9).180630-0026) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/d62f64ac53a647e4a5be66a50a609f542/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3030.27 ((SQLServer2017-CU9).180630-0026) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/cd65ee0c97594540ac37cf1346fd46072/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3030.27 ((SQLServer2017-CU9).180630-0026) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/20879ea42b6046c6ac042fd5917732433/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3030.27 ((SQLServer2017-CU9).180630-0026) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/ffcd6d3fd4724d65b7f0c3c1dcd3bbbc2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3030.27 ((SQLServer2017-CU9).180630-0026) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/9af640605b0941d9b7934ab9eea3acdd1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3030.27 ((SQLServer2017-CU9).180630-0026) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/31ea27e79fc14bb991e62f4060d7c3a81/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3030.27 ((SQLServer2017-CU9).180630-0026) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/7805edcb819f4e70ab4d14520165787f1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3030.27 ((SQLServer2017-CU9).180630-0026) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/097b87a6547a4e8d87b2f63f8b514e0b1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3030.27 ((SQLServer2017-CU9).180630-0026) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/764a2e690ea84ab3943f336482774e932/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3030.27 ((SQLServer2017-CU9).180630-0026) +``` + +# SQL Server 2017 RTM CU8 - 14.0.3029.16 - x64 (KB4338363) +``` powershell +# SQL Server 2017 RTM CU8 - 14.0.3029.16 - x64 (KB4338363) +$outputFolder = 'c:\sqlsyms\14.0.3029.16\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/5525b238911a499ca15f316ab6c962822/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3029.16 ((SQLServer2017-CU8).180613-1911) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/1399d2afb4264c55b70e45f70f798bf22/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3029.16 ((SQLServer2017-CU8).180613-1911) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/c50bc63f8aee470a99e4662f43e0d0522/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3029.16 ((SQLServer2017-CU8).180613-1911) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/35d0d8eb3c1c437ba654cb78cd4fa1e62/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3029.16 ((SQLServer2017-CU8).180613-1911) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/e2ba4bb806624faa8bbacdae707e61163/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3029.16 ((SQLServer2017-CU8).180613-1911) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/404b3fcd8cc841ccbe0003b3dfb189f02/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3029.16 ((SQLServer2017-CU8).180613-1911) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/281f91e3d7d14f3faaa9992d00ba32991/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3029.16 ((SQLServer2017-CU8).180613-1911) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/28abba31fdde432389c3beb6641c86b61/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3029.16 ((SQLServer2017-CU8).180613-1911) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/10393de02ddd42ae80046a075942ed4b1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3029.16 ((SQLServer2017-CU8).180613-1911) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/3ed5a913bd7f49e4b00d13e1e0d96bd01/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3029.16 ((SQLServer2017-CU8).180613-1911) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/78fd9b633d9d4f15b3fa6cef32db99d72/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3029.16 ((SQLServer2017-CU8).180613-1911) +``` + +# SQL Server 2017 RTM CU7 - 14.0.3026.27 - x64 (KB4229789) +``` powershell +# SQL Server 2017 RTM CU7 - 14.0.3026.27 - x64 (KB4229789) +$outputFolder = 'c:\sqlsyms\14.0.3026.27\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/10da85787e1149a58e60e6c0b2c7a1552/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3026.27 ((SQLServer2017-CU7).180510-1901) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/65dcd0640108491a9e0de5ed8058f1fb2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3026.27 ((SQLServer2017-CU7).180510-1901) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/293ecb04af0f483b898462dba64e945a2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3026.27 ((SQLServer2017-CU7).180510-1901) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/3799cfd261564e5ba73053afe3e0b60c2/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3026.27 ((SQLServer2017-CU7).180510-1901) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/c236c6b5eced44c3a22b1b7779f989d33/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3026.27 ((SQLServer2017-CU7).180510-1901) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/8d9a1bacfae04c508cd2852cfc3d4e912/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3026.27 ((SQLServer2017-CU7).180510-1901) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/6fc5beab5b2b42d9b0575f3e384038f51/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3026.27 ((SQLServer2017-CU7).180510-1901) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/946a419bcbcc44d08c05275adfb3dbc01/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3026.27 ((SQLServer2017-CU7).180510-1901) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/ed1e63b89e7743619a7f541d831943f01/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3026.27 ((SQLServer2017-CU7).180510-1901) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/2747080059f64f4ba2a97a69287d05e51/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3026.27 ((SQLServer2017-CU7).180510-1901) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/37b0126ce3264429b7a3070d9c7ca29d2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3026.27 ((SQLServer2017-CU7).180510-1901) +``` + +# SQL Server 2017 RTM CU6 - 14.0.3025.34 - x64 (KB4101464) +``` powershell +# SQL Server 2017 RTM CU6 - 14.0.3025.34 - x64 (KB4101464) +$outputFolder = 'c:\sqlsyms\14.0.3025.34\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/a98a782c58784e29bbaa2c211b0f5c682/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3025.34 ((SQLServer2017-CU6).180410-0033) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/f24aacbfad9e414285f7046d1d48d2be2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3025.34 ((SQLServer2017-CU6).180410-0033) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/42522ba8c70843a89dd2cbe8af1bb4b32/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3025.34 ((SQLServer2017-CU6).180410-0033) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/b4e8225ee505470da1c3ae7cd8b872e12/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3025.34 ((SQLServer2017-CU6).180410-0033) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/02573056bbd745149600abc3fda59b873/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3025.34 ((SQLServer2017-CU6).180410-0033) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/75e13c8cab1140ff95e0a8be1561e5f52/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3025.34 ((SQLServer2017-CU6).180410-0033) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/e9265ab70bc24f7892140a0c56c8fff71/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3025.34 ((SQLServer2017-CU6).180410-0033) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/0b7a9ff5214245c7935cedb57471d2b71/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3025.34 ((SQLServer2017-CU6).180410-0033) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/99e106f3dc9d4485910ca051be7c7ead1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3025.34 ((SQLServer2017-CU6).180410-0033) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/ebfd29864c4549c48179f4a037ac91271/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3025.34 ((SQLServer2017-CU6).180410-0033) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/ae60023494ff4dd7a992cde1dbedd2d52/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3025.34 ((SQLServer2017-CU6).180410-0033) +``` + +# SQL Server 2017 RTM CU5 - 14.0.3023.8 - x64 (KB4092643) +``` powershell +# SQL Server 2017 RTM CU5 - 14.0.3023.8 - x64 (KB4092643) +$outputFolder = 'c:\sqlsyms\14.0.3023.8\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/109e36e55c01403497cc5d50c579d8532/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3023.08 ((SQLServer2017-CU5).180302-2330) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/bddaac25fb1f426da61e50a94d7fc9ab2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3023.08 ((SQLServer2017-CU5).180302-2330) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/b1507220d6954a02a8b70fc6a55ef15a2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3023.08 ((SQLServer2017-CU5).180302-2330) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/3741e4701fc3405b96394985517ff8a02/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3023.08 ((SQLServer2017-CU5).180302-2330) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/ac8d8709958847f8a0acfc7d842689343/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3023.08 ((SQLServer2017-CU5).180302-2330) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/b32f21bc37674e1b935d03ad80b368f42/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3023.08 ((SQLServer2017-CU5).180302-2330) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/457d193fc3f44383aceee37f22beb4ee1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3023.08 ((SQLServer2017-CU5).180302-2330) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/6051c5232f1b45d7add16da0ffbd40561/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3023.08 ((SQLServer2017-CU5).180302-2330) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/ae5d32ddd37e4201b4deb372cd8eeace1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3023.08 ((SQLServer2017-CU5).180302-2330) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/ab8e5af83878473e9872fa70607103c91/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3023.08 ((SQLServer2017-CU5).180302-2330) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/691d47cd1fe84e27beecb625888885242/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3023.08 ((SQLServer2017-CU5).180302-2330) +``` + +# SQL Server 2017 RTM CU4 - 14.0.3022.28 - x64 (KB4056498) +``` powershell +# SQL Server 2017 RTM CU4 - 14.0.3022.28 - x64 (KB4056498) +$outputFolder = 'c:\sqlsyms\14.0.3022.28\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/57d7c3c8a5d0448e80136b24d0fff1c32/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3022.28 ((SQLServer2017-CU1).180209-2025) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/d579a66e0be244f4933f70d895ea0ca72/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3022.28 ((SQLServer2017-CU1).180209-2025) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/3b96d064c2a7446b8bf27f889a05c5f82/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3022.28 ((SQLServer2017-CU1).180209-2025) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/c0a46b4eda834af696bc62f1f25d2ed12/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3022.28 ((SQLServer2017-CU1).180209-2025) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/98358edb8975452a950cf30afd43dacb3/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3022.28 ((SQLServer2017-CU1).180209-2025) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/d2356ed3f2a54cd39d5b0d6c67c270b02/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3022.28 ((SQLServer2017-CU1).180209-2025) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/374a04e072bc477297ac9c32d1cec4761/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3022.28 ((SQLServer2017-CU1).180209-2025) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/ae215b6a707a4db08bc6442bd43ac11c1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3022.28 ((SQLServer2017-CU1).180209-2025) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/076f3b18167d41edbd98e8898113cad41/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3022.28 ((SQLServer2017-CU1).180209-2025) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/69e152bad2594a2cb66eaeeaa412f1611/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3022.28 ((SQLServer2017-CU1).180209-2025) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/6061b66f34624106bafd4ee77d938d8f2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3022.28 ((SQLServer2017-CU1).180209-2025) +``` + +# SQL Server 2017 RTM CU3 - 14.0.3015.40 - x64 (KB4052987) +``` powershell +# SQL Server 2017 RTM CU3 - 14.0.3015.40 - x64 (KB4052987) +$outputFolder = 'c:\sqlsyms\14.0.3015.40\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/fd63f54995484f9cada261048b448e362/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3015.40 ((SQLServer2017-CU1).171222-2334) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/8e5e48eb780a41c496ec3aff3e0470dd2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3015.40 ((SQLServer2017-CU1).171222-2334) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/b882d062f0ae4f3a826bdae177e2f6ae2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3015.40 ((SQLServer2017-CU1).171222-2334) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/a56fa639b1be44b791f33e70221a74d42/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3015.40 ((SQLServer2017-CU1).171222-2334) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/35e6d755c08b44dea0288b8f4c8be7e33/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3015.40 ((SQLServer2017-CU1).171222-2334) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/a90c29baa7a945e79a5f316c1c016de92/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3015.40 ((SQLServer2017-CU1).171222-2334) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/a1723bbc5db04c588a7c8090f24732931/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3015.40 ((SQLServer2017-CU1).171222-2334) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/84fb90a5783b4d3da9f829e36dd5e4f11/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3015.40 ((SQLServer2017-CU1).171222-2334) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/72cc987076974daead0760fbfc9e06dc1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3015.40 ((SQLServer2017-CU1).171222-2334) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/8041f1f6e7894ae08d6acdd1ed3988d91/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3015.40 ((SQLServer2017-CU1).171222-2334) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/422ffe74342b4124ac700e11127116952/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3015.40 ((SQLServer2017-CU1).171222-2334) +``` + +# SQL Server 2017 RTM CU2 - 14.0.3008.27 - x64 (KB4052574) +``` powershell +# SQL Server 2017 RTM CU2 - 14.0.3008.27 - x64 (KB4052574) +$outputFolder = 'c:\sqlsyms\14.0.3008.27\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/3138403f1ce44cc1969afc40973749f12/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3008.27 ((SQLServer2017-CU1).171116-1722) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/f1a833a2d2c34202b7302121de112bd32/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3008.27 ((SQLServer2017-CU1).171116-1722) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/40d5a1efad844abfa5a689f2e49153e12/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3008.27 ((SQLServer2017-CU1).171116-1722) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/a1dfaae5bf0f4d5691487e1d7ca137fe2/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3008.27 ((SQLServer2017-CU1).171116-1722) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/abc003696f9c4269b13c4e246bd6d10e2/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3008.27 ((SQLServer2017-CU1).171116-1722) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/8d19325e37f34ec5b6f4ebe1ea29978e2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3008.27 ((SQLServer2017-CU1).171116-1722) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/9496aab8e37448c5ad97fde8635a3d201/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3008.27 ((SQLServer2017-CU1).171116-1722) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/d984365873cb4a10a728e6f95b206aef1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3008.27 ((SQLServer2017-CU1).171116-1722) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/5c90a79531e94e37ba58d8993b04e1201/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3008.27 ((SQLServer2017-CU1).171116-1722) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/edcf09de5c5a482991e58e26301562341/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3008.27 ((SQLServer2017-CU1).171116-1722) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/11a2d383108e4e49bac7214a5c4e7c2e2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3008.27 ((SQLServer2017-CU1).171116-1722) +``` + +# SQL Server 2017 RTM CU1 - 14.0.3006.16 - x64 (KB4038634) +``` powershell +# SQL Server 2017 RTM CU1 - 14.0.3006.16 - x64 (KB4038634) +$outputFolder = 'c:\sqlsyms\14.0.3006.16\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/87eba05ec89242d9927509fa7cd4df222/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.3006.16 ((SQLServer2017-CU1).171019-0548) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/e801003d9d0e480aaf2a9961f14722be2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.3006.16 ((SQLServer2017-CU1).171019-0548) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/5eb2d9b1ed7647099675595f5c1af9542/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.3006.16 ((SQLServer2017-CU1).171019-0548) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/dfeb0841aebc48fc92d2ebce8243d6b02/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.3006.16 ((SQLServer2017-CU1).171019-0548) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/133d9c8bada14ea89a11c0c505f8c2412/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.3006.16 ((SQLServer2017-CU1).171019-0548) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/c7ef60b6dc0c4068a48974e6dcf589e42/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.3006.16 ((SQLServer2017-CU1).171019-0548) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/e1feb096228e45b4ad3fd948d10b06f21/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.3006.16 ((SQLServer2017-CU1).171019-0548) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/fc74cd37bd3c40f1a63232f24b9861621/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.3006.16 ((SQLServer2017-CU1).171019-0548) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/88d42585c0844b0493b3383459c778cb1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.3006.16 ((SQLServer2017-CU1).171019-0548) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/85149cd8bce34a5d80e738205084b92a1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.3006.16 ((SQLServer2017-CU1).171019-0548) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/641d7dfd397d4232a6cf7ccc61db3ec32/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.3006.16 ((SQLServer2017-CU1).171019-0548) +``` + +# SQL Server 2017 RTM GDR - 14.0.2014.14 - x64 (KB4494351) +``` powershell +# SQL Server 2017 RTM GDR - 14.0.2014.14 - x64 (KB4494351) +$outputFolder = 'c:\sqlsyms\14.0.2014.14\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/3b83b1a537f04ab3a16e88432d682bcb2/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.2014.14 ((SQL17_RTM_GDR).190405-1545) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/d72fae04d4364d2f9fddc737646f1baa2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.2014.14 ((SQL17_RTM_GDR).190405-1545) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/51b6292d90284698b26fd5785f1470cd2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.2014.14 ((SQL17_RTM_GDR).190405-1545) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/74cac1ac260d4f90b5c2e3d16bd2e1fa2/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.2014.14 ((SQL17_RTM_GDR).190405-1545) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/bf2dc2594f0045b287cf32f04ea6dc033/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.2014.14 ((SQL17_RTM_GDR).190405-1545) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/1f4bea33f4a44fcbbb2ed8b1b636dc442/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.2014.14 ((SQL17_RTM_GDR).190405-1545) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/962db9f1c6a34d7bb306a6b5a9eb43821/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.2014.14 ((SQL17_RTM_GDR).190405-1545) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/20bb3d988bee43fa8b73251c97892d9b1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.2014.14 ((SQL17_RTM_GDR).190405-1545) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/1cab94f0f12f4c0dafd50eaf20df7ae51/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.2014.14 ((SQL17_RTM_GDR).190405-1545) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/a54634c716264671ad9b42292c6d6c751/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.2014.14 ((SQL17_RTM_GDR).190405-1545) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/408c96c6da754a7f9ea16fd4e961910c2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.2014.14 ((SQL17_RTM_GDR).190405-1545) +``` + +# SQL Server 2017 RTM GDR - 14.0.2002.14 - x64 (KB4293803) +``` powershell +# SQL Server 2017 RTM GDR - 14.0.2002.14 - x64 (KB4293803) +$outputFolder = 'c:\sqlsyms\14.0.2002.14\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/eede151a1fe14c888e12bd2cd18499342/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.2002.14 ((SQL17_RTM_GDR).180721-1410) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/1365eb638bb547fb8dda02460ccb1db32/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.2002.14 ((SQL17_RTM_GDR).180721-1410) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/3d765ec46087444a99857a8850ed91612/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.2002.14 ((SQL17_RTM_GDR).180721-1410) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/59c28b768a1a468d9a1d7c9e3e86c8792/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.2002.14 ((SQL17_RTM_GDR).180721-1410) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/c51ed42364994190bde46cadad32bfcc3/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.2002.14 ((SQL17_RTM_GDR).180721-1410) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/67fa8e005f9e4dd5aa0f1eecd911e9fd2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.2002.14 ((SQL17_RTM_GDR).180721-1410) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/0f1a7721cd8e47319fec23bdc5ec7b911/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.2002.14 ((SQL17_RTM_GDR).180721-1410) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/3ae9ebe14179453fa16c7790e4468c0a1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.2002.14 ((SQL17_RTM_GDR).180721-1410) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/1986c63f87fd4b93aecba08c176afb911/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.2002.14 ((SQL17_RTM_GDR).180721-1410) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/5b3e2b01fca64473b86112687e9633b51/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.2002.14 ((SQL17_RTM_GDR).180721-1410) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/c11351f7ec7643bfa04d930c29d6d4872/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.2002.14 ((SQL17_RTM_GDR).180721-1410) +``` + +# SQL Server 2017 RTM GDR - 14.0.2000.63 - x64 (KB4057122) +``` powershell +# SQL Server 2017 RTM GDR - 14.0.2000.63 - x64 (KB4057122) +$outputFolder = 'c:\sqlsyms\14.0.2000.63\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/48cf4690e5f34376afb5a53a8f8ab45d2/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.2000.63 ((SQL17_RTM_GDR).171222-2325) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/efc35e061a2a4daf97ee2bac1f6a96302/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.2000.63 ((SQL17_RTM_GDR).171222-2325) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/59f051256d4743af8f758d0645475b962/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.2000.63 ((SQL17_RTM_GDR).171222-2325) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/5e35faefffe6499b9489c56f061d804e2/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.2000.63 ((SQL17_RTM_GDR).171222-2325) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/989ba51ed4984d1e8df0b1653ecaf3fc3/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.2000.63 ((SQL17_RTM_GDR).171222-2325) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/20e66bce4c7f42f5837a7e65b84e7a742/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.2000.63 ((SQL17_RTM_GDR).171222-2325) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/db011824808740f7b2bdc935fde6ea301/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.2000.63 ((SQL17_RTM_GDR).171222-2325) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/77a3acda141547c1a6c80fdd4417d3651/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.2000.63 ((SQL17_RTM_GDR).171222-2325) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/177b8b95f7254a86a9eb266863bccfb01/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.2000.63 ((SQL17_RTM_GDR).171222-2325) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/77e3bb72b6cb4714aafd8f36cfceccfe1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.2000.63 ((SQL17_RTM_GDR).171222-2325) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/4b38c81bae244806938fe19e14dfbf2e2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.2000.63 ((SQL17_RTM_GDR).171222-2325) +``` + +# SQL Server 2017 RTM RTM - 14.0.1000.169 - x64 (NA) +``` powershell +# SQL Server 2017 RTM RTM - 14.0.1000.169 - x64 (NA) +$outputFolder = 'c:\sqlsyms\14.0.1000.169\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/3cbcf6039e774ef7b3216ad46ed66e162/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2017.0140.1000.169 ((SQLServer).170822-2340) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/f188529c1026441ea07ad838452c34832/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2017.0140.1000.169 ((SQLServer).170822-2340) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/a93a74f3276b4f14a8a57d6b42bf8ae22/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2017.0140.1000.169 ((SQLServer).170822-2340) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/e0a351d14abe45afbaef64d1f88cc9fa2/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2017.0140.1000.169 ((SQLServer).170822-2340) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/7db97580232143a99f64077925f11a9d3/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2017.0140.1000.169 ((SQLServer).170822-2340) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/7be72e22126e41a0ba4a1589d22db4ef2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2017.0140.1000.169 ((SQLServer).170822-2340) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/a042792795f74ae093210433b2ef4f5c1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2017.0140.1000.169 ((SQLServer).170822-2340) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/79032174ef0b4f9eac01826df8f5334f1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2017.0140.1000.169 ((SQLServer).170822-2340) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/2cf7210d69f34a5484c0aa7010921c501/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2017.0140.1000.169 ((SQLServer).170822-2340) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/e1b7563a29b445e6aec1dc8739824fa61/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2017.0140.1000.169 ((SQLServer).170822-2340) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/2270ab48523147ce8c3aa44993fb31bb2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2017.0140.1000.169 ((SQLServer).170822-2340) +``` + diff --git a/Errors/PDB/SQL-Server-2019.md b/Errors/PDB/SQL-Server-2019.md new file mode 100644 index 00000000..697afc15 --- /dev/null +++ b/Errors/PDB/SQL-Server-2019.md @@ -0,0 +1,306 @@ +# SQL Server 2019 RTM CU5 - 15.0.4043.16 - x64 (KB4552255) +``` powershell +# SQL Server 2019 RTM CU5 - 15.0.4043.16 - x64 (KB4552255) +$outputFolder = 'c:\sqlsyms\15.0.4043.16\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/26dc3c5c64d84fbe9858e9751952614b2/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2019.0150.4043.16 ((SQLServer2019-CU5).200611-0058) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/b7ecc728f4d145db8216e57082798f7f2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2019.0150.4043.16 ((SQLServer2019-CU5).200611-0058) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/e0e08efa82cf49839524d699fcbfcdd32/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2019.0150.4043.16 ((SQLServer2019-CU5).200611-0058) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/fb3bc1d1ea3b445e8b2d8f82af2c83082/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2019.0150.4043.16 ((SQLServer2019-CU5).200611-0058) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/2250bc823b6d45d78bbb1526118d5bcd1/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2019.0150.4043.16 ((SQLServer2019-CU5).200611-0058) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/f15f1bb425e345fbbbf9052dfff3009f2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2019.0150.4043.16 ((SQLServer2019-CU5).200611-0058) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/7119961e9948486980ac4126d67f28671/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2019.0150.4043.16 ((SQLServer2019-CU5).200611-0058) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/a5e2854d1d5e4c1b9c354018f78c6ca91/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2019.0150.4043.16 ((SQLServer2019-CU5).200611-0058) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/822326dc5739477b9d02545c442b49911/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2019.0150.4043.16 ((SQLServer2019-CU5).200611-0058) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/5303b7b87c2c4e2789a75900f67989fe1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2019.0150.4043.16 ((SQLServer2019-CU5).200611-0058) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/17641aefa414415686ca0f4ad81a06a12/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2019.0150.4043.16 ((SQLServer2019-CU5).200611-0058) +``` + +# SQL Server 2019 RTM CU4 - 15.0.4033.1 - x64 (KB4548597) +``` powershell +# SQL Server 2019 RTM CU4 - 15.0.4033.1 - x64 (KB4548597) +$outputFolder = 'c:\sqlsyms\15.0.4033.1\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/a17ffc040bf74b9da5f1c2f8bee3b0ae2/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2019.0150.4033.01 ((SQLServer2019-CU4).200314-2237) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/007d639428594ba6b418a4031001af3c2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2019.0150.4033.01 ((SQLServer2019-CU4).200314-2237) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/a0e96c634bcf469ba8d5739a3763b31c2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2019.0150.4033.01 ((SQLServer2019-CU4).200314-2237) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/72be5cf0b1754f7990ac550066c59cf22/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2019.0150.4033.01 ((SQLServer2019-CU4).200314-2237) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/8cf1b3945a3342828669727df4b89a561/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2019.0150.4033.01 ((SQLServer2019-CU4).200314-2237) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/996fcbd6df90470fbf483f5bbc076f022/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2019.0150.4033.01 ((SQLServer2019-CU4).200314-2237) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/5e53ca24d90540b48d0c183348897c011/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2019.0150.4033.01 ((SQLServer2019-CU4).200314-2237) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/caaa30913c3f443fa2971996571662721/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2019.0150.4033.01 ((SQLServer2019-CU4).200314-2237) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/0727c20ffb694b7b966a311ba8a839ed1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2019.0150.4033.01 ((SQLServer2019-CU4).200314-2237) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/46e02f96623c4a3b980d6b915c81586c1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2019.0150.4033.01 ((SQLServer2019-CU4).200314-2237) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/f326b1ebadce4ed7b63721256723d9d12/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2019.0150.4033.01 ((SQLServer2019-CU4).200314-2237) +``` + +# SQL Server 2019 RTM CU3 - 15.0.4023.6 - x64 (KB4538853) +``` powershell +# SQL Server 2019 RTM CU3 - 15.0.4023.6 - x64 (KB4538853) +$outputFolder = 'c:\sqlsyms\15.0.4023.6\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/1f99f28740354638ab808a14641af26a2/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2019.0150.4023.06 ((SQLServer2019-CU3).200304-0805) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/7ec066594c274590ad0e4284ecbb7e7b2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2019.0150.4023.06 ((SQLServer2019-CU3).200304-0805) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/6f5ca7b595704b1a83302a33ae4bc0232/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2019.0150.4023.06 ((SQLServer2019-CU3).200304-0805) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/c5447784964c488cb3ec1370a45ce8a32/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2019.0150.4023.06 ((SQLServer2019-CU3).200304-0805) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/ac8c33e259e74a37be1fba98de2d5dea1/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2019.0150.4023.06 ((SQLServer2019-CU3).200304-0805) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/b82843359f73486ebb55be54a8258a512/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2019.0150.4023.06 ((SQLServer2019-CU3).200304-0805) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/eabcb2cbd8734147826fc8e5fed91d051/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2019.0150.4023.06 ((SQLServer2019-CU3).200304-0805) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/67e76e9883cc408ab61bef65da8566ca1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2019.0150.4023.06 ((SQLServer2019-CU3).200304-0805) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/4aa18ea029164914a8ebca601fb086f31/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2019.0150.4023.06 ((SQLServer2019-CU3).200304-0805) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/24f1b7e3408e46df88b53a0417eff0ec1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2019.0150.4023.06 ((SQLServer2019-CU3).200304-0805) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/e46cc8dbdfc540dda33b7bd994f636782/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2019.0150.4023.06 ((SQLServer2019-CU3).200304-0805) +``` + +# SQL Server 2019 RTM CU2 - 15.0.4013.40 - x64 (KB4536075) +``` powershell +# SQL Server 2019 RTM CU2 - 15.0.4013.40 - x64 (KB4536075) +$outputFolder = 'c:\sqlsyms\15.0.4013.40\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/db2c3b3cd98041eebe71f258bb783cf52/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2019.0150.4013.40 ((SQLServer2019-CU2).200204-0018) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/79cc12f37c694a4cb246d9ff1006f48a2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2019.0150.4013.40 ((SQLServer2019-CU2).200204-0018) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/135a7055bda8408a958cfd365c4a04342/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2019.0150.4013.40 ((SQLServer2019-CU2).200204-0018) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/8d85294d07c14151baa2c1fdcedb3d702/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2019.0150.4013.40 ((SQLServer2019-CU2).200204-0018) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/dc09a9a5bc5d41798cfd16759101bc0f1/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2019.0150.4013.40 ((SQLServer2019-CU2).200204-0018) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/f6fa22f7a94744a3836e2e336677209a2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2019.0150.4013.40 ((SQLServer2019-CU2).200204-0018) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/05c36542b2c44ac2b7e2b6718e4ee9dd1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2019.0150.4013.40 ((SQLServer2019-CU2).200204-0018) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/b2a184d9e3704c63a988ad8a142af4e81/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2019.0150.4013.40 ((SQLServer2019-CU2).200204-0018) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/2d4753074ba64ba193ab702286a752b71/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2019.0150.4013.40 ((SQLServer2019-CU2).200204-0018) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/19e519afd6a34b2ba91458cbf5378e801/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2019.0150.4013.40 ((SQLServer2019-CU2).200204-0018) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/70258a046ea44af38bf97bb73a90df412/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2019.0150.4013.40 ((SQLServer2019-CU2).200204-0018) +``` + +# SQL Server 2019 RTM CU1 - 15.0.4003.23 - x64 (KB4527376) +``` powershell +# SQL Server 2019 RTM CU1 - 15.0.4003.23 - x64 (KB4527376) +$outputFolder = 'c:\sqlsyms\15.0.4003.23\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/1c28d53f4ce34500a0824edf754bb3182/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2019.0150.4003.23 ((SQL19_RTM_QFE-OD).191206-2237) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/725357d7267b4fcb8bed1520f7638ae52/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2019.0150.4003.23 ((SQL19_RTM_QFE-OD).191206-2237) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/872bec978b414b4894b0007d495aff9c2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2019.0150.4003.23 ((SQL19_RTM_QFE-OD).191206-2237) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/c2f014bfeb4148e79fa69e3bdf81fc232/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2019.0150.4003.23 ((SQL19_RTM_QFE-OD).191206-2237) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/9186d8f25f3344849c0afbd8086431c71/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2019.0150.4003.23 ((SQL19_RTM_QFE-OD).191206-2237) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/86c0928cbca241508082e6ae13a7b2ad2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2019.0150.4003.23 ((SQL19_RTM_QFE-OD).191206-2237) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/ddc9bae1e79e4be38aba05b28f20ba481/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2019.0150.4003.23 ((SQL19_RTM_QFE-OD).191206-2237) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/9c7a349dca4a4f8bb2a405e2a36d7b091/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2019.0150.4003.23 ((SQL19_RTM_QFE-OD).191206-2237) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/f19350dff8c54443aee52644b816d1371/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2019.0150.4003.23 ((SQL19_RTM_QFE-OD).191206-2237) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/6c2376ab69404cf89eea336bc33242371/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2019.0150.4003.23 ((SQL19_RTM_QFE-OD).191206-2237) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/db06d320fc1a4f1492e857d7804288672/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2019.0150.4003.23 ((SQL19_RTM_QFE-OD).191206-2237) +``` + +# SQL Server 2019 RTM Servicing Update (GDR1) - 15.0.2070.41 - x64 (KB4517790) +``` powershell +# SQL Server 2019 RTM Servicing Update (GDR1) - 15.0.2070.41 - x64 (KB4517790) +$outputFolder = 'c:\sqlsyms\15.0.2070.41\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/35fa14a3b9874a72a017fadba93e24b12/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2019.0150.2070.41 ((SQLServer).191029-0237) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/1535e7976f0a431baf2704de5f2e5fdc2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2019.0150.2070.41 ((SQLServer).191029-0237) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/9cb9edfe939f4b03b50222c9b39f196c2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2019.0150.2070.41 ((SQLServer).191029-0237) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/bdd5d0345b64423394986dc1a4a37e3d2/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2019.0150.2070.41 ((SQLServer).191029-0237) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/01955e0a0c344aa9ba96522fb1ce96671/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2019.0150.2070.41 ((SQLServer).191029-0237) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/34e92930c4454a74acadc5f504d350f92/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2019.0150.2070.41 ((SQLServer).191029-0237) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/39717e154f0746668714cce86cebc6ba1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2019.0150.2070.41 ((SQLServer).191029-0237) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/e1295a820f7d4cb08ca66421bc0e872c1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2019.0150.2070.41 ((SQLServer).191029-0237) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/30c5297c5e244754a8e799717f9dd69b1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2019.0150.2070.41 ((SQLServer).191029-0237) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/69bd28349a494ebca2c0c0be7230183c1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2019.0150.2070.41 ((SQLServer).191029-0237) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/c0ead5152bae41f69d8dbcb210237a062/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2019.0150.2070.41 ((SQLServer).191029-0237) +``` + +# SQL Server 2019 RTM RTM - 15.0.2000.5 - x64 (Nov 2019) +``` powershell +# SQL Server 2019 RTM RTM - 15.0.2000.5 - x64 (Nov 2019) +$outputFolder = 'c:\sqlsyms\15.0.2000.5\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/a32ecbddb336439994cc1bf8ca5612052/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2019.0150.2000.05 ((SQLServer).190924-2033) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/c451d01cb0d142afb1e497def47bd4b32/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2019.0150.2000.05 ((SQLServer).190924-2033) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/b69375ae56964976a91c384bda088abc2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2019.0150.2000.05 ((SQLServer).190924-2033) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/c111d07e3fe9461cb21655d20b2f13e82/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2019.0150.2000.05 ((SQLServer).190924-2033) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/d3cc4bb1711f45e5bdcbfdc6ce90400e1/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2019.0150.2000.05 ((SQLServer).190924-2033) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/ee3b2b5f10024545bc623c768f8e98c82/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2019.0150.2000.05 ((SQLServer).190924-2033) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/b996f74062ef41f88e762d7cde413ca81/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2019.0150.2000.05 ((SQLServer).190924-2033) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/a5b534efcad44ea4b8951a28847907031/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2019.0150.2000.05 ((SQLServer).190924-2033) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/139725cae1124fd19c7065ca5dd091c01/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2019.0150.2000.05 ((SQLServer).190924-2033) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/6e3e07ad09d6475aae40a87c8483f31e1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2019.0150.2000.05 ((SQLServer).190924-2033) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/55586008647b45f49f51934563c320cb2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2019.0150.2000.05 ((SQLServer).190924-2033) +``` + +# SQL Server 2019 RC RC1 - 15.0.1900.25 - x64 (Aug 2019) +``` powershell +# SQL Server 2019 RC RC1 - 15.0.1900.25 - x64 (Aug 2019) +$outputFolder = 'c:\sqlsyms\15.0.1900.25\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/807730dc54d8486cbb301034d5c8e8d42/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2019.0150.1900.25 ((SQLServer).190816-2101) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/df94c4b01e8b47a7aab9cc2c24b425bb2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2019.0150.1900.25 ((SQLServer).190816-2101) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/176f91f058de40ca94e15eda8da9cc382/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2019.0150.1900.25 ((SQLServer).190816-2101) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/a3397ad3fbbd424eb40829ec9875fc832/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2019.0150.1900.25 ((SQLServer).190816-2101) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/7c43dc13a0244c34a87633c0b3bdf9851/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2019.0150.1900.25 ((SQLServer).190816-2101) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/e2f9e096f96e4860b8ba44cf4cc5a0a72/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2019.0150.1900.25 ((SQLServer).190816-2101) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/ca9b35071e0143df9136f86359a5ac471/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2019.0150.1900.25 ((SQLServer).190816-2101) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/a11cc82202ff404a9241a178f6c5c5eb1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2019.0150.1900.25 ((SQLServer).190816-2101) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/bdfab5fc03914efc839596e3476487e51/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2019.0150.1900.25 ((SQLServer).190816-2101) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/ebd4a16987eb4c8198107eca6471f4af1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2019.0150.1900.25 ((SQLServer).190816-2101) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/8f08dd3bcf934ea8933e21473ded4a042/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2019.0150.1900.25 ((SQLServer).190816-2101) +``` + +# SQL Server 2019 CTP CTP 3.2 - 15.0.1800.32 - x64 (Jul 2019) +``` powershell +# SQL Server 2019 CTP CTP 3.2 - 15.0.1800.32 - x64 (Jul 2019) +$outputFolder = 'c:\sqlsyms\15.0.1800.32\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/9c623f4336c24e489fd8dd3998f34cc02/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2019.0150.1800.32 ((SQLServer).190718-0401) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/e705bad3292c47e4b4d6963b8e559a1d2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2019.0150.1800.32 ((SQLServer).190718-0401) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/7a2bc2e75f4f4bc4ae68bbb4952c30642/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2019.0150.1800.32 ((SQLServer).190718-0401) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/9f16df7c1680418d83a375eb42883a312/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2019.0150.1800.32 ((SQLServer).190718-0401) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/85d769fd63df4a07b0bd03e683b3ac8e1/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2019.0150.1800.32 ((SQLServer).190718-0401) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/fa2ccd5225de4ff3a33d2f28ddb69ec22/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2019.0150.1800.32 ((SQLServer).190718-0401) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/1c3a00d0fa0a41d89e8f0b5ba2713f5d1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2019.0150.1800.32 ((SQLServer).190718-0401) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/886259b54c1246ff9884f355af67f1201/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2019.0150.1800.32 ((SQLServer).190718-0401) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/87b8448051c848149b5beb098d4880841/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2019.0150.1800.32 ((SQLServer).190718-0401) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/434635bff10945e8bb07c9f25339e75e1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2019.0150.1800.32 ((SQLServer).190718-0401) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/22541fc9a9034693b17da8546301e3bb2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2019.0150.1800.32 ((SQLServer).190718-0401) +``` + +# SQL Server 2019 CTP CTP3.1 - 15.0.1700.37 - x64 (Jun 2019) +``` powershell +# SQL Server 2019 CTP CTP3.1 - 15.0.1700.37 - x64 (Jun 2019) +$outputFolder = 'c:\sqlsyms\15.0.1700.37\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/9e557f85f9224d708abf2f557c7456e62/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2019.0150.1700.37 ((SQLServer).190619-1757) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/9af9b26e3fea49f1bd5b5367174bd9242/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2019.0150.1700.37 ((SQLServer).190619-1757) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/a6090023473742aa8f5c2fe198274cfe2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2019.0150.1700.37 ((SQLServer).190619-1757) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/e7708ef60f1d406f8bf6b05117dd8d962/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2019.0150.1700.37 ((SQLServer).190619-1757) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/12aa7d212fb14305bb582a9d0156079c1/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2019.0150.1700.37 ((SQLServer).190619-1757) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/60706aa038aa4e84901a0eb75c660d452/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2019.0150.1700.37 ((SQLServer).190619-1757) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/6b687fb2adab4f49b13169f0f6a6b1261/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2019.0150.1700.37 ((SQLServer).190619-1757) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/b96e03193f454e32a634e57ec66cb2dc1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2019.0150.1700.37 ((SQLServer).190619-1757) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/6b65fc282cf944fa9f3facf18303fa2e1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2019.0150.1700.37 ((SQLServer).190619-1757) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/0eed3325fb7f4ee085f479e484f5bfa81/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2019.0150.1700.37 ((SQLServer).190619-1757) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/51dbb121d73f4dbaa4640507a7558ecc2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2019.0150.1700.37 ((SQLServer).190619-1757) +``` + +# SQL Server 2019 CTP CTP3.0 - 15.0.1600.8 - x64 (May 2019) +``` powershell +# SQL Server 2019 CTP CTP3.0 - 15.0.1600.8 - x64 (May 2019) +$outputFolder = 'c:\sqlsyms\15.0.1600.8\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/8be214152c184afcaa324365f9c1a3b52/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2019.0150.1600.08 ((SQLServer).190517-0718) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/6bf39a278a27415e9aabfdb240d9ca612/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2019.0150.1600.08 ((SQLServer).190517-0718) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/c3e953f7f5704ce69b8ca62fbc62656b2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2019.0150.1600.08 ((SQLServer).190517-0718) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/8e72849826824e919215135180d284d92/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2019.0150.1600.08 ((SQLServer).190517-0718) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/d0e0e82ed4be4852962c4ac90303107c1/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2019.0150.1600.08 ((SQLServer).190517-0718) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/3986538b627e42b982a5c663fa9751862/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2019.0150.1600.08 ((SQLServer).190517-0718) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/866191ebab104dd38be0a902d87762581/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2019.0150.1600.08 ((SQLServer).190517-0718) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/38304f5776fc4982a96cf4628dcc51941/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2019.0150.1600.08 ((SQLServer).190517-0718) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/3bfcef2ebbba4702af4be06c10c06f861/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2019.0150.1600.08 ((SQLServer).190517-0718) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/25b7cfed794846d8acfed97c702ba2cd1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2019.0150.1600.08 ((SQLServer).190517-0718) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/a0d82d62e01542b9962d6093d402ebf62/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2019.0150.1600.08 ((SQLServer).190517-0718) +``` + +# SQL Server 2019 CTP CTP2.5 - 15.0.1500.28 - x64 (April 2019) +``` powershell +# SQL Server 2019 CTP CTP2.5 - 15.0.1500.28 - x64 (April 2019) +$outputFolder = 'c:\sqlsyms\15.0.1500.28\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/de490193e66048d4b8f93980b36f5cec2/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2019.0150.1500.28 ((SQLServer).190415-2131) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/222c7b12b2d34c709a092e59249e541a2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2019.0150.1500.28 ((SQLServer).190415-2131) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/ae39c1a85f294c068a7510b8c93814432/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2019.0150.1500.28 ((SQLServer).190415-2131) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/6916c4073925451ba18162d2b39980dc2/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2019.0150.1500.28 ((SQLServer).190415-2131) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/1c80ecdf24d44affa414ab37a3a78f6f1/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2019.0150.1500.28 ((SQLServer).190415-2131) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/af19898435d34f4e9f1dcda16e34b98a2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2019.0150.1500.28 ((SQLServer).190415-2131) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/f0f4f38d477a491db3fa7360b91551531/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2019.0150.1500.28 ((SQLServer).190415-2131) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/3f3eafd827f14c60ba3709af3fa2af791/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2019.0150.1500.28 ((SQLServer).190415-2131) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/09127f33dee145fcb2b1828163d986a11/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2019.0150.1500.28 ((SQLServer).190415-2131) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/dc460c45ed50496f9eff9c3fc107f46f1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2019.0150.1500.28 ((SQLServer).190415-2131) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/2fe2f4d6593444dca6294d8694cc01442/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2019.0150.1500.28 ((SQLServer).190415-2131) +``` + +# SQL Server 2019 CTP CTP2.4 - 15.0.1400.75 - x64 (March 2019) +``` powershell +# SQL Server 2019 CTP CTP2.4 - 15.0.1400.75 - x64 (March 2019) +$outputFolder = 'c:\sqlsyms\15.0.1400.75\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/19d870c6afaa43c9b925ace5a6c841d92/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2019.0150.1400.75 ((SQLServer).190316-1802) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/a3a47799b1b64d928b721a14d2caa7252/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2019.0150.1400.75 ((SQLServer).190316-1802) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/14270b62941a4b98bd6c0f4e640ce7182/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2019.0150.1400.75 ((SQLServer).190316-1802) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/7348cf1b0b4a4fe6bd0a8091df4b602a2/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2019.0150.1400.75 ((SQLServer).190316-1802) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/ad38a740f1a54a93b5ad507dcdd9d4d01/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2019.0150.1400.75 ((SQLServer).190316-1802) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/32664240697e4a6a99c56bbaa4b286a32/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2019.0150.1400.75 ((SQLServer).190316-1802) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/a6fad09bf4054c9697c38eb84eae5a801/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2019.0150.1400.75 ((SQLServer).190316-1802) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/70da4b6f6a574d47bba5cc811ec1046a1/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2019.0150.1400.75 ((SQLServer).190316-1802) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/dbd7a18fab2946f8a58c35c6bcdfa13d1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2019.0150.1400.75 ((SQLServer).190316-1802) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/1b74c0360a0e4338a7d92cd8c00cd9d31/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2019.0150.1400.75 ((SQLServer).190316-1802) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/dde99a1492e84ef0926504cfe6afebec2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2019.0150.1400.75 ((SQLServer).190316-1802) +``` + +# SQL Server 2019 CTP CTP2.3 - 15.0.1300.359 - x64 (Feb 2019) +``` powershell +# SQL Server 2019 CTP CTP2.3 - 15.0.1300.359 - x64 (Feb 2019) +$outputFolder = 'c:\sqlsyms\15.0.1300.359\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/8d76a19c14344ec387a897611b8b8b882/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2019.0150.1300.359 ((SQLServer).190216-0730) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/a3f62ef419b64a8c973a24150ba095b22/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2019.0150.1300.359 ((SQLServer).190216-0730) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/66abfc4397dd480f8873349e5edbfd142/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2019.0150.1300.359 ((SQLServer).190216-0730) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/c7ce4847496848b2ae3f24a282f479b12/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2019.0150.1300.359 ((SQLServer).190216-0730) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/a0f649ac82df495ba6a2a8fd818fb1dd1/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2019.0150.1300.359 ((SQLServer).190216-0730) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/33dbea5fbe0143d58286fe47f21605702/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2019.0150.1300.359 ((SQLServer).190216-0730) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/b1b0c9de60a14ec5a04f8f1cd80a75301/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2019.0150.1300.359 ((SQLServer).190216-0730) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/4293b10217714217a630622cb51ca0861/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2019.0150.1300.359 ((SQLServer).190216-0730) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/68bda83b7e99449987e9bdaa25a3abd31/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2019.0150.1300.359 ((SQLServer).190216-0730) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/aff6d1fc049e46028094cb26ee5fb9101/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2019.0150.1300.359 ((SQLServer).190216-0730) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/377253089c3e42168bbd7d13bedb1da52/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2019.0150.1300.359 ((SQLServer).190216-0730) +``` + +# SQL Server 2019 CTP CTP2.2 - 15.0.1200.24 - x64 (Dec 2018) +``` powershell +# SQL Server 2019 CTP CTP2.2 - 15.0.1200.24 - x64 (Dec 2018) +$outputFolder = 'c:\sqlsyms\15.0.1200.24\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/2c606b4367a4429c992d5ca42512c7282/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2018.0150.1200.24 ((SQLServer).181205-2233) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/a67be7179bab4e30bc9e9b2bf0a0259a2/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2018.0150.1200.24 ((SQLServer).181205-2233) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/9a0e2aabffc94c52a0c130ba253fe9712/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2018.0150.1200.24 ((SQLServer).181205-2233) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/d58e802ce7984e098a7cec464a001bee2/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2018.0150.1200.24 ((SQLServer).181205-2233) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/15d57320c04b444bb34709c58a93d1691/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2018.0150.1200.24 ((SQLServer).181205-2233) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/8eb24ab8cb084224b18cdb3aaa075be02/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2018.0150.1200.24 ((SQLServer).181205-2233) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/40669c7f8e7f4d33949b7c590b78ae581/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2018.0150.1200.24 ((SQLServer).181205-2233) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/48d913073c2c404cac8f449c33020ba31/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2018.0150.1200.24 ((SQLServer).181205-2233) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/71c0383ff3d64837baa474cb8fd46d341/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2018.0150.1200.24 ((SQLServer).181205-2233) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/25ac40a4dfb04d8d9e943259156c6eff1/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2018.0150.1200.24 ((SQLServer).181205-2233) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/eef4684b29ec49ada134bf2e5d266c7b2/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2018.0150.1200.24 ((SQLServer).181205-2233) +``` + +# SQL Server 2019 CTP CTP2.1 - 15.0.1100.94 - x64 (Nov 2018) +``` powershell +# SQL Server 2019 CTP CTP2.1 - 15.0.1100.94 - x64 (Nov 2018) +$outputFolder = 'c:\sqlsyms\15.0.1100.94\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/2396a09ad02847069a2932edada5013f2/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2018.0150.1100.94 ((SQLServer).181101-2034) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/2a859b14f55a49b18757dae8a9d431b02/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2018.0150.1100.94 ((SQLServer).181101-2034) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/84f83087a0914973a9378f1bd7391f0a2/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2018.0150.1100.94 ((SQLServer).181101-2034) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/4a0764a16a9f4862a294c68fa70d9e362/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2018.0150.1100.94 ((SQLServer).181101-2034) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/15a322a3311b4663b97cd77c55312efc3/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2018.0150.1100.94 ((SQLServer).181101-2034) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/2c7c552e20814e7cafd031b4a5f55ff82/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2018.0150.1100.94 ((SQLServer).181101-2034) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/1861f31229a24d098ba62005e71ec1ed1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2018.0150.1100.94 ((SQLServer).181101-2034) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/0eefeca4685943f0b57d87091fda67e41/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2018.0150.1100.94 ((SQLServer).181101-2034) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/c9379eab5bab492cbbff0cec75549d6f1/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2018.0150.1100.94 ((SQLServer).181101-2034) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/c8e790ff4bdf41bc976393b733fae5521/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2018.0150.1100.94 ((SQLServer).181101-2034) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/28856cd400a64ae8bdd78eee5d1969a12/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2018.0150.1100.94 ((SQLServer).181101-2034) +``` + +# SQL Server 2019 CTP CTP2.0 - 15.0.1000.34 - x64 (Oct 2018) +``` powershell +# SQL Server 2019 CTP CTP2.0 - 15.0.1000.34 - x64 (Oct 2018) +$outputFolder = 'c:\sqlsyms\15.0.1000.34\x64' # <>' +mkdir -f $outputFolder +if (-not (Test-Path "$outputFolder\SqlDK.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlDK.pdb/1fb52db46791403f80a736a3a2892d872/SqlDK.pdb' -OutFile "$outputFolder\SqlDK.pdb" } # File version 2018.0150.1000.34 ((SQLServer).180918-0824) +if (-not (Test-Path "$outputFolder\sqlmin.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlmin.pdb/dbb1be06cf8f47fab0354ab426dc85b82/sqlmin.pdb' -OutFile "$outputFolder\sqlmin.pdb" } # File version 2018.0150.1000.34 ((SQLServer).180918-0824) +if (-not (Test-Path "$outputFolder\sqllang.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqllang.pdb/e0c87c8653a14fce8988a727a0c113742/sqllang.pdb' -OutFile "$outputFolder\sqllang.pdb" } # File version 2018.0150.1000.34 ((SQLServer).180918-0824) +if (-not (Test-Path "$outputFolder\SqlTsEs.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SqlTsEs.pdb/95328c1d4b7e4c0991b1e3b23d7599132/SqlTsEs.pdb' -OutFile "$outputFolder\SqlTsEs.pdb" } # File version 2018.0150.1000.34 ((SQLServer).180918-0824) +if (-not (Test-Path "$outputFolder\sqlaccess.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlaccess.pdb/d51850bf713a4cd0bd080a52bdbda48d3/sqlaccess.pdb' -OutFile "$outputFolder\sqlaccess.pdb" } # File version 2018.0150.1000.34 ((SQLServer).180918-0824) +if (-not (Test-Path "$outputFolder\qds.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/qds.pdb/b7b40f4370474643b66a0b4f458bfa1e2/qds.pdb' -OutFile "$outputFolder\qds.pdb" } # File version 2018.0150.1000.34 ((SQLServer).180918-0824) +if (-not (Test-Path "$outputFolder\hkruntime.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkruntime.pdb/6b48ecaa4c254d3fb8415b7b48b1addf1/hkruntime.pdb' -OutFile "$outputFolder\hkruntime.pdb" } # File version 2018.0150.1000.34 ((SQLServer).180918-0824) +if (-not (Test-Path "$outputFolder\hkengine.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkengine.pdb/98e6ce276a384a459c3902090bb411e01/hkengine.pdb' -OutFile "$outputFolder\hkengine.pdb" } # File version 2018.0150.1000.34 ((SQLServer).180918-0824) +if (-not (Test-Path "$outputFolder\hkcompile.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/hkcompile.pdb/b3123f07e8a24ff99677f0c0a39ab3461/hkcompile.pdb' -OutFile "$outputFolder\hkcompile.pdb" } # File version 2018.0150.1000.34 ((SQLServer).180918-0824) +if (-not (Test-Path "$outputFolder\SQLOS.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/SQLOS.pdb/1c74d1e91078452f9facb3317fdf7b851/SQLOS.pdb' -OutFile "$outputFolder\SQLOS.pdb" } # File version 2018.0150.1000.34 ((SQLServer).180918-0824) +if (-not (Test-Path "$outputFolder\sqlservr.pdb")) { Invoke-WebRequest -uri 'https://msdl.microsoft.com/download/symbols/sqlservr.pdb/b3c1eb7ab1d2455aac81b7eb7fb43a162/sqlservr.pdb' -OutFile "$outputFolder\sqlservr.pdb" } # File version 2018.0150.1000.34 ((SQLServer).180918-0824) +``` + diff --git a/Errors/README.md b/Errors/README.md index 9706ae62..8c01d4f0 100644 --- a/Errors/README.md +++ b/Errors/README.md @@ -2,15 +2,15 @@ ## Useful links - - [System Error Messages](https://technet.microsoft.com/en-us/library/cc645603%28v=sql.105%29.aspx) - - [Database Engine Error Severities](https://docs.microsoft.com/en-us/sql/relational-databases/errors-events/database-engine-error-severities) - - [Integration Services Error and Message Reference](https://docs.microsoft.com/en-us/sql/integration-services/integration-services-error-and-message-reference) - - [View and Read SQL Server Setup Log Files](https://docs.microsoft.com/en-us/sql/database-engine/install-windows/view-and-read-sql-server-setup-log-files) - - [Troubleshoot the SQL Server Utility](https://docs.microsoft.com/en-us/sql/database-engine/troubleshoot-the-sql-server-utility) - - [Common Issues: Licensing Errors](http://blogs.sqlsentry.com/georgeboakye/common-issues-licensing-errors/) - - [SQL Server 2016 Distributed Replay Errors](https://www.sqlskills.com/blogs/jonathan/sql-server-2016-distributed-replay-errors/) - - [The Instance ID MSSQLSERVER Is Already In Use](http://www.sqlservercentral.com/articles/MSSQLSERVER/161398/) - - [SQL Server: Detach/Attach Gotchas!](https://sqljana.wordpress.com/2018/04/08/sql-server-detach-attach-gotchas/) +- [System Error Messages](https://technet.microsoft.com/en-us/library/cc645603%28v=sql.105%29.aspx) +- [Database Engine Error Severities](https://docs.microsoft.com/en-us/sql/relational-databases/errors-events/database-engine-error-severities) +- [Integration Services Error and Message Reference](https://docs.microsoft.com/en-us/sql/integration-services/integration-services-error-and-message-reference) +- [View and Read SQL Server Setup Log Files](https://docs.microsoft.com/en-us/sql/database-engine/install-windows/view-and-read-sql-server-setup-log-files) +- [Troubleshoot the SQL Server Utility](https://docs.microsoft.com/en-us/sql/database-engine/troubleshoot-the-sql-server-utility) +- [Common Issues: Licensing Errors](https://www.sentryone.com/blog/georgeboakye/common-issues-licensing-errors) +- [SQL Server 2016 Distributed Replay Errors](https://www.sqlskills.com/blogs/jonathan/sql-server-2016-distributed-replay-errors/) +- [The Instance ID MSSQLSERVER Is Already In Use](http://www.sqlservercentral.com/articles/MSSQLSERVER/161398/) +- [SQL Server: Detach/Attach Gotchas!](https://sqljana.wordpress.com/2018/04/08/sql-server-detach-attach-gotchas/) ## SQL Server All Errors List @@ -18,47 +18,47 @@ ```sql SELECT message_id, severity, text FROM sys.messages - WHERE language_id = 1033; -- assuming US English + WHERE language_id = 1033; /* assuming US English */ ``` Your `language_id` you can find in [`sys.syslanguages`](https://docs.microsoft.com/en-us/sql/relational-databases/system-compatibility-views/sys-syslanguages-transact-sql) system view, column `msglangid`: -langid | dateformat | datefirst | upgrade | name | alias | months | shortmonths | days | lcid | msglangid --------|------------|-----------|---------|--------------------|---------------------|----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|------|---------- -0 | mdy | 7 | 0 | us_english | English | January,February,March,April,May,June,July,August,September,October,November,December | Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec | Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday | 1033 | 1033 -1 | dmy | 1 | 0 | Deutsch | German | Januar,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember | Jan,Feb,Mär,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez | Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag,Sonntag | 1031 | 1031 -2 | dmy | 1 | 0 | Français | French | janvier,février,mars,avril,mai,juin,juillet,août,septembre,octobre,novembre,décembre | janv,févr,mars,avr,mai,juin,juil,août,sept,oct,nov,déc | lundi,mardi,mercredi,jeudi,vendredi,samedi,dimanche | 1036 | 1036 -3 | ymd | 7 | 0 | 日本語 | Japanese | 01,02,03,04,05,06,07,08,09,10,11,12 | 01,02,03,04,05,06,07,08,09,10,11,12 | 月曜日,火曜日,水曜日,木曜日,金曜日,土曜日,日曜日 | 1041 | 1041 -4 | dmy | 1 | 0 | Dansk | Danish | januar,februar,marts,april,maj,juni,juli,august,september,oktober,november,december | jan,feb,mar,apr,maj,jun,jul,aug,sep,okt,nov,dec | mandag,tirsdag,onsdag,torsdag,fredag,lørdag,søndag | 1030 | 1030 -5 | dmy | 1 | 0 | Español | Spanish | Enero,Febrero,Marzo,Abril,Mayo,Junio,Julio,Agosto,Septiembre,Octubre,Noviembre,Diciembre | Ene,Feb,Mar,Abr,May,Jun,Jul,Ago,Sep,Oct,Nov,Dic | Lunes,Martes,Miércoles,Jueves,Viernes,Sábado,Domingo | 3082 | 3082 -6 | dmy | 1 | 0 | Italiano | Italian | gennaio,febbraio,marzo,aprile,maggio,giugno,luglio,agosto,settembre,ottobre,novembre,dicembre | gen,feb,mar,apr,mag,giu,lug,ago,set,ott,nov,dic | lunedì,martedì,mercoledì,giovedì,venerdì,sabato,domenica | 1040 | 1040 -7 | dmy | 1 | 0 | Nederlands | Dutch | januari,februari,maart,april,mei,juni,juli,augustus,september,oktober,november,december | jan,feb,mrt,apr,mei,jun,jul,aug,sep,okt,nov,dec | maandag,dinsdag,woensdag,donderdag,vrijdag,zaterdag,zondag | 1043 | 1043 -8 | dmy | 1 | 0 | Norsk | Norwegian | januar,februar,mars,april,mai,juni,juli,august,september,oktober,november,desember | jan,feb,mar,apr,mai,jun,jul,aug,sep,okt,nov,des | mandag,tirsdag,onsdag,torsdag,fredag,lørdag,søndag | 2068 | 2068 -9 | dmy | 7 | 0 | Português | Portuguese | janeiro,fevereiro,março,abril,maio,junho,julho,agosto,setembro,outubro,novembro,dezembro | jan,fev,mar,abr,mai,jun,jul,ago,set,out,nov,dez | segunda-feira,terça-feira,quarta-feira,quinta-feira,sexta-feira,sábado,domingo | 2070 | 2070 -10 | dmy | 1 | 0 | Suomi | Finnish | tammikuuta,helmikuuta,maaliskuuta,huhtikuuta,toukokuuta,kesäkuuta,heinäkuuta,elokuuta,syyskuuta,lokakuuta,marraskuuta,joulukuuta | tammi,helmi,maalis,huhti,touko,kesä,heinä,elo,syys,loka,marras,joulu | maanantai,tiistai,keskiviikko,torstai,perjantai,lauantai,sunnuntai | 1035 | 1035 -11 | ymd | 1 | 0 | Svenska | Swedish | januari,februari,mars,april,maj,juni,juli,augusti,september,oktober,november,december | jan,feb,mar,apr,maj,jun,jul,aug,sep,okt,nov,dec | måndag,tisdag,onsdag,torsdag,fredag,lördag,söndag | 1053 | 1053 -12 | dmy | 1 | 0 | čeština | Czech | leden,únor,březen,duben,květen,červen,červenec,srpen,září,říjen,listopad,prosinec | I,II,III,IV,V,VI,VII,VIII,IX,X,XI,XII | pondělí,úterý,středa,čtvrtek,pátek,sobota,neděle | 1029 | 1029 -13 | ymd | 1 | 0 | magyar | Hungarian | január,február,március,április,május,június,július,augusztus,szeptember,október,november,december | jan,febr,márc,ápr,máj,jún,júl,aug,szept,okt,nov,dec | hétfő,kedd,szerda,csütörtök,péntek,szombat,vasárnap | 1038 | 1038 -14 | dmy | 1 | 0 | polski | Polish | styczeń,luty,marzec,kwiecień,maj,czerwiec,lipiec,sierpień,wrzesień,październik,listopad,grudzień | I,II,III,IV,V,VI,VII,VIII,IX,X,XI,XII | poniedziałek,wtorek,środa,czwartek,piątek,sobota,niedziela | 1045 | 1045 -15 | dmy | 1 | 0 | română | Romanian | ianuarie,februarie,martie,aprilie,mai,iunie,iulie,august,septembrie,octombrie,noiembrie,decembrie | Ian,Feb,Mar,Apr,Mai,Iun,Iul,Aug,Sep,Oct,Nov,Dec | luni,marţi,miercuri,joi,vineri,sîmbătă,duminică | 1048 | 1048 -16 | ymd | 1 | 0 | hrvatski | Croatian | siječanj,veljača,ožujak,travanj,svibanj,lipanj,srpanj,kolovoz,rujan,listopad,studeni,prosinac | sij,vel,ožu,tra,svi,lip,srp,kol,ruj,lis,stu,pro | ponedjeljak,utorak,srijeda,četvrtak,petak,subota,nedjelja | 1050 | 1050 -17 | dmy | 1 | 0 | slovenčina | Slovak | január,február,marec,apríl,máj,jún,júl,august,september,október,november,december | I,II,III,IV,V,VI,VII,VIII,IX,X,XI,XII | pondelok,utorok,streda,štvrtok,piatok,sobota,nedeľa | 1051 | 1051 -18 | dmy | 1 | 0 | slovenski | Slovenian | januar,februar,marec,april,maj,junij,julij,avgust,september,oktober,november,december | jan,feb,mar,apr,maj,jun,jul,avg,sept,okt,nov,dec | ponedeljek,torek,sreda,četrtek,petek,sobota,nedelja | 1060 | 1060 -19 | dmy | 1 | 0 | ελληνικά | Greek | Ιανουαρίου,Φεβρουαρίου,Μαρτίου,Απριλίου,Μα_ου,Ιουνίου,Ιουλίου,Αυγούστου,Σεπτεμβρίου,Οκτωβρίου,Νοεμβρίου,Δεκεμβρίου | Ιαν,Φεβ,Μαρ,Απρ,Μαϊ,Ιουν,Ιουλ,Αυγ,Σεπ,Οκτ,Νοε,Δεκ | Δευτέρα,Τρίτη,Τετάρτη,Πέμπτη,Παρασκευή,Σάββατο,Κυριακή | 1032 | 1032 -20 | dmy | 1 | 0 | български | Bulgarian | януари,февруари,март,април,май,юни,юли,август,септември,октомври,ноември,декември | януари,февруари,март,април,май,юни,юли,август,септември,октомври,ноември,декември | понеделник,вторник,сряда,четвъртък,петък,събота,неделя | 1026 | 1026 -21 | dmy | 1 | 0 | русский | Russian | Январь,Февраль,Март,Апрель,Май,Июнь,Июль,Август,Сентябрь,Октябрь,Ноябрь,Декабрь | янв,фев,мар,апр,май,июн,июл,авг,сен,окт,ноя,дек | понедельник,вторник,среда,четверг,пятница,суббота,воскресенье | 1049 | 1049 -22 | dmy | 1 | 0 | Türkçe | Turkish | Ocak,Şubat,Mart,Nisan,Mayıs,Haziran,Temmuz,Ağustos,Eylül,Ekim,Kasım,Aralık | Oca,Şub,Mar,Nis,May,Haz,Tem,Ağu,Eyl,Eki,Kas,Ara | Pazartesi,Salı,Çarşamba,Perşembe,Cuma,Cumartesi,Pazar | 1055 | 1055 -23 | dmy | 1 | 0 | British | British English | January,February,March,April,May,June,July,August,September,October,November,December | Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec | Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday | 2057 | 1033 -24 | dmy | 1 | 0 | eesti | Estonian | jaanuar,veebruar,märts,aprill,mai,juuni,juuli,august,september,oktoober,november,detsember | jaan,veebr,märts,apr,mai,juuni,juuli,aug,sept,okt,nov,dets | esmaspäev,teisipäev,kolmapäev,neljapäev,reede,laupäev,pühapäev | 1061 | 1061 -25 | ymd | 1 | 0 | latviešu | Latvian | janvāris,februāris,marts,aprīlis,maijs,jūnijs,jūlijs,augusts,septembris,oktobris,novembris,decembris | jan,feb,mar,apr,mai,jūn,jūl,aug,sep,okt,nov,dec | pirmdiena,otrdiena,trešdiena,ceturtdiena,piektdiena,sestdiena,svētdiena | 1062 | 1062 -26 | ymd | 1 | 0 | lietuvių | Lithuanian | sausis,vasaris,kovas,balandis,gegužė,birželis,liepa,rugpjūtis,rugsėjis,spalis,lapkritis,gruodis | sau,vas,kov,bal,geg,bir,lie,rgp,rgs,spl,lap,grd | pirmadienis,antradienis,trečiadienis,ketvirtadienis,penktadienis,šeštadienis,sekmadienis | 1063 | 1063 -27 | dmy | 7 | 0 | Português (Brasil) | Brazilian | Janeiro,Fevereiro,Março,Abril,Maio,Junho,Julho,Agosto,Setembro,Outubro,Novembro,Dezembro | Jan,Fev,Mar,Abr,Mai,Jun,Jul,Ago,Set,Out,Nov,Dez | Segunda-Feira,Terça-Feira,Quarta-Feira,Quinta-Feira,Sexta-Feira,Sábado,Domingo | 1046 | 1046 -28 | ymd | 7 | 0 | 繁體中文 | Traditional Chinese | 一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月 | 01,02,03,04,05,06,07,08,09,10,11,12 | 星期一,星期二,星期三,星期四,星期五,星期六,星期日 | 1028 | 1028 -29 | ymd | 7 | 0 | 한국어 | Korean | 01,02,03,04,05,06,07,08,09,10,11,12 | 01,02,03,04,05,06,07,08,09,10,11,12 | 월요일,화요일,수요일,목요일,금요일,토요일,일요일 | 1042 | 1042 -30 | ymd | 7 | 0 | 简体中文 | Simplified Chinese | 01,02,03,04,05,06,07,08,09,10,11,12 | 01,02,03,04,05,06,07,08,09,10,11,12 | 星期一,星期二,星期三,星期四,星期五,星期六,星期日 | 2052 | 2052 -31 | dmy | 1 | 0 | Arabic | Arabic | Muharram,Safar,Rabie I,Rabie II,Jumada I,Jumada II,Rajab,Shaaban,Ramadan,Shawwal,Thou Alqadah,Thou Alhajja | Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec | Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday | 1025 | 1025 -32 | dmy | 7 | 0 | ไทย | Thai | มกราคม,กุมภาพันธ์,มีนาคม,เมษายน,พฤษภาคม,มิถุนายน,กรกฎาคม,สิงหาคม,กันยายน,ตุลาคม,พฤศจิกายน,ธันวาคม | ม.ค.,ก.พ.,มี.ค.,เม.ย.,พ.ค.,มิ.ย.,ก.ค.,ส.ค.,ก.ย.,ต.ค.,พ.ย.,ธ.ค. | จันทร์,อังคาร,พุธ,พฤหัสบดี,ศุกร์,เสาร์,อาทิตย์ | 1054 | 1054 -33 | dmy | 1 | 0 | norsk (bokmål) | Bokmål | januar,februar,mars,april,mai,juni,juli,august,september,oktober,november,desember | jan,feb,mar,apr,mai,jun,jul,aug,sep,okt,nov,des | mandag,tirsdag,onsdag,torsdag,fredag,lørdag,søndag | 1044 | 1044 +| langid | dateformat | datefirst | upgrade | name | alias | months | shortmonths | days | lcid | msglangid | +|--------|------------|-----------|---------|--------------------|---------------------|----------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|------|-----------| +| 0 | mdy | 7 | 0 | us_english | English | January,February,March,April,May,June,July,August,September,October,November,December | Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec | Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday | 1033 | 1033 | +| 1 | dmy | 1 | 0 | Deutsch | German | Januar,Februar,März,April,Mai,Juni,Juli,August,September,Oktober,November,Dezember | Jan,Feb,Mär,Apr,Mai,Jun,Jul,Aug,Sep,Okt,Nov,Dez | Montag,Dienstag,Mittwoch,Donnerstag,Freitag,Samstag,Sonntag | 1031 | 1031 | +| 2 | dmy | 1 | 0 | Français | French | janvier,février,mars,avril,mai,juin,juillet,août,septembre,octobre,novembre,décembre | janv,févr,mars,avr,mai,juin,juil,août,sept,oct,nov,déc | lundi,mardi,mercredi,jeudi,vendredi,samedi,dimanche | 1036 | 1036 | +| 3 | ymd | 7 | 0 | 日本語 | Japanese | 01,02,03,04,05,06,07,08,09,10,11,12 | 01,02,03,04,05,06,07,08,09,10,11,12 | 月曜日,火曜日,水曜日,木曜日,金曜日,土曜日,日曜日 | 1041 | 1041 | +| 4 | dmy | 1 | 0 | Dansk | Danish | januar,februar,marts,april,maj,juni,juli,august,september,oktober,november,december | jan,feb,mar,apr,maj,jun,jul,aug,sep,okt,nov,dec | mandag,tirsdag,onsdag,torsdag,fredag,lørdag,søndag | 1030 | 1030 | +| 5 | dmy | 1 | 0 | Español | Spanish | Enero,Febrero,Marzo,Abril,Mayo,Junio,Julio,Agosto,Septiembre,Octubre,Noviembre,Diciembre | Ene,Feb,Mar,Abr,May,Jun,Jul,Ago,Sep,Oct,Nov,Dic | Lunes,Martes,Miércoles,Jueves,Viernes,Sábado,Domingo | 3082 | 3082 | +| 6 | dmy | 1 | 0 | Italiano | Italian | gennaio,febbraio,marzo,aprile,maggio,giugno,luglio,agosto,settembre,ottobre,novembre,dicembre | gen,feb,mar,apr,mag,giu,lug,ago,set,ott,nov,dic | lunedì,martedì,mercoledì,giovedì,venerdì,sabato,domenica | 1040 | 1040 | +| 7 | dmy | 1 | 0 | Nederlands | Dutch | januari,februari,maart,april,mei,juni,juli,augustus,september,oktober,november,december | jan,feb,mrt,apr,mei,jun,jul,aug,sep,okt,nov,dec | maandag,dinsdag,woensdag,donderdag,vrijdag,zaterdag,zondag | 1043 | 1043 | +| 8 | dmy | 1 | 0 | Norsk | Norwegian | januar,februar,mars,april,mai,juni,juli,august,september,oktober,november,desember | jan,feb,mar,apr,mai,jun,jul,aug,sep,okt,nov,des | mandag,tirsdag,onsdag,torsdag,fredag,lørdag,søndag | 2068 | 2068 | +| 9 | dmy | 7 | 0 | Português | Portuguese | janeiro,fevereiro,março,abril,maio,junho,julho,agosto,setembro,outubro,novembro,dezembro | jan,fev,mar,abr,mai,jun,jul,ago,set,out,nov,dez | segunda-feira,terça-feira,quarta-feira,quinta-feira,sexta-feira,sábado,domingo | 2070 | 2070 | +| 10 | dmy | 1 | 0 | Suomi | Finnish | tammikuuta,helmikuuta,maaliskuuta,huhtikuuta,toukokuuta,kesäkuuta,heinäkuuta,elokuuta,syyskuuta,lokakuuta,marraskuuta,joulukuuta | tammi,helmi,maalis,huhti,touko,kesä,heinä,elo,syys,loka,marras,joulu | maanantai,tiistai,keskiviikko,torstai,perjantai,lauantai,sunnuntai | 1035 | 1035 | +| 11 | ymd | 1 | 0 | Svenska | Swedish | januari,februari,mars,april,maj,juni,juli,augusti,september,oktober,november,december | jan,feb,mar,apr,maj,jun,jul,aug,sep,okt,nov,dec | måndag,tisdag,onsdag,torsdag,fredag,lördag,söndag | 1053 | 1053 | +| 12 | dmy | 1 | 0 | čeština | Czech | leden,únor,březen,duben,květen,červen,červenec,srpen,září,říjen,listopad,prosinec | I,II,III,IV,V,VI,VII,VIII,IX,X,XI,XII | pondělí,úterý,středa,čtvrtek,pátek,sobota,neděle | 1029 | 1029 | +| 13 | ymd | 1 | 0 | magyar | Hungarian | január,február,március,április,május,június,július,augusztus,szeptember,október,november,december | jan,febr,márc,ápr,máj,jún,júl,aug,szept,okt,nov,dec | hétfő,kedd,szerda,csütörtök,péntek,szombat,vasárnap | 1038 | 1038 | +| 14 | dmy | 1 | 0 | polski | Polish | styczeń,luty,marzec,kwiecień,maj,czerwiec,lipiec,sierpień,wrzesień,październik,listopad,grudzień | I,II,III,IV,V,VI,VII,VIII,IX,X,XI,XII | poniedziałek,wtorek,środa,czwartek,piątek,sobota,niedziela | 1045 | 1045 | +| 15 | dmy | 1 | 0 | română | Romanian | ianuarie,februarie,martie,aprilie,mai,iunie,iulie,august,septembrie,octombrie,noiembrie,decembrie | Ian,Feb,Mar,Apr,Mai,Iun,Iul,Aug,Sep,Oct,Nov,Dec | luni,marţi,miercuri,joi,vineri,sîmbătă,duminică | 1048 | 1048 | +| 16 | ymd | 1 | 0 | hrvatski | Croatian | siječanj,veljača,ožujak,travanj,svibanj,lipanj,srpanj,kolovoz,rujan,listopad,studeni,prosinac | sij,vel,ožu,tra,svi,lip,srp,kol,ruj,lis,stu,pro | ponedjeljak,utorak,srijeda,četvrtak,petak,subota,nedjelja | 1050 | 1050 | +| 17 | dmy | 1 | 0 | slovenčina | Slovak | január,február,marec,apríl,máj,jún,júl,august,september,október,november,december | I,II,III,IV,V,VI,VII,VIII,IX,X,XI,XII | pondelok,utorok,streda,štvrtok,piatok,sobota,nedeľa | 1051 | 1051 | +| 18 | dmy | 1 | 0 | slovenski | Slovenian | januar,februar,marec,april,maj,junij,julij,avgust,september,oktober,november,december | jan,feb,mar,apr,maj,jun,jul,avg,sept,okt,nov,dec | ponedeljek,torek,sreda,četrtek,petek,sobota,nedelja | 1060 | 1060 | +| 19 | dmy | 1 | 0 | ελληνικά | Greek | Ιανουαρίου,Φεβρουαρίου,Μαρτίου,Απριλίου,Μα_ου,Ιουνίου,Ιουλίου,Αυγούστου,Σεπτεμβρίου,Οκτωβρίου,Νοεμβρίου,Δεκεμβρίου | Ιαν,Φεβ,Μαρ,Απρ,Μαϊ,Ιουν,Ιουλ,Αυγ,Σεπ,Οκτ,Νοε,Δεκ | Δευτέρα,Τρίτη,Τετάρτη,Πέμπτη,Παρασκευή,Σάββατο,Κυριακή | 1032 | 1032 | +| 20 | dmy | 1 | 0 | български | Bulgarian | януари,февруари,март,април,май,юни,юли,август,септември,октомври,ноември,декември | януари,февруари,март,април,май,юни,юли,август,септември,октомври,ноември,декември | понеделник,вторник,сряда,четвъртък,петък,събота,неделя | 1026 | 1026 | +| 21 | dmy | 1 | 0 | русский | Russian | Январь,Февраль,Март,Апрель,Май,Июнь,Июль,Август,Сентябрь,Октябрь,Ноябрь,Декабрь | янв,фев,мар,апр,май,июн,июл,авг,сен,окт,ноя,дек | понедельник,вторник,среда,четверг,пятница,суббота,воскресенье | 1049 | 1049 | +| 22 | dmy | 1 | 0 | Türkçe | Turkish | Ocak,Şubat,Mart,Nisan,Mayıs,Haziran,Temmuz,Ağustos,Eylül,Ekim,Kasım,Aralık | Oca,Şub,Mar,Nis,May,Haz,Tem,Ağu,Eyl,Eki,Kas,Ara | Pazartesi,Salı,Çarşamba,Perşembe,Cuma,Cumartesi,Pazar | 1055 | 1055 | +| 23 | dmy | 1 | 0 | British | British English | January,February,March,April,May,June,July,August,September,October,November,December | Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec | Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday | 2057 | 1033 | +| 24 | dmy | 1 | 0 | eesti | Estonian | jaanuar,veebruar,märts,aprill,mai,juuni,juuli,august,september,oktoober,november,detsember | jaan,veebr,märts,apr,mai,juuni,juuli,aug,sept,okt,nov,dets | esmaspäev,teisipäev,kolmapäev,neljapäev,reede,laupäev,pühapäev | 1061 | 1061 | +| 25 | ymd | 1 | 0 | latviešu | Latvian | janvāris,februāris,marts,aprīlis,maijs,jūnijs,jūlijs,augusts,septembris,oktobris,novembris,decembris | jan,feb,mar,apr,mai,jūn,jūl,aug,sep,okt,nov,dec | pirmdiena,otrdiena,trešdiena,ceturtdiena,piektdiena,sestdiena,svētdiena | 1062 | 1062 | +| 26 | ymd | 1 | 0 | lietuvių | Lithuanian | sausis,vasaris,kovas,balandis,gegužė,birželis,liepa,rugpjūtis,rugsėjis,spalis,lapkritis,gruodis | sau,vas,kov,bal,geg,bir,lie,rgp,rgs,spl,lap,grd | pirmadienis,antradienis,trečiadienis,ketvirtadienis,penktadienis,šeštadienis,sekmadienis | 1063 | 1063 | +| 27 | dmy | 7 | 0 | Português (Brasil) | Brazilian | Janeiro,Fevereiro,Março,Abril,Maio,Junho,Julho,Agosto,Setembro,Outubro,Novembro,Dezembro | Jan,Fev,Mar,Abr,Mai,Jun,Jul,Ago,Set,Out,Nov,Dez | Segunda-Feira,Terça-Feira,Quarta-Feira,Quinta-Feira,Sexta-Feira,Sábado,Domingo | 1046 | 1046 | +| 28 | ymd | 7 | 0 | 繁體中文 | Traditional Chinese | 一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月 | 01,02,03,04,05,06,07,08,09,10,11,12 | 星期一,星期二,星期三,星期四,星期五,星期六,星期日 | 1028 | 1028 | +| 29 | ymd | 7 | 0 | 한국어 | Korean | 01,02,03,04,05,06,07,08,09,10,11,12 | 01,02,03,04,05,06,07,08,09,10,11,12 | 월요일,화요일,수요일,목요일,금요일,토요일,일요일 | 1042 | 1042 | +| 30 | ymd | 7 | 0 | 简体中文 | Simplified Chinese | 01,02,03,04,05,06,07,08,09,10,11,12 | 01,02,03,04,05,06,07,08,09,10,11,12 | 星期一,星期二,星期三,星期四,星期五,星期六,星期日 | 2052 | 2052 | +| 31 | dmy | 1 | 0 | Arabic | Arabic | Muharram,Safar,Rabie I,Rabie II,Jumada I,Jumada II,Rajab,Shaaban,Ramadan,Shawwal,Thou Alqadah,Thou Alhajja | Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec | Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday | 1025 | 1025 | +| 32 | dmy | 7 | 0 | ไทย | Thai | มกราคม,กุมภาพันธ์,มีนาคม,เมษายน,พฤษภาคม,มิถุนายน,กรกฎาคม,สิงหาคม,กันยายน,ตุลาคม,พฤศจิกายน,ธันวาคม | ม.ค.,ก.พ.,มี.ค.,เม.ย.,พ.ค.,มิ.ย.,ก.ค.,ส.ค.,ก.ย.,ต.ค.,พ.ย.,ธ.ค. | จันทร์,อังคาร,พุธ,พฤหัสบดี,ศุกร์,เสาร์,อาทิตย์ | 1054 | 1054 | +| 33 | dmy | 1 | 0 | norsk (bokmål) | Bokmål | januar,februar,mars,april,mai,juni,juli,august,september,oktober,november,desember | jan,feb,mar,apr,mai,jun,jul,aug,sep,okt,nov,des | mandag,tirsdag,onsdag,torsdag,fredag,lørdag,søndag | 1044 | 1044 | ## Levels of Severity @@ -87,129 +87,170 @@ langid | dateformat | datefirst | upgrade | name | alias ## SQL Server Errors -| message_id | Description | Article | -|-----------:|----------------------------------------------------------------------------------------------------------|------------------------------------------------| -| ? | You may see “out of user memory quota” message in errorlog when you use In-Memory OLTP feature … | [Out of user memory quota][7] | -| ? | Logon Failure: The User has not Been Granted. The operating system returned the error ????? while … | [Compressed backup errors][8] | -| ? | A transport-level error has occurred when receiving results from the server. | [link1][31] | -| - | The MSSQLSERVER service was unable to log on as SQLAuthority\SQLFarmService with the currently c … | [The User has not Been Granted][9] | -| 0 | A server error occurred on current command. The results, if any, should be discarded. | [Who owns your availability groups?] | -| 102 | Incorrect syntax near '%.*ls'. | [102_link1],[102_link2][39] | -| 120 | The select list for the INSERT statement contains fewer items than the insert list. The number of … | [120_link1][35] | -| 121 | The select list for the INSERT statement contains more items than the insert list. The number of … | [121_link1][35] | -| 145 | ORDER BY items must appear in the select list if SELECT DISTINCT is specified. | [145_link1][27] | -| 156 | Incorrect syntax near the keyword 'ORDER'. | [156_link1][23] | -| 207 | Invalid column name '%.*ls'. | [207_link1] | -| 213 | Column name or number of supplied values does not match table definition. | [213_link1][3],[213_link2][35] | -| 229 | The %ls permission was denied on the object '%.*ls', database '%.*ls', schema '%.*ls'. | [229_link1][12] | -| 241 | Conversion failed when converting date and/or time from character string. | [241_link1] | -| 264 | The column name '%.*ls' is specified more than once in the SET clause or column list of an INSERT … | [264_link1][25] | -| 297 | The user does not have permission to perform this action. | [297_link1][12] | -| 352 | The table-valued parameter "%.*ls" must be declared with the READONLY option. | [352_link1][22] | -| 459 | Collation '%.*ls' is supported on Unicode data types only and cannot be applied to char, varchar or … | [459_link1] | -| 535 | The datediff function resulted in an overflow. The number of dateparts separating two date/time | [535_link1] | -| 596 | Cannot continue execution because the session is in the kill state. | [596_link1],[596_link2][31],[596_link3][32] | -| 650 | You can only specify the READPAST lock in the READ COMMITTED or REPEATABLE READ isolation levels. | [650_link1] | -| 657 | Could not disable support for increased partitions in database … | [657_link1] | -| 666 | The maximum system-generated unique value for a duplicate group was exceeded for index with … | [666_link1] | -| 701 | There is insufficient system memory in resource pool '%ls' to run this query. … | [701_link1],[701_link2][11] | -| 824 | SQL Server detected a logical consistency-based I/O error … | [824_link1],[824_link2],[KB2152734] | -| 825 | The operating system returned error %ls to SQL Server. It failed creating event for a %S_MSG at … | [825_link1] | -| 913 | Could Not Find Database %d. Database May Not be Activated Yet or May be in Transition … | [913_link1] | -| 922 | Database '%.*ls' is being recovered. Waiting until recovery is finished. | [922_link1] | -| 926 | Database '%.*ls' cannot be opened. It has been marked SUSPECT by recovery. See the SQL Server errorlog … | [926_link1] | -| 1052 | Conflicting %ls options "%ls" and "%ls". | [1052_link1][33] | -| 1065 | The NOLOCK and READUNCOMMITTED lock hints are not allowed for target tables of INSERT, UPDATE, DELETE …| [1065_link1] | -| 1219 | Your session has been disconnected because of a high priority DDL operation. | [1219_link1][32] | -| 1701 | Creating or altering table %ls failed because the minimum row size would be 8061, including 10 b … | [1701_link1] | -| 1807 | Could not obtain exclusive lock on database ‘model’. Retry the operation later. … | [1807_link1] | -| 1904 | The statistics on table has 65 columns in the key list … | [1904_link1] | -| 1908 | Column '%.*ls' is partitioning column of the index '%.*ls'. Partition columns for a unique index … | [1908_link1][18] | -| 2812 | Could not find stored procedure '%.*ls'. | [2812_link1][38] | -| 3101 | Exclusive access could not be obtained because the database is in use. … | [3101_link1] | -| 3154 | The backup set holds a backup of a database other than the existing … | [3154_link1] | -| 3241 | The media family on device '%ls' is incorrectly formed. SQL Server cannot process this media fam … | [3241_link1] | -| 3314 | During undoing of a logged operation in database '%.*ls', an error occurred at log record ID %S … | [3314_link1] | -| 3634 | The operating system returned the error '%ls' while attempting '%ls' on '%ls'. … | [3634_link1] | -| 3637 | A parallel operation cannot be started from a DAC connection. | [3637_link1] | -| 3743 | The database '%.*ls' is enabled for database mirroring. Database mirroring must be removed befor … | [3743_link1] | -| 3906 | Failed to update database "%.*ls" because the database is read-only. | [3906_link1] | -| 3930 | The current transaction cannot be committed and cannot support operations that write to the log … | [3930_link1] | -| 4064 | Cannot open user default database. Login failed.Login failed. … | [4064_link1] | -| 4189 | Cannot convert to text/ntext or collate to '%.*ls' because these legacy LOB types do not support UTF-8 … | [4189_link1][21] | -| 4629 | Permissions on server scoped catalog views or system stored procedures or extended stored … | [4629_link1][12] | -| 4901 | ALTER TABLE only allows columns to be added that can contain nulls, or have a DEFAULT definition … | [4901_link1][33] | -| 4922 | ALTER TABLE ALTER COLUMN Address failed because one or more objects access this column. … | [4922_link1] | -| 4934 | Computed column '%.*ls' in table '%.*ls' cannot be persisted because the column does user or … | [4934_link1] | -| 4947 | ALTER TABLE SWITCH statement failed. There is no identical index in source table '%.*ls' for the … | [4947_link1][18] | -| 5004 | To use ALTER DATABASE, the database must be in a writable state in which a checkpoint can be executed. | [5004_link1] | -| 5120 | Unable to open the physical file ... Operating system error 5: "5(Access is denied.)" … | [SQL SERVER - FIX Error 5120] | -| 5123 | CREATE FILE encountered operating system error "%ls"(The system cannot find the path specified.) … | [5123_link1], [5123_link2] | -| 5171 | %.*ls is not a primary database file. | [5171_link1][29] | -| 5172 | The header for file '%ls' is not a valid database file header. The %ls property is incorrect. | [5172_link1][29] | -| 5846 | Common language runtime (CLR) execution is not supported under lightweight pooling. Disable one of two … | [5846_link1] | -| 6335 | XML datatype instance has too many levels of nested nodes. Maximum allowed depth is 128 levels. | [6335_link1] | -| 6348 | Specified collection '%.*ls' cannot be created because it already exists or you do not have permission. | [6348_link1][36] | -| 6401 | Cannot roll back %.*ls. No transaction or savepoint of that name was found. | [6401_link1][4] | -| 7341 | Cannot get the current row value of column "%ls.%ls" from OLE DB provider "%ls" for linked server "%ls … | [7341_link1][37] | -| 7344 | The OLE DB provider "%ls" for linked server "%ls" could not %ls table "%ls" because of column … | [7344_link1][3] | -| 7356 | The OLE DB provider "%ls" for linked server "%ls" supplied inconsistent metadata for a column. … | [7356_link1][37] | -| 7357 | Cannot process the object "%ls". The OLE DB provider "%ls" for linked server "%ls" indicates that … | [7357_link1][2], [7357_link2][2] | -| 7391 | The operation could not be performed because OLE DB provider "%ls" for linked server "%ls" ... … | [7391_link2][2] | -| 7719 | CREATE/ALTER partition function failed as only maximum of 1000 partitions can be created. … | [657_link1] | -| 8101 | An explicit value for the identity column in table '%.*ls' can only be specified when a column list is … | [8101_link1][40] | -| 8107 | IDENTITY_INSERT is already ON for table '%.*ls.%.*ls.%.*ls'. Cannot perform SET operation for table '% … | [8107_link1][40] | -| 8115 | Arithmetic overflow error converting %ls to data type %ls. | [8115_link1][24] | -| 8180 | Statement(s) could not be prepared. | [8180_link1][28] | -| 8127 | Column "%.*ls.%.*ls" is invalid in the ORDER BY clause because it is not contained in either an … | [8127_link1][27] | -| 8624 | Internal Query Processor Error: The query processor could not produce a query plan. | [8624_link1] | -| 8645 | A timeout occurred while waiting for memory resources to execute the query in resource pool '%ls' (%ld … | [8645_link1] | -| 8651 | Could not perform the operation because the requested memory grant was not available in resource … | [8651_link1] | -| 8672 | The MERGE statement attempted to UPDATE or DELETE the same row more than once... … | [8672_link1] | -| 8909 | Table error: Object ID %d, index ID %d, partition ID %I64d, alloc unit ID %I64d (type %.*ls), pa … | [8909_link1] | -| 8921 | Check terminated. A failure was detected while collecting facts. Possibly tempdb out of space or … | [8921_link1] | -| 8948 | Database error: Page %S_PGID is marked with the wrong type in PFS page %S_PGID. PFS status 0x%x … | [8948_link1][20] | -| 9001 | The log for database '%.*ls' is not available. Check the operating system error log for related … | [9001_link1][16] | -| 9002 | The transaction log for database '%ls' is full due to '%ls'. … | [9002_link1][17],[9002_link2][19],[9002_link3] | -| 9105 | The provided statistics stream is corrupt. | [9105_link1][33] | -| 10314 | An error occurred in the Microsoft .NET Framework while trying to load assembly id %d. The server may … | [10314_link1] | -| 10637 | Cannot perform this operation on '%.*ls' with ID %I64d as one or more indexes are currently in … | [10637_link1][32] | -| 10794 | The %S_MSG '%ls' is not supported with %S_MSG. | [10794_link1][39] | -| 11535 | EXECUTE statement failed because its WITH RESULT SETS clause specified %d result set(s), and the … | [11535_link1][38] | -| 12349 | Operation not supported for memory optimized tables having columnstore index. | [12349_link1][41] | -| 13515 | Setting SYSTEM_VERSIONING to ON failed because history table '%.*ls' has custom unique keys defined. … | [13515_link1][33] | -| 13518 | Setting SYSTEM_VERSIONING to ON failed because history table '%.*ls' has IDENTITY column specification … | [13518_link1][33] | -| 13523 | Setting SYSTEM_VERSIONING to ON failed because table '%.*ls' has %d columns and table '%.*ls' has %d … | [13523_link1][33] | -| 13543 | Setting SYSTEM_VERSIONING to ON failed because history table '%.*ls' contains invalid records with end … | [13543_link1][33] | -| 13570 | The use of replication is not supported with system-versioned temporal table '%s' | [13570_link1] | -| 13573 | Setting SYSTEM_VERSIONING to ON failed because history table '%.*ls' contains overlapping records. | [13573_link1][33] | -| 13575 | ADD PERIOD FOR SYSTEM_TIME failed because table '%.*ls' contains records where end of period is not … | [13575_link1][33] | -| 13901 | Identifier '%.*ls' in a MATCH clause is not a node table or an alias for a node table. | [13901_link1][30] | -| 13902 | Identifier '%.*ls' in a MATCH clause is not an edge table or an alias for an edge table. | [13902_link1][30] | -| 15002 | The procedure 'sys.sp_dbcmptlevel' cannot be executed within a transaction. … | [15002_link1] | -| 15021 | Invalid value given for parameter %s. Specify a valid parameter value. | [15021_link1] | -| 15136 | The database principal is set as the execution context of one or more procedures, functions, … | [15136_link1] | -| 15190 | There are still remote logins or linked logins for the server '%s'. | [15190_link1] | -| 15199 | The current security context cannot be reverted. Please switch to the original database where … | [15199_link1][1] | -| 15274 | Access to the remote server is denied because the current security context is not trusted. | [15274_link1] | -| 15406 | Cannot execute as the server principal because the principal "%.*ls" does not exist, this type of … | [15406_link1][1] | -| 17182 | TDSSNIClient initialization failed with error 0x%lx, status code 0x%lx. Reason: %S_MSG %.*ls | [17182_link1][15] | -| 17190 | Initializing the FallBack certificate failed with error code: %d, state: %d, error number: %d. … | [17190_link1] | -| 17300 | SQL Server was unable to run a new system task, either because there is insufficient memory or the … | [17300_link1] | -| 18272 | During restore restart, an I/O error occurred on checkpoint file '%s' (operating system error %s … | [18272_link1] | -| 18357 | Reason: An attempt to login using SQL authentication failed. Server is configured for Integrated … | [18357_link1][5] | -| 18452 | Login failed. The login is from an untrusted domain and cannot be used with Windows authenticati … | [18452_link1] | -| 18456 | Login failed for user '%.*ls'.%.*ls%.*ls | [18456_link1] | -| 22911 | The capture job cannot be used by Change Data Capture to extract changes from the log when … | [22911_link1] | -| 25713 | The value specified for %S_MSG, "%.*ls", %S_MSG, "%.*ls", is invalid. | [25713_link1],[25713_link2] | -| 26023 | Server TCP provider failed to listen on [ %s <%s> %d]. Tcp port is already in use. | [26023_link1][13] | -| 33111 | Cannot find server %S_MSG with thumbprint '%.*ls'. | [33111_link1] | -| 33206 | SQL Server Audit failed to create the audit file '%s'. Make sure that the disk is not full and … | [33206_link1][10] | -| 35250 | The connection to the primary replica is not active. The command cannot be processed. | [35250_link1] | -| 35320 | Column store indexes are not allowed on tables for which the durability option SCHEMA_ONLY is specified. | [35320_link1][41] | -| 35337 | UPDATE STATISTICS failed because statistics cannot be updated on a columnstore index. … | [35337_link1][33] | -| 35343 | The statement failed. Column '%.*ls' has a data type that cannot participate in a columnstore index. | [35343_link1][36] | -| 39004 | A '%s' script error occurred during execution of 'sp_execute_external_script' with HRESULT 0x%x. | [39004_link1][14] | +| message_id | Description | Article | +|-----------:|----------------------------------------------------------------------------------------------------------|-----------------------------------------------------| +| 0 | You may see “out of user memory quota” message in errorlog when you use In-Memory OLTP feature … | [Out of user memory quota][7] | +| 0 | Logon Failure: The User has not Been Granted. The operating system returned the error ????? while … | [Compressed backup errors][8] | +| 0 | A transport-level error has occurred when receiving results from the server. | [link1][31] | +| 0 | The MSSQLSERVER service was unable to log on as SQLAuthority\SQLFarmService with the currently c … | [The User has not Been Granted][9] | +| 0 | A server error occurred on current command. The results, if any, should be discarded. | [Who owns your availability groups?] | +| 0 | A network-related issue or instance-specific error occured while establishing a connection to SQL Server | [Cannot Connect to SQL Server] | +| 0 | Connecting to Azure SQL Database: Requested tenant identifier '00000000-0000-0000-0000-000000000000' is… | [Requested tenant identifier] | +| 102 | Incorrect syntax near '%.*ls'. | [102_link1],[102_link2][39] | +| 120 | The select list for the INSERT statement contains fewer items than the insert list. The number of … | [120_link1][35] | +| 121 | The select list for the INSERT statement contains more items than the insert list. The number of … | [121_link1][35] | +| 131 | The size (%d) given to the %S_MSG '%.*ls' exceeds the maximum allowed for any data type (%d). | [131_link1][47] | +| 145 | ORDER BY items must appear in the select list if SELECT DISTINCT is specified. | [145_link1][27] | +| 156 | Incorrect syntax near the keyword 'ORDER'. | [156_link1][23] | +| 207 | Invalid column name '%.*ls'. | [207_link1] | +| 213 | Column name or number of supplied values does not match table definition. | [213_link1][3],[213_link2][35] | +| 229 | The %ls permission was denied on the object '%.*ls', database '%.*ls', schema '%.*ls'. | [229_link1][12] | +| 241 | Conversion failed when converting date and/or time from character string. | [241_link1] | +| 257 | Implicit conversion from data type %ls to %ls is not allowed. Use the CONVERT function to run this query | [257_link1] | +| 264 | The column name '%.*ls' is specified more than once in the SET clause or column list of an INSERT … | [264_link1][25] | +| 297 | The user does not have permission to perform this action. | [297_link1][12] | +| 352 | The table-valued parameter "%.*ls" must be declared with the READONLY option. | [352_link1][22] | +| 459 | Collation '%.*ls' is supported on Unicode data types only and cannot be applied to char, varchar or … | [459_link1] | +| 535 | The datediff function resulted in an overflow. The number of dateparts separating two date/time | [535_link1] | +| 596 | Cannot continue execution because the session is in the kill state. | [596_link1],[596_link2][31],[596_link3][32] | +| 650 | You can only specify the READPAST lock in the READ COMMITTED or REPEATABLE READ isolation levels. | [650_link1] | +| 657 | Could not disable support for increased partitions in database … | [657_link1] | +| 665 | The operating system returned error 665(The requested operation could not be completed due to a file … | [665_link1],[665_link2][52] | +| 666 | The maximum system-generated unique value for a duplicate group was exceeded for index with … | [666_link1] | +| 701 | There is insufficient system memory in resource pool '%ls' to run this query. … | [701_link1],[701_link2][11] | +| 824 | SQL Server detected a logical consistency-based I/O error … | [824_link1],[824_link2],[KB2152734],[824_link3][42] | +| 825 | The operating system returned error %ls to SQL Server. It failed creating event for a %S_MSG at … | [825_link1] | +| 913 | Could Not Find Database %d. Database May Not be Activated Yet or May be in Transition … | [913_link1] | +| 922 | Database '%.*ls' is being recovered. Waiting until recovery is finished. | [922_link1] | +| 926 | Database '%.*ls' cannot be opened. It has been marked SUSPECT by recovery. See the SQL Server errorlog … | [926_link1] | +| 1052 | Conflicting %ls options "%ls" and "%ls". | [1052_link1][33] | +| 1065 | The NOLOCK and READUNCOMMITTED lock hints are not allowed for target tables of INSERT, UPDATE, DELETE …| [1065_link1] | +| 1105 | Could not allocate space for object '%.*ls'%.*ls in database '%.*ls' because the '%.*ls' filegroup is …| [1105_link1] | +| 1204 | The instance of the SQL Server Database Engine cannot obtain a LOCK resource at this time. Rerun your … | [1204_link1][46] | +| 1205 | Transaction (Process ID %d) was deadlocked on %.*ls resources with another process and has been chosen … | [1205_link1][46] | +| 1222 | Lock request time out period exceeded. | [1222_link1][46] | +| 1219 | Your session has been disconnected because of a high priority DDL operation. | [1219_link1][32] | +| 1450 | The operating system returned error 1450 (Insufficient system resources exist to complete the … | [52] | +| 1480 | The %S_MSG database "%.*ls" is changing roles from "%ls" to "%ls" because the mirroring session or … | [1480_link1][48] | +| 1701 | Creating or altering table %ls failed because the minimum row size would be 8061, including 10 b … | [1701_link1] | +| 1807 | Could not obtain exclusive lock on database ‘model’. Retry the operation later. … | [1807_link1] | +| 1904 | The statistics on table has 65 columns in the key list … | [1904_link1] | +| 1908 | Column '%.*ls' is partitioning column of the index '%.*ls'. Partition columns for a unique index … | [1908_link1][18] | +| 2533 | Table error: page %S_PGID allocated to object ID %d, index ID %d, partition ID %I64d, alloc unit ID … | [2533_link1][50] | +| 2534 | Table error: page %S_PGID, whose header indicates that it is allocated to object ID %d, index ID %d, … | [2534_link1][50] | +| 2812 | Could not find stored procedure '%.*ls'. | [2812_link1][38] | +| 3101 | Exclusive access could not be obtained because the database is in use. … | [3101_link1] | +| 3154 | The backup set holds a backup of a database other than the existing … | [3154_link1] | +| 3241 | The media family on device '%ls' is incorrectly formed. SQL Server cannot process this media fam … | [3241_link1] | +| 3314 | During undoing of a logged operation in database '%.*ls', an error occurred at log record ID %S … | [3314_link1] | +| 3634 | The operating system returned the error '%ls' while attempting '%ls' on '%ls'. … | [3634_link1] | +| 3637 | A parallel operation cannot be started from a DAC connection. | [3637_link1] | +| 3743 | The database '%.*ls' is enabled for database mirroring. Database mirroring must be removed befor … | [3743_link1] | +| 3906 | Failed to update database "%.*ls" because the database is read-only. | [3906_link1] | +| 3930 | The current transaction cannot be committed and cannot support operations that write to the log … | [3930_link1] | +| 3956 | Snapshot isolation transaction failed to start in database '%.*ls' because the ALTER DATABASE command … | [3956_link1][49] | +| 3960 | Snapshot isolation transaction aborted due to update conflict. You cannot use snapshot isolation to … | [3960_link1][49] | +| 4064 | Cannot open user default database. Login failed.Login failed. … | [4064_link1] | +| 4189 | Cannot convert to text/ntext or collate to '%.*ls' because these legacy LOB types do not support UTF-8 … | [4189_link1][21] | +| 4353 | Conflicting file relocations have been specified for file '%.*ls'. Only a single WITH MOVE clause … | [4353_link1] | +| 4629 | Permissions on server scoped catalog views or system stored procedures or extended stored … | [4629_link1][12] | +| 4901 | ALTER TABLE only allows columns to be added that can contain nulls, or have a DEFAULT definition … | [4901_link1][33] | +| 4922 | ALTER TABLE ALTER COLUMN Address failed because one or more objects access this column. … | [4922_link1] | +| 4934 | Computed column '%.*ls' in table '%.*ls' cannot be persisted because the column does user or … | [4934_link1] | +| 4947 | ALTER TABLE SWITCH statement failed. There is no identical index in source table '%.*ls' for the … | [4947_link1][18] | +| 5004 | To use ALTER DATABASE, the database must be in a writable state in which a checkpoint can be executed. | [5004_link1] | +| 5011 | User does not have permission to alter database '%.*ls', the database does not exist, or the database … | [5011_link1][49] | +| 5061 | ALTER DATABASE failed because a lock could not be placed on database '%.*ls'. Try again later. | [5061_link1] | +| 5084 | Setting database option %ls to %ls for database '%.*ls'. | [5084_link1][43] | +| 5120 | Unable to open the physical file ... Operating system error 5: "5(Access is denied.)" … | [SQL SERVER - FIX Error 5120] | +| 5123 | CREATE FILE encountered operating system error "%ls"(The system cannot find the path specified.) … | [5123_link1], [5123_link2] | +| 5171 | %.*ls is not a primary database file. | [5171_link1][29] | +| 5172 | The header for file '%ls' is not a valid database file header. The %ls property is incorrect. | [5172_link1][29] | +| 5235 | %lsDBCC %ls (%ls%ls%ls)%ls executed by %ls terminated abnormally due to error state %d. Elapsed time: … | [5235_link1][50] | +| 5846 | Common language runtime (CLR) execution is not supported under lightweight pooling. Disable one of two … | [5846_link1] | +| 6335 | XML datatype instance has too many levels of nested nodes. Maximum allowed depth is 128 levels. | [6335_link1] | +| 6348 | Specified collection '%.*ls' cannot be created because it already exists or you do not have permission. | [6348_link1][36] | +| 6401 | Cannot roll back %.*ls. No transaction or savepoint of that name was found. | [6401_link1][4] | +| 7341 | Cannot get the current row value of column "%ls.%ls" from OLE DB provider "%ls" for linked server "%ls … | [7341_link1][37] | +| 7344 | The OLE DB provider "%ls" for linked server "%ls" could not %ls table "%ls" because of column … | [7344_link1][3] | +| 7356 | The OLE DB provider "%ls" for linked server "%ls" supplied inconsistent metadata for a column. … | [7356_link1][37] | +| 7357 | Cannot process the object "%ls". The OLE DB provider "%ls" for linked server "%ls" indicates that … | [7357_link1][2], [7357_link2][2] | +| 7391 | The operation could not be performed because OLE DB provider "%ls" for linked server "%ls" ... … | [7391_link2][2] | +| 7719 | CREATE/ALTER partition function failed as only maximum of 1000 partitions can be created. … | [657_link1] | +| 7926 | Check statement aborted. The database could not be checked as a database snapshot could not be created … | [7926_link1][50] | +| 8101 | An explicit value for the identity column in table '%.*ls' can only be specified when a column list is … | [8101_link1][40] | +| 8107 | IDENTITY_INSERT is already ON for table '%.*ls.%.*ls.%.*ls'. Cannot perform SET operation for table '% … | [8107_link1][40] | +| 8115 | Arithmetic overflow error converting %ls to data type %ls. | [8115_link1][24] | +| 8116 | Argument data type %ls is invalid for argument %d of %ls function. | [8116_link1][44] | +| 8117 | Operand data type %ls is invalid for %ls operator. | [8117_link1][44] | +| 8180 | Statement(s) could not be prepared. | [8180_link1][28] | +| 8127 | Column "%.*ls.%.*ls" is invalid in the ORDER BY clause because it is not contained in either an … | [8127_link1][27] | +| 8152 | String or binary data would be truncated. | [8152_link1][47] | +| 8624 | Internal Query Processor Error: The query processor could not produce a query plan. | [8624_link1] | +| 8645 | A timeout occurred while waiting for memory resources to execute the query in resource pool '%ls' (%ld … | [8645_link1] | +| 8651 | Could not perform the operation because the requested memory grant was not available in resource … | [8651_link1] | +| 8672 | The MERGE statement attempted to UPDATE or DELETE the same row more than once... … | [8672_link1] | +| 8909 | Table error: Object ID %d, index ID %d, partition ID %I64d, alloc unit ID %I64d (type %.*ls), pa … | [8909_link1] | +| 8921 | Check terminated. A failure was detected while collecting facts. Possibly tempdb out of space or … | [8921_link1] | +| 8928 | Object ID %d, index ID %d, partition ID %I64d, alloc unit ID %I64d (type %.*ls): Page %S_PGID could not… | [8928_link1][42] | +| 8939 | Table error: Object ID %d, index ID %d, partition ID %I64d, alloc unit ID %I64d (type %.*ls), page … | [8939_link1][42] | +| 8948 | Database error: Page %S_PGID is marked with the wrong type in PFS page %S_PGID. PFS status 0x%x … | [8948_link1][20] | +| 9001 | The log for database '%.*ls' is not available. Check the operating system error log for related … | [9001_link1][16] | +| 9002 | The transaction log for database '%ls' is full due to '%ls'. … | [9002_link1][17],[9002_link2][19],[9002_link3] | +| 9105 | The provided statistics stream is corrupt. | [9105_link1][33] | +| 9642 | An error occurred in a Service Broker/Database Mirroring transport connection endpoint, Error: %i, … | [9105_link1][45] | +| 10314 | An error occurred in the Microsoft .NET Framework while trying to load assembly id %d. The server may … | [10314_link1],[10314_link2] | +| 10637 | Cannot perform this operation on '%.*ls' with ID %I64d as one or more indexes are currently in … | [10637_link1][32] | +| 10794 | The %S_MSG '%ls' is not supported with %S_MSG. | [10794_link1][39],[10794_link2] | +| 11442 | Columnstore index creation is not supported in tempdb when memory-optimized metadata mode is enabled. … | [11442_link1][51] | +| 11535 | EXECUTE statement failed because its WITH RESULT SETS clause specified %d result set(s), and the … | [11535_link1][38] | +| 12349 | Operation not supported for memory optimized tables having columnstore index. | [12349_link1][41] | +| 13609 | JSON text is not properly formatted. Unexpected character '%lc' is found at position %d. | [13609_link1] | +| 13515 | Setting SYSTEM_VERSIONING to ON failed because history table '%.*ls' has custom unique keys defined. … | [13515_link1][33] | +| 13518 | Setting SYSTEM_VERSIONING to ON failed because history table '%.*ls' has IDENTITY column specification … | [13518_link1][33] | +| 13523 | Setting SYSTEM_VERSIONING to ON failed because table '%.*ls' has %d columns and table '%.*ls' has %d … | [13523_link1][33] | +| 13543 | Setting SYSTEM_VERSIONING to ON failed because history table '%.*ls' contains invalid records with end … | [13543_link1][33] | +| 13570 | The use of replication is not supported with system-versioned temporal table '%s' | [13570_link1] | +| 13573 | Setting SYSTEM_VERSIONING to ON failed because history table '%.*ls' contains overlapping records. | [13573_link1][33] | +| 13575 | ADD PERIOD FOR SYSTEM_TIME failed because table '%.*ls' contains records where end of period is not … | [13575_link1][33] | +| 13901 | Identifier '%.*ls' in a MATCH clause is not a node table or an alias for a node table. | [13901_link1][30] | +| 13902 | Identifier '%.*ls' in a MATCH clause is not an edge table or an alias for an edge table. | [13902_link1][30] | +| 15002 | The procedure 'sys.sp_dbcmptlevel' cannot be executed within a transaction. … | [15002_link1] | +| 15021 | Invalid value given for parameter %s. Specify a valid parameter value. | [15021_link1] | +| 15136 | The database principal is set as the execution context of one or more procedures, functions, … | [15136_link1] | +| 15190 | There are still remote logins or linked logins for the server '%s'. | [15190_link1] | +| 15199 | The current security context cannot be reverted. Please switch to the original database where … | [15199_link1][1] | +| 15274 | Access to the remote server is denied because the current security context is not trusted. | [15274_link1] | +| 15404 | Could not obtain information about Windows NT group/user '%ls', error code %#lx. | [15404_link1] | +| 15406 | Cannot execute as the server principal because the principal "%.*ls" does not exist, this type of … | [15406_link1][1] | +| 15457 | Configuration option '%ls' changed from %ld to %ld. Run the RECONFIGURE statement to install. | [5457_link1][43] | +| 17051 | SQL Server evaluation edition has expired. | [17051_link1] | +| 17182 | TDSSNIClient initialization failed with error 0x%lx, status code 0x%lx. Reason: %S_MSG %.*ls | [17182_link1][15] | +| 17190 | Initializing the FallBack certificate failed with error code: %d, state: %d, error number: %d. … | [17190_link1] | +| 17300 | SQL Server was unable to run a new system task, either because there is insufficient memory or the … | [17300_link1] | +| 17836 | Length specified in network packet payload did not match number of bytes read; the connection has been … | [17836_link1][45] | +| 18054 | Error %d, severity %d, state %d was raised, but no message with that error number was found in … | [18054_link1] | +| 18272 | During restore restart, an I/O error occurred on checkpoint file '%s' (operating system error %s … | [18272_link1] | +| 18357 | Reason: An attempt to login using SQL authentication failed. Server is configured for Integrated … | [18357_link1][5] | +| 18401 | Login failed for user '%.*ls'. Reason: Server is in script upgrade mode. Only administrator can connect… | [18401_link1] | +| 18452 | Login failed. The login is from an untrusted domain and cannot be used with Windows authenticati … | [18452_link1] | +| 18456 | Login failed for user '%.*ls'.%.*ls%.*ls | [18456_link1] | +| 20598 | The row was not found at the Subscriber when applying the replicated %S_MSG command for Table '%s' with… | [20598_link1] | +| 22911 | The capture job cannot be used by Change Data Capture to extract changes from the log when … | [22911_link1] | +| 25713 | The value specified for %S_MSG, "%.*ls", %S_MSG, "%.*ls", is invalid. | [25713_link1],[25713_link2] | +| 26023 | Server TCP provider failed to listen on [ %s <%s> %d]. Tcp port is already in use. | [26023_link1][13] | +| 33111 | Cannot find server %S_MSG with thumbprint '%.*ls'. | [33111_link1] | +| 33206 | SQL Server Audit failed to create the audit file '%s'. Make sure that the disk is not full and … | [33206_link1][10] | +| 35217 | The thread pool for Always On Availability Groups was unable to start a new worker thread because … | [35217_link1] | +| 35250 | The connection to the primary replica is not active. The command cannot be processed. | [35250_link1] | +| 35264 | Always On Availability Groups data movement for database '%.*ls' has been suspended for the following … | [35264_link1][48] | +| 35320 | Column store indexes are not allowed on tables for which the durability option SCHEMA_ONLY is specified. | [35320_link1][41] | +| 35337 | UPDATE STATISTICS failed because statistics cannot be updated on a columnstore index. … | [35337_link1][33] | +| 35343 | The statement failed. Column '%.*ls' has a data type that cannot participate in a columnstore index. | [35343_link1][36] | +| 39004 | A '%s' script error occurred during execution of 'sp_execute_external_script' with HRESULT 0x%x. | [39004_link1][14] | +| 41121 | The local availability replica of availability group '%.*ls' cannot accept signal '%s' in its current …| [41121_link1] | +| 41317 | A user transaction that accesses memory optimized tables or natively compiled modules cannot access more…| [41317_link1][51] | +| 41922 | The backup operation for a database with service-managed transaprent data encryption is not supported on…| [41922_link1] | [1]:https://sqlstudies.com/2018/05/16/the-trials-and-tribulations-of-reverting-from-impersonation/ [2]:https://sqlpowershell.wordpress.com/2016/11/09/sql-server-discuss-executesql-at-linkedserver/ @@ -252,16 +293,31 @@ langid | dateformat | datefirst | upgrade | name | alias [39]:http://www.nikoport.com/2015/09/02/columnstore-indexes-part-64-t-sql-improvements-in-sql-server-2016/ [40]:https://bertwagner.com/2019/06/25/multiple-identity-inserts/ [41]:https://www.sqlshack.com/how-to-create-a-clustered-columnstore-index-on-a-memory-optimized-table/ +[42]:https://www.sqlserverscience.com/internals/invalid-protection-option/ +[43]:https://www.red-gate.com/hub/product-learning/sql-monitor/spotting-unauthorized-configuration-settings-sql-server +[44]:https://www.red-gate.com/hub/product-learning/sql-prompt/problems-caused-by-use-of-the-sql_variant-datatype +[45]:http://www.seangallardy.com/error-8474-state-11-17836-state-20-9642-state-3-and-your-companys-need-to-incessantly-scan-for-vulnerable-ports/ +[46]:https://www.mssqltips.com/sqlservertip/6279/prevent-sql-server-blocking-using-locktimeout/ +[47]:https://www.sqlshack.com/sql-varchar-data-type-deep-dive/ +[48]:https://blog.waynesheffield.com/wayne/archive/2020/08/availability-group-issues-fixed-with-alerts/ +[49]:https://www.red-gate.com/simple-talk/sql/t-sql-programming/row-versioning-concurrency-in-sql-server/ +[50]:https://sqlblog.org/2020/11/05/navigating-dbcc-checkdb-for-vldb +[51]:https://www.mssqltips.com/sqlservertip/6230/memoryoptimized-tempdb-metadata-in-sql-server-2019/ +[52]:https://learn.microsoft.com/troubleshoot/sql/database-engine/database-file-operations/1450-and-665-errors-running-dbcc-checkdb [Who owns your availability groups?]:http://www.cjsommer.com/2016-10-20-who-owns-your-availability-groups/ +[Cannot Connect to SQL Server]:https://dallasdbas.com/irl-cannot-connect-to-sql-server/ +[Requested tenant identifier]:https://sqlstudies.com/2020/05/20/connecting-to-azure-sql-database-requested-tenant-identifier-00000000-0000-0000-0000-000000000000-is-not-valid/ [102_link1]:http://jasonbrimhall.info/2017/11/17/incorrect-syntax-what/ [207_link1]:http://www.sqlservercentral.com/questions/IDENT_CURRENT/165581/ [241_link1]:https://www.essentialsql.com/datatype-conversion-in-sql-using-cast-and-convert/ +[257_link1]:https://sqlstudies.com/2020/04/16/what-is-the-datatype-sql_varient/ [459_link1]:https://sqlquantumleap.com/2019/03/13/differences-between-the-various-binary-collations-cultures-versions-and-bin-vs-bin2/ [535_link1]:http://www.sqlservercentral.com/articles/T-SQL/153921/ [596_link1]:http://sql-sasquatch.blogspot.ru/2017/09/sqlserver-just-how-minimal-can-that.html [650_link1]:https://sqlundercover.com/2019/02/07/alter-table-fails-on-replicated-tables-with-isolation-level-serializable-or-read-uncommitted-on-sql2012-and-earlier/ [657_link1]:https://blog.sqlauthority.com/2016/05/20/sql-server-disabling-15000-15k-partitions/ +[665_link1]:https://dba.stackexchange.com/a/334820 [666_link1]:https://blogs.msdn.microsoft.com/psssql/2018/02/16/uniqueifier-considerations-and-error-666/ [701_link1]:https://blogs.msdn.microsoft.com/psssql/2017/02/22/be-aware-of-701-error-if-you-use-memory-optimized-table-variable-in-a-loop/ [824_link1]:http://www.sqlservercentral.com/blogs/sql-server-citation-sql-blog-by-hemantgiri-s-goswami-sql-mvp/2016/08/23/resolve-microsoft-sql-server-error-code-824/ @@ -272,6 +328,7 @@ langid | dateformat | datefirst | upgrade | name | alias [926_link1]:https://blog.sqlauthority.com/2018/11/06/sql-server-script-level-upgrade-for-database-master-failed-because-upgrade-step-msdb110_upgrade-sql-encountered-error-926-state-1-severity-25/ [KB2152734]:https://support.microsoft.com/help/2152734 [1065_link1]:https://www.mssqltips.com/sqlservertip/2470/understanding-the-sql-server-nolock-hint/ +[1105_link1]:https://www.joshthecoder.com/2019/07/17/can-you-fail-to-spill-to-tempdb.html [1701_link1]:http://www.sqlservercentral.com/questions/163450/ [1807_link1]:http://www.sqlservercentral.com/blogs/martin_catherall/2017/01/22/create-database-ive-not-seen-that-before/ [1904_link1]:http://blog.sqlauthority.com/2016/10/27/sql-server-fix-error-msg-1904-statistics-table-65-columns-key-list/ @@ -288,10 +345,12 @@ langid | dateformat | datefirst | upgrade | name | alias [3906_link1]:https://thelonedba.wordpress.com/2019/03/03/failed-update-read-only-database-backup/ [3930_link1]:http://michaeljswart.com/2017/01/case-study-troubleshooting-doomed-transactions/ [4064_link1]:https://blog.sqlauthority.com/2008/11/04/sql-server-fix-error-4064-cannot-open-user-default-database-login-failed-login-failed-for-user/ +[4353_link1]:https://blog.sqlauthority.com/2019/05/24/sql-server-fix-msg-4353-conflicting-file-relocations-have-been-specified-for-file-only-a-single-with-move-clause-should-be-specified-for-any-logical-file-name/ [4922_link1]:https://www.mssqltips.com/sqlservertip/4749/sql-server-2016-online-alter-column-operation/ [4934_link1]:https://www.brentozar.com/archive/2018/04/an-odd-case-of-blocking/ [SQL SERVER - FIX Error 5120]:http://blog.sqlauthority.com/2016/10/26/sql-server-fix-error-5120-database-read-mode-attaching-files/ [5004_link1]:https://www.scarydba.com/2019/02/11/query-store-and-a-read_only-database/ +[5061_link1]:https://sqlstudies.com/2020/06/11/end-an-alter-database-immediately-if-anyone-is-in-the-database/ [5123_link1]:https://blogs.msdn.microsoft.com/sql_pfe_blog/2016/11/10/tempdb-misconfiguration-when-sql-server-fails-to-create-a-secondary-data-file/ [5123_link2]:https://blog.sqlauthority.com/2017/09/21/sql-server-fix-msg-5123-level-16-create-file-encountered-operating-system-error-5/ [5846_link1]:https://bornsql.ca/blog/proposed-sql-server-defaults-disable-lightweight-pooling/ @@ -304,19 +363,30 @@ langid | dateformat | datefirst | upgrade | name | alias [8921_link1]:https://www.sqlskills.com/blogs/paul/disaster-recovery-101-fixing-a-broken-system-table-page/ [9002_link3]:https://www.sqlserverscience.com/internals/adding-new-transaction-log-file-when-existing-log-full/ [10314_link1]:https://www.sqlskills.com/blogs/paul/the-curious-case-of-the-clr-assembly-failure-after-an-ag-failover/ +[10314_link2]:https://www.sqlservercentral.com/articles/do-not-set-trustwority-on-for-the-ssisdb-catalog +[10794_link2]:https://www.brentozar.com/archive/2020/07/remember-nothing-stops-a-hekaton-transaction-yeah-about-that/ +[13609_link1]:https://itsalljustelectrons.blogspot.com/2019/05/Splitting-Strings-With-OPENJSON.html [13570_link1]:https://www.mssqltips.com/sqlservertip/5281/sql-server-replication-for-temporal-tables/ [15002_link1]:https://blogs.msdn.microsoft.com/luti/2017/05/17/sql-server-offline-after-applying-service-pack/ [15021_link1]:https://nebraskasql.blogspot.com/2018/10/invalid-value-given-for-parameter.html [15136_link1]:https://blogs.msdn.microsoft.com/psssql/2016/11/15/unable-to-drop-a-user-in-a-database/ [15190_link1]:https://blog.sqlauthority.com/2018/12/15/sql-server-fix-msg-15190-there-are-still-remote-logins-or-linked-logins-for-the-server/ [15274_link1]:https://blog.sqlauthority.com/2019/06/03/sql-server-fix-msg-15274-access-to-the-remote-server-is-denied-because-the-current-security-context-is-not-trusted/ +[15404_link1]:https://sqlstudies.com/2020/05/06/could-not-obtain-information-about-windows-nt-group-user/ +[17051_link1]:https://www.brentozar.com/archive/2020/06/how-to-upgrade-sql-server-evaluation-edition-to-developer-edition/ [17190_link1]:https://www.sqlskills.com/blogs/jonathan/using-group-managed-service-accounts-for-sql-server/ [17300_link1]:https://blog.sqlauthority.com/2018/08/16/sql-server-error-17300-the-error-is-printed-in-terse-mode-because-there-was-error-during-formatting/ +[18054_link1]:https://sqlstudies.com/2019/07/24/custom-error-messages/ [18272_link1]:https://sqlundercover.com/2017/08/29/restores-using-invalid-backup-default-locations/ +[18401_link1]:https://blog.sqlauthority.com/2019/05/20/sql-server-fix-error-login-failed-for-user-reason-server-is-in-script-upgrade-mode-only-administrator-can-connect-at-this-time-microsoft-sql-server-error-18401/ [18452_link1]:http://jasonbrimhall.info/2016/11/08/login-from-an-untrusted-domain-back-to-basics/ [18456_link1]:https://sqlstudies.com/2017/01/12/why-wont-my-sql-logins-work/ +[20598_link1]:https://support.microsoft.com/help/3066750 [22911_link1]:https://www.sqlshack.com/sql-server-filestream-with-change-data-capture/ [25713_link1]:https://sqlquantumleap.com/2018/01/22/server-audit-mystery-filtering-class_type-gets-error-msg-25713/ [25713_link2]:https://sqlquantumleap.com/2018/01/30/server-audit-mystery-filtering-action_id-gets-error-msg-25713/ [33111_link1]:https://sqlundercover.com/2018/04/04/encrypting-sql-server-database-backups/ [35250_link1]:https://blog.sqlauthority.com/2017/05/18/sql-server-fix-msg-35250-level-16-state-7-connection-primary-replica-not-active-command-cannot-processed/ +[35217_link1]:https://www.seangallardy.com/error-35217-and-availability-groups-smh/ +[41121_link1]:https://joshthecoder.com/2020/06/22/a-bug-with-ag-health-checks.html +[41922_link1]:http://timradney.com/2020/05/23/updated-default-settings-for-azure-sql-managed-instance-databases/ diff --git a/Extended_Events/ADS_Standard_Azure.sql b/Extended_Events/ADS_Standard_Azure.sql new file mode 100644 index 00000000..a882b8b1 --- /dev/null +++ b/Extended_Events/ADS_Standard_Azure.sql @@ -0,0 +1,31 @@ +/* +Original link: https://sqlperformance.com/2020/04/sql-performance/bandwidth-friendly-query-profiling-azure-sql-database +Author: Greg Gonzalez +*/ + +ALTER EVENT SESSION [ADS_Standard_Azure] ON DATABASE +DROP EVENT sqlserver.attention, +DROP EVENT sqlserver.existing_connection, +DROP EVENT sqlserver.login, +DROP EVENT sqlserver.logout, +DROP EVENT sqlserver.rpc_completed, +DROP EVENT sqlserver.sql_batch_completed, +DROP EVENT sqlserver.sql_batch_starting +GO + +ALTER EVENT SESSION [ADS_Standard_Azure] ON DATABASE +ADD EVENT sqlserver.rpc_completed( +ACTION(package0.event_sequence,sqlserver.client_app_name,sqlserver.client_pid,sqlserver.database_id,sqlserver.query_hash,sqlserver.session_id,sqlserver.username) + WHERE (([package0].[equal_boolean]([sqlserver].[is_system],(0))) AND ([duration] >= (1000000)))), +ADD EVENT sqlserver.sql_batch_completed( +ACTION(package0.event_sequence,sqlserver.client_app_name,sqlserver.client_pid,sqlserver.database_id,sqlserver.query_hash,sqlserver.session_id,sqlserver.username) + WHERE (([package0].[equal_boolean]([sqlserver].[is_system],(0))) AND ([duration] >= (1000000)))) +GO + +ALTER EVENT SESSION [ADS_Standard_Azure] ON DATABASE +DROP TARGET package0.ring_buffer +GO + +ALTER EVENT SESSION [ADS_Standard_Azure] ON DATABASE +ADD TARGET package0.ring_buffer(SET max_events_limit=(10),max_memory=(51200)) +GO diff --git a/Extended_Events/AppExecutionTimeout.sql b/Extended_Events/AppExecutionTimeout.sql new file mode 100644 index 00000000..2117eb4d --- /dev/null +++ b/Extended_Events/AppExecutionTimeout.sql @@ -0,0 +1,34 @@ +/* +Original link: http://blog.sqlgrease.com/how-to-detect-query-timeout-errors-with-extended-events/ +Author: Franklin Yamamoto + +SELECT + object_name + , convert(xml, event_data) AS event_data + , file_name + , file_offset +FROM sys.fn_xe_file_target_read_file(N'AppExecutionTimeout*.xel',NULL,NULL,NULL); +GO +*/ + +/* Stop trace if started */ +IF EXISTS (SELECT * FROM sys.dm_xe_sessions WHERE name = 'AppExecutionTimeout') + ALTER EVENT SESSION AppExecutionTimeout ON SERVER STATE = STOP; + +/* Delete trace if exists */ +IF EXISTS (SELECT * FROM sys.server_event_sessions WHERE name = 'AppExecutionTimeout') + DROP EVENT SESSION AppExecutionTimeout ON SERVER; + +/* Create trace */ +CREATE EVENT SESSION AppExecutionTimeout ON SERVER +ADD EVENT sqlserver.attention +(ACTION (sqlserver.session_id, sqlserver.database_id, sqlserver.database_name, +sqlserver.username, sqlserver.sql_text, sqlserver.client_hostname, +sqlserver.client_app_name) +WHERE ([package0].[equal_boolean]([sqlserver].[is_system],(0)))) +ADD TARGET package0.event_file(SET filename=N'AppExecutionTimeout.xel', +max_file_size=(5),max_rollover_files=(2)); +GO + +ALTER EVENT SESSION AppExecutionTimeout ON SERVER STATE = START; +GO diff --git a/Extended_Events/AuditFileSize.sql b/Extended_Events/AuditFileSize.sql new file mode 100644 index 00000000..f0cb9888 --- /dev/null +++ b/Extended_Events/AuditFileSize.sql @@ -0,0 +1,56 @@ +/* +Original link: https://jasonbrimhall.info/2019/06/25/database-file-changes/ +Source link: https://github.com/ktaranov/sqlserver-kit/blob/master/Extended_Events/AuditFileSize.sql +Author: Phil Factor + +*/ + +USE master; +GO +-- Create the Event Session +IF EXISTS ( SELECT * + FROM sys.server_event_sessions + WHERE name = 'AuditFileSize' ) + DROP EVENT SESSION AuditFileSize + ON SERVER; +GO + +CREATE EVENT SESSION AuditFileSize ON SERVER +ADD EVENT sqlserver.database_file_size_change ( --good + ACTION ( sqlserver.database_id, sqlserver.session_id, + sqlserver.database_name, sqlserver.client_hostname, sqlserver.sql_text, + sqlserver.nt_username, sqlserver.username, sqlserver.session_nt_username, + sqlserver.client_app_name, sqlserver.context_info, + sqlserver.client_connection_id ) + ), +ADD EVENT sqlserver.databases_shrink_data_movement ( --good + ACTION ( sqlserver.database_id, sqlserver.session_id, + sqlserver.database_name, sqlserver.client_hostname, sqlserver.sql_text, + sqlserver.nt_username, sqlserver.username, sqlserver.session_nt_username, + sqlserver.client_app_name, sqlserver.context_info, + sqlserver.client_connection_id ) + ), +ADD EVENT sqlserver.databases_log_file_used_size_changed ( --good --this is a very chatty event and may be left off + ACTION ( sqlserver.database_id, sqlserver.session_id, + sqlserver.database_name, sqlserver.client_hostname, sqlserver.sql_text, + sqlserver.nt_username, sqlserver.username, sqlserver.session_nt_username, + sqlserver.client_app_name, sqlserver.context_info, + sqlserver.client_connection_id ) + ), +ADD EVENT sqlserver.databases_log_shrink ( --good + ACTION ( sqlserver.database_id, sqlserver.session_id, + sqlserver.database_name, sqlserver.client_hostname, sqlserver.sql_text, + sqlserver.nt_username, sqlserver.username, sqlserver.session_nt_username, + sqlserver.client_app_name, sqlserver.context_info, + sqlserver.client_connection_id ) + ) +ADD TARGET package0.event_file ( + SET filename = 'c:\XE\AuditFileSize.xel' + , max_file_size = 5 + , max_rollover_files = 4 ) +WITH ( MAX_MEMORY = 4 MB + , EVENT_RETENTION_MODE = ALLOW_SINGLE_EVENT_LOSS + , TRACK_CAUSALITY = ON + , MAX_DISPATCH_LATENCY = 1 SECONDS + , STARTUP_STATE = ON ); +GO diff --git a/Extended_Events/AutoTuneMonitor.sql b/Extended_Events/AutoTuneMonitor.sql new file mode 100644 index 00000000..2d62826f --- /dev/null +++ b/Extended_Events/AutoTuneMonitor.sql @@ -0,0 +1,84 @@ +/* +https://jasonbrimhall.info/2019/01/04/automatic-tuning-monitoring-and-diagnostics/ +Author: Jason Brimhall +*/ + +USE master; +GO +-- Create the Event Session +IF EXISTS +( + SELECT * + FROM sys.server_event_sessions + WHERE name = 'AutoTuneMonitor' +) + DROP EVENT SESSION AutoTuneMonitor ON SERVER; +GO + +CREATE EVENT SESSION [AutoTuneMonitor] +ON SERVER + ADD EVENT qds.automatic_tuning_config_change + (ACTION + ( + sqlserver.database_id, + sqlserver.nt_username, + sqlserver.sql_text, + sqlserver.username, + sqlserver.session_nt_username, + sqlserver.client_app_name, + sqlserver.session_id, + sqlserver.client_hostname + ) + ), + ADD EVENT qds.automatic_tuning_diagnostics + (ACTION + ( + sqlserver.database_id, + sqlserver.nt_username, + sqlserver.sql_text, + sqlserver.username, + sqlserver.session_nt_username, + sqlserver.client_app_name, + sqlserver.session_id, + sqlserver.client_hostname + ) + ), + ADD EVENT qds.automatic_tuning_state_change + (ACTION + ( + sqlserver.database_id, + sqlserver.nt_username, + sqlserver.sql_text, + sqlserver.username, + sqlserver.session_nt_username, + sqlserver.client_app_name, + sqlserver.session_id, + sqlserver.client_hostname + ) + ), + ADD EVENT qds.automatic_tuning_error + (ACTION + ( + sqlserver.database_id, + sqlserver.nt_username, + sqlserver.sql_text, + sqlserver.username, + sqlserver.session_nt_username, + sqlserver.client_app_name, + sqlserver.session_id, + sqlserver.client_hostname + ) + ) + ADD TARGET package0.event_file + (SET filename = N'C:\XE\AutoTuneMonitor.xel'), + ADD TARGET package0.ring_buffer +WITH +( + MAX_DISPATCH_LATENCY = 5 SECONDS, + TRACK_CAUSALITY = ON, + STARTUP_STATE = OFF +); +GO + +ALTER EVENT SESSION [AutoTuneMonitor] ON SERVER STATE = START; +GO \ No newline at end of file diff --git a/Extended_Events/CheckpointTracking.sql b/Extended_Events/CheckpointTracking.sql new file mode 100644 index 00000000..b697cc53 --- /dev/null +++ b/Extended_Events/CheckpointTracking.sql @@ -0,0 +1,59 @@ +/* +Original link: https://www.sqlserverscience.com/extended-events/checkpoint-tracking-via-extended-events/ +Author: Max Vernon +*/ + +IF NOT EXISTS ( /* only create this session if one doesn't already exist + to prevent inadvertant loss of events. + */ + SELECT 1 + FROM sys.server_event_sessions ss + WHERE ss.name = N'CheckpointTracking' + ) +BEGIN + CREATE EVENT SESSION CheckpointTracking + ON SERVER + ADD EVENT sqlserver.checkpoint_begin + ( + ACTION + ( + package0.callstack + , package0.collect_system_time + , package0.event_sequence + , sqlserver.client_app_name + , sqlserver.client_hostname + , sqlserver.database_id + , sqlserver.database_name + , sqlserver.is_system + , sqlserver.session_id + , sqlserver.session_nt_username + , sqlserver.sql_text + ) + ) + , ADD EVENT sqlserver.checkpoint_end + ( + ACTION + ( + package0.callstack + , package0.collect_system_time + , package0.event_sequence + , sqlserver.client_app_name + , sqlserver.client_hostname + , sqlserver.database_id + , sqlserver.database_name + , sqlserver.is_system + , sqlserver.session_id + , sqlserver.session_nt_username + , sqlserver.sql_text + ) + ) + ADD TARGET package0.ring_buffer + ( + SET max_memory = 10240 + ) + WITH (STARTUP_STATE=OFF); +END +GO +ALTER EVENT SESSION CheckpointTracking +ON SERVER +STATE = START; diff --git a/Extended_Events/ConfigurationItemsChanged.sql b/Extended_Events/ConfigurationItemsChanged.sql new file mode 100644 index 00000000..50c2f1d5 --- /dev/null +++ b/Extended_Events/ConfigurationItemsChanged.sql @@ -0,0 +1,85 @@ +/* +Original link: https://www.red-gate.com/hub/product-learning/sql-monitor/spotting-unauthorized-configuration-settings-sql-server +Source link: https://github.com/ktaranov/sqlserver-kit/blob/master/Extended_Events/ConfigurationItemsChanged.sql +Author: Phil Factor + + +SELECT + CONVERT(datetime2, + SwitchOffset(CONVERT(datetimeoffset,xed.event_data.value('(@timestamp)[1]', 'datetime2')), + DateName(TzOffset, SYSDATETIMEOFFSET()))) AS datetime_local, + xed.event_data.value('(data[@name="error_number"]/value)[1]', 'int') AS [Error_Number], + xed.event_data.value('(data[@name="severity"]/value)[1]', 'int') AS Severity, + xed.event_data.value('(data[@name="message"]/value)[1]', 'varchar(255)') AS [Message], + xed.event_data.value('(action[@name="username"]/value)[1]', 'varchar(255)') AS UserName, + xed.event_data.value('(action[@name="nt_username"]/value)[1]', 'varchar(255)') AS NT_Username, + xed.event_data.value('(action[@name="sql_text"]/value)[1]', 'nvarchar(max)') AS SQL_Text, + xed.event_data.value('(action[@name="database_name"]/value)[1]', 'varchar(255)') AS [Database_Name], + xed.event_data.value('(action[@name="client_connection_id"]/value)[1]', 'varchar(255)') AS client_conn, + xed.event_data.value('(action[@name="client_app_name"]/value)[1]', 'varchar(255)') AS client_app_name +FROM @Target_Data.nodes('//RingBufferTarget/event') AS xed (event_data); + +EXEC sp_configure 'show advanced options',1; +RECONFIGURE; +GO +EXEC sp_configure 'CLR Enabled',1; +EXEC sp_configure 'Ad Hoc Distributed Queries',1; +EXEC sp_configure 'Cross DB Ownership Chaining',1; +EXEC sp_configure 'Database Mail XPs',1; +EXEC sp_configure 'Ole Automation Procedures',1; +EXEC sp_configure 'Remote ACCESS',1; +EXEC sp_configure 'Remote Admin Connections',1; +EXEC sp_configure 'Scan for Startup Procs',1; +RECONFIGURE -- To update the currently configured value for advanced options. +GO + +/* this code turns OFF some of the configuration items with security issues */ +EXEC sp_configure 'show advanced options',1; +RECONFIGURE; +GO +EXEC sp_configure 'Ad Hoc Distributed Queries',0; +EXEC sp_configure 'CLR ENABLED',0; +EXEC sp_configure 'Cross DB Ownership Chaining',0; +EXEC sp_configure 'Database Mail XPs',0; +EXEC sp_configure 'Ole Automation Procedures',0; +EXEC sp_configure 'Remote ACCESS',0; +EXEC sp_configure 'Remote Admin Connections',0; +EXEC sp_configure 'Scan for Startup Procs',0; +EXEC sp_configure 'show advanced options',0; +RECONFIGURE; -- To update the currently configured value for advanced options. +GO +*/ + +USE master; +GO + +IF EXISTS --if the session already exists, then delete it. We are assuming you've changed something + ( + SELECT * FROM sys.server_event_sessions + WHERE server_event_sessions.name = 'ConfigurationItemsChanged' + ) + DROP EVENT SESSION ConfigurationItemsChanged ON SERVER; +GO +CREATE EVENT SESSION ConfigurationItemsChanged -- the name of the session +ON SERVER + ADD EVENT sqlserver.error_reported --just the one event + (ACTION + ( + sqlserver.client_app_name, sqlserver.client_connection_id, + sqlserver.database_name, sqlserver.nt_username, sqlserver.sql_text, + sqlserver.username --all these are useful for tracking an error + ) + WHERE (([error_number]=(15457)) OR ([error_number]=(5084))) + ) + ADD TARGET package0.ring_buffer /* we will write it to a ring buffer target only */ + (SET max_memory = (4096)) +WITH + ( + MAX_MEMORY = 4096KB, EVENT_RETENTION_MODE = ALLOW_SINGLE_EVENT_LOSS, + MAX_DISPATCH_LATENCY = 30 SECONDS, MAX_EVENT_SIZE = 0KB, + MEMORY_PARTITION_MODE = NONE, TRACK_CAUSALITY = OFF, STARTUP_STATE = ON + ); +GO + +ALTER EVENT SESSION ConfigurationItemsChanged ON SERVER STATE = START; +GO diff --git a/Extended_Events/FileSizeChanges.sql b/Extended_Events/FileSizeChanges.sql new file mode 100644 index 00000000..9adcef3f --- /dev/null +++ b/Extended_Events/FileSizeChanges.sql @@ -0,0 +1,106 @@ +/* +Original link: https://sqlperformance.com/2020/04/extended-events/removing-default-trace-2 +Author: Aaron Bertrand + +WITH FileInfo(XEPath) AS + ( + SELECT LEFT(BasePath,COALESCE(NULLIF(CHARINDEX(SessName,BasePath)-1,-1),0)) + SessName + N'*.xel' + FROM + ( + SELECT xmlsrc.data.value(N'(@name)[1]', N'nvarchar(max)'), SessName + FROM + ( + SELECT CONVERT(xml,target_data), s.[name] + FROM sys.dm_xe_session_targets AS t + INNER JOIN sys.dm_xe_sessions AS s + ON s.[address] = t.event_session_address + WHERE s.[name] = N'FileSizeChanges' + ) AS xefile (TargetData, SessName) + CROSS APPLY TargetData.nodes(N'//EventFileTarget/File') AS xmlsrc(data) + ) AS InnerData(BasePath, SessName) + ), + SessionData([EventData]) AS + ( + SELECT CONVERT(xml, TargetData.event_data) FROM FileInfo CROSS APPLY + sys.fn_xe_file_target_read_file(FileInfo.XEPath, NULL, NULL, NULL) AS TargetData + ), + src AS + ( + SELECT + EndTimeUTC = x.d.value(N'(@timestamp)[1]', N'datetime2'), + DatabaseID = x.d.value(N'(data [@name="database_id"]/value)[1]', N'int'), + [FileName] = x.d.value(N'(data [@name="file_name"]/value)[1]', N'sysname'), + Duration = x.d.value(N'(data [@name="duration"]/value)[1]', N'int'), + FileType = x.d.value(N'(data [@name="file_type"]/text)[1]', N'varchar(4)'), + Culprit = x.d.value(N'(action[@name="sql_text"]/value)[1]', N'nvarchar(max)'), + IsAutomatic = x.d.value(N'(data [@name="is_automatic"]/value)[1]', N'varchar(5)'), + ChangeKB = x.d.value(N'(data [@name="size_change_kb"]/value)[1]', N'bigint'), + Principal = x.d.value(N'(action[@name="server_principal_name"]/value)[1]', N'sysname'), + username = x.d.value(N'(action[@name="username"]/value)[1]', N'sysname'), + AppName = x.d.value(N'(action[@name="client_app_name"]/value)[1]', N'sysname'), + HostName = x.d.value(N'(action[@name="client_hostname"]/value)[1]', N'sysname') + --, [EventData] -- raw XML to troubleshoot specific events + FROM SessionData CROSS APPLY EventData.nodes('/event') AS x(d) + ) + SELECT + DatabaseName = DB_NAME(DatabaseID), + [FileName], + DurationSeconds = CONVERT(decimal(18,3),Duration/1000000.0), + StartTimeUTC = CONVERT(datetime2(3), DATEADD(MICROSECOND, -Duration, EndTimeUTC)), + EndTimeUTC = CONVERT(datetime2(3), EndTimeUTC), + FileType, + Culprit = CASE WHEN Culprit IS NULL AND AppName LIKE N'Repl%' + THEN AppName ELSE Culprit END, + IsAutomatic, + ChangeMB = CONVERT(decimal(18,3), ChangeKB / 1024.0), + Principal = COALESCE([Principal], COALESCE(NULLIF(username,N''),N'?')), + HostName, + App = CASE WHEN AppName LIKE N'%Management Studio%Query%' + THEN N'SSMS - Query Window' + WHEN AppName LIKE N'%Management Studio%' + THEN N'SSMS - GUI!' + ELSE AppName END--, [EventData] -- raw XML to troubleshoot specific events + FROM src; +*/ + +/* Create trace */ +DECLARE @path nvarchar(max) = (SELECT REVERSE(SUBSTRING(p, CHARINDEX(N'\', p), 4000)) + FROM (SELECT REVERSE((CONVERT(nvarchar(max), SERVERPROPERTY(N'ErrorLogFileName'))))) AS s(p)); + +IF EXISTS (SELECT 1 FROM sys.dm_xe_sessions WHERE name = N'FileSizeChanges') +BEGIN + EXEC sys.sp_executesql N'DROP EVENT SESSION FileSizeChanges ON SERVER;'; +END + +DECLARE @sql nvarchar(max) = N' CREATE EVENT SESSION FileSizeChanges ON SERVER +ADD EVENT sqlserver.database_file_size_change +( + ACTION + ( + sqlserver.sql_text, + sqlserver.client_app_name, + sqlserver.client_hostname, + sqlserver.username, + sqlserver.server_principal_name + ) +) +ADD TARGET package0.event_file +( + SET filename = ''' + @path + N'FileSizeChanges.xel'', + MAX_FILE_SIZE = 100, -- MB + MAX_ROLLOVER_FILES = 100 -- 100 MB x 100 = max 10 GB +) +WITH +( + MAX_MEMORY = 8192 KB, + EVENT_RETENTION_MODE = ALLOW_SINGLE_EVENT_LOSS, + MAX_DISPATCH_LATENCY = 30 SECONDS, + MAX_EVENT_SIZE = 0 KB, + TRACK_CAUSALITY = OFF, + STARTUP_STATE = ON +); + +ALTER EVENT SESSION FileSizeChanges ON SERVER STATE = START;'; + +EXEC sys.sp_executesql @sql; +GO diff --git a/Extended_Events/InvestigateWaitsMaxDop.sql b/Extended_Events/InvestigateWaitsMaxDop.sql new file mode 100644 index 00000000..ebe0dc89 --- /dev/null +++ b/Extended_Events/InvestigateWaitsMaxDop.sql @@ -0,0 +1,53 @@ +/* +Original link: https://www.sqlskills.com/blogs/paul/who-is-overriding-maxdop-1-on-the-instance/ +Author: Paul Randal + +-- Get parallel plan with trace flag https://github.com/ktaranov/sqlserver-kit/blob/master/SQL%20Server%20Trace%20Flag.md#8649 +SELECT * FROM AdventureWorks2012.Sales.SalesOrderDetail WHERE OrderQty > 1000 OPTION (MAXDOP 8, QUERYTRACEON 8649); +GO + +SELECT + [data1].[value] ('(./@timestamp)[1]', 'datetime') AS [Time], + [data1].[value] ('(./data[@name="dop"]/value)[1]', 'INT') AS [DOP], + [data1].[value] ('(./action[@name="client_hostname"]/value)[1]', 'VARCHAR(MAX)') AS [Host], + [data1].[value] ('(./action[@name="nt_username"]/value)[1]', 'VARCHAR(MAX)') AS [User], + [data1].[value] ('(./action[@name="sql_text"]/value)[1]','VARCHAR(MAX)') AS [Statement] +FROM ( + SELECT CONVERT (XML, [target_data]) AS data + FROM sys.dm_xe_session_targets [xst] + INNER JOIN sys.dm_xe_sessions [xs] + ON [xst].[event_session_address] = [xs].[address] + WHERE [xs].[name] = N'InvestigateWaitsMaxDop') AS t +CROSS APPLY data.nodes('//event') n (data1); +GO +*/ + +/* Stop trace if started */ +IF EXISTS (SELECT * FROM sys.dm_xe_sessions WHERE name = 'InvestigateWaitsMaxDop') + ALTER EVENT SESSION InvestigateWaitsMaxDop ON SERVER STATE = STOP; + +/* Delete trace if exists */ +IF EXISTS (SELECT * FROM sys.server_event_sessions WHERE name = 'InvestigateWaitsMaxDop') + DROP EVENT SESSION InvestigateWaitsMaxDop ON SERVER; + +/* Create trace */ +CREATE EVENT SESSION InvestigateWaitsMaxDop ON SERVER +ADD EVENT sqlserver.degree_of_parallelism +( + ACTION ( + sqlserver.client_hostname, + sqlserver.nt_username, + sqlserver.sql_text) + WHERE dop > 1 /* parallel plans */ +) +ADD TARGET package0.ring_buffer +WITH ( + MAX_MEMORY = 50 MB, + MAX_DISPATCH_LATENCY = 5 SECONDS +); +GO + +/* Start trace +ALTER EVENT SESSION InvestigateWaitsMaxDop ON SERVER STATE = START; +GO +*/ diff --git a/Extended_Events/LinkedServerMonitor.sql b/Extended_Events/LinkedServerMonitor.sql new file mode 100644 index 00000000..2096622b --- /dev/null +++ b/Extended_Events/LinkedServerMonitor.sql @@ -0,0 +1,135 @@ +/* +https://jasonbrimhall.info/2021/01/02/powerful-monitoring-for-your-linked-servers-with-xevents/ +by Jason Brimhall 2021-01-02 +*/ + +/* Create the Event Session */ +IF EXISTS +( + SELECT * + FROM sys.server_event_sessions + WHERE name = 'LinkedServerMonitor' +) + DROP EVENT SESSION LinkedServerMonitor ON SERVER; +GO + + +CREATE EVENT SESSION [LinkedServerMonitor] +ON SERVER + ADD EVENT sqlserver.oledb_data_read + (ACTION + ( + package0.callstack + , sqlserver.client_app_name + , sqlserver.database_name + , sqlserver.nt_username + , sqlserver.query_hash + , sqlserver.query_plan_hash + , sqlserver.session_id + , sqlserver.sql_text + , sqlserver.client_hostname + , sqlserver.tsql_stack + , package0.event_sequence + , sqlserver.context_info + , sqlserver.client_connection_id + , sqlserver.username + , sqlserver.database_id + ) + ) + , ADD EVENT sqlserver.oledb_query_interface + (ACTION + ( + package0.callstack + , sqlserver.client_app_name + , sqlserver.database_name + , sqlserver.nt_username + , sqlserver.query_hash + , sqlserver.query_plan_hash + , sqlserver.session_id + , sqlserver.sql_text + , sqlserver.client_hostname + , sqlserver.tsql_stack + , package0.event_sequence + , sqlserver.context_info + , sqlserver.client_connection_id + , sqlserver.username + , sqlserver.database_id + ) + ) + , ADD EVENT sqlserver.oledb_error + (ACTION + ( + package0.callstack + , sqlserver.client_app_name + , sqlserver.database_name + , sqlserver.nt_username + , sqlserver.query_hash + , sqlserver.query_plan_hash + , sqlserver.session_id + , sqlserver.sql_text + , sqlserver.client_hostname + , sqlserver.tsql_stack + , package0.event_sequence + , sqlserver.context_info + , sqlserver.client_connection_id + , sqlserver.username + , sqlserver.database_id + ) + ) + , ADD EVENT sqlserver.oledb_provider_information + (ACTION + ( + package0.callstack + , sqlserver.client_app_name + , sqlserver.database_name + , sqlserver.nt_username + , sqlserver.query_hash + , sqlserver.query_plan_hash + , sqlserver.session_id + , sqlserver.sql_text + , sqlserver.client_hostname + , sqlserver.tsql_stack + , package0.event_sequence + , sqlserver.context_info + , sqlserver.client_connection_id + , sqlserver.username + , sqlserver.database_id + ) + ) + , ADD EVENT sqlserver.oledb_provider_initialized + (ACTION + ( + package0.callstack + , sqlserver.client_app_name + , sqlserver.database_name + , sqlserver.nt_username + , sqlserver.query_hash + , sqlserver.query_plan_hash + , sqlserver.session_id + , sqlserver.sql_text + , sqlserver.client_hostname + , sqlserver.tsql_stack + , package0.event_sequence + , sqlserver.context_info + , sqlserver.client_connection_id + , sqlserver.username + , sqlserver.database_id + ) + ) + ADD TARGET package0.event_file + (SET filename = N'C:\XE\LinkedServerMonitor', max_file_size = (256), max_rollover_files = (2)) + , ADD TARGET package0.histogram + (SET filtering_event_name = N'sqlserver.oledb_data_read' + , slots = (10000) --modify depending on your needs + , source = N'sqlserver.tsql_stack') +WITH +( + MAX_DISPATCH_LATENCY = 5 SECONDS + , TRACK_CAUSALITY = ON + , STARTUP_STATE = ON +); +GO + + +ALTER EVENT SESSION LinkedServerMonitor ON SERVER STATE = START; +GO diff --git a/Extended_Events/LockEscalation.sql b/Extended_Events/LockEscalation.sql new file mode 100644 index 00000000..eaca905f --- /dev/null +++ b/Extended_Events/LockEscalation.sql @@ -0,0 +1,14 @@ +/* +https://littlekendra.com/2017/04/03/which-locks-count-toward-lock-escalation/ +by Kendra Little Melton 2017-04-03 +*/ + +DROP EVENT SESSION LockEscalation ON SERVER; +GO + +CREATE EVENT SESSION LockEscalation ON SERVER +ADD EVENT sqlserver.lock_escalation(SET collect_database_name=(1),collect_statement=(1) + ACTION(sqlserver.session_id)) +ADD TARGET package0.event_file(SET filename=N'C:\XE\Lock_Escalation.xel') +WITH (MAX_MEMORY=4096 KB,EVENT_RETENTION_MODE=NO_EVENT_LOSS,MAX_DISPATCH_LATENCY=5 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=OFF,STARTUP_STATE=OFF) +GO diff --git a/Extended_Events/SchemaQueryByUser.sql b/Extended_Events/SchemaQueryByUser.sql new file mode 100644 index 00000000..648f3283 --- /dev/null +++ b/Extended_Events/SchemaQueryByUser.sql @@ -0,0 +1,30 @@ +/* +Original link: https://gist.github.com/SQLDBAWithABeard/3a617e04de5db729e941a0fd6ebed7cc +Author: Rob Sewell +*/ + +/* Stop trace if started */ +IF EXISTS (SELECT * FROM sys.dm_xe_sessions WHERE name = 'SchemaQueryByUser') + ALTER EVENT SESSION SchemaQueryByUser ON SERVER STATE = STOP; + +/* Delete trace if exists */ +IF EXISTS (SELECT * FROM sys.server_event_sessions WHERE name = 'SchemaQueryByUser') + DROP EVENT SESSION SchemaQueryByUser ON SERVER; + +/* Create trace */ +CREATE EVENT SESSION SchemaQueryByUser ON SERVER +ADD EVENT sqlserver.sql_batch_completed(SET collect_batch_text=(1) + ACTION(sqlserver.database_name, sqlserver.session_server_principal_name) + WHERE ((((((((NOT ([sqlserver].[like_i_sql_unicode_string]([sqlserver].[session_server_principal_name],N'EZCORP\Y%'))) + AND (([sqlserver].[like_i_sql_unicode_string]([batch_text],N'%%')) + OR ([sqlserver].[equal_i_sql_unicode_string]([sqlserver].[database_name],N'')))) + AND (NOT ([sqlserver].[like_i_sql_unicode_string]([batch_text],N'%SELECT CASE WHEN has_dbaccess%END%')))) + AND (NOT ([sqlserver].[like_i_sql_unicode_string]([batch_text],N'%SELECT case when @edition = N''SQL Azure''%')))) + AND (NOT ([sqlserver].[like_i_sql_unicode_string]([batch_text],N'%SERVERPROPERTY(%')))) + AND (NOT ([sqlserver].[like_i_sql_unicode_string]([batch_text],N'%HasMemoryOptimizedObjects from master.sys.master_files mf join master.sys.databases db on mf.database_id%')))) + AND (NOT ([sqlserver].[like_i_sql_unicode_string]([batch_text],N'%database_query_store_options%')))) + AND (NOT ([sqlserver].[like_i_sql_unicode_string]([batch_text],N'%SET SHOWPLAN%'))))) +GO + +ALTER EVENT SESSION SchemaQueryByUser ON SERVER STATE = START; +GO diff --git a/Extended_Events/System_Health_Addition.sql b/Extended_Events/System_Health_Addition.sql new file mode 100644 index 00000000..2913af7b --- /dev/null +++ b/Extended_Events/System_Health_Addition.sql @@ -0,0 +1,50 @@ +/* +Original link: https://karaszi.com/looking-for-strange +Author: Tibor Karaszi's +*/ + +--Stop trace if started +IF EXISTS (SELECT * FROM sys.dm_xe_sessions WHERE name = 'SystemHealthAddition') + ALTER EVENT SESSION SystemHealthAddition ON SERVER STATE = STOP; + +--Delete trace if exists +IF EXISTS (SELECT * FROM sys.server_event_sessions WHERE name = 'SystemHealthAddition') + DROP EVENT SESSION SystemHealthAddition ON SERVER; + +--Create trace +CREATE EVENT SESSION [SystemHealthAddition] ON SERVER +ADD EVENT sqlserver.attention( + WHERE (package0.greater_than_uint64(database_id,(4)) + AND package0.equal_boolean(sqlserver.is_system,(0)))) , +ADD EVENT sqlserver.auto_stats( + WHERE (package0.greater_than_uint64(database_id,(4)) + AND package0.equal_boolean(sqlserver.is_system,(0)) + AND package0.greater_than_equal_int64(object_id,(1000000)) + AND package0.greater_than_uint64(duration,(10)))), +ADD EVENT sqlserver.database_file_size_change, +ADD EVENT sqlserver.database_started, +ADD EVENT sqlserver.lock_deadlock, +ADD EVENT sqlserver.lock_escalation, +ADD EVENT sqlserver.lock_timeout_greater_than_0, +ADD EVENT sqlserver.long_io_detected, + +--Begin performance section +ADD EVENT qds.query_store_plan_forcing_failed, +ADD EVENT sqlserver.exchange_spill, +ADD EVENT sqlserver.execution_warning, +ADD EVENT sqlserver.hash_spill_details, +ADD EVENT sqlserver.hash_warning, +ADD EVENT sqlserver.optimizer_timeout, +ADD EVENT sqlserver.query_memory_grant_blocking, +ADD EVENT sqlserver.query_memory_grants, +ADD EVENT sqlserver.sort_warning, +ADD EVENT sqlserver.window_spool_ondisk_warning +--End performance section + +ADD TARGET package0.event_counter; +GO + +/* +--Start trace +ALTER EVENT SESSION SystemHealthAddition ON SERVER STATE = START; +*/ diff --git a/Extended_Events/TrackApiCursor.sql b/Extended_Events/TrackApiCursor.sql new file mode 100644 index 00000000..b91beb3f --- /dev/null +++ b/Extended_Events/TrackApiCursor.sql @@ -0,0 +1,97 @@ +/* +https://blog.pythian.com/extended-events-fetching-api-cursors/ +by Shawn Melton January 3, 2017 +*/ + +DROP EVENT SESSION TrackApiCursor ON SERVER; +GO + +CREATE EVENT SESSION TrackApiCursor ON SERVER +ADD EVENT sqlserver.cursor_close( + ACTION( + sqlserver.client_app_name, + sqlserver.database_name, + sqlserver.is_system, + sqlserver.session_id, + sqlserver.sql_text) + WHERE ( + [sqlserver].[is_system]<>(0) + -- AND [sqlserver].[client_app_name]=N'Steely-Eyed-Missle-Man' + ) +), +ADD EVENT sqlserver.cursor_open( + ACTION( + sqlserver.client_app_name, + sqlserver.database_name, + sqlserver.is_system, + sqlserver.query_hash, + sqlserver.session_id, + sqlserver.sql_text) + WHERE ( + [sqlserver].[is_system]<>(0) + -- AND [sqlserver].[client_app_name]=N'Steely-Eyed-Missle-Man' + ) +), +ADD EVENT sqlserver.rpc_completed( + ACTION( + sqlserver.client_app_name, + sqlserver.database_name, + sqlserver.is_system, + sqlserver.query_hash, + sqlserver.session_id, + sqlserver.sql_text) + WHERE ( + [sqlserver].[is_system]<>(0) + -- AND [sqlserver].[client_app_name]=N'Steely-Eyed-Missle-Man' + ) +) +ADD TARGET package0.event_file(SET filename=N'Track_api_cursor.xel') +WITH ( + MAX_DISPATCH_LATENCY=12 SECONDS, + TRACK_CAUSALITY=ON +); +GO + +ALTER EVENT SESSION TrackApiCursor ON SERVER STATE = START; +GO + +/* Read the data */ +IF OBJECT_ID('tempdb..#XEResults') IS NOT NULL + DROP TABLE #XEResults ; +GO +IF OBJECT_ID('tempdb..#XEResultsParsed') IS NOT NULL + DROP TABLE #XEResultsParsed ; +GO + +-- Create results table to load data from XE files +CREATE TABLE #XEResults +( + [RowID] INT IDENTITY + PRIMARY KEY, + [event_data] XML +); + +-- Load the event data from the file target +INSERT INTO #XEResults + ([event_data]) +SELECT CAST([event_data] AS XML) AS event_data +FROM [sys].[fn_xe_file_target_read_file](N'Track_api_cursor*xel',NULL,NULL,NULL) ; + +--SELECT * FROM #XEResults + +-- Query the Event data from the Target. +SELECT [event].[value]('(@name)[1]', 'varchar(50)') AS event_name +-- , DATEADD(hh, DATEDIFF(hh, GETUTCDATE(), CURRENT_TIMESTAMP), [event].[value]('(@timestamp)[1]', 'datetime2')) AS [timestamp] + ,[event].[value]('(action[@name="session_id"]/value)[1]', 'int') AS [session_id] + ,[event].[value]('(action[@name="database_name"]/value)[1]','varchar(128)') AS [database_name] + ,[event].[value]('(action[@name="client_app_name"]/value)[1]','varchar(500)') AS [client_app_name] + ,[event].[value]('(data[@name="object_name"]/value)[1]', 'varchar(50)') AS [object_name] + ,[event].[value]('(action[@name="sql_text"]/value)[1]','varchar(max)') AS [sql_text] + ,[event].[value]('(data[@name="statement"]/value)[1]', 'varchar(1000)') AS [statement] + ,[event].[value]('(action[@name="attach_activity_id_xfer"]/value)[1]', 'varchar(200)') AS [attach_activity_id_xfer] + ,[event].[value]('(action[@name="attach_activity_id"]/value)[1]', 'varchar(200)') AS [attach_activity_id] +FROM #XEResults +CROSS APPLY [event_data].[nodes]('event') AS [q] ([event]) +ORDER BY DATEADD(hh, DATEDIFF(hh, GETUTCDATE(), CURRENT_TIMESTAMP),[event].[value]('(@timestamp)[1]', 'datetime2')) + ,[event].[value]('(action[@name="attach_activity_id"]/value)[1]', 'varchar(200)'); + diff --git a/Extended_Events/XE_Truncate.sql b/Extended_Events/XE_Truncate.sql new file mode 100644 index 00000000..5289f428 --- /dev/null +++ b/Extended_Events/XE_Truncate.sql @@ -0,0 +1,23 @@ +/* +https://www.sqlservercentral.com/forums/topic/extended-events-capture-truncate-using-object_altered-event +by Evgeny Garaev 2018-06-28 +*/ + +/* Stop trace if started */ +IF EXISTS (SELECT * FROM sys.dm_xe_sessions WHERE name = N'XE_Truncate') + ALTER EVENT SESSION XE_Truncate ON SERVER STATE = STOP; + +/* Delete trace if exists */ +IF EXISTS (SELECT * FROM sys.server_event_sessions WHERE name = N'XE_Truncate') + DROP EVENT SESSION XE_Truncate ON SERVER; + + +CREATE EVENT SESSION XE_Truncate ON SERVER +ADD EVENT sqlserver.sp_statement_starting(SET collect_statement=(1) +WHERE ([sqlserver].[like_i_sql_unicode_string]([statement], N'truncate table%'))), +ADD EVENT sqlserver.sql_statement_starting(SET collect_statement=(1) +WHERE ([sqlserver].[like_i_sql_unicode_string]([statement],N'truncate table%'))); +GO + +ALTER EVENT SESSION XE_Truncate ON SERVER STATE = START; +GO diff --git a/LICENSE b/LICENSE index 5a8a329d..89f65430 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2015-2019 Konstantin Taranov +Copyright (c) 2015-2021 Konstantin Taranov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/PowerShell/Collect_Windows_Counters.ps1 b/PowerShell/Collect_Windows_Counters.ps1 new file mode 100644 index 00000000..7ad22ea4 --- /dev/null +++ b/PowerShell/Collect_Windows_Counters.ps1 @@ -0,0 +1,61 @@ +# http://www.bradleyschacht.com/collecting-server-performance-metrics-powershell/ + +$outputDirectory = "C:\Temp"; #Directory where the restult file will be stored. + +$computerName = ""; #Set the Computer from which to collect counters. Leave blank for local computer. +$sampleInterval = 15; #Collection interval in seconds. +$maxSamples = 240; #How many samples should be collected at the interval specified. Set to 0 for continuous collection. + +# Check to see if the output directory exists. If not, create it. +if (-not(Test-Path $outputDirectory)) + { + Write-Host "Output directory does not exist. Directory will be created." + $null = New-Item -Path $outputDirectory -ItemType "Directory" + Write-Host "Output directory created."; + } + +# Strip the \ off the end of the directory if necessary. +if ($outputDirectory.EndsWith("\")) {$outputDirectory = $outputDirectory.Substring(0, $outputDirectory.Length - 1)}; + +#Create the name of the output file in the format of "computer date time.csv". +$outputFile = "$outputDirectory\$(if($computerName -eq ''){$env:COMPUTERNAME} else {$computerName}) $(Get-Date -Format "yyyy_MM_dd HH_mm_ss").csv"; + +# Write the parameters to the screen. +Write-Host " + +Collecting counters... +Press Ctrl+C to exit."; + +# Specify the list of performance counters to collect. +$counters = + @(` + "\Processor(_Total)\% Processor Time" ` + ,"\Memory\Available MBytes" ` + ,"\Paging File(_Total)\% Usage" ` + ,"\LogicalDisk(*)\Avg. Disk Bytes/Read" ` + ,"\LogicalDisk(*)\Avg. Disk Bytes/Write" ` + ,"\LogicalDisk(*)\Avg. Disk sec/Read" ` + ,"\LogicalDisk(*)\Avg. Disk sec/Write" ` + ,"\LogicalDisk(*)\Disk Read Bytes/sec" ` + ,"\LogicalDisk(*)\Disk Write Bytes/sec" ` + ,"\LogicalDisk(*)\Disk Reads/sec" ` + ,"\LogicalDisk(*)\Disk Writes/sec" + ); + +#Set the variables for the Get-Counter cmdlet. +$variables = @{ + SampleInterval = $sampleInterval; + Counter = $counters; +} + +#Add the computer name if it was not blank. +if ($computerName -ne "") {$variables.Add("ComputerName","$computerName")}; + +#Either set the sample interval or specify to collect continuous. +if ($maxSamples -eq 0) {$variables.Add("Continuous",1)} +else {$variables.Add("MaxSamples","$maxSamples")}; + +# Show the variables then execute the command while storing the results in a file. +$variables; +Get-Counter @Variables | Export-Counter -FileFormat csv -Path $outputFile; + \ No newline at end of file diff --git a/PowerShell/Convert_trc_to_2008r2.ps1 b/PowerShell/Convert_trc_to_2008r2.ps1 new file mode 100644 index 00000000..b60c20a3 --- /dev/null +++ b/PowerShell/Convert_trc_to_2008r2.ps1 @@ -0,0 +1,33 @@ +#requires -version 2.0 + +<# +.SYNOPSIS + Changes the version information in the header of a SQL Server trace + +.DESCRIPTION + Author: Gianluca Sartori - @spaghettidba + Create date: 2012-11-07 + https://spaghettidba.com/2012/11/08/more-on-converting-trace-files/ + +.PARAMETER fileName + Trace file name +#> + +## ============================================= +## Author: Gianluca Sartori - @spaghettidba +## Create date: 2012-11-07 +## Description: Changes the version information +## in the header of a SQL Server trace +## ============================================= +$fileName = "somefile.trc" + +# The version information we want to write: 0x0A = 10 = SQLServer 2008 +[Byte[]] $versionData = 0x0A +# The offset of the version information in the file +$offset = 390 + +[System.IO.FileMode] $open = [System.IO.FileMode]::OpenOrCreate +$stream = New-Object System.IO.FileStream -ArgumentList $fileName, $open +$stream.Seek($offset, [System.IO.SeekOrigin]::Begin); +$stream.Write($versionData, 0, $versionData.Length); +$stream.Close() diff --git a/PowerShell/Disable_CEIP.ps1 b/PowerShell/Disable_CEIP.ps1 new file mode 100644 index 00000000..c275bbd7 --- /dev/null +++ b/PowerShell/Disable_CEIP.ps1 @@ -0,0 +1,36 @@ +#requires -version 2.0 + +<# +.SYNOPSIS + Disable SQL Server CEIP services + +.DESCRIPTION + Author: Eric Cobb + Create date: 2020-02-18 + http://www.sqlnuggets.com/blog/disable-telemetry-on-multiple-sql-servers-with-powershell/ + +.PARAMETER server + Server list where disable SEIP services +#> + +$server = 'Server01' ,'Server02','Server03','Server04'; + +# Stop all CEIP services +invoke-command -computername $server {Get-Service |? name -Like "*TELEMETRY*" | ? status -eq "running" | Stop-Service}; + +# Disable all CEIP services +invoke-command -computername $server {Get-Service |? name -Like "*TELEMETRY*" | Set-Service -StartMode Disabled}; + +# Check service status (should see "stopped" and "disabled" +invoke-command -computername $server {Get-Service |? name -Like "*TELEMETRY*" | select -property name,starttype,status}; + +# Disable "Error Reporting" and "Customer Feedback" Registry Values +invoke-command -computername $server {Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server' -Recurse | Where-Object -Property Property -eq 'EnableErrorReporting'| Set-ItemProperty -Name EnableErrorReporting -Value 0}; +invoke-command -computername $server {Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server' -Recurse | Where-Object -Property Property -eq 'EnableErrorReporting'| Set-ItemProperty -Name CustomerFeedback -Value 0}; +invoke-command -computername $server {Get-ChildItem 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server' -Recurse | Where-Object -Property Property -eq 'EnableErrorReporting'| Set-ItemProperty -Name EnableErrorReporting -Value 0}; +invoke-command -computername $server {Get-ChildItem 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server' -Recurse | Where-Object -Property Property -eq 'EnableErrorReporting'| Set-ItemProperty -Name CustomerFeedback -Value 0}; + +# Check registry values (should see 0 for "EnableErrorReporting" and "CustomerFeedback") +invoke-command -computername $server {Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server' -Recurse | Where-Object -Property Property -eq 'EnableErrorReporting'}; +invoke-command -computername $server {Get-ChildItem 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server' -Recurse | Where-Object -Property Property -eq 'EnableErrorReporting'}; + \ No newline at end of file diff --git a/PowerShell/Disable_Enable_All_Triggers_In_Database.ps1 b/PowerShell/Disable_Enable_All_Triggers_In_Database.ps1 new file mode 100644 index 00000000..51ac8a30 --- /dev/null +++ b/PowerShell/Disable_Enable_All_Triggers_In_Database.ps1 @@ -0,0 +1,25 @@ +#requires -version 5.0 +#requires -modules dbatools + +<# +.SYNOPSIS + Disable and enable again all triggers in database + +.DESCRIPTION + Disable and enable again all triggers in database + https://jesspomfret.com/disable-all-triggers/ + +.PARAMETER database + Database name +#> + +$database = "AdventureWorks2017"; +$svr = Connect-DbaInstance -SqlInstance server1; +$foreach ($tbl in $svr.databases[$database].Tables) +{ + foreach ($tr in $($tbl.Triggers | Where-Object Isenabled)) { + $triggers += $tr | Select-Object @{l='SchemaName';e={$tbl.Schema}}, @{l='TableName';e={$tbl.name}}, @{l='TriggerName';e={$_.name}}; + $tr.isenabled = $FALSE; + $tr.alter(); + } +} diff --git a/PowerShell/Export_Query_To_Csv.ps1 b/PowerShell/Export_Query_To_Csv.ps1 new file mode 100644 index 00000000..d31f9082 --- /dev/null +++ b/PowerShell/Export_Query_To_Csv.ps1 @@ -0,0 +1,40 @@ +#requires -version 5.0 +#requires -modules sqlserver + +<# +.SYNOPSIS + Export SQL server table to csv file with quotes (if needed) and header + +.DESCRIPTION + Piping Invoke-Sqlcmd into csv file with quotes only if needed. + Also replace False and True on 0 and 1 for bit types columns. + +.NOTES + Original link: http://www.sqlmovers.com/removing-quotes-from-csv-created-by-powershell/ + Author: Russ Loski + Version: 1.3 + Modified: 2020-01-09 by Konstantin Taranov + Source link: https://github.com/ktaranov/sqlserver-kit/blob/master/Powershell/Export_Query_To_Csv.ps1 +#> + +$databaseName = "master"; +$fileName = $tableName = "sys.objects"; +$delimiter = ","; # possible values "`t", ",", ";", "|" +if ($delimiter -eq "|") { + $delimiterReg = $delimiterBit = "\|"; + } else { + $delimiterReg = $delimiterBit = $delimiter; + }; +$regReplace = '\G(?^|' + $delimiterReg + '+)(("(?[^' + $delimiterReg + '"]*?)"(?=' + $delimiterReg + '|$))|(?".*?(? " + ($minSizeFilter * 128); +} + +if ($maxSizeFilter -ne $null) { + $qry += "`n`tAND au.data_pages <= " + ($maxSizeFilter * 128); +} + +$qry += "`nORDER BY SchemaName, ObjName, p.index_id;"; + +$idxList = Invoke-Sqlcmd -ServerInstance $serverName -database $dbName -query $qry + +$totalSize = 0; +$migratedSize = 0; +$foreachIndex = 0; +$foreachSize = $idxList.Length; + +#iterate through each index +foreach ($i in $idxList | sort Size_MB,SchemaName,ObjName) { + $sn = $i.SchemaName; + $on = $i.ObjName; + $iid = $i.IndexID; + $in = $i.IdxName; + $sz = $i.Size_MB; + $oid = $i.ObjID; + $online = "ON"; + + $foreachIndex += 1; + $totalSize += $sz; + + PrintUpdate "[$foreachIndex / $foreachSize] Moving $sn.$on ($iid) [$sz MB]" $true; + # does index contain datatypes that prohibit online operations? + #if($online = "ON") { + if($iid -le 1) { + # if indexID = 0 then look in sys.columns + $qry = "SELECT COUNT(c.OBJECT_ID) AS n + FROM sys.columns c + INNER JOIN sys.objects o ON c.object_id = o.object_id + INNER JOIN sys.schemas s ON o.schema_id = s.schema_id + INNER JOIN sys.types t ON c.user_type_id = t.user_type_id + WHERE s.name = '$sn' + AND o.name = '$on' + AND ( + t.name IN ('text','ntext','image','xml') + OR ( + t.name IN ('varchar','nvarchar','varbinary') + AND + t.max_length = -1 + ) + );"; + } else { + # else look in sys.index_columns + $qry = "SELECT COUNT(ic.object_id) AS n + FROM sys.index_columns ic + INNER JOIN sys.objects o ON ic.object_id = o.object_id + INNER JOIN sys.schemas s ON o.schema_id = s.schema_id + INNER JOIN sys.columns c ON ic.object_id = c.object_id AND ic.column_id = c.column_id + INNER JOIN sys.types t ON c.user_type_id = t.user_type_id + WHERE s.name = '$sn' + AND o.name = '$on' + AND ic.index_id = $iid + AND ( + t.name IN ('text','ntext','image','xml') + OR ( + t.name IN ('varchar','nvarchar','varbinary') + AND + t.max_length = -1 + ) + );"; + } + + try { + $rs = Invoke-Sqlcmd -ServerInstance $serverName -database $dbName -query $qry; + if($rs[0] -gt 0) { + $online = "OFF"; + } + } catch { + $online = "OFF"; + } + #} + + # if lob filegroup needs to change re-create and swap + if(![System.DBNULL]::Value.Equals($i.LOBFilegroup) -and $i.LOBFilegroup -ne $destFG -and $iid -le 1) { + # skipping because we're not doing offline operations + PrintUpdate " Skipping - LOB filegroup prevents online operations" $true; + continue; + } # + + # if index = 0 then create CL, move, delete CL + if($iid -eq 0) { + if($online -eq "OFF") { + # skipping because it can't be done online + PrintUpdate " Skipping - column(s) prevents online operations" $true; + continue; + } + + # disable all NC indexes + $tbl = $db.Tables.Item($on, $sn); + PrintUpdate " Disabling nonclustered indexes" $true; + foreach($ix in $tbl.Indexes | where {$_.ID -gt 1}) { + $j = $ix.ID; + PrintUpdate " Disabling index $j" $true; + if($runQueries -eq "y") { + $ix.Disable(); + $ix.Refresh(); + } + } # foreach + + # create clustered index on first column, rebuild CL on new filegroup, drop CL and return to heap + $qry = "SELECT QUOTENAME([name]) AS n FROM sys.columns WHERE object_id = $oid AND column_id = 1"; + $firstCol = Invoke-Sqlcmd -ServerInstance $serverName -database $dbName -query $qry; + + $qry = "CREATE CLUSTERED INDEX CL_Blah ON [$sn].[$on] (" + $firstCol.n + ") `nWITH(ONLINE=$online) ON [$destFG];"; + $qry += "`nDROP INDEX CL_Blah ON [$sn].[$on];"; + #Write-Host $qry; + PrintUpdate " Moving heap" $true; + RunSQLQuery($qry); + $migratedSize += $sz; + + # rebuild all NC indexes on new filegroup + PrintUpdate " Re-enabling nonclustered indexes" $true; + foreach($ix in $tbl.Indexes | where {$_.ID -gt 1}) { + $j = $ix.ID; + PrintUpdate " Rebuilding index $j" $true; + $ix.FileGroup = $destFG; + if($runQueries -eq "y") { + $ix.Recreate(); + $ix.Refresh(); + } + $migratedSize += ($ix.SpaceUsed/1MB); + } # foreach + + } elseif($iid -ge 1) { #clustered index + if(![System.DBNULL]::Value.Equals($i.LOBFilegroup) -and $i.LOBFilegroup -ne $destFG) { + # if the LOB filegroup needs to change, it can't be done here + # the table needs to be dropped and everything recreated + PrintUpdate " Skipping - LOB filegroup prevents online operations" $true; + continue; + } + + if($online -eq "OFF") { + # skipping because it can't be done online + PrintUpdate " Skipping - column(s) prevents online operations" $true; + continue; + } + + $tbl = $db.Tables.Item($on, $sn); + + # if index is on a heap, skip because all NC indexes on heaps will be rebuilt when the heap is moved + if(!$tbl.HasClusteredIndex) { + PrintUpdate " Skipping because index is on a heap" $true; + continue; + } + + $idx = $tbl.Indexes[$in]; + + $scr = "CREATE "; + if($idx.IsUnique -eq $true) {$scr += "UNIQUE ";} + if($idx.IsClustered -eq $true) {$scr += "CLUSTERED ";} + $scr += "INDEX [$in] ON [$sn].[$on]("; + $scr += GetIndexColumns $idx $false; + $scr += ") "; + if((GetIndexColumns $idx $true) -ne "") { + $scr += "`nINCLUDE ("; + $scr += GetIndexColumns $idx $true; + $scr += ") "; + } + if($idx.FilterDefinition -ne "") { + $scr += "`nWHERE "; + $scr += $idx.FilterDefinition; + $scr += " "; + } + $scr += "`nWITH (DROP_EXISTING=ON, ONLINE=$online, SORT_IN_TEMPDB="; + if($sz -lt 25000) { + $scr += "ON, " + } else { + $scr += "OFF, " + } + #add partition compression support later + $scr += "DATA_COMPRESSION="; + $scr += $idx.PhysicalPartitions[0].DataCompression; + $scr += ") `nON [$destFG];"; + + RunSQLQuery($scr); + $migratedSize += $sz; + + } + +} #foreach + +Write-Host "Made it to end"; +Write-Host "Total Size: $totalSize MB"; +Write-Host "Migrated Size: $migratedSize MB"; + +$runDuration = New-TimeSpan $dtStart (Get-Date); +$hrs = $runDuration.Hours; +$mins = $runDuration.Minutes; +$secs = $runDuration.Seconds; +write-host "Completed in $hrs hours $mins minutes $secs seconds"; + diff --git a/PowerShell/Scripting_Out_SQL_Server_Data_As_Insert_Statements.ps1 b/PowerShell/Scripting_Out_SQL_Server_Data_As_Insert_Statements.ps1 new file mode 100644 index 00000000..a0edb49c --- /dev/null +++ b/PowerShell/Scripting_Out_SQL_Server_Data_As_Insert_Statements.ps1 @@ -0,0 +1,161 @@ +#requires -version 5.0 +#requires -modules sqlserver + +<# +.SYNOPSIS + Script for writing out data from one or more databases either in insert statements + +.DESCRIPTION + Script for writing out data from one or more databases either in insert statements + (useful for scripting small tables of static data) or in native BCP files + + Other types of BCP output are easy to do by altering the BCP parameters in the + script slightly. + You can specify which tables you want to script out via a regex. You can use wildcards + to specify the databases + +.PARAMETER Filepath + Local directory to save build-scripts to. + +.PARAMETER DataSource + Server name and instance. + +.PARAMETER Databases + Databases to copy from. wildcard comparison *, ? [a-d](range) and [and](set of chars). + +.PARAMETER SQLUserName + Leave blank if Windows auth. + +.PARAMETER TablesRegex + Regex match to specify tables. + +.PARAMETER UseBCP + Use native BCP files if true and generate INSERT statments if false. Default false. + +.NOTES + Original link: https://www.red-gate.com/simple-talk/blogs/scripting-out-sql-server-data-as-insert-statements-via-powershell/ + Author: Phil Factor + Version: 1.1 + Modified: 2019-08-26 by Konstantin Taranov + Source link: https://github.com/ktaranov/sqlserver-kit/blob/master/Powershell/Scripting_Out_SQL_Server_Data_As_Insert_Statements.ps1 +#> + + +$Filepath = 'C:\Temp'; # local directory to save build-scripts to +$DataSource = 'localhost'; # server name and instance +$Databases = @('maste*', 'model'); <# the databases to copy from. wildcard comparison *, ? + [a-d](range) and [and](set of chars) #> +$SQLUserName = ''; #leave blank if Windows auth +$TablesRegex = '.*'; # Regex match to specify tables +$UseBCP =$false; + +# set "Option Explicit" to catch subtle errors +set-psdebug -strict +$ErrorActionPreference = "stop" # you can opt to stagger on, bleeding, if an error occurs +#load the sqlserver module +$popVerbosity = $VerbosePreference +$VerbosePreference = "Silentlycontinue" +# the import process is very noisy if you are in verbose mode +Import-Module sqlserver -DisableNameChecking #load the SQLPS functionality +$VerbosePreference = $popVerbosity +# get credentials if necessary +if ($SQLUserName -ne '') #then it is using SQL Server Credentials +{ + $SqlEncryptedPasswordFile = ` + "$env:USERPROFILE\$($SqlUserName)-$($SQLInstance).txt" + # test to see if we know about the password in a secure string stored in the user area + if (Test-Path -path $SqlEncryptedPasswordFile -PathType leaf) + { + #has already got this set for this login so fetch it + $Sqlencrypted = Get-Content $SqlEncryptedPasswordFile | ConvertTo-SecureString + $SqlCredentials = ` + New-Object System.Management.Automation.PsCredential($SqlUserName, $Sqlencrypted) + } + else #then we have to ask the user for it + { + #hasn't got this set for this login + $SqlCredentials = get-credential -Credential $SqlUserName + $SqlCredentials.Password | ConvertFrom-SecureString | + Set-Content $SqlEncryptedPasswordFile + } +} + +$ms = 'Microsoft.SqlServer' +$My = "$ms.Management.Smo" # +if ($SQLUserName -eq '') #dead simple if using windows security +{ $s = new-object ("$My.Server") $DataSource } +else # if using sql server security we do it via a connection object +{ + $ServerConnection = new-object "$ms.Management.Common.ServerConnection" ( + $DataSource, $SQLUsername, $SqlCredentials.Password) + $s = new-object ("$My.Server") $ServerConnection +} +if ($s.Version -eq $null) { Throw "Can't find the instance $Datasource" } +$CreationScriptOptions = new-object ("$My.ScriptingOptions") +<# this is only needed if we are doing insert statements #> +$MyPreferences = @{ + 'ScriptBatchTerminator' = $true; # this only goes to the file + 'ToFileOnly' = $true; #no need of string output as well + 'ScriptData' = $true; + 'scriptSchema' = $false; + 'Encoding' = [System.Text.Encoding]::UTF8; +} +$MyPreferences.GetEnumerator() | + Foreach{ $Name = $_.name; $CreationScriptOptions.$name = $_.Value } + +$possibilities = $s.Databases | select name +$DatabaseList = @() +$DatabaseList += $databases | +where { $_ -Notlike '*[*?]*' } | +where { $possibilities.Name -contains $_ } +$DatabaseList += $databases | + where { $_ -like '*[*?]*' } | + foreach{ $wildcard = $_; $possibilities.Name | where { $_ -like $wildcard } } +$DatabaseList | Sort-Object -Unique | + foreach { + write-verbose "now doing $($_)" + $TheDatabase = $s.Databases[$_] + + $TheDatabase.Tables | where { $_.IsSystemObject -eq $false -and $_.name -match $tablesRegex } | + foreach{ + <# calculate where it should be saved #> + $directory = "$($FilePath)\$($s.Name)\$($TheDatabase.Name)\Data" + <# check that the directory exists #> + if (-not (Test-Path -PathType Container $directory)) + { + <# we create the directory if it doesn't already exist #> + $null = New-Item -ItemType Directory -Force -Path $directory; + } + if ($UseBCP -eq $true) <# then we are doing a Native BCP#> + { + if ($SQLUserName -eq '')<# OK. Easy, a trusted connection #> + { + #native format -n, Trusted connection -T + BCP "$($_.Schema).$($_.Name)" out "$($directory)\$($_.Schema)_$($_.Name).bcp" ` + -n -T "-d$($TheDatabase.Name)" "-S$($s.Name)" + } + else <# if not a trusted connection we need to provide a userid and password #> + { + $progress=''; + $Progress=BCP "$($_.Schema).$($_.Name)" out "$($directory)\$($_.Schema)_$($_.Name).bcp" ` + -n "-d$($TheDatabase.Name)" "-S$($s.Name)" ` + "-U$($s.ConnectionContext.Login)" "-P$($s.ConnectionContext.Password)" + } + Write-verbose "Writing out to $($_.Schema).$($_.Name) $($directory)\$($_.Schema)_$($_.Name).bcp + $progress" + if (-not ($?)) # if there was an error + { + throw ("Error with data export of $($directory)\$($_.Schema)_$($_.Name).bcp "); + } + + } + else <# we are doing insert statements #> + { + $CreationScriptOptions.Filename = ` + "$($FilePath)\$($s.Name)\$($TheDatabase.Name)\Data\$($_.Schema)_$($_.Name)_Data.sql"; + $scripter = new-object ("$My.Scripter") ($s); + $scripter.Options = $CreationScriptOptions; + $scripter.EnumScript($_.Urn); + } + } +} diff --git a/PowerShell/Simulate_Databse_Load.ps1 b/PowerShell/Simulate_Databse_Load.ps1 new file mode 100644 index 00000000..d1a641fd --- /dev/null +++ b/PowerShell/Simulate_Databse_Load.ps1 @@ -0,0 +1,77 @@ +# https://www.scarydba.com/2019/01/07/powershell-to-simulate-load/ +# GRANT FRITCHEY +# 2019-01-07 + + +# connect to the database +$SqlConnection = New-Object System.Data.SqlClient.SqlConnection +$SqlConnection.ConnectionString = 'Server=WIN-8A2LQANSO51;Database=AdventureWorks2017;trusted_connection=true' + +# gather values +$RefCmd = New-Object System.Data.SqlClient.SqlCommand +$RefCmd.CommandText = "SELECT th.ReferenceOrderID, +COUNT(th.ReferenceOrderID) AS RefCount +FROM Production.TransactionHistory AS th +GROUP BY th.ReferenceOrderID;" +$RefCmd.Connection = $SqlConnection +$SqlAdapter = New-Object System.Data.SqlClient.SqlDataAdapter +$SqlAdapter.SelectCommand = $RefCmd +$RefData = New-Object System.Data.DataSet +$SqlAdapter.Fill($RefData) + +# Execute a stored procedure +$Sniffcmd = New-Object System.Data.SqlClient.SqlCommand +$Sniffcmd.CommandType = [System.Data.CommandType]'StoredProcedure' +$Sniffcmd.CommandText = "dbo.ProductTransactionHistoryByReference" +$Sniffcmd.Parameters.Add("@ReferenceOrderID",[System.Data.SqlDbType]"Int") +$Sniffcmd.Connection = $SqlConnection + +# Optionally, clear the cache +$Freecmd = New-Object System.Data.SqlClient.SqlCommand +$Freecmd.CommandText = "DECLARE @plan_handle VARBINARY(64); +SELECT @plan_handle = deps.plan_handle +FROM sys.dm_exec_procedure_stats AS deps +WHERE deps.object_id = OBJECT_ID('dbo.ProductTransactionHistoryByReference'); +DBCC FREEPROCCACHE(@plan_handle);" +$Freecmd.Connection = $SqlConnection + +# Count the executions +$x = 0 + +# Run forever +while(1 -ne 0) +{ + foreach($row in $RefData.Tables[0]) + { + # Establish an occasional wait + $check = get-random -Minimum 7 -Maximum 20 + $wait = $x % $check + if ($wait -eq 0) + { + #set a random sleep period in seconds + $waittime = get-random -minimum 3 -maximum 13 + start-sleep -s $waittime + $x = 0} + # Up the count + $x += 1 + # Execute the procedure + $RefID = $row[0] + $SqlConnection.Open() + $Sniffcmd.Parameters["@ReferenceOrderID"].Value = $RefID + $Sniffcmd.ExecuteNonQuery() | Out-Null + $SqlConnection.Close() + # clear the cache on each execution + #$SqlConnection.Open() + #$Freecmd.ExecuteNonQuery() | Out-Null + #$SqlConnection.Close() + # clear the cache based on random + $check = get-random -Minimum 7 -Maximum 20 + $clear = $x % $check + if($clear -eq 4) + { + $SqlConnection.Open() + $Freecmd.ExecuteNonQuery() | Out-Null + $SqlConnection.Close() + } + } +} \ No newline at end of file diff --git a/README.md b/README.md index 245ad0d2..49364d6f 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,17 @@ # SQL Server KIT -[![licence badge]][licence] +[![license badge]][license] [![stars badge]][stars] [![forks badge]][forks] [![issues badge]][issues] [![contributors_badge]][contributors] -[licence badge]:https://img.shields.io/badge/license-MIT-blue.svg +[license badge]:https://img.shields.io/badge/license-MIT-blue.svg [stars badge]:https://img.shields.io/github/stars/ktaranov/sqlserver-kit.svg [forks badge]:https://img.shields.io/github/forks/ktaranov/sqlserver-kit.svg [issues badge]:https://img.shields.io/github/issues/ktaranov/sqlserver-kit.svg [contributors_badge]:https://img.shields.io/github/contributors/ktaranov/sqlserver-kit.svg -[licence]:https://github.com/ktaranov/sqlserver-kit/blob/master/LICENSE.md +[license]:https://github.com/ktaranov/sqlserver-kit/blob/master/LICENSE [stars]:https://github.com/ktaranov/sqlserver-kit/stargazers [forks]:https://github.com/ktaranov/sqlserver-kit/network [issues]:https://github.com/ktaranov/sqlserver-kit/issues @@ -30,13 +30,14 @@ Useful links, scripts, tools and best practice for Microsoft SQL Server Database - [Free Database Podcasts](#podcasts) - [SQL Courses](#courses) - [SQL Server Backwards Compatibility](#backwards-compatibility) - - [Social, Forum and Messenger SQL Server Groups](#sql-social) + - [Social, Forum and Messenger SQL Server Groups](#social) - [SQL Server Open Source Projects](#open-source) - [BIML Resources and Bloggers](#biml-resources-and-bloggers) - [PowerShell and SQL Server](#powershell-and-sql-server) - [TSQL Format Code](#tsql-format-code) - [SQL Server Test Data Generation](#sql-server-test-data-generation) - [Free SQL Server and R ebooks](#free-ebooks) + - [Paid SQL Server ebooks](#paid-ebooks) - [License](#license) @@ -48,7 +49,7 @@ Useful links, scripts, tools and best practice for Microsoft SQL Server Database - [SQL Server Name Convention and T-SQL Programming Style](/SQL%20Server%20Name%20Convention%20and%20T-SQL%20Programming%20Style.md) - [SQL Server Licensing](/SQL%20Server%20Licensing.md) - [SQL Server People](/SQL%20Server%20People.md 'Most Valuable SQL Server professionals') - - [SQL Server Trace Flag](/SQL%20Server%20Trace%20Flag.md 'Complete list - 597 Trace Flags') (**Complete list - 597 trace flags**) + - [SQL Server Trace Flag](/SQL%20Server%20Trace%20Flag.md 'Complete list - 613 Trace Flags') (**Complete list - 620 trace flags**) - [SQL Server Version](/SQL%20Server%20Version.md 'List of all Microsoft SQL Sever versions') (**Complete list - from SQL Server 1.0 to SQL Server 2019**) - [Articles](/Articles) - [CLR procedures](/CLR) @@ -95,7 +96,7 @@ Useful links, scripts, tools and best practice for Microsoft SQL Server Database - [udf_SplitStringByDelimiter](/User_Defined_Function/udf_SplitStringByDelimiter.sql) - [udf_Tally](/User_Defined_Function/udf_Tally.sql) - and many others... - - [Utilities](/Utilities) (**Complete list of 277 SQL Server paid and free Utilities and Tools**) + - [Utilities](/Utilities) (**Complete list of 395 SQL Server paid and free Utilities and Tools**) **[⬆ back to top](#table-of-contents)** @@ -110,15 +111,13 @@ Useful links, scripts, tools and best practice for Microsoft SQL Server Database - [MSSQLTips](https://www.mssqltips.com/get-free-sql-server-tips/) - [BRENT OZAR](https://www.brentozar.com/) scripts, videos and articles - [Simple-talk Articles](https://www.simple-talk.com/) - - [SQLSentry Blog](http://blogs.sqlsentry.com) + - [SentryOne Blog](https://www.sentryone.com/blog) - [Glenn Berry's SQL Server Performance](http://sqlserverperformance.wordpress.com/) - [Kenneth Fisher SQLStudies Blog](http://sqlstudies.com/) - [Best SQL Server Perfomance Blog](http://sqlperformance.com/) - [Weblogs SQLTeam Blogs](http://weblogs.sqlteam.com/) - - [SQLMag](http://sqlmag.com/) - - [SQLShack](http://www.sqlshack.com/) - - [LessThanDot SQL Server Blog](http://blogs.lessthandot.com/index.php/category/datamgmt/dbprogramming/mssqlserver/) - - [SQLBlog](http://sqlblog.com) + - [SQLShack](https://www.sqlshack.com/) + - [SQL Kiwi by Paul White](https://www.sql.kiwi/) - [DatabseJournal SQL Server Blog](http://www.databasejournal.com/features/mssql/) - [SQLPass](http://www.sqlpass.org/Home.aspx) - [Vertabelo Blog](http://www.vertabelo.com/blog) @@ -138,52 +137,63 @@ Useful links, scripts, tools and best practice for Microsoft SQL Server Database - [SQL.ru SQL Server](http://www.sql.ru/blogs/t-sql) (Russian) - [C# Corner SQL Server Articles](http://www.c-sharpcorner.com/technologies/sql-server) - [TechTarget Blog](http://searchsqlserver.techtarget.com/) - - [Toad SQL Server Blog](http://www.toadworld.com/platforms/sql-server/b/weblog) + - [Toad SQL Server Blog](https://blog.toadworld.com/tag/sql-server) - [SQL-Articles](http://sql-articles.com/articles/) - [DallasDBAs Blog](http://dallasdbas.com/blog/) - [UpSearch Blog](https://upsearch.com/blog/) + - [SQL tutorial](https://www.scaler.com/topics/sql) - [ProData Blog](http://blogs.prodata.ie/) - - [Red9 SQL Server Performance Blog](https://red9.com/blog/) - [DallasDBAs.com Blog](http://dallasdbas.com/blog/) - [SQLBI Blog](http://www.sqlbi.com) - [RDX Blog](http://blog.rdx.com) - [Codingsight](http://codingsight.com/) - [Solomon Rutzky's SQL Quantum Leap Blog](https://SqlQuantumLeap.com/) + - [Niels Berglund Blog](https://nielsberglund.com) + - [BornSQL Blog](https://bornsql.ca/blog/) + - [Kevin Chant Blog](https://www.kevinrchant.com/) + - [SQLBlog.org](https://sqlblog.org) + - [Idera SQL Server Blog](https://community.idera.com/tags/SQL%2bServer) + - [SQL Server Science Blog](https://www.sqlserverscience.com/) (by Max Vernon) + - [Kohera SQL Server Blog](https://kohera.be/blog/category/sql-server/) + - [SQL Queries Cheat Sheet](https://helpercodes.com/sql-query-cheatsheet-tutorial/) - Security (great thanks to [Troy Hunt](https://www.troyhunt.com/troys-ultimate-list-of-security-links/)) - SQL injection - - [sqlmap](http://sqlmap.org/) – The tool for mounting SQL injection attacks tests against a running site - - [Drupal 7 SQL injection flaw of 2014](https://www.drupal.org/PSA-2014-003) – great example of how impactful it still is (patch it within 7 hours or you’re owned) - - [Ethical Hacking: SQL Injection](http://www.pluralsight.com/courses/ethical-hacking-sql-injection) – If you really want to go deep, here’s five and a half hours worth of Pluralsight content + - [sqlmap - The tool for mounting SQL injection attacks tests against a running site](http://sqlmap.org/) + - [Drupal 7 SQL injection flaw of 2014](https://www.drupal.org/PSA-2014-003) – great example of how impactful it still is (patch it within 7 hours or you are owned) + - [Ethical Hacking: SQL Injection](http://www.pluralsight.com/courses/ethical-hacking-sql-injection) – If you really want to go deep, here is five and a half hours worth of Pluralsight content - Exploit databases and breach coverage - [seclists.org](http://seclists.org) – Heaps of exploits consolidated from various bug tracking lists - [Exploit Database](https://www.exploit-db.com/) – Very comprehensive list of vulnerabilities - - [PunkSPIDER](https://www.punkspider.org/) – Lots of vulnerabilities of all kinds all over the web (about 90M sites scanned with over 3M vulns at present) - [Data Loss DB](http://datalossdb.org/) – Good list of breaches including stats on number of records compromised - - [Information is Beautiful: World’s Biggest Data Breaches](http://www.informationisbeautiful.net/visualizations/worlds-biggest-data-breaches-hacks/) – Fantastic visualisation of incidents that give a great indication of scale + - [Information is Beautiful: World’s Biggest Data Breaches](http://www.informationisbeautiful.net/visualizations/worlds-biggest-data-breaches-hacks/) - [Biggest data breaches in history](https://www.comparitech.com/blog/information-security/biggest-data-breaches-in-history/) (by Dave Albaugh) - [Microsoft SQL Server Permissions Posters](https://github.com/Microsoft/sql-server-samples/tree/master/samples/features/security/permissions-posters) - [Module Signing Info](https://modulesigning.info/) - Info and resources related to module signing (i.e. Certificates, Asymmetric Keys, `ADD SIGNATURE`, etc) in T-SQL and SQLCLR + - [SQL Server security best practices](https://learn.microsoft.com/en-us/sql/relational-databases/security/sql-server-security-best-practices) (by Microsoft) - Free Videos - [Youtube Brent Ozar](https://www.youtube.com/user/BrentOzar/videos) + - [Youtube Free SQL Server Statisctics Class](https://www.youtube.com/playlist?list=PLDYqU5RH_aX05ajDAH-6sYXr4i1Mjh9lT) - [SQLPASSTV videos](https://www.youtube.com/user/SQLPASSTV/videos) - [IDERA Resource Center](https://www.idera.com/resourcecentral) - [MSSQLTips SQL Server Webcasts and Videos](https://www.mssqltips.com/sql-server-webcasts/) - [SQL Server Videos](http://www.sqlservervideos.com/) - [TECHNET How do I Videos](https://technet.microsoft.com/en-us/library/dd353197.aspx) - [Veeam Learn Microsoft SQL Server](http://go.veeam.com/learn-microsoft-sql-server-free-video-tutorial-course.html) - - [MidnightDBA ITBookWorm Video](http://midnightdba.itbookworm.com/) + - [MidnightDBA ITBookWorm Video](http://midnightdba.itbookworm.com/Minion/Reindex) - [SQL Server Hangouts](https://www.youtube.com/playlist?list=PLvcGRPk71pmRi2UZHKfyruJKu_zHZ0ROc) (by Boris Hristov, Cathrine Wilhelmsen) - [Youtube russianVC](https://www.youtube.com/channel/UC0UA5gKnOq9TM1RNvMIArwg) (Russian) + - [Youtube SSMSBoost tutorials](https://www.youtube.com/channel/UCkm2ETlBDjs5V-kKb6j86zQ) - [Youtube Redgate Videos](https://www.youtube.com/redgate) - [User Group.tv](http://usergroup.tv/) (by Shawn Weisfeld) - [SQLPass Virtual Chapters](http://www.sqlpass.org/passchapters/virtualchapters.aspx) - [Youtube SQLpassion](https://www.youtube.com/channel/UCkrUQVPrv36Musorn0K4KoA) - - [SQLBits Video](https://sqlbits.com/) - - [Business Intelligence Videos](http://www.bidn.com/Videos/Videos) + - [SQLBits Video](https://sqlbits.com/content/) - [Pragmatic Works Free Training Webinars](http://pragmaticworks.com/Training/FreeTrainingWebinars) - [Youtube Pragmatic Works Video](https://www.youtube.com/user/PragmaticWorks) (by Devin Knight and Manuel Quintana) - - [MVP: Data Platform](https://channel9.msdn.com/Blogs/MVP-Data-Platform) + - [TechEd SQL Server Videos](https://channel9.msdn.com/Search?term=sql%20server&lang-en=true) - [Build 2018 conference](http://sqlservercode.blogspot.ru/2018/05/azure-sql-data-warehouse-azure-sql.html) + - [New Stars of Data SQL Server Video](https://www.youtube.com/playlist?list=PLLq_tkpMFDU5ibrnqn6I8CZxZ2-zYWG9m) + - [Youtube Community 1nn0va](https://www.youtube.com/c/Community1nn0va/videos) (by Community 1nn0va) - Free Database Podcasts - [SQL Server Radio](http://www.sqlserverradio.com/) (by Guy Glantser and Matan Yungman) - [SQL Data Partners](http://sqldatapartners.com/podcast/) (by Carlos L Chacon, César Oviedo and Adrian Miranda) @@ -191,25 +201,28 @@ Useful links, scripts, tools and best practice for Microsoft SQL Server Database - [RunAs Radio](http://runasradio.com/) (by Richard Campbell and Greg Hughes) - [People Talking Tech](http://peopletalkingtech.com/) (by Denny Cherry) - [NET Rocks!](http://www.dotnetrocks.com/) (by Richard Campbell and Carl Franklin) - - [SQL Down Under Podcast](http://www.sqldownunder.com/Podcasts) (by Greg Low) + - [SQL Down Under Podcast](https://sqldownunder.com/pages/sql-down-under-podcast) (by Greg Low) - [Free sql server video tutorials for beginners](http://csharp-video-tutorials.blogspot.ru/p/free-sql-server-video-tutorials-for.html) (by PRAGIM Technologies) - - [Midnight DBA Podcast](http://midnightdba.itbookworm.com/Show) (by Sean and Jen McCown) - [Dear SQL DBA](https://www.littlekendra.com/dearsqldba/) (by Kendra Little) - [GroupBy.org - Group By is a free online event for the community, by the community](https://groupby.org/) (by Brent Ozar team) - [DevopsCafe](http://devopscafe.org/) (by John Willis and Damon Edwards) - [SQLPlayer](http://sqlplayer.net/) (by Kamil Nowinski and Damian Widera) - [Data Driven](http://datadriven.tv/) (by Frank La Vigne and Andy Leonard) - - [SQL Down Under Podcast](https://www.sqldownunder.com) (by Greg Low) - [SQL Undercover Podcast](https://sqlundercover.com/category/podcast/) (by David Fowler and Adrian Buckman) + - [Dallas DBAs](https://dallasdbas.com/) (by Kevin Hill) + - [SQL Server Pain Relief: Office Hours](https://www.stitcher.com/podcast/sql-server-pain-relief-office-hours-with-brent-ozar-unlimitedr) (by Brent Ozar) + - [Azure DevOps Podcast](http://azuredevopspodcast.clear-measure.com/) (by Microsoft) + - [Mixed Extents](https://youtu.be/hBgMadT9fuU) (by EightKB) - Courses - Free - - [Learn SQL Server by solving problems](https://sqlworkbooks.com/courses-overview/) (by Little Kendra) + - [SQLBolt - Learn SQL with simple, interactive exercises](https://sqlbolt.com/) + - [Learning Extended Events in 60 Days](https://jasonbrimhall.info/2015/09/08/learning-extended-events-in-60-days/) and new [link](http://sqlxevents.com/) (by Jason Brimhall) + - [Learn SQL Server by solving problems](https://littlekendra.com/courses-overview/) (by Little Kendra) - [Codecademy Learn SQL](https://www.codecademy.com/learn/learn-sql) - [Codecademy SQL: Table Transformation](https://www.codecademy.com/learn/sql-table-transformation) - [Codecademy SQL: Analyzing Business Metrics](https://www.codecademy.com/learn/sql-analyzing-business-metrics) - [MVA SQL Server Courses](https://mva.microsoft.com/product-training/sql-server) - - [How to Think Like the SQL Server Engine](https://learnfrom.brentozar.com/courses/how-to-think-like-the-engine-an-introduction-to-sql-server-internals/) - - [Number and Date Tables](https://www.brentozar.com/archive/2016/01/video-free-training-of-the-week-number-and-date-tables/) + - [How to Think Like the SQL Server Engine](https://www.brentozar.com/training/think-like-sql-server-engine/) - [Free SQL Tutorials](http://www.guru99.com/sql.html) - [OpenedX Microsoft Courses](https://openedx.microsoft.com/) - [SQLBolt - Learn SQL with simple, interactive exercises](https://sqlbolt.com/) @@ -217,22 +230,41 @@ Useful links, scripts, tools and best practice for Microsoft SQL Server Database - [HackerRank.com - SQL interactive exercises and many others languages](https://www.hackerrank.com/domains/sql) - [SQL-EX.ru - Practical skills of SQL language](http://www.sql-ex.ru) (Russian, English) - [Free Azure certification training courses](https://rlevchenko.com/2019/01/11/free-azure-certification-training-courses/) + - [SQL Server Tutorial](https://www.tutorialgateway.org/sql/) (by Tutorial Gateway) + - [Intro to SQL: Querying and managing data](https://www.khanacademy.org/computing/computer-programming/sql) + - [T-SQL Tutorial](https://www.tutorialspoint.com/t_sql/index.htm) (by TutorialSpoint) + - [T-SQL Tutorial and examples](https://www.tsql.info/sql-tutorial.php) (by tsql.info) + - [Red Gate Data Platform courses](https://www.red-gate.com/hub/university/courses/data-platform) (by Red Gate) + - [SQLZoo tutorial](https://sqlzoo.net/) + - [edX SQL Courses](https://www.edx.org/learn/sql) (by edX) + - [SQL Murder Mystery](https://github.com/NUKnightLab/sql-mysteries) (by NUKnightLab) + - [SQL Murder Mystery with answers](https://github.com/erika-e/sql-mysteries) (by Erika Pullum) + - [SQL Problems and solutions](http://www.sql-tutorial.ru/en) (by S. I. Moiseenko) + - [Advanced T-SQL Puzzles](https://github.com/smpetersgithub/AdvancedSQLPuzzles) (by Scott Peters) + - [Leetcode SQL Problems](https://leetcode.com/problemset/database/) - Paid - [Lynda Courses](http://www.lynda.com/SQL-Server-training-tutorials/456-0.html) - [Veeam Free Courses](https://go.veeam.com/microsoft-sql-series-webinars.html) - [SQLSkills Trainings](https://www.sqlskills.com/sql-server-training/online-training/) - - [Brent Ozar Team Trainings](https://learnfrom.brentozar.com/) + - [Brent Ozar Team Trainings](https://www.brentozar.com/training/) - [Pluralsight Courses](https://www.pluralsight.com/search?q=sql+server&categories=all) - [SolidQ Classes](https://training.solidq.com/classes/) - [JOOQ SQL Masterclass](http://www.jooq.org/training/) - [Learn SQL Server High Availability & Disaster Recovery](https://learnsqlserverhadr.com/) (by Edwin M Sarmiento) - [Madeira Data Solutions Academy](http://madeira-data-solutions.teachable.com/) - [SQLpassion Online Academy](http://www.sqlpassion.at/online-training/index.html) (by Klaus Aschenbrenner) - - SQL Server Backwards Compatibility - - [2017 Backwards Compatibility](https://docs.microsoft.com/en-us/sql/database-engine/sql-server-database-engine-backward-compatibility) - - [2016 Backwards Compatibility](https://docs.microsoft.com/en-us/sql/database-engine/sql-server-database-engine-backward-compatibility) + - [Vertabelo Academy](https://academy.vertabelo.com/) + - [Darling Data - The Best SQL Server Training On The Internet?](https://learn.erikdarlingdata.com/) (by Erik Darling) + - [W3Resource SQL Exercises, Practice, Solution](https://www.w3resource.com/sql-exercises/) (by w3resource) + - [LinkedIn SQL Server cources](https://www.linkedin.com/learning/search?entityType=COURSE&keywords=sql%20server) (by LinkedIn) + - SQL Server Deprecated database engine features and Backwards Compatibility + - [Deprecated Features in SQL Server Replication](https://learn.microsoft.com/en-us/sql/relational-databases/replication/deprecated-features-in-sql-server-replication?view=sql-server-ver16) + - [Deprecated database engine features in SQL Server 2022](https://learn.microsoft.com/sql/database-engine/discontinued-database-engine-functionality-in-sql-server?view=sql-server-ver16) + - [Deprecated database engine features in SQL Server 2019](https://learn.microsoft.com/sql/database-engine/deprecated-database-engine-features-in-sql-server-2019?view=sql-server-ver16) + - [Deprecated database engine features in SQL Server 2017](https://learn.microsoft.com/sql/database-engine/deprecated-database-engine-features-in-sql-server-2017?view=sql-server-ver16) + - [Deprecated database engine features in SQL Server 2016](https://learn.microsoft.com/sql/database-engine/deprecated-database-engine-features-in-sql-server-2016?view=sql-server-ver16) - [2014 Backwards Compatibility](https://docs.microsoft.com/en-us/sql/getting-started/backward-compatibility?view=sql-server-2014) - - [2012 Backwards Compatibility](https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2012/cc707787(v=sql.110)) + - [2012 Backwards Compatibility](https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2012/ms143532(v=sql.110)) - [2008 R2 Backwards Compatibility](https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2008-r2/cc707787(v=sql.105)) - [2008 Backwards Compatibility](https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2008/cc707787(v=sql.100)) - [2005 Backwards Compatibility](https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2005/ms143532(v=sql.90)) @@ -252,24 +284,54 @@ Useful links, scripts, tools and best practice for Microsoft SQL Server Database - [Power BI feedback](https://ideas.powerbi.com/forums/265200-power-bi-ideas) - [SSMS feedback](https://social.msdn.microsoft.com/Forums/en-US/home?forum=sqltools) - [SQL Server Data Tools feedback](https://social.msdn.microsoft.com/Forums/en-US/home?forum=ssdt&filter=alltypes&sort=lastpostdesc) - - Social, Forum and Messenger SQL Server Groups + - Social, Forum and Messenger SQL Server Groups - [SQLServerCentral Forum](http://www.sqlservercentral.com/Forums/) (more than 10^6 People) - [Slack #sqlhelp](https://sqlcommunity.slack.com/messages/sqlhelp/) (more than 900 People) - [Slack #firstresponderkit](https://sqlcommunity.slack.com/messages/firstresponderkit/) (more then 90 People) - - [Twitter #sqlhelp](https://twitter.com/hashtag/sqlhelp) (more than 500 People) + - [Twitter #SQLServer](https://twitter.com/hashtag/SQLServer), [Twitter #SQLFamily](https://twitter.com/hashtag/SQLFamily), [Twitter #sqlhelp](https://twitter.com/hashtag/sqlhelp) (more than 500 People) + - Reddit – [`/r/sqlserver`](https://www.reddit.com/r/SQLServer/), [`/r/sql`](https://www.reddit.com/r/SQL/), and [`/r/database`](https://www.reddit.com/r/Database/) - [SQL.ru SQL Server Forum](http://www.sql.ru/forum/microsoft-sql-server) (more than 10^5 People, Russian) - [VK.com #sqlcom](https://vk.com/sqlcom) (more than 3600 People, Russian) - [SQL Server User Group Meetings](https://www.mssqltips.com/sql-server-user-groups/) - [Russian SQL Server User Group](https://www.facebook.com/groups/144858492215825/) (900 People, Russian) - - [SQLcom.ru telegram chat](https://t.me/sqlcom) (1110 People, Russian) + - [SQLcom.ru telegram chat](https://t.me/sqlcom) (1900 People, Russian) - [PowerBI telegram chat](https://t.me/PBI_Rus) (295 People, Russian) - [PostgesSQL telegram chat](https://t.me/pgsql) (2823 People, Russian) - [DBA telegram chat](https://t.me/dba_ru) (1389 People, Russian) + - [SQLTeam SQL Server Forum](https://forums.sqlteam.com/) + - [Red Gate SQL Server Forum](https://forum.red-gate.com/) + - [Microsoft SQL Server on Q&A](https://docs.microsoft.com/en-us/answers/products/sql-server) + - SQL Server Conferences + - [SQL Saturdays](https://sqlsaturday.com/) + - [Pass Sumit - Red Gate](https://passdatacommunitysummit.com) + - [SQLBits](https://sqlbits.com/) + - [Microsoft Ignite](https://myignite.microsoft.com/home) + - [Microsoft Build](https://mybuild.microsoft.com/home) + - [Devintersection](https://devintersection.com/) + - [SentryOne SQL Server Virtual Conference](https://info.sentryone.com/accelerate-2020) + - [Red Gate SQL Server Online Events](https://www.red-gate.com/hub/events/online-events/) + - [EigthKB Sql Server Internals Conference](https://eightkb.online/) + - [DataWeekender](https://www.dataweekender.com/schedule) + - [Dativerse](https://sessionize.com/dativerse) + - [Future Data Driven](https://datadrivencommunity.com/) + - [DataMinds Connect](https://datamindsconnect.be/) + - [New Stars of Data ](https://www.newstarsofdata.com/) + - [Data Weekender](https://www.dataweekender.com/) + - [Data Toboggan](http://www.datatoboggan.co.uk/) + - [The SQL Server & Azure SQL Conference](https://www.mssqlconf.com/#!/) + - [Microsoft Build](https://mybuild.microsoft.com/home) + - [Microsoft Ignite](https://myignite.microsoft.com/home) + - [Microsoft Inspire](https://myinspire.microsoft.com/home) + - [DataMinutes](https://datagrillen.com/dataminutes/) + - [Data & AI Summit](https://databricks.com/dataaisummit) - Open Source Projects + - [SQLFluff - A SQL linter and auto-formatter for Humans](https://github.com/sqlfluff/sqlfluff) + - [sp_whoisactive](http://whoisactive.com/) (documentation) and github repo for it [sp_WhoIsActive](https://github.com/amachanic/sp_whoisactive) (by Adam Machanic) - [Brent Ozar SQL Server First Responder Kit](https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit) (Github) - [SQL Server Ola Hallengren's Maintenance Solution](https://github.com/olahallengren/sql-server-maintenance-solution) (by Ola Hallengren) (Github) - [Standby restore script output for Ola Hallengren's Maintenance Solution](https://github.com/jzagelbaum/OlaHallengrenRestoreScript) (by jzagelbaum) (Github) - [SqlQueryStress - SQL query stress simulator for SQL Server](https://github.com/ErikEJ/SqlQueryStress) (by Adam Machanic and Erik Ejlskov Jensen) + - [WorkloadTools - collection of tools to collect, analyze and replay SQL Server workloads, on premises and in the cloud](https://github.com/spaghettidba/WorkloadTools) (by Gianluca Sartori) - [Statistic Parser](https://github.com/Jorriss/StatisticsParser) (by Richie Rump) (Github) - [SQL Generator](https://github.com/Jorriss/sqlgenerator) (by Richie Rump) (Github) - [Columnstore Indexes Scripts Library](https://github.com/NikoNeugebauer/CISL) (by Niko Neugebauer) (Github) @@ -279,7 +341,8 @@ Useful links, scripts, tools and best practice for Microsoft SQL Server Database - [stpChecklist_Seguranca - stored procedure with more than 70 security items to validate your SQL Server database](https://github.com/dirceuresende/checklist_seguranca) (by Dirceu Resende) - [mssql-docker - Official Microsoft repository for SQL Server in Docker resources](https://github.com/ktaranov/mssql-docker) (by Microsoft) (Github) - [SQLCover - TSQL code coverage tool for SQL Server 2008+](https://github.com/GoEddie/SQLCover) (by Ed Elliott) (Github) - - [tSQLt testing framework for Microsoft SQL Server](https://github.com/tSQLt-org/tSQLt) (Github) + - [tSQLt - testing framework for Microsoft SQL Server](https://github.com/tSQLt-org/tSQLt) (Github) + - [SQLCop - tSQLt tests to highlight potential problems in your database](https://github.com/red-gate/SQLCop) (Red Gate) - [T-SQL SimMetrics string matching algorithms](https://github.com/GuerrillaAnalytics/similarity) (Github) - [Azure Blob Storage Backup](https://github.com/bornsql/azureblobstoragesync) (by Randolph West) (Github) - [StackExchange.DataExplorer - free tool for executing SQL queries against Stack Exchange databases](https://github.com/StackExchange/StackExchange.DataExplorer) (Github) @@ -307,7 +370,7 @@ Useful links, scripts, tools and best practice for Microsoft SQL Server Database - [Automatically fix high VLF counts in SQL Server 2012+](https://github.com/tboggiano/autofix-vlfs) (by Tracy Boggiano) - [splittinglargefiles - Process for splitting large files in a filegroup that has grown out of control.](https://github.com/tboggiano/splittinglargefiles) (by Tracy Boggiano) - [olamaintconfigtables - This are tables and jobs that can use to run Ola's scripts as T-SQL Jobs and run on Linux](https://github.com/tboggiano/olamaintconfigtables) (by Tracy Boggiano) - - [SQL Undercover Toolbox - A collection of cool and useful tools, procedures and scripts for the discerning DBA ](https://github.com/SQLUndercover/UndercoverToolbox) (by SQL Undercover) + - [SQL Undercover Toolbox - A collection of cool and useful tools, procedures and scripts for the discerning DBA](https://github.com/SQLUndercover/UndercoverToolbox) (by SQL Undercover) - [dba-database - Database containing DBA helper code and open source software](https://github.com/amtwo/dba-database) (by Andy Mallon) - [SQLServerSpaceAnalysis PowerBI](https://github.com/SQLJana/SQLServerSpaceAnalysis) (by Jana Sattainathan) - [SQL Server Telegram Bot](https://github.com/ionflux/mssql-telegram-bot/) @@ -329,8 +392,46 @@ Useful links, scripts, tools and best practice for Microsoft SQL Server Database - [TabularTranslator - allow create translations for a translation file generated by SSDT for tabular models with the compatibility level 1200 and up](https://github.com/Kjonge/TabularTranslator) (by Kjonge) - [TSqlStrong - T-Sql type checker that detects improper joins, possibly null value operations, enumeration check constraint violations, incorrect use of temporary table at call site, and more](https://github.com/JSuder-xx/TSqlStrong) (by John Suder) - [SQL Power Doc - is a collection of Windows PowerShell scripts and modules that discover, document, and diagnose SQL Server instances and their underlying Windows OS & machine configuration](https://github.com/kendalvandyke/sqlpowerdoc) (by Kendal Van Dyke) + - [rsqlserver - Sql Server driver database interface (DBI) driver for R](https://github.com/agstudy/rsqlserver) + - [DBA MultiTool - T-SQL scripts for the long haul: optimizing storage, on-the-fly documentation, and general administrative needs.](https://github.com/LowlyDBA/dba-multitool) (by John McCall) + - [language-extensions-sqlserver - SQL Server Language Extensions project](https://github.com/microsoft/sql-server-language-extensions) (by Microsoft) + - [AzureRMR - R package for interacting with Azure Resource Manager](https://github.com/Azure/AzureRMR) (by Microsoft) + - [EntityFramework.Utilities - Provides extensions for EntityFramework that doesn't exist out of the box like delete and update by query and bulk inserts](https://github.com/MikaelEliasson/EntityFramework.Utilities) (by Mikael Eliasson) + - [EFCore.BulkExtensions - Entity Framework Core Bulk Batch Extensions for Insert Update Delete and Read (CRUD) operations on SQL Server and SQLite](https://github.com/borisdj/EFCore.BulkExtensions) (by Boris Djurdjevic) + - [Performance Analysis of Logs (PAL) Tool](https://github.com/clinthuffman/PAL) (by Clint Huffman) + - [SQL-Server-Permissions-Manager - a set of scripts for managing logins and permissions on SQL Server databases](https://github.com/ericcobb/SQL-Server-Permissions-Manager) (by Eric Cobb) + - [AwesomeSQLServer - collection of SQL Server Queries and documentations to fix your SQL Server's bottle neck](https://github.com/SQLadmin/AwesomeSQLServer) (by SqlAdmin) + - [databases_scripts - SQL Server useful scripts](https://github.com/dgavrikov/databases_scripts/tree/master/SQL%20Server) (by Dmitriy Gavrikov) + - [sp_PressureDetector - stored procedure for quickly detecting CPU and Memory pressure on a SQL Server](https://github.com/erikdarlingdata/DarlingData/tree/main/sp_PressureDetector) (by Erik Darling) + - [sp_HumanEvents - make Extended Events easier and more approachable for the average admin to troubleshoot common scenarios](https://www.erikdarlingdata.com/sp_humanevents/) (by Erik Darling) + - [Export Prometheus metrics from SQL queries](https://github.com/albertodonato/query-exporter) (by Alberto Donato) + - [homebrew-mssql-release - brew formulae for Microsoft ODBC Driver for SQL Server and SQL Server Command Line Utilities](https://github.com/microsoft/homebrew-mssql-release) (by Microsoft) + - [ASSP - Analysis Services Stored Procedure Project](https://asstoredprocedures.github.io/ASStoredProcedures/) (by Darren Gosbell) + - [Data-Blogger-Resource-Kit - Includes resources for use by bloggers, microbloggers, vloggers, and origami enthusiasts who focus on SQL Server](https://github.com/amtwo/Data-Blogger-Resource-Kit) (by Andy Andy Mallon) + - [SQL-Server-Multi-Thread - a framework to do multi-threading in T-SQL using SQL Server Agent jobs.](https://github.com/jobbish-sql/SQL-Server-Multi-Thread) (by ) + - [SQL Server and Azure SQL Labs and Workshops](https://microsoft.github.io/sqlworkshops/) (by Microsoft) + - [MsSqlDependencyBrowser - Simple tool to browse between dependent objects on MS SQL Server](https://github.com/usharik/MsSqlDependencyBrowser) (by Aleksej Usharovskij) + - [`Projects-MS-SQL-Server-DBA` - Utilities and Scripts for SQL Server dba](https://github.com/jobgemws/Projects-MS-SQL-Server-DBA) (by Evgeniy Gribkov) + - [`sp_alter_column` stored procedure is able to alter a column with dependencies](https://github.com/segovoni/sp_alter_column) (by Sergio Govoni) + - [Toolbox repository for Madeira's consultant team](https://github.com/MadeiraData/MadeiraToolbox) (by Madeira) + - [`mssql-jobs-hadr` - maintain scheduled jobs on SQL Servers with either Availability Groups or Database Mirroring](https://github.com/MadeiraData/mssql-jobs-hadr) (by Eitan Blumin) + - [Fluent Migrator is a migration framework for .NET much like Ruby on Rails Migrations](https://github.com/fluentmigrator/fluentmigrator) (by Eivind Gussiås Løksetheloekset, Mark Junker, Tom Marien) + - [SQL Server in Docker](https://github.com/microsoft/mssql-docker) (by Microsoft) + - [ActiveRecord SQL Server Adapter - SQL Server Adapter For Rails](https://github.com/rails-sqlserver/activerecord-sqlserver-adapter) (by rails-sqlserver) + - [EFCorePowerTools - Reverse engineering, model visualization and migrations UI for EF Core](https://github.com/ErikEJ/EFCorePowerTools) (by Erik Ejlskov Jensen) + - [SqlTableDependency - a high-level C# component used to audit, monitor and receive notifications on SQL Server's record table changes](https://github.com/christiandelbianco/monitor-table-change-with-sqltabledependency) (by Christian Del Bianco) + - [EFSecondLevelCache.Core - Entity Framework Core Second Level Caching Library (Redis)](https://github.com/VahidN/EFSecondLevelCache.Core) (by Vahid Nasiri) + - [Dotmim.Sync - a brand new database synchronization, multi platform, multi databases, developed on top of .Net Standard 2.0](https://github.com/Mimetis/Dotmim.Sync) + - [Hekaton-based shock absorber pattern for SQL Server](https://github.com/sqlsunday/shock-absorber) (by Daniel Hutmacher) + - [HammerDBBenchmark - Swarchy T101 Wilson HammerDb Benchmark Setup Scripts for SQL Server](https://github.com/swarchy/HammerDBBenchmark) (by Swarchy T101 Wilson) + - [sqlblockedprocesses - SQL Server Blocked Process Report Viewer](https://github.com/mjswart/sqlblockedprocesses) (by Michael J. Swart) + - [sp_CRUDGen - stored procedure that generates stored procedures for you based on your tables and metadata like foreign keys and data types](https://github.com/kevinmartintech/sp_CRUDGen) (by Kevin Martin) + - [sp_Develop - can be used by database developers, software developers and for performing database code (smell) reviews.s](https://github.com/EmergentSoftware/SQL-Server-Development-Assessment) (by Kevin Martin) + - [DBA Dash - Performance monitoring tool for SQL Server](https://github.com/trimble-oss/dba-dash) (by Trimble) + - [lowlydba.sqlserver - A cross-platform Ansible collection using PowerShell to configure and maintain SQL Server](https://github.com/lowlydba/lowlydba.sqlserver) - (by John McCall) + - [SQLWatch - SQLWATCH is an Open Source and completely free SQL Server Monitoring project](https://sqlwatch.io/) (by Marcin Gminski) + - [Azure_Synapse_Toolbox - Repository of tools/queries for managing and monitoring Azure Synapse](https://github.com/microsoft/Azure_Synapse_Toolbox) (by Microsoft) - Other - - [sp_whoisactive](http://whoisactive.com/) (by Adam Machanic) - [SQL# SQLCLR functions](https://sqlsharp.com/) (by Sql Quantum Lift) - [SQL Server Latch Classes Library](https://www.sqlskills.com/help/latches/) (by Paul S. Randal) - [SQL Server Wait Types Library](https://www.sqlskills.com/help/waits/) (by Paul S. Randal) @@ -344,11 +445,10 @@ Useful links, scripts, tools and best practice for Microsoft SQL Server Database - [SQL Server Connection Strings](https://www.connectionstrings.com/sql-server/) - [SQL Connection String Generator for .NET](https://aireforge.com/Tools/ConnectionStringGenerator) - [SQL Injection Cheat Sheet](https://www.netsparker.com/blog/web-security/sql-injection-cheat-sheet/) (by Ferruh Mavituna) - - [RSS Most Recent SQL Server KBs](https://support.microsoft.com/en-us/rss?rssid=1044) - [Stackoverflow SQL Anti Patterns](http://stackoverflow.com/questions/346659/what-are-the-most-common-sql-anti-patterns) - [Azure Speed](http://www.azurespeed.com/) (by Blair Chen) - - [SQLFiddle](http://sqlfiddle.com) - - [DBFiddle](https://dbfiddle.uk/?rdbms=sqlserver_2017) + - [DBFiddle - test your queries online](https://dbfiddle.uk/?rdbms=sqlserver_2019) + - [SQLize Online - is a free online SQL environment for quickly running, experimenting with and sharing SQL code](https://sqlize.online/sql/mssql2019/) - [Experts-Exchange.com MS SQL Server Topics](https://www.experts-exchange.com/topics/ms-sql-server/) - [Paste The Plan - share query plans quickly and easily](https://www.brentozar.com/pastetheplan/) (by Brent Ozar Team) - [StackExchange DataExplorer Query On line](http://data.stackexchange.com/stackoverflow/query/new) @@ -363,7 +463,7 @@ Useful links, scripts, tools and best practice for Microsoft SQL Server Database - [OrcaMDF - C# parser for MDF files](https://github.com/improvedk/OrcaMDF) (by Mark S. Rasmussen) - [Microsoft SQL Server Zabbix templates](https://share.zabbix.com/databases/microsoft-sql-server) - [Telegraf SQL Server Plugin](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/sqlserver) (by influxdata) - - [SDU Tools - pure TSQL functions Toolkit](https://sqldownunder.com/sdu-tools/) (by SQLDownUnder) + - [SDU Tools - pure TSQL functions Toolkit](https://sqldownunder.com/pages/sdu-tools) (by SQLDownUnder) - [Microsoft SQL Server Publications](https://www.microsoft.com/en-us/research/search/?q=sql+server&content-type=publications) - [SQL Server Feedback](https://feedback.azure.com/forums/908035-sql-server) - [Docs Overview SQL Tools](https://docs.microsoft.com/en-us/sql/tools/overview-sql-tools) @@ -379,6 +479,20 @@ Useful links, scripts, tools and best practice for Microsoft SQL Server Database - [Azure updates](https://azure.microsoft.com/en-us/updates/?status=all) - [Guides for Microsoft SQL Server Express](https://expressdb.io/) (by John McCall) - [SQL Server Diagrams](http://www.e-squillace.com/tech/techdiagrams/#SQL_Server) + - [SQL Cheat Sheet for MySQL](https://websitesetup.org/sql-cheat-sheet/) (by Luke Harrison) + - [Azure Database Migration Guide](https://datamigration.microsoft.com/) (by Microsoft) + - [Hermitage: Testing transaction isolation levels in relation databases](https://github.com/ept/hermitage) (by Martin Kleppmann) + - [csv to INSERT online converter - translates your tab-delimited data into a T-SQL INSERT statement](https://table.strd.co/) (by Structured Concepts AB) + - [SQL Server Diagrams](http://www.e-squillace.com/techdiagrams-sqlserver/) (by George Squillace) + - [New Stars of Data 2020 Presentations](https://github.com/SQLGrillen/NSOD-1) (by SQLGrillen) + - [Get Your ColumnScore](https://columnscore.com) (by ColumnScore) + - [SQL Assessment API rules in .csv format](https://github.com/microsoft/sql-server-samples/blob/master/samples/manage/sql-assessment-api/DefaultRuleset.csv) (by Microsoft) + - [SQL cheat sheet for PostgreSQL and Oracle](https://www.pcwdld.com/sql-cheat-sheet) (by Marc Wilson) + - [Bllitz Excel UI](https://1pro.bi/blitz-excel-ui/) (by Alex) + - [Industry-specific Data Models - cover Subject Areas and are used to create Enterprise Data Models](https://web.archive.org/web/20220330034214/http://databaseanswers.org/data_models/) + - [Library of Database Schemas](https://dbschemalibrary.com/) + - [SQLFacts - A powerful suite of FREE TSQL tools for SQL Server database professionals](https://www.sqlfacts.com) + - [sql-log-shipping-service - provides a solution for automatically restoring SQL Server transaction log backups](https://github.com/trimble-oss/sql-log-shipping-service) (by Trimble Online Source Store) **[⬆ back to top](#table-of-contents)** @@ -394,7 +508,7 @@ BIML Resources - [Stairway to Biml](http://www.sqlservercentral.com/stairway/100550/) - [Biml User Group at LinkedIn](https://www.linkedin.com/groups/4640985) - [Building Blocks of Biml (Pluralsight course by Stacia Misner Varga)](https://app.pluralsight.com/library/courses/building-blocks-biml/table-of-contents) -- [Biml-tagged posts on this blog](http://sqlblog.com/blogs/andy_leonard/archive/tags/BIML/default.aspx) +- [SQL Reserved Words](https://modern-sql.com/reserved-words-empirical-list) (by Markus Winand) BIML Bloggers - [Ben Weissman](https://www.solisyon.de/biml-blog-de/) @@ -403,15 +517,12 @@ BIML Bloggers - [Brian Bønk](http://www.bonk.dk/biml/) - [Cathrine Wilhelmsen](http://www.cathrinewilhelmsen.net/biml/) - [Datachix: Julie Smith and Audrey Hammonds](http://datachix.com/) -- [David Stein](http://www.made2mentor.com/category/biml/) -- [Davide Mauri](http://sqlblog.com/blogs/davide_mauri/archive/tags/BIML/default.aspx) +- [Davide Mauri](http://blog.davidemauri.it/) - [Erik Hudzik](http://www.anexinet.com/blog/author/ehudzik/) - [Hennie de Nooijer](http://bifuture.blogspot.com/search/label/BIML) - [John Welch](http://agilebi.com/jwelch/tag/biml/) - [Joost van Rossum](http://microsoft-ssis.blogspot.com/search/label/BIML) -- [Koen Verbeeck](http://blogs.lessthandot.com/index.php/tag/biml/) - [Marco Schreuder](http://blog.in2bi.eu/biml/) -- [Martin Andersson](http://www.frysdisken.net/) - [Meagan Longoria](https://datasavvy.wordpress.com/category/biml/) - [Nicholas Sorrell](http://sorrell.github.io/) - [Paul Te Braak](https://paultebraak.wordpress.com/tag/biml/) @@ -419,8 +530,6 @@ BIML Bloggers - [Reeves Smith](https://reevessmith.wordpress.com/category/biml/) - [Roelant Vos](http://roelantvos.com/blog/?tag=biml) - [Rui Custódio](http://www.bi4all.pt/taxonomy/term/75) -- [Samuel Vanga](http://samuelvanga.com/category/biml/) -- [Stephen Leach](http://www.imgroup.com/author/stephen-leach/) - [Tim Mitchell](https://www.timmitchell.net/post/tag/biml/) - [Warwick Rudd](http://www.sqlmastersconsulting.com.au/SQL-Server-Blog/PID/1675/mcat/1682/evl/0/nsw/t/EDNSearch/Biml) @@ -442,7 +551,6 @@ BIML Bloggers - [PowerShell Blog NetNerds](https://blog.netnerds.net/) - [QS Config](http://www.sqlhammer.com/qs-config/) (by Derik Hammer) - [Idera 89 Free SQL Server PowerShell Scripts](https://www.idera.com/productssolutions/freetools/sqlpowershellscripts) - - [Performance Analysis of Logs (PAL) Tool](https://github.com/clinthuffman/PAL) (by Clint Huffman) - [Powershell SQL Server Library (PSSQLLib)](https://github.com/sanderstad/PSSQLLib) (by Sander Stad) (Github) - [Trello Board: Powershell and SQL Client Tools](https://trello.com/b/NEerYXUU/powershell-sql-client-tools-sqlps-ssms) - [PowerUpSQL: A PowerShell Toolkit for Attacking SQL Server](https://github.com/NetSPI/PowerUpSQL) (Github) @@ -452,73 +560,72 @@ BIML Bloggers - [Powershell xSQLServer module contains DSC resources for deployment and configuration of SQL Server](https://github.com/PowerShell/xSQLServer) (Github by Microsoft) - [Export-DMVInformation - Export the resuts from Glenn Berry's DMV queries directly to Excel](https://github.com/sanderstad/Export-DMVInformation/) (Github) (by Sander Stad) - [Export-QueryToSQLTable - Export one or more query results run against one or more instances/databases to table](https://github.com/SQLJana/Export-QueryToSQLTable) (by Jana Sattainathan) (Github) + - [PowerBIETL - a developer tool to quickly load a SQL Database using PowerBIDesktop queries](https://www.powershellgallery.com/packages/PowerBIETL/) (by DevScope) **[⬆ back to top](#table-of-contents)** ## TSQL Format Code - - http://sqlinform.com/ - - http://www.dpriver.com/pp/sqlformat.htm - - http://stackoverflow.com/questions/401928/sql-formatter-for-sql-management-studio - - http://www.apexsql.com/sql_tools_refactor.aspx + - [SQLinform Online Web](https://sqlinform.azurewebsites.net) + - [SQLinform Online Utility](https://www.sqlinform.com) + - [Instant SQL Formatter](http://www.dpriver.com/pp/sqlformat.htm) - http://poorsql.com/ - http://www.architectshack.com/PoorMansTSqlFormatter.ashx - http://www.ssmstoolspack.com/ - http://www.devart.com/dbforge/sql/sqlcomplete/ - - http://www.sql-format.com/ - - http://extras.sqlservercentral.com/prettifier/prettifier.aspx + - http://www.apexsql.com/sql_tools_refactor.aspx + - http://stackoverflow.com/questions/401928/sql-formatter-for-sql-management-studio **[⬆ back to top](#table-of-contents)** ## SQL Server Test Data Generation - https://www.simple-talk.com/sql/t-sql-programming/generating-test-data-in-tsql/ + - http://www.convertcsv.com/generate-test-data.htm - https://github.com/benkeen/generatedata - https://sourceforge.net/projects/dbmonster/ - https://sourceforge.net/projects/spawner/ - - http://databene.org/databene-benerator - - [Tools for Generating Mock Data?](https://stackoverflow.com/q/591892) + - [Tools for Generating Mock Data](https://stackoverflow.com/q/591892) - https://mockaroo.com + - https://anonymize.strd.co/ **[⬆ back to top](#table-of-contents)** ## Free SQL Server and R ebooks - SQL Server: - - [Awesome Red Gate ebooks](http://www.red-gate.com/community/books/) + - [Awesome Red Gate ebooks](https://www.red-gate.com/hub/books/) - SQL Developers - [Defensive Database Programming](https://assets.red-gate.com/community/books/defensive-database-programming.pdf) (by Alex Kuznetsov) - [Inside the SQL Server Query Optimizer](https://assets.red-gate.com/community/books/inside-the-sql-server-query-optimizer.pdf) (by Benjamin Nevarez) - - [SQL Server Execution Plans, 2nd Edition](https://assets.red-gate.com/community/books/sql-server-execution-plans-book.zip) (by Grant Fritchey) + - [SQL Server Execution Plans, 3rd Edition](https://www.red-gate.com/products/dba/sql-monitor/entrypage/execution-plans) (by Grant Fritchey) - [SQL Server Source Control Basics](https://www.red-gate.com/products/sql-development/sql-source-control/entrypage/sql-server-source-control-basics) (by Robert Sheldon, Rob Richardson & Tony Davis) - [The Art of XSD](https://assets.red-gate.com/community/books/the-art-of-xsd.pdf) (by Jacob Sebastian) - [The Redgate Guide to SQL Server Team-based Development](https://assets.red-gate.com/products/sql-development/sql-source-control/entrypage/assets/RG_Guide_to_SQL_Server_Dev.pdf) (by Phil Factor, Grant Fritchey, Alex Kuznetsov, and Mladen Prajdić) - [XML Stairway](https://assets.red-gate.com/simple-talk/stairway-to-xml.pdf) - [119 SQL Code Smells](https://assets.red-gate.com/community/books/sql-code-smells.pdf) + - [High Performance Techniques for SQL Server](https://www.sentryone.com/sql-server-books) (by SentryOne) - SQL DBA - [SQL Server Internals: In-Memory OLTP](https://www.red-gate.com/library/sql-server-internals-in-memory-oltp) (by Kalen Delaney) - [Fundamentals Of SQL Server 2012 Replication](https://assets.red-gate.com/community/books/fundamentals-of-sql-server-2012-replication.pdf) (by Sebastian Meine) - [Tribal SQL](https://www.red-gate.com/library/tribal-sql) - - [SQL Server Transaction Log Management](https://assets.red-gate.com/offerings/transaction-log-management.pdf) (by Tony Davis and Gail Shaw) + - [SQL Server Transaction Log Management](https://www.red-gate.com/library/sql-server-transaction-log-management) (by Tony Davis and Gail Shaw) - [The Art of SQL Server FILESTREAM](https://assets.red-gate.com/community/books/art-of-ss-filestream.pdf) (by Jacob Sebastian and Sven Aelterman) - [SQL Server Concurrency: Locking, Blocking and Row Versioning](https://www.red-gate.com/library/sql-server-concurrency-locking-blocking-and-row-versioning) (by Kalen Delaney) - [SQL Server Backup and Restore](https://assets.red-gate.com/community/books/sql-server-backup-and-restore.pdf) (by Shawn McGehee) - - [Troubleshooting SQL Server: A Guide for the Accidental DBA](http://assets.red-gate.com/products/dba/assets/Accidental_DBA_EBook.zip) (by Jonathan Kehayias and Ted Krueger ) + - [Troubleshooting SQL Server: A Guide for the Accidental DBA](https://www.red-gate.com/library/troubleshooting-sql-server-a-guide-for-accidental-dbas) (by Jonathan Kehayias and Ted Krueger ) - [SQL Server Hardware](http://assets.red-gate.com/community/books/sql-server-hardware-ebook.pdf) (by Glen Berry) - [Microsoft huge collection](https://blogs.msdn.microsoft.com/mssmallbiz/2013/06/18/huge-collection-of-free-microsoft-ebooks-for-you-including-office-office-365-sharepoint-sql-server-system-center-visual-studio-web-development-windows-windows-azure-and-windows-server/) - [Microsoft large collection](https://blogs.msdn.microsoft.com/mssmallbiz/2012/07/27/large-collection-of-free-microsoft-ebooks-for-you-including-sharepoint-visual-studio-windows-phone-windows-8-office-365-office-2010-sql-server-2012-azure-and-more/) - [Largest FREE Microsoft eBook Giveaway!](https://blogs.msdn.microsoft.com/mssmallbiz/2017/07/11/largest-free-microsoft-ebook-giveaway-im-giving-away-millions-of-free-microsoft-ebooks-again-including-windows-10-office-365-office-2016-power-bi-azure-windows-8-1-office-2013-sharepo/) - - [Microsoft MVA Free ebooks](https://mva.microsoft.com/ebooks) - [OnlineVideoLectures ebooks](http://onlinevideolecture.com/ebooks/?subject=SQL-Server) - [Brent Ozar ebooks](https://www.brentozar.com/first-aid/) - [E-books SQL Server Directory](http://www.e-booksdirectory.com/listing.php?category=569) - - [TOAD SQL Server ebooks](https://www.toadworld.com/platforms/sql-server/b/weblog/archive/2013/06/21/huge-collection-of-free-microsoft-sql-server-ebooks) - [Syncfusion Techportal](http://syncfusion.com/resources/techportal) - [Modern Storage Strategies for SQL Server](http://www.actualtech.io/gg-modern-storage/) - [Migrating SQL Server Databases to Azure](https://blogs.msdn.microsoft.com/microsoft_press/2016/05/11/free-ebook-microsoft-azure-essentials-migrating-sql-server-databases-to-azure/) - - [SQL Sentry Free eBooks](https://www.sqlsentry.com/sql-server-books) + - [SentryOne Free eBooks](https://www.sentryone.com/resources#filter=.ebook) - [Microsoft Cloud Security for Enterprise Architects (PDF)](http://download.microsoft.com/download/6/d/f/6dfd7614-bbcf-4572-a871-e446b8cf5d79/msft_cloud_architecture_security.pdf) - [Brent Ozar SQL Server Setup Checklist eBook](http://u.brentozar.com/eBook_SQL_Server_Setup_Checklist.pdf) - [Introducing Microsoft SQL Server 2016](https://info.microsoft.com/Introducing-SQL-Server-2016-eBook.html) @@ -531,7 +638,12 @@ SQL Server: - [Troubleshooting SQL Server Performance](https://info.sentryone.com/ebook-troubleshooting-sql-server-performance) (by Kevin Kline) - [Azure Machine Learning Studio: An Unleashed Guide](http://radacad.com/book-azure-machine-learning-studio-an-unleashed-guide) (by Leila Etaati) - [Nutanix Best Practices for SQL Server 2016](https://www.nutanix.com/viewer.html?type=pdf&lpurl=virtualize-microsoft-sql-server-hyperconverged-infrastructure.php&fromCampaign=true) (by Nutanix, Inc.) - + - [Cloud Analytics with Microsoft Azure](https://azure.microsoft.com/en-us/resources/cloud-analytics-with-microsoft-azure/) (by Has Altaiar, Jack Lee, Michael Peña) + - [Snowflake for SQL Server Users Part 1 – Core Concepts](https://sqldownunder.blob.core.windows.net/public/SnowflakeForSQLServerUsers_Part_1_CoreConcepts%20-%20for%20SDU%20Insiders.pdf) (by Dr Greg Low) + - [The Fundamental Guide To Sql Query Optimization](https://www.quest.com/whitepapert/the-fundamental-guide-to-sql-query-optimization8143740/) (by Janis Griffin) + - [An Expert Guide To Sql Server Performance Tuning](https://www.quest.com/whitepaper/an-expert-guide-to-sql-server-performance-tuning8143874/) (by Brent Ozar, Pinal Dave, Janis Griffin) + - [Microsoft® SQL Server® Notes for Professionals book](https://books.goalkicker.com/MicrosoftSQLServerBook/) (by GoalKicker Books) + R: - [BookDown - Write HTML, PDF, ePub, and Kindle books with R Markdown](https://bookdown.org) - [FreeComputerBooks R EBooks](http://freecomputerbooks.com/langRBooks.html) @@ -545,6 +657,24 @@ R: **[⬆ back to top](#table-of-contents)** + +## SQL Server Paid Books +- [T-SQL Fundamentals](https://amzn.to/39CLxSN) 361 pages (by Itzik Ben-Gan) +- [T-SQL Querying (Developer Reference)](https://amzn.to/3bGxVIa) 803 pages (by Itzik Ben-Gan) +- [Great Post, Erik](https://amzn.to/3bMtgUY) 342 pages (by Erik Darling) +- [Learn T-SQL Querying](https://amzn.to/39Ia7BX) 450 pages (by Pedro Lopes, Pam Lahoud) +- [SQL Server 2017 Query Performance Tuning](https://amzn.to/2UW3s2E) 823 pages (by Grant Fritchey) +- [Query Store for SQL Server 2019](https://amzn.to/2OZAzPp) 236 pages (by Tracy Boggiano, Grant Fritchey) +- [SQL Server 2019 Revealed](https://amzn.to/2OZSiWS) 444 pages (by Bob Ward) +- [Pro SQL Server Internals](https://www.amazon.co.uk/dp/1484219635/) 840 pages (by Dmitri Korotkevitch) +- [Pro SQL Server Always On Availability Groups](https://www.amazon.co.uk/dp/B01M3U6WRM/) 332 pages (by Uttam Parui, Vivek Sanil) +- [Refactoring Legacy T-SQL for Improved Performance: Modern Practices for SQL Server](https://www.amazon.co.uk/dp/1484255801/) 260 pages (by Lisa Bohm) +- [Hands-On SQL Server 2019 Analysis Services](https://www.packtpub.com/product/hands-on-sql-server-2019-analysis-services/9781800204768) (by Steve Hughes) + + +**[⬆ back to top](#table-of-contents)** + + ## License [MIT](/LICENSE) diff --git a/SQL Server DBCC List.md b/SQL Server DBCC List.md index c3933df7..b94d2541 100644 --- a/SQL Server DBCC List.md +++ b/SQL Server DBCC List.md @@ -227,7 +227,7 @@ DBCC setioweight (weight) DBCC show_statistics ('table_name', 'target_name') -DBCC showcontig (table_id | table_name [, index_id | index_name] [WITH FAST, ALL_INDEXES, TABLERESULTS [,ALL_LEVELS]]) +DBCC showcontig (table_id | table_name [, index_id | index_name] [WITH FAST, ALL_INDEXES, TABLERESULTS [,ALL_LEVELS]]) -- https://www.sqlskills.com/blogs/paul/the-curious-case-of-extent-scan-fragmentation/ DBCC showdbaffinity diff --git a/SQL Server Data Types.md b/SQL Server Data Types.md index 7ce21e14..b2b3a3ed 100644 --- a/SQL Server Data Types.md +++ b/SQL Server Data Types.md @@ -2,32 +2,14 @@ Detailed information about Microsoft SQL Server Data Types and its mapping to another databases and program languages analog. ## Table of Contents: - - [Source link](#source-link) - - [Data Type Precedence (Transact-SQL)](#data-type-precedence) - - [Data Type Synonyms (Transact-SQL)](#data-type-synonyms) - - [Precision, Scale, and Length (Transact-SQL)](#precision-scale-and-length) - - [SQL Server, SSIS and Biml Data Types](#sql-server-ssis-and-biml-data-types) - - [SQL Server Data Types Length](#sql-server-data-types-length) - - [SQL Server to MySQL, Oracle, PostgreSQL and SQLite Data Type Mapping](#sql-server-to-mysql-oracle-postgresql-sqlite) - - -## Source link - - - [Data Types (Transact-SQL)](https://docs.microsoft.com/en-us/sql/t-sql/data-types/data-types-transact-sql) - - [Data Type Precedence (Transact-SQL)](https://docs.microsoft.com/en-us/sql/t-sql/data-types/data-type-precedence-transact-sql) - - [Data Type Synonyms (Transact-SQL)](https://docs.microsoft.com/en-us/sql/t-sql/data-types/data-type-synonyms-transact-sql) - - [Precision, Scale, and Length](https://docs.microsoft.com/en-us/sql/t-sql/data-types/precision-scale-and-length-transact-sql) - - [Integration Services Data Types](https://docs.microsoft.com/en-us/sql/integration-services/data-flow/integration-services-data-types) - - [DbType Enumeration](https://docs.microsoft.com/en-us/dotnet/api/system.data.dbtype) - - [SQL Server, SSIS and Biml Data Types](http://www.cathrinewilhelmsen.net/2014/05/27/sql-server-ssis-and-biml-data-types/) - - [SQL Server Integration Services, Data Type Mapping](http://milambda.blogspot.ru/2014/02/sql-server-integration-services-data.html) - - [SQL Server Data Type Conversion](https://msdn.microsoft.com/en-us/library/ms191530.aspx) - - [SQL Server to MySQL Data Type Conversion](https://convertdb.com/mysql_mssql_mapping) - - [SQL Server to Oracle Data Type Conversion](https://docs.oracle.com/cd/B19306_01/gateways.102/b14270/apa.htm) - - [SQL Server to PostgreSQL Data Type Conversion](http://www.sqlines.com/sql-server-to-postgresql) - - [SQL Server to SQLite Data Type Conversion](http://ericsink.com/mssql_mobile/data_types.html) - -**[⬆ back to top](#table-of-contents)** +- [Data Type Precedence (Transact-SQL)](#data-type-precedence) +- [Data Type Synonyms (Transact-SQL)](#data-type-synonyms) +- [Precision, Scale, and Length (Transact-SQL)](#precision-scale-and-length) +- [SQL Server, SSIS and Biml Data Types](#sql-server-ssis-and-biml-data-types) +- [SQL Server Data Types Length](#sql-server-data-types-length) +- [SQL Server to MySQL, Oracle, PostgreSQL and SQLite Data Type Mapping](#sql-server-to-mysql-oracle-postgresql-sqlite) +- [SQL Server Data Types Mapping to Program Languages](#sql-server-data-types-mapping-to-program-languages) +- [Source links](#source-links) ## Data Type Precedence (Transact-SQL) @@ -37,35 +19,35 @@ If the conversion is not a supported implicit conversion, an error is returned. When both operand expressions have the same data type, the result of the operation has that data type. SQL Server uses the following precedence order for data types: - 1. sql_variant - 2. xml - 3. datetimeoffset - 4. datetime2 - 5. datetime - 6. smalldatetime - 7. date - 8. time - 9. float - 10. real - 11. decimal - 12. money - 13. smallmoney - 14. bigint - 15. int - 16. smallint - 17. tinyint - 18. bit - 19. ntext - 20. text - 21. image - 22. timestamp - 23. uniqueidentifier - 24. nvarchar (including nvarchar(max) ) - 25. nchar - 26. varchar (including varchar(max) ) - 27. char - 28. varbinary (including varbinary(max) ) - 29. binary (lowest) +1. [sql_variant] (**highest**) +2. [xml] +3. [datetimeoffset] +4. [datetime2] +5. [datetime] +6. [smalldatetime] +7. [date] +8. [time] +9. [float][4] +10. [real][4] +11. [decimal][2] +12. [money][3] +13. [smallmoney][3] +14. [bigint][1] +15. [int][1] +16. [smallint][1] +17. [tinyint][1] +18. [bit] +19. [ntext][7] +20. [text][7] +21. [image][7] +22. [timestamp] +23. [uniqueidentifier] +24. [nvarchar][5] (including [nvarchar(max)][5]) +25. [nchar][5] +26. [varchar][5] (including [varchar(max)][5]) +27. [char][5] +28. [varbinary][8] (including [varbinary(max)][8]) +29. [binary][8] (**lowest**) **[⬆ back to top](#table-of-contents)** @@ -159,22 +141,22 @@ The table does not include all possible mappings or all data types, but is meant | [geography] | - | DT_IMAGE | - | Object | Object | | [geometry] | - | DT_IMAGE | - | Object | Object | | [hierarchyid] | - | DT_BYTES | - | Object | Object | -| [image] (*) | Object | DT_IMAGE | - | Binary | Binary | +| [image][7] (*) | Object | DT_IMAGE | - | Binary | Binary | | [int][1] | Int32 | DT_I4 | LONG | Int32 | Int32 | | [money][3] | Object | DT_CY, DT_NUMERIC | CURRENCY | Currency | Currency | | [nchar][5] | String | DT_WSTR | NVARCHAR | StringFixedLength | StringFixedLength | -| [ntext] (*) | String | DT_NTEXT | - | String | String | -| [numeric] | Decimal | DT_NUMERIC | NUMERIC | Decimal | Decimal | +| [ntext][7] (*) | String | DT_NTEXT | - | String | String | +| [numeric][2] | Decimal | DT_NUMERIC | NUMERIC | Decimal | Decimal | | [nvarchar][5] | String | DT_WSTR | NVARCHAR | String | String | -| [nvarchar](max) | Object | DT_NTEXT | - | - | String | -| [real] | Single | DT_R4 | FLOAT, DOUBLE | Single | Single | +| [nvarchar(max)][5] | Object | DT_NTEXT | - | - | String | +| [real][4] | Single | DT_R4 | FLOAT, DOUBLE | Single | Single | | [rowversion] | Object | DT_BYTES | - | Binary | Binary | | [smalldatetime] | DateTime | DT_DBTIMESTAMP | DATE | DateTime | DateTime | | [smallint][1] | Int16 | DT_I2 | SHORT | Int16 | Int16 | | [smallmoney][3] | Object | DT_CY, DT_NUMERIC | CURRENCY | Currency | Currency | | [sql_variant] | Object | DT_WSTR, DT_NTEXT | - | Object | Object | | [table] | Object | - | - | - | - | -| [text] (*) | Object | DT_TEXT | - | - | AnsiString | +| [text][7] (*) | Object | DT_TEXT | - | - | AnsiString | | [time] | Object | DT_DBTIME2 | DBTIME2 | Time | Time | | [timestamp] (*) | Object | DT_BYTES | - | Binary | Binary | | [tinyint][1] | Byte | DT_UI1 | BYTE | Byte | Byte | @@ -182,7 +164,7 @@ The table does not include all possible mappings or all data types, but is meant | [varbinary][8] | Object | DT_BYTES | - | Binary | Binary | | [varbinary(max)][8]| Object | DT_IMAGE | - | Binary | Binary | | [varchar][5] | String | DT_STR | VARCHAR | String | AnsiString | -| [varchar](max) | Object | DT_TEXT | - | - | AnsiString | +| [varchar(max)][5] | Object | DT_TEXT | - | - | AnsiString | | [xml] | Object | DT_NTEXT | - | - | Xml | (\* *These data types will be removed in a future version of SQL Server. Avoid using these data types in new projects, and try to change them in current projects*) @@ -212,13 +194,13 @@ The table does not include all possible mappings or all data types, but is meant | Date and time | [datetimeoffset] | | 26-29
30-34 | 8
10 | 0001-01-01 through 9999-12-31
January 1, 1 CE through December 31, 9999 CE
00:00:00 through 23:59:59.9999999
-14:00 throuth +14:00 | | Character Strings | [char][5] | 1-8000 | | n | | | Character Strings | [varchar][5] | 1-8000 | | n + 2 | | -| Character Strings | [varchar](max) | 1-(2^31 - 1) | | 2^31 - 1 + 2 | | +| Character Strings | [varchar(max)][5] | 1-(2^31 - 1) | | 2^31 - 1 + 2 | | | Character Strings | [nchar][5] | 1-4000 | | | | | Character Strings | [nvarchar][5] | 1-4000 | | | | -| Character Strings | [nvarchar](max) | 1-(2^31 - 1) | | | | -| Character Strings | [ntext](*) | 1-(2^30 - 1) | | n + n | | -| Character Strings | [text](*) | 1-(2^31 - 1) | | | | -| Binary Strings | [image](*) | 1-(2^31 - 1) | | n | | +| Character Strings | [nvarchar(max)][5] | 1-(2^31 - 1) | | | | +| Character Strings | [ntext][7] (*) | 1-(2^30 - 1) | | n + n | | +| Character Strings | [text][7] (*) | 1-(2^31 - 1) | | | | +| Binary Strings | [image][7] (*) | 1-(2^31 - 1) | | n | | | Binary Strings | [binary][8] | 1-8000 | | n | | | Binary Strings | [varbinary][8] | 1-8000 | | n | | | Binary Strings | [varbinary(max)][8]| 1-(2^31 - 1) | | n + 2 | | @@ -226,19 +208,32 @@ The table does not include all possible mappings or all data types, but is meant | Other Data Types | [sql_variant] | | | max 8016 | | | Other Data Types | [hierarchyid] | | | max 892 | | | Other Data Types | [rowversion] | | | 8 | | -| Other Data Types | [timestamp](*) | | | | | +| Other Data Types | [timestamp] (*) | | | | | | Other Data Types | [uniqueidentifier] | | | 16 | | | Other Data Types | [xml] | | | max 2Gb | | | Other Data Types | [table] | | | | | | Spatial Data Types | [geometry] | | | | | | Spatial Data Types | [geography] | | | | | +(\* *These data types will be removed in a future version of SQL Server. Avoid using these data types in new projects, and try to change them in current projects*) + **[⬆ back to top](#table-of-contents)** ## SQL Server to MySQL, Oracle, PostgreSQL, SQLite Data Type Mapping +- [SQL Server 2019 data types](https://docs.microsoft.com/en-us/sql/t-sql/data-types/data-types-transact-sql?view=sql-server-ver15) +- [MySQL 8.0 data types](https://dev.mysql.com/doc/refman/8.0/en/data-types.html) +- [Oracle 19C data types](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlqr/Data-Types.html#GUID-DCCC6F18-15A0-4ECC-BA48-16F73F844844) +- [PostgreSQL 12 data types](https://www.postgresql.org/docs/12/datatype.html) +- [SQLite 3 data types][28] +- [SQL Server to MySQL Data Type Conversion](https://convertdb.com/mysql_mssql_mapping) +- [SQL Server to Oracle Data Type Conversion](https://docs.oracle.com/cd/B19306_01/gateways.102/b14270/apa.htm) +- [SQL Server to PostgreSQL Data Type Conversion](http://www.sqlines.com/sql-server-to-postgresql) +- [SQL Server to SQLite Data Type Conversion](http://ericsink.com/mssql_mobile/data_types.html) + + Common data-type conversions between SQL Server, Oracle, Sybase ASE, and DB2. More details [here](https://www.sqlserverscience.com/documentation/common-data-type-conversions-between-sql-server-oracle-sybase-ase-and-db2/) @@ -270,49 +265,122 @@ FROM sys.fn_helpdatatypemap ( ); ``` -| General Type | Type | MySQL | Oracle | PostgreSQL | SQLite | -|-----------------------|--------------------|---------------------------------|---------------|-----------------------------|--------:| -| Exact Numerics | [bit] | [TINYINT(1)][20] | NUMBER(3) | BOOLEAN | INTEGER | -| Exact Numerics | [tinyint][1] | [TINYINT(3) UNSIGNED][20] | NUMBER(3) | SMALLINT | INTEGER | -| Exact Numerics | [smallint][1] | [SMALLINT][20] | NUMBER(5) | SMALLINT | INTEGER | -| Exact Numerics | [int][1] | [INT][20] | NUMBER(10) | INT | INTEGER | -| Exact Numerics | [bigint][1] | [BIGINT][20] | NUMBER(19) | BIGINT | INTEGER | -| Exact Numerics | [decimal][2] | [DECIMAL][21] | NUMBER(p[,s]) | DECIMAL(p,s) | REAL | -| Exact Numerics | [smallmoney][3] | [DECIMAL(10,4)][21] | NUMBER(10,4) | MONEY | REAL | -| Exact Numerics | [money][3] | [DECIMAL(19,4)][21] | NUMBER(19,4) | MONEY | REAL | -| Approximate Numerics | [float][4] | [FLOAT][22] | FLOAT(49) | DOUBLE PRECISION | REAL | -| Date and Time | [date] | [DATE][22] | DATE | DATE | TEXT | -| Date and Time | [smalldatetime] | [TIMESTAMP][23] | DATE | TIMESTAMP(0) | TEXT | -| Date and Time | [time] | [TIME][24] | | TIME | TEXT | -| Date and Time | [datetime2] | [DATETIME][23] | | TIMESTAMP | TEXT | -| Date and Time | [datetime] | [DATETIME][23] | DATE | TIMESTAMP(3) | TEXT | -| Date and time | [datetimeoffset] | | | TIMESTAMP
with time zone| TEXT | -| Character Strings | [char][5] | CHAR | CHAR | CHAR | TEXT | -| Character Strings | [varchar][5] | VARCHAR | VARCHAR2 | VARCHAR | TEXT | -| Character Strings | [varchar](max) | LONGTEXT | VARCHAR2 | TEXT | TEXT | -| Character Strings | [nchar][5] | NCHAR | | NCHAR | TEXT | -| Character Strings | [nvarchar][5] | VARCHAR with character set utf8 | NCHAR | VARCHAR | TEXT | -| Character Strings | [nvarchar](max) | LONGTEXT | NCHAR | TEXT | TEXT | -| Character Strings | [ntext][4] (*) | | LONG | TEXT | TEXT | -| Character Strings | [text][4] (*) | | LONG | TEXT | TEXT | -| Binary Strings | [image][4] (*) | LONGBLOB | LONG RAW | BYTEA | BLOB | -| Binary Strings | [binary][8] | BINARY | RAW | BYTEA | BLOB | -| Binary Strings | [varbinary][8] | | RAW | BYTEA | BLOB | -| Binary Strings | [varbinary(max)][8]| LONGTEXT | RAW | BYTEA | BLOB | -| Other Data Types | [cursor] | | | | TEXT | -| Other Data Types | [sql_variant] | BLOB | | | TEXT | -| Other Data Types | [hierarchyid] | | | | TEXT | -| Other Data Types | [rowversion] | | | BYTEA | TEXT | -| Other Data Types | [timestamp] (*) | | RAW | BYTEA | TEXT | -| Other Data Types | [uniqueidentifier] | CHAR | CHAR(36) | CHAR(16) | TEXT | -| Other Data Types | [xml] | | | XML | TEXT | -| Other Data Types | [table] | | | | - | -| Spatial Data Types | [geometry] | | | VARCHAR | TEXT | -| Spatial Data Types | [geography] | | | VARCHAR | TEXT | +| General Type | Type | ANSI | MySQL | Oracle | PostgreSQL | SQLite | +|-----------------------|--------------------|------|:--------------------------|:--------------|:----------------------------|:--------------| +| Exact Numerics | [bit] | No | [TINYINT(1)][20] | NUMBER(1) | BOOLEAN | [INTEGER][28] | +| Exact Numerics | [tinyint][1] | No | [TINYINT(3) UNSIGNED][20] | NUMBER(3) | SMALLINT | [INTEGER][28] | +| Exact Numerics | [smallint][1] | Yes | [SMALLINT][20] | NUMBER(5) | SMALLINT | [INTEGER][28] | +| Exact Numerics | [int][1] | Yes | [INT][20] | NUMBER(10) | INT | [INTEGER][28] | +| Exact Numerics | [bigint][1] | No | [BIGINT][20] | NUMBER(19) | BIGINT | [INTEGER][28] | +| Exact Numerics | [decimal][2] | Yes | [DECIMAL][21] | NUMBER(p[,s]) | DECIMAL(p,s) | [REAL][28] | +| Exact Numerics | [smallmoney][3] | No | [DECIMAL(10,4)][21] | NUMBER(10,4) | MONEY | [REAL][28] | +| Exact Numerics | [money][3] | No | [DECIMAL(19,4)][21] | NUMBER(19,4) | MONEY | [REAL][28] | +| Approximate Numerics | [real][4] | Yes | [FLOAT][22] | FLOAT(24) | DOUBLE PRECISION | [REAL][28] | +| Approximate Numerics | [float][4](1-24) | Yes | [FLOAT][22] | FLOAT(24) | DOUBLE PRECISION | [REAL][28] | +| Approximate Numerics | [float][4](25-53) | Yes | [FLOAT][22] | FLOAT(49) | DOUBLE PRECISION | [REAL][28] | +| Date and Time | [date] | Yes | [DATE][22] | DATE | DATE | [TEXT][28] | +| Date and Time | [smalldatetime] | No | [TIMESTAMP][23] | DATE | TIMESTAMP(0) | [TEXT][28] | +| Date and Time | [time] | Yes | [TIME][24] | - | TIME | [TEXT][28] | +| Date and Time | [datetime2] | Yes | [DATETIME][23] | - | TIMESTAMP | [TEXT][28] | +| Date and Time | [datetime] | Yes | [DATETIME][23] | DATE | TIMESTAMP(3) | [TEXT][28] | +| Date and time | [datetimeoffset] | No | - | - | TIMESTAMP
with time zone| [TEXT][28] | +| Character Strings | [char][5] | Yes | [CHAR][26] | CHAR | CHAR | [TEXT][28] | +| Character Strings | [varchar][5] | Yes | [VARCHAR][26] | VARCHAR2 | VARCHAR | [TEXT][28] | +| Character Strings | [varchar(max)][5] | Yes | [LONGTEXT][25] | VARCHAR2 | TEXT | [TEXT][28] | +| Character Strings | [nchar][5] | Yes | [CHAR][26] with utf8 | NCHAR | CHAR | [TEXT][28] | +| Character Strings | [nvarchar][5] | Yes | [VARCHAR][26] with utf8 | NVARCHAR | VARCHAR | [TEXT][28] | +| Character Strings | [nvarchar(max)][5] | Yes | [LONGTEXT][25] | NCHAR | TEXT | [TEXT][28] | +| Character Strings | [ntext][7] (*) | No | [LONGTEXT][25] | CLOB | TEXT | [TEXT][28] | +| Character Strings | [text][7] (*) | No | [LONGTEXT][25] | LONG | TEXT | [TEXT][28] | +| Binary Strings | [image][7] (*) | No | [LONGBLOB][25] | LONG RAW | BYTEA | [BLOB][28] | +| Binary Strings | [binary][8] | Yes | [BINARY][27] | BLOB | BYTEA | [BLOB][28] | +| Binary Strings | [varbinary][8] | Yes | [VARBINARY][27] | RAW | BYTEA | [BLOB][28] | +| Binary Strings | [varbinary(max)][8]| Yes | [LONGTEXT][25] | RAW | BYTEA | [BLOB][28] | +| Other Data Types | [cursor] | No | - | - | - | - | +| Other Data Types | [sql_variant] | No | [TEXT][25] | CLOB | TEXT | [TEXT][28] | +| Other Data Types | [hierarchyid] | No | [TEXT][25] | BLOB | VARCHAR | [TEXT][28] | +| Other Data Types | [rowversion] | No | [TEXT][25] | RAW | BYTEA | [TEXT][28] | +| Other Data Types | [timestamp] (*) | No | [TEXT][25] | RAW | BYTEA | [TEXT][28] | +| Other Data Types | [uniqueidentifier] | No | [CHAR(16)][26] | CHAR(16) | CHAR(16) | [TEXT][28] | +| Other Data Types | [xml] | Yes | [LONGTEXT][25] | [XMLTYPE] | XML | [TEXT][28] | +| Other Data Types | [table] | No | - | - | - | - | +| Spatial Data Types | [geometry] | No | [TEXT][25] | BLOB | VARCHAR | [TEXT][28] | +| Spatial Data Types | [geography] | No | [TEXT][25] | BLOB | VARCHAR | [TEXT][28] | + +(\* *These data types will be removed in a future version of SQL Server. Avoid using these data types in new projects, and try to change them in current projects*) **[⬆ back to top](#table-of-contents)** + +## SQL Server Data Types Mapping to Program Languages + + +- [Java and SQL Server supported data types](https://docs.microsoft.com/en-us/sql/language-extensions/how-to/java-to-sql-data-types) +- [Data type mappings between Python and SQL Server](https://docs.microsoft.com/en-us/sql/machine-learning/python/python-libraries-and-data-types) +- [Data type mappings between R and SQL Server](https://docs.microsoft.com/en-us/sql/machine-learning/r/r-libraries-and-data-types) + +| General Type | Type | ANSI | Java | Python | R | +|:----------------------|:-------------------|:-----|:---------------------|:--------|:----------| +| Exact Numerics | [bit] | No | boolean | bool | logical | +| Exact Numerics | [tinyint][1] | No | short | uint8 | integer | +| Exact Numerics | [smallint][1] | Yes | short | int16 | integer | +| Exact Numerics | [int][1] | Yes | int | int32 | integer | +| Exact Numerics | [bigint][1] | No | long | numeric | numeric | +| Exact Numerics | [decimal][2] | Yes | java.math.BigDecimal | ? | numeric | +| Exact Numerics | [smallmoney][3] | No | java.math.BigDecimal | ? | numeric | +| Exact Numerics | [money][3] | No | java.math.BigDecimal | ? | numeric | +| Approximate Numerics | [real][4] | Yes | float | float32 | numeric | +| Approximate Numerics | [float][4](1-24) | Yes | float | float32 | numeric | +| Approximate Numerics | [float][4](25-53) | Yes | double | float64 | numeric | +| Date and Time | [date] | Yes | java.sql.date | ? | POSIXct | +| Date and Time | [smalldatetime] | No | java.sql.timestamp | ? | POSIXct | +| Date and Time | [time] | Yes | ? | ? | POSIXct | +| Date and Time | [datetime2] | Yes | java.sql.timestamp | ? | POSIXct | +| Date and Time | [datetime] | Yes | java.sql.timestamp | ? | POSIXct | +| Date and time | [datetimeoffset] | No | ? | ? | ? | +| Character Strings | [char][5] | Yes | String (**) | str | character | +| Character Strings | [varchar][5] | Yes | String (**) | str | character | +| Character Strings | [varchar(max)][5] | Yes | String (**) | str | character | +| Character Strings | [nchar][5] | Yes | String | str | character | +| Character Strings | [nvarchar][5] | Yes | String | str | character | +| Character Strings | [nvarchar(max)][5] | Yes | String | str | character | +| Character Strings | [ntext][7] (*) | No | String | str | character | +| Character Strings | [text][7] (*) | No | String (**) | str | character | +| Binary Strings | [image][7] (*) | No | byte[] | str | - | +| Binary Strings | [binary][8] | Yes | byte[] | raw | raw | +| Binary Strings | [varbinary][8] | Yes | byte[] | bytes | raw | +| Binary Strings | [varbinary(max)][8]| Yes | byte[] | bytes | raw | +| Other Data Types | [cursor] | No | - | - | - | +| Other Data Types | [sql_variant] | No | String | str | - | +| Other Data Types | [hierarchyid] | No | String | str | - | +| Other Data Types | [rowversion] | No | ? | ? | - | +| Other Data Types | [timestamp] (*) | No | ? | ? | - | +| Other Data Types | [uniqueidentifier] | No | String | str | - | +| Other Data Types | [xml] | Yes | ? | ? | - | +| Other Data Types | [table] | No | - | - | - | +| Spatial Data Types | [geometry] | No | ? | ? | - | +| Spatial Data Types | [geography] | No | ? | ? | - | + (\* *These data types will be removed in a future version of SQL Server. Avoid using these data types in new projects, and try to change them in current projects*) +(\*\* *Only UTF8 Strings supported*) + +**[⬆ back to top](#table-of-contents)** + + +## Source links + +- [Data Types (Transact-SQL)](https://docs.microsoft.com/en-us/sql/t-sql/data-types/data-types-transact-sql) +- [Data Type Precedence (Transact-SQL)](https://docs.microsoft.com/en-us/sql/t-sql/data-types/data-type-precedence-transact-sql) +- [Data Type Synonyms (Transact-SQL)](https://docs.microsoft.com/en-us/sql/t-sql/data-types/data-type-synonyms-transact-sql) +- [Precision, Scale, and Length](https://docs.microsoft.com/en-us/sql/t-sql/data-types/precision-scale-and-length-transact-sql) +- [Integration Services Data Types](https://docs.microsoft.com/en-us/sql/integration-services/data-flow/integration-services-data-types) +- [DbType Enumeration](https://docs.microsoft.com/en-us/dotnet/api/system.data.dbtype) +- [SQL Server, SSIS and Biml Data Types](http://www.cathrinewilhelmsen.net/2014/05/27/sql-server-ssis-and-biml-data-types/) +- [SQL Server Integration Services, Data Type Mapping](http://milambda.blogspot.ru/2014/02/sql-server-integration-services-data.html) +- [Data type conversion (Database Engine)](https://docs.microsoft.com/en-us/sql/t-sql/data-types/data-type-conversion-database-engine) + +**[⬆ back to top](#table-of-contents)** + [1]:https://docs.microsoft.com/sql/t-sql/data-types/int-bigint-smallint-and-tinyint-transact-sql [2]:https://docs.microsoft.com/sql/t-sql/data-types/decimal-and-numeric-transact-sql @@ -346,3 +414,10 @@ FROM sys.fn_helpdatatypemap ( [22]:https://dev.mysql.com/doc/refman/8.0/en/floating-point-types.html [23]:https://dev.mysql.com/doc/refman/8.0/en/datetime.html [24]:https://dev.mysql.com/doc/refman/8.0/en/time.html +[25]:https://dev.mysql.com/doc/refman/8.0/en/blob.html +[26]:https://dev.mysql.com/doc/refman/8.0/en/char.html +[27]:https://dev.mysql.com/doc/refman/8.0/en/binary-varbinary.html + +[28]:https://www.sqlite.org/datatype3.html + +[XMLTYPE]:https://docs.oracle.com/en/database/oracle/oracle-database/12.2/arpls/XMLTYPE.html diff --git a/SQL Server Drivers.md b/SQL Server Drivers.md index 60b43e28..43dec2e7 100644 --- a/SQL Server Drivers.md +++ b/SQL Server Drivers.md @@ -5,6 +5,17 @@ Please see below for a summary of the different drivers, both current and legacy [SQL Server Drivers](https://docs.microsoft.com/en-us/sql/connect/sql-server-drivers) +# Driver feature support matrix for Microsoft SQL Server +[Driver feature support matrix for Microsoft SQL Server](https://docs.microsoft.com/en-us/sql/connect/driver-feature-matrix) +If you're planning to use a feature in Microsoft SQL Server, it might not be available in all drivers. Some reasons a feature might not be in a particular driver include: + +- The feature doesn't apply to the driver technology. +- The feature is new and hasn't been implemented across all drivers yet. +- The feature isn't in demand in a particular driver. +- Other features are being implemented first. +We wish all drivers supported every feature and spend effort to ensure feature parity across drivers. However that isn't always possible. To help you choose the appropriate driver for your needs, here's a list of popular features and the drivers that implement them. + + ## Current SQL Drivers The following SQL Drivers are actively developed. Each driver has a support statement that can be found by following the links. @@ -15,6 +26,12 @@ This driver is developed, tested, and supported by Microsoft. [Microsoft ADO.NET for SQL Server](https://docs.microsoft.com/en-us/sql/connect/ado-net/microsoft-ado-net-for-sql-server) | [Download .Net Driver](http://www.microsoft.com/net/download/) +### Ballerina +The Ballerina MSSQL Connector provides seamless integration with Microsoft SQL Server, allowing developers to work with databases efficiently in cloud-native and REST-based applications. This connector is an open-source project which is actively developed, tested, and supported by the Ballerina team. + +[ballerinax/mssql connector for SQL Server](https://central.ballerina.io/ballerinax/mssql/latest) | [GitHub](https://github.com/ballerina-platform/module-ballerinax-mssql) + + ### JDBC The JDBC SQL driver is a Java implementation of the TDS protocol, which is supported by all modern versions of SQL Server. This driver is developed, tested, and supported by Microsoft. @@ -30,7 +47,7 @@ The ODBC SQL driver is a C++ implementation of the TDS protocol, which is suppor ### PHP The PHP SQL driver relies on the Microsoft SQL Server ODBC Driver to handle the low-level communication with SQL Server. This driver is developed, tested, and supported by Microsoft. -[Microsoft PHP Driver for SQL Driver](https://docs.microsoft.com/en-us/sql/connect/php/microsoft-php-driver-for-sql-server) | [Download PHP Driver](https://www.microsoft.com/en-us/download/details.aspx?id=20098) | [Github](https://github.com/Microsoft/msphpsql) +[Microsoft PHP Driver for SQL Driver](https://docs.microsoft.com/en-us/sql/connect/php/microsoft-php-driver-for-sql-server) | [Download PHP Driver](https://github.com/microsoft/msphpsql/releases/latest) | [Github](https://github.com/Microsoft/msphpsql) ### Node.js diff --git a/SQL Server Name Convention and T-SQL Programming Style.md b/SQL Server Name Convention and T-SQL Programming Style.md index 0407f990..2e63ae48 100644 --- a/SQL Server Name Convention and T-SQL Programming Style.md +++ b/SQL Server Name Convention and T-SQL Programming Style.md @@ -1,109 +1,162 @@ # SQL Server Name Convention and T-SQL Programming Style + > There are only two hard things in Computer Science: cache invalidation and naming things > -- [Phil Karlton](https://www.karlton.org/2017/12/naming-things-hard/) -[Naming convention][99] is a set of rules for choosing the character sequence to be used for identifiers which denote variables, types, functions, and other entities in source code and documentation. +[Naming convention](https://en.wikipedia.org/wiki/Naming_convention_(programming)) is a set of rules for choosing the character sequence to be used for identifiers which denote variables, types, functions, and other entities in source code and documentation. Reasons for using a naming convention (as opposed to allowing programmers to choose any character sequence) include the following: - - To reduce the effort needed to read and understand source code; - - To enable code reviews to focus on more important issues than arguing over syntax and naming standards. - - To enable code quality review tools to focus their reporting mainly on significant issues other than syntax and style preferences. - -[99]:https://en.wikipedia.org/wiki/Naming_convention_(programming) +- To reduce the effort needed to read and understand source code. +- To enable code reviews to focus on more important issues than arguing over syntax and naming standards. +- To enable code quality review tools to focus their reporting mainly on significant issues other than syntax and style preferences. ## Table of Contents - - [SQL Server Object Name Convention](#sql-server-object-name-convention) - - [SQL Server Data Types Recommendation](#data-types-recommendation) - - [T-SQL Programming Style](#t-sql-programming-style) - - [General programming style](#general-programming-style) - - [Stored procedures and functions programming style](#programming-style) - - [Reference and useful links](#reference) + +- [SQL Server Object Name Convention](#sql-server-object-name-convention) +- [SQL Server Data Types Recommendation](#data-types-recommendation) +- [SQL Server Function Recommendations](#function-recommendation) +- [T-SQL Programming T-SQL Style](#t-sql-programming-style) + - [General T-SQL programming style](#general-t-sql-programming-style) + - [Stored procedures and functions programming style](#programming-style) + - [Dynamic T-SQL Recommendation](#dynamic-t-sql-recommendation) +- [Reference and useful links](#reference) ## SQL Server Object Name Convention -| Object | Code | Notation | Length | Plural | Prefix | Suffix | Abbreviation | Char Mask | Example | -|----------------------------------|------| ---------- |-------:|--------|--------|--------|--------------|--------------|--------------------------------------| -| Database | | UPPERCASE | 30 | No | No | No | Yes | [A-z] | `MYDATABASE` | -| Database Trigger | | PascalCase | 50 | No | DTR_ | No | Yes | [A-z] | `DTR_CheckLogin` | -| Schema | | lowercase | 30 | No | No | No | Yes | [a-z][0-9] | `myschema` | -| File Table | | PascalCase | 128 | No | FT_ | No | Yes | [A-z][0-9] | `FT_MyTable` | -| Global Temporary Table | | PascalCase | 117 | No | No | No | Yes | ##[A-z][0-9] | `##MyTable` | -| Local Temporary Table | | PascalCase | 116 | No | No | No | Yes | #[A-z][0-9] | `#MyTable` | -| Table | U | PascalCase | 128 | No | No | No | Yes | [A-z][0-9] | `MyTable` | -| Table Column | | PascalCase | 128 | No | No | No | Yes | [A-z][0-9] | `MyColumn` | -| Table Default Values | D | PascalCase | 128 | No | DF_ | No | Yes | [A-z][0-9] | `DF_MyTable_MyColumn` | -| Table Check Column Constraint | C | PascalCase | 128 | No | CK_ | No | Yes | [A-z][0-9] | `CK_MyTable_MyColumn` | -| Table Check Table Constraint | C | PascalCase | 128 | No | CTK_ | No | Yes | [A-z][0-9] | `CTK_MyTable_MyColumn_AnotherColumn` | -| Table Primary Key | PK | PascalCase | 128 | No | PK_ | No | Yes | [A-z][0-9] | `PK_MyTableID` | -| Table Alternative Key | UQ | PascalCase | 128 | No | AK_ | No | Yes | [A-z][0-9] | `AK_MyTable_MyColumn_AnotherColumn` | -| Table Foreign Key | F | PascalCase | 128 | No | FK_ | No | Yes | [A-z][0-9] | `FK_MyTable_ForeignTableID` | -| Table Clustered Index | | PascalCase | 128 | No | IXC_ | No | Yes | [A-z][0-9] | `IXC_MyTable_MyColumn_AnotherColumn` | -| Table Non Clustered Index | | PascalCase | 128 | No | IX_ | No | Yes | [A-z][0-9] | `IX_MyTable_MyColumn_AnotherColumn` | -| Table Trigger | TR | PascalCase | 128 | No | TR_ | No | Yes | [A-z][0-9] | `TR_MyTable_LogicalName` | -| View | V | PascalCase | 128 | No | VI_ | No | No | [A-z][0-9] | `VI_LogicalName` | -| Stored Procedure | P | PascalCase | 128 | No | usp_ | No | No | [A-z][0-9] | `usp_LogicalName` | -| Scalar User-Defined Function | FN | PascalCase | 128 | No | udf_ | No | No | [A-z][0-9] | `udf_FunctionLogicalName` | -| Table-Valued Function | FN | PascalCase | 128 | No | tvf_ | No | No | [A-z][0-9] | `tvf_FunctionLogicalName` | -| Synonym | SN | camelCase | 128 | No | sy_ | No | No | [A-z][0-9] | `sy_logicalName` | -| Sequence | SO | PascalCase | 128 | No | sq_ | No | No | [A-z][0-9] | `sq_TableName` | -| CLR Assembly | | PascalCase | 128 | No | CA | No | Yes | [A-z][0-9] | `CALogicalName` | -| CLR Stored Procedures | PC | PascalCase | 128 | No | pc_ | No | Yes | [A-z][0-9] | `pc_CAName_LogicalName` | -| CLR Scalar User-Defined Function | | PascalCase | 128 | No | cudf_ | No | No | [A-z][0-9] | `cudf_CAName_LogicalName` | -| CLR Table-Valued Function | | PascalCase | 128 | No | ctvf_ | No | No | [A-z][0-9] | `ctvf_CAName_LogicalName` | -| CLR User-Defined Aggregates | | PascalCase | 128 | No | ca_ | No | No | [A-z][0-9] | `ca_CAName_LogicalName` | -| CLR User-Defined Types | | PascalCase | 128 | No | ct_ | No | No | [A-z][0-9] | `ct_CAName_LogicalName` | -| CLR Triggers | | PascalCase | 128 | No | ctr_ | No | No | [A-z][0-9] | `ctr_CAName_LogicalName` | +| Object | Code | Notation | Length | Plural | Prefix | Suffix | Abbreviation | Char Mask | Example | +|------------------------------------------|------| ---------- |-------:|--------|---------|--------|--------------|--------------|--------------------------------------| +| [Database] | | UPPERCASE | 30 | No | No | No | Yes | [A-z] | `MYDATABASE` | +| [Schema] | | lowercase | 30 | No | No | No | Yes | [a-z][0-9] | `myschema` | +| [Global Temporary Table] | | PascalCase | 117 | No | No | No | Yes | ##[A-z][0-9] | `##MyTable` | +| [Local Temporary Table] | | PascalCase | 116 | No | No | No | Yes | #[A-z][0-9] | `#MyTable` | +| [File Table] | | PascalCase | 128 | No | `FT_` | No | Yes | [A-z][0-9] | `FT_MyTable` | +| [Memory-optimized SCHEMA_AND_DATA Table] | | PascalCase | 128 | No | `MT_` | `_SD` | Yes | [A-z][0-9] | `MT_MyTable_SD` | +| [Memory-optimized SCHEMA_ONLY Table] | | PascalCase | 128 | No | `MT_` | `_SO` | Yes | [A-z][0-9] | `MT_MyTable_SO` | +| [Temporal Table] | | PascalCase | 128 | No | No | `_TT` | Yes | [A-z][0-9] | `MyTable_TT` | +| [Disk-Based Table] | U | PascalCase | 128 | No | No | No | Yes | [A-z][0-9] | `MyTable` | +| [Disk-Based Wide Table - SPARSE Column] | U | PascalCase | 128 | No | No | `_SPR` | Yes | [A-z][0-9] | `MyTable_SPR` | +| [Table Column] | | PascalCase | 128 | No | No | No | Yes | [A-z][0-9] | `MyColumn` | +| [Table Column SPARSE] | | PascalCase | 128 | No | No | `_SPR` | Yes | [A-z][0-9] | `MyColumn_SPR` | +| [Columns Check Constraint] | C | PascalCase | 128 | No | `CTK_` | No | Yes | [A-z][0-9] | `CTK_MyTable_MyColumn_AnotherColumn` | +| [Column Check Constraint] | C | PascalCase | 128 | No | `CK_` | No | Yes | [A-z][0-9] | `CK_MyTable_MyColumn` | +| [Column Default Values] | D | PascalCase | 128 | No | `DF_` | No | Yes | [A-z][0-9] | `DF_MyTable_MyColumn` | +| [Table Primary Key] | PK | PascalCase | 128 | No | `PK_` | No | Yes | [A-z][0-9] | `PK_MyTableID` | +| [Table Unique (Alternative) Key] | UQ | PascalCase | 128 | No | `AK_` | No | Yes | [A-z][0-9] | `AK_MyTable_MyColumn_AnotherColumn` | +| [Table Foreign Key] | F | PascalCase | 128 | No | `FK_` | No | Yes | [A-z][0-9] | `FK_MyTable_ForeignTableID` | +| [Table Clustered Index] | | PascalCase | 128 | No | `IXC_` | No | Yes | [A-z][0-9] | `IXC_MyTable_MyColumn_AnotherColumn` | +| [Table Non Clustered Index] | | PascalCase | 128 | No | `IX_` | No | Yes | [A-z][0-9] | `IX_MyTable_MyColumn_AnotherColumn` | +| [DDL Trigger] | TR | PascalCase | 128 | No | `TR_` | `_DDL` | Yes | [A-z][0-9] | `TR_LogicalName_DDL` | +| [DML Trigger] | TR | PascalCase | 128 | No | `TR_` | `_DML` | Yes | [A-z][0-9] | `TR_MyTable_LogicalName_DML` | +| [Logon Trigger] | TR | PascalCase | 128 | No | `TR_` | `_LOG` | Yes | [A-z][0-9] | `TR_LogicalName_LOG` | +| [View] | V | PascalCase | 128 | No | `VI_` | No | No | [A-z][0-9] | `VI_LogicalName` | +| [Indexed View] | V | PascalCase | 128 | No | `VIX_` | No | No | [A-z][0-9] | `VIX_LogicalName` | +| [Statistic] | | PascalCase | 128 | No | `ST_` | No | No | [A-z][0-9] | `ST_MyTable_MyColumn_AnotherColumn` | +| [Stored Procedure] | P | PascalCase | 128 | No | `usp_` | No | No | [A-z][0-9] | `usp_LogicalName` | +| [Scalar User-Defined Function] | FN | PascalCase | 128 | No | `udf_` | No | No | [A-z][0-9] | `udf_FunctionLogicalName` | +| [Table-Valued Function] | FN | PascalCase | 128 | No | `tvf_` | No | No | [A-z][0-9] | `tvf_FunctionLogicalName` | +| [Synonym] | SN | camelCase | 128 | No | `sy_` | No | No | [A-z][0-9] | `sy_logicalName` | +| [Sequence] | SO | PascalCase | 128 | No | `sq_` | No | No | [A-z][0-9] | `sq_TableName` | +| [CLR Assembly] | | PascalCase | 128 | No | `CA ` | No | Yes | [A-z][0-9] | `CALogicalName` | +| [CLR Stored Procedures] | PC | PascalCase | 128 | No | `pc_` | No | Yes | [A-z][0-9] | `pc_CAName_LogicalName` | +| [CLR Scalar User-Defined Function] | | PascalCase | 128 | No | `cudf_` | No | No | [A-z][0-9] | `cudf_CAName_LogicalName` | +| [CLR Table-Valued Function] | | PascalCase | 128 | No | `ctvf_` | No | No | [A-z][0-9] | `ctvf_CAName_LogicalName` | +| [CLR User-Defined Aggregates] | | PascalCase | 128 | No | `ca_` | No | No | [A-z][0-9] | `ca_CAName_LogicalName` | +| [CLR User-Defined Types] | | PascalCase | 128 | No | `ct_` | No | No | [A-z][0-9] | `ct_CAName_LogicalName` | +| [CLR Triggers] | | PascalCase | 128 | No | `ctr_` | No | No | [A-z][0-9] | `ctr_CAName_LogicalName` | +| [Linked Server] | | PascalCase | 128 | No | `ls_` | No | No | [A-z][0-9] | `ls_LogicalName` | + +[Database]:https://docs.microsoft.com/en-us/sql/t-sql/statements/create-database-transact-sql +[Schema]:https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/create-a-database-schema +[Global Temporary Table]:https://docs.microsoft.com/en-us/sql/relational-databases/tables/tables +[Local Temporary Table]:https://docs.microsoft.com/en-us/sql/relational-databases/tables/tables +[File Table]:https://docs.microsoft.com/en-us/sql/relational-databases/blob/filetables-sql-server +[Memory-optimized SCHEMA_AND_DATA Table]:https://docs.microsoft.com/en-us/sql/relational-databases/in-memory-oltp/introduction-to-memory-optimized-tables +[Memory-optimized SCHEMA_ONLY Table]:https://docs.microsoft.com/en-us/sql/relational-databases/in-memory-oltp/defining-durability-for-memory-optimized-objects +[Temporal Table]:https://docs.microsoft.com/en-us/sql/relational-databases/tables/temporal-tables +[Disk-Based Table]:https://docs.microsoft.com/en-us/sql/relational-databases/in-memory-oltp/comparing-disk-based-table-storage-to-memory-optimized-table-storage +[Disk-Based Wide Table - SPARSE Column]:https://docs.microsoft.com/en-us/sql/relational-databases/tables/tables#wide-tables +[Table Column]:https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-table-transact-sql +[Table Column SPARSE]:https://docs.microsoft.com/en-us/sql/relational-databases/tables/use-sparse-columns +[Columns Check Constraint]:https://docs.microsoft.com/en-us/sql/relational-databases/tables/create-check-constraints +[Column Check Constraint]:https://docs.microsoft.com/en-us/sql/relational-databases/tables/create-check-constraints +[Column Default Values]:https://docs.microsoft.com/en-us/sql/relational-databases/tables/specify-default-values-for-columns +[Table Primary Key]:https://docs.microsoft.com/en-us/sql/relational-databases/tables/create-primary-keys +[Table Unique (Alternative) Key]:https://docs.microsoft.com/en-us/sql/relational-databases/tables/create-unique-constraints +[Table Foreign Key]:https://docs.microsoft.com/en-us/sql/relational-databases/tables/create-foreign-key-relationships +[Table Clustered Index]:https://docs.microsoft.com/en-us/sql/relational-databases/indexes/clustered-and-nonclustered-indexes-described +[Table Non Clustered Index]:https://docs.microsoft.com/en-us/sql/relational-databases/indexes/clustered-and-nonclustered-indexes-described +[DDL Trigger]:https://docs.microsoft.com/en-us/sql/t-sql/statements/create-trigger-transact-sql +[DML Trigger]:https://docs.microsoft.com/en-us/sql/relational-databases/triggers/dml-triggers +[Logon Trigger]:https://docs.microsoft.com/en-us/sql/t-sql/statements/create-trigger-transact-sql +[View]:https://docs.microsoft.com/en-us/sql/relational-databases/views/views +[Indexed View]:https://docs.microsoft.com/en-us/sql/relational-databases/views/create-indexed-views +[Statistic]:https://docs.microsoft.com/en-us/sql/t-sql/statements/create-statistics-transact-sql +[Stored Procedure]:https://docs.microsoft.com/en-us/sql/t-sql/statements/create-procedure-transact-sql +[Scalar User-Defined Function]:https://docs.microsoft.com/en-us/sql/relational-databases/user-defined-functions/create-user-defined-functions-database-engine#Scalar +[Table-Valued Function]:https://docs.microsoft.com/en-us/sql/relational-databases/user-defined-functions/create-user-defined-functions-database-engine#TVF +[Synonym]:https://docs.microsoft.com/en-us/sql/relational-databases/synonyms/synonyms-database-engine +[Sequence]:https://docs.microsoft.com/en-us/sql/relational-databases/sequence-numbers/sequence-numbers +[CLR Assembly]:https://docs.microsoft.com/en-us/sql/relational-databases/clr-integration/assemblies/creating-an-assembly +[CLR Stored Procedures]:https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/sql/clr-stored-procedures +[CLR Scalar User-Defined Function]:https://docs.microsoft.com/en-us/sql/relational-databases/clr-integration-database-objects-user-defined-functions/clr-user-defined-functions +[CLR Table-Valued Function]:https://docs.microsoft.com/en-us/sql/relational-databases/clr-integration-database-objects-user-defined-functions/clr-table-valued-functions +[CLR User-Defined Aggregates]:https://docs.microsoft.com/en-us/sql/relational-databases/clr-integration-database-objects-user-defined-functions/clr-user-defined-aggregates +[CLR User-Defined Types]:https://docs.microsoft.com/en-us/sql/relational-databases/clr-integration-database-objects-user-defined-types/clr-user-defined-types +[CLR Triggers]:https://docs.microsoft.com/en-us/sql/relational-databases/triggers/create-clr-triggers +[Linked Server]:https://docs.microsoft.com/en-us/sql/relational-databases/linked-servers/linked-servers-database-engine **[⬆ back to top](#table-of-contents)** ## SQL Server Data Types Recommendation -More details about SQL Server data types and mapping it with another databases you can find [here](https://github.com/ktaranov/sqlserver-kit/blob/master/SQL%20Server%20Data%20Types.md) - -| General Type | Type | Recommended | What use instead | Why use or not | -|----------------------|---------------------|----------------|--------------------|-----------------------------------------------------------| -| Exact Numerics | [bit] | *Maybe* | [tinyint][1] | | -| Exact Numerics | [tinyint][1] | *Maybe* | [int][1] | | -| Exact Numerics | [smallint][1] | *Maybe* | [int][1] | | -| Exact Numerics | [int][1] | Yes | - | | -| Exact Numerics | [bigint][1] | Yes | [int][1] | | -| Exact Numerics | [decimal][2] | Yes | - | | -| Exact Numerics | [smallmoney][3] | No | [decimal][2] | [possibility to loss precision due to rounding errors][9] | -| Exact Numerics | [money][3] | No | [decimal][2] | [possibility to loss precision due to rounding errors][9] | -| Approximate Numerics | [real][4] | Yes | - | | -| Approximate Numerics | [float][4] | Yes | - | | -| Date and Time | [date] | Yes | - | | -| Date and Time | [smalldatetime] | *Maybe* | [date] | | -| Date and Time | [time] | Yes | - | | -| Date and Time | [datetime2] | Yes | - | | -| Date and Time | [datetime] | No | [datetime2] | | -| Date and time | [datetimeoffset] | Yes | - | | -| Character Strings | [char][5] | *Maybe* | | | -| Character Strings | [varchar][5] | Yes | [varchar][5] | | -| Character Strings | [varchar(max)][5] | Yes | - | | -| Character Strings | [nchar][6] | *Maybe* | [nvarchar][6] | | -| Character Strings | [nvarchar][6] | Yes | - | | -| Character Strings | [nvarchar(max)][6] | Yes | - | | -| Character Strings | [ntext][7] | **Deprecated** | [nvarchar(max)][6] | | -| Character Strings | [text][7] | **Deprecated** | [nvarchar(max)][6] | | -| Binary Strings | [image][7] | **Deprecated** | [nvarchar(max)][6] | | -| Binary Strings | [binary][8] | **Deprecated** | [nvarchar(max)][6] | | -| Binary Strings | [varbinary][8] | Yes | - | | -| Binary Strings | [varbinary(max)][8] | Yes | - | | -| Other Data Types | [cursor] | *Maybe* | - | | -| Other Data Types | [sql_variant] | No | [varchar][5]? | | -| Other Data Types | [hierarchyid] | *Maybe* | - | | -| Other Data Types | [rowversion] | *Maybe* | - | | -| Other Data Types | [timestamp] | **Deprecated** | [rowversion] | it is just synonym to [rowversion] data type | -| Other Data Types | [uniqueidentifier] | Yes | - | | -| Other Data Types | [xml] | Yes | - | | -| Other Data Types | [table] | *Maybe* | - | | -| Spatial Data Types | [geometry] | Yes | - | | -| Spatial Data Types | [geography] | Yes | - | | + +More details about SQL Server data types and mapping it with another databases and program languages you can find [here](https://github.com/ktaranov/sqlserver-kit/blob/master/SQL%20Server%20Data%20Types.md) + +| General Type | Type | ANSI | Recommended | What use instead | Why use or not | +|----------------------|---------------------|------|----------------|--------------------|------------------------------------------------------------------------------------| +| Exact Numerics | [bit] | No | *Maybe* | [tinyint][1] | `bit` convert any number (except 0) to 1, 0 converted to 0 | +| Exact Numerics | [tinyint][1] | No | *Maybe* | [int][1] | for saving 3 bytes compare to `int` data type or for replacing `bit` data type | +| Exact Numerics | [smallint][1] | Yes | *Maybe* | [int][1] | for saving 2 bytes compare to `int` data type | +| Exact Numerics | [int][1] | Yes | Yes | - | | +| Exact Numerics | [bigint][1] | No | Yes | [int][1] | if you work more than 2^31 numbers. | +| Exact Numerics | [decimal][2] | Yes | Yes | - | | +| Exact Numerics | [smallmoney][3] | No | *Maybe* | [decimal][2] | [possibility to loss precision due to rounding errors][9] | +| Exact Numerics | [money][3] | No | *Maybe* | [decimal][2] | [possibility to loss precision due to rounding errors][9] | +| Approximate Numerics | [real][4] | Yes | Yes | - | | +| Approximate Numerics | [float][4](1-24) | Yes | No | [real][4] | SQL Server automatically converts `float(1-24)` to `real` data type | +| Approximate Numerics | [float][4](24-53) | Yes | Yes | - | | +| Date and Time | [date] | Yes | Yes | - | | +| Date and Time | [smalldatetime] | No | *Maybe* | [date] | | +| Date and Time | [time] | Yes | Yes | - | | +| Date and Time | [datetime2] | No | Yes | - | | +| Date and Time | [datetime] | Yes | *Maybe* | [datetime2] | [On the Advantages of DateTime2(n) over DateTime] | +| Date and time | [datetimeoffset] | No | Yes | - | | +| Character Strings | [char][5] | Yes | *Maybe* | [varchar][5] | Save 1 byte from `varchar`, but be ready for trailing spaces | +| Character Strings | [varchar][5] | Yes | Yes | - | | +| Character Strings | [varchar(max)][5] | Yes | Yes | - | | +| Character Strings | [nchar][6] | Yes | *Maybe* | [nvarchar][6] | | +| Character Strings | [nvarchar][6] | Yes | Yes | - | | +| Character Strings | [nvarchar(max)][6] | Yes | Yes | - | | +| Character Strings | [ntext][7] | No | **Deprecated** | [nvarchar(max)][6] | [NVARCHAR(MAX) VS NTEXT in SQL Server] | +| Character Strings | [text][7] | No | **Deprecated** | [varchar(max)][6] | [Differences Between Sql Server TEXT and VARCHAR(MAX) Data Type] | +| Binary Strings | [image][7] | No | **Deprecated** | [varbinary(max)][8]| [VARBINARY(MAX) Tames the BLOB] | +| Binary Strings | [binary][8] | Yes | **Deprecated** | [varbinary][8] | [Conversions between any data type and the binary data types are not guaranteed][8]| +| Binary Strings | [varbinary][8] | Yes | Yes | - | | +| Binary Strings | [varbinary(max)][8] | Yes | Yes | - | | +| Other Data Types | [cursor] | No | Yes | - | | +| Other Data Types | [sql_variant] | No | Yes | - | | +| Other Data Types | [hierarchyid] | No | Yes | - | | +| Other Data Types | [rowversion] | No | *Maybe* | - | | +| Other Data Types | [timestamp] | No | **Deprecated** | [rowversion] | it is just synonym to [rowversion] data type and must be [removed][] | +| Other Data Types | [uniqueidentifier] | No | Yes | - | | +| Other Data Types | [xml] | Yes | Yes | - | | +| Other Data Types | [table] | No | *Maybe* | - | | +| Spatial Data Types | [geometry] | No | Yes | - | | +| Spatial Data Types | [geography] | No | Yes | - | | [1]:https://docs.microsoft.com/sql/t-sql/data-types/int-bigint-smallint-and-tinyint-transact-sql [2]:https://docs.microsoft.com/sql/t-sql/data-types/decimal-and-numeric-transact-sql @@ -113,7 +166,6 @@ More details about SQL Server data types and mapping it with another databases y [6]:https://docs.microsoft.com/sql/t-sql/data-types/nchar-and-nvarchar-transact-sql [7]:https://docs.microsoft.com/sql/t-sql/data-types/ntext-text-and-image-transact-sql [8]:https://docs.microsoft.com/sql/t-sql/data-types/binary-and-varbinary-transact-sql - [9]:https://www.red-gate.com/hub/product-learning/sql-prompt/avoid-use-money-smallmoney-datatypes [bit]:https://docs.microsoft.com/sql/t-sql/data-types/bit-transact-sql @@ -133,143 +185,376 @@ More details about SQL Server data types and mapping it with another databases y [table]:https://docs.microsoft.com/sql/t-sql/data-types/table-transact-sql [geometry]:https://docs.microsoft.com/sql/t-sql/spatial-geometry/spatial-types-geometry-transact-sql [geography]:https://docs.microsoft.com/sql/t-sql/spatial-geography/spatial-types-geography +[On the Advantages of DateTime2(n) over DateTime]:http://www.sqltact.com/2012/12/on-advantages-of-datetime2n-over.html +[Differences Between Sql Server TEXT and VARCHAR(MAX) Data Type]:https://sqlhints.com/2016/05/11/differences-between-sql-server-text-and-varcharmax-data-type/ +[NVARCHAR(MAX) VS NTEXT in SQL Server]:https://www.sqlservercurry.com/2010/07/nvarcharmax-vs-ntext-in-sql-server.html +[VARBINARY(MAX) Tames the BLOB]:https://www.itprotoday.com/microsoft-visual-studio/varbinarymax-tames-blob +[removed]:https://feedback.azure.com/forums/908035-sql-server/suggestions/32889865-deprecate-timestamp-the-keyword-not-rowversion-i **[⬆ back to top](#table-of-contents)** + +## SQL Server Function Recommendations + +This is only recommendations! But it is consistent for choosing only 1 function from possibles alterntives and use only it. + +| Not Recommended | Recommended | When and Why | More details | +|-----------------------|------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------| +| [`!=`][12] | [`<>`][12] | `<>` is [`ANSI`], `!=` not `ANSI`, [`<>` and `!=` are identical][13] | [13] | +| [`CONVERT`][10] | [`CAST`][10] | `CAST` is [`ANSI`] | [14],[15] | +| [`ISNULL`] | [`COALECSE`] | `COALECSE` is [`ANSI`] and supports more than two arguments, `ISNULL` has dangerous behaviour with possibility to implicit triming string | [16],[17] | +| [`DATEDIFF`] | [`DATEADD`] | The predicate `MyDateTime < DATEADD(SECOND, -1, GETUTCDATE())` syntax is [`SARGable`] | [18],[19] | +| [`SELECT`] | [`SET`] | Using `SET` (is [`ANSI`]) instead of `SELECT` when assigning variables due to properly work with `Msg 501 Subquery returned more than 1 value` | [20],[21],[22] | +| [`STR`] | [`CAST`][10] | `STR` is not [`ANSI`], extremly slow, don't use more than 15 digits, and has rounding problem - use `CAST` plus concatenate instead `STR` | [23] | +| [`ISNUMERIC`] | [`TRY_CONVERT`] | `ISNUMERIC` can often lead to data type conversion errors, when importing data. For SQL Server below 2012 use `WHERE` with `LIKE`. | [24] | +| [`GETDATE`] | [`SYSUTCDATETIME`] | Daylight Saving Time and other factors can play havoc with our dates and times, rounding to the nearest 3 milliseconds. | [25] | +| [`GETUTCDATE`] | [`SYSUTCDATETIME`] | Daylight Saving Time and other factors can play havoc with our dates and times, rounding to the nearest 3 milliseconds. | [25] | +| [`SYSDATETIME`] | [`SYSUTCDATETIME`] | Daylight Saving Time and other factors can play havoc with our dates and times, rounding to the nearest 3 milliseconds. | [25] | +| [`CURRENT_TIMESTAMP`] | [`SYSUTCDATETIME`] | It's too similar to the poorly-named TIMESTAMP data type, which has nothing to do with dates and times and should be called `ROWVERSION`. | [26] | +| [`DATETIMEFROMPARTS`] | [`DATETIME2FROMPARTS`] | The `datetime` data type returns a value to the nearest three milliseconds, as long as it ends with 0, 3, and 7. This is data corruption by definition. | [26] | +| [`ISDATE`] | [`TRY_CONVERT`] | `ISNUMERIC` can often lead to data type conversion errors, when importing data. For SQL Server below 2012 use `WHERE` with `LIKE`. | [26] | +| [`BETWEEN`] | [`>=`] and [`<=`] | Always use an open-ended range to prevent erroneously including or excluding rows. It's much less complex to find the beginning of the next period than the end of the current period. | [27] | + +[12]:https://docs.microsoft.com/sql/t-sql/language-elements/comparison-operators-transact-sql +[13]:https://dba.stackexchange.com/a/155670/107045 +[14]:https://www.sentryone.com/blog/aaronbertrand/backtobasics-cast-vs-convert +[15]:https://nakulvachhrajani.com/2011/07/18/cast-vs-convert-is-there-a-difference-as-far-as-sql-server-is-concerned-which-is-better/ +[`COALECSE`]:https://docs.microsoft.com/sql/t-sql/language-elements/coalesce-transact-sql +[`ISNULL`]:https://docs.microsoft.com/sql/t-sql/functions/isnull-transact-sql +[16]:https://www.mssqltips.com/sqlservertip/2689/deciding-between-coalesce-and-isnull-in-sql-server/ +[17]:https://nocolumnname.blog/2017/10/09/a-subtle-difference-between-coalesce-and-isnull/ +[`DATEADD`]:https://docs.microsoft.com/en-us/sql/t-sql/functions/dateadd-transact-sql +[`DATEDIFF`]:https://docs.microsoft.com/en-us/sql/t-sql/functions/datediff-transact-sql +[`SARGable`]:https://www.sqlshack.com/how-to-use-sargable-expressions-in-t-sql-queries-performance-advantages-and-examples/ +[18]:https://michaeljswart.com/2017/12/when-measuring-timespans-try-dateadd-instead-of-datediff/ +[19]:https://dba.stackexchange.com/q/132437/107045 +[`SET`]:https://docs.microsoft.com/en-gb/sql/t-sql/language-elements/set-local-variable-transact-sql +[`SELECT`]:https://docs.microsoft.com/en-gb/sql/t-sql/language-elements/select-local-variable-transact-sql +[20]:https://assets.red-gate.com/community/books/defensive-database-programming.pdf +[21]:https://www.mssqltips.com/sqlservertip/1888/when-to-use-set-vs-select-when-assigning-values-to-variables-in-sql-server/ +[22]:http://vyaskn.tripod.com/differences_between_set_and_select.htm +[`STR`]:https://docs.microsoft.com/en-us/sql/t-sql/functions/str-transact-sql +[23]:https://www.sqlservercentral.com/articles/hidden-formatting-troubles-with-str-sql-spackle +[`ISNUMERIC`]:https://docs.microsoft.com/en-us/sql/t-sql/functions/isnumeric-transact-sql +[`TRY_CONVERT`]:https://docs.microsoft.com/en-us/sql/t-sql/functions/try-convert-transact-sql +[24]:https://www.red-gate.com/hub/product-learning/sql-prompt/sql-prompt-code-analysis-avoid-using-isnumeric-function-e1029 +[25]:https://bornsql.ca/blog/dates-times-sql-server-t-sql-functions-get-current-date-time/ +[`GETDATE`]:https://docs.microsoft.com/sql/t-sql/functions/getdate-transact-sql +[`SYSUTCDATETIME`]:https://docs.microsoft.com/en-gb/sql/t-sql/functions/sysutcdatetime-transact-sql +[`GETUTCDATE`]:https://docs.microsoft.com/sql/t-sql/functions/getutcdate-transact-sql +[`SYSDATETIME`]:https://docs.microsoft.com/sql/t-sql/functions/sysdatetime-transact-sql +[`CURRENT_TIMESTAMP`]:https://docs.microsoft.com/sql/t-sql/functions/current-timestamp-transact-sql +[26]:https://bornsql.ca/blog/dates-and-times-in-sql-server-more-functions-you-should-never-use/ +[`DATETFROMPARTS`]:https://docs.microsoft.com/sql/t-sql/functions/datefromparts-transact-sql +[`DATETIMEFROMPARTS`]:https://docs.microsoft.com/sql/t-sql/functions/datetimefromparts-transact-sql +[`DATETIME2FROMPARTS`]:https://docs.microsoft.com/sql/t-sql/functions/datetime2fromparts-transact-sql +[`ISDATE`]:https://docs.microsoft.com/sql/t-sql/functions/isdate-transact-sql +[`BETWEEN`]:https://docs.microsoft.com/sql/t-sql/language-elements/between-transact-sql +[`>=`]:https://docs.microsoft.com/en-us/sql/t-sql/language-elements/greater-than-or-equal-to-transact-sql +[`<=`]:https://docs.microsoft.com/en-us/sql/t-sql/language-elements/less-than-or-equal-to-transact-sql +[27]:https://www.mssqltips.com/sqlservertip/5206/sql-server-datetime-best-practices/ + +**[⬆ back to top](#table-of-contents)** + + + ## T-SQL Programming Style -SQL Server T-SQL Coding Conventions, Best Practices, and Programming Guidelines +SQL Server T-SQL Coding Conventions, Best Practices, and Programming Guidelines. -### General programming style + +### General programming T-SQL style + + - For database objects names in code use only schema plus object name, do not hardcode server and database names in your code: + ```tsql + /* good */ + CREATE TABLE dbo.MyTable (MyColumn int); + + /* bad*/ + CREATE TABLE PRODSERVER.PRODDB.dbo.MyTable (MyColumn int); + CREATE TABLE MyTable (MyColumn int); + ``` + More details [here](https://www.red-gate.com/simple-talk/opinion/editorials/why-you-shouldnt-hardcode-the-current-database-name-in-your-views-functions-and-stored-procedures/), + [here](https://www.sqlserverscience.com/basics/on-default-schemas-and-search-paths/), + [here](https://www.red-gate.com/hub/product-learning/sql-prompt/finding-code-smells-using-sql-prompt-procedures-lack-schema-qualification), + [here](https://sqlstudies.com/2020/06/22/i-created-a-table-and-sql-created-a-schema-and-a-user/), + [here](https://sqlperformance.com/2014/11/t-sql-queries/multiple-plans-identical-query), + [here](https://sqlblog.org/2019/09/12/bad-habits-to-kick-avoiding-the-schema-prefix). + - Delimiters: **spaces** (not tabs). + - Always use multi-line comment `/* */` instead in-line comment `--` in production code due to potential formating problems in different tools and programs. + More details [here](https://www.brentozar.com/archive/2021/04/never-ever-ever-start-t-sql-comments-with-two-dashes/), [here](https://sqlkover.com/ssis-and-the-ora-00907-missing-right-parenthesis-error/), and [here](https://docs.microsoft.com/troubleshoot/sql/admin/crashes-run-oracle-linked-server-query). + - Never use asterisk (`*`) in select statements `SELECT *` and `INSERT` statements, use explicit column names. + Main problems are: traffic issues, Memory Grants issues, Index usage issues. + **Only one exception, see it below.** + More details [here](https://www.red-gate.com/hub/product-learning/sql-prompt/finding-code-smells-using-sql-prompt-asterisk-select-list), + [here](https://sqlblog.org/2009/10/10/bad-habits-to-kick-using-select-omitting-the-column-list), + [here](https://dba.stackexchange.com/q/253873/107045), + [here](https://www.erikdarlingdata.com/sql-server/all-the-problems-with-select/). + - Use asterisk (`*`) **ONLY** in an archiving situation, where rows are being moved to another table that must have the same structure. + ```sql + INSERT INTO SalesOrderArchive /* Note no column list */ + SELECT * + FROM SalesOrder + WHERE OrderDate < @OneYearAgo; + + DELETE FROM SalesOrder + WHERE OrderDate < @OneYearAgo; + ``` + If a new column is added to `SalesOrder` table in the future, but not to `SalesOrderArchive`, the `INSERT` will fail. + Which sounds bad, but it's actually a really good thing! Because the alternative is much worse. + If all the columns were listed on the `INSERT` and the `SELECT`, then the `INSERT` would succeed, and so would the following `DELETE` (which is effectively `DELETE *`). + Production code that succeeds doesn't get any attention, and it may be a long time before someone notices that the new column is not being archived, but being silently deleted altogether. + More details [here](https://dba.stackexchange.com/a/253917/107045). + - No square brackets `[]` and [reserved words](https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Check_Reserved_Words_For_Object_Names.sql) in object names and alias, use only Latin symbols **`[A-z]`** and numeric **`[0-9]`**. + - Prefer [`ANSI`](http://standards.iso.org/ittf/PubliclyAvailableStandards/c053681_ISO_IEC_9075-1_2011.zip) syntax and functions ([`CAST`][10] instead [`CONVERT`][10], [`COALESE`](https://docs.microsoft.com/en-us/sql/t-sql/language-elements/coalesce-transact-sql) instead [`ISNULL`](https://docs.microsoft.com/en-us/sql/t-sql/functions/isnull-transact-sql), etc.). + - All finished expressions should have semicolon `;` at the end. + This is [`ANSI`] standard and Microsoft announced with the SQL Server 2008 release that semicolon statement terminators will become mandatory in a future version so statement terminators other than semicolons (whitespace) are currently deprecated. + This deprecation announcement means that you should always use semicolon terminators in new development. + From [Transact-SQL Syntax Conventions (Transact-SQL)](https://docs.microsoft.com/en-us/sql/t-sql/language-elements/transact-sql-syntax-conventions-transact-sql): + > Although the semicolon isn't required for most statements in this version of SQL Server, it will be required in a future version. + + More details [here](http://www.dbdelta.com/always-use-semicolon-statement-terminators/), [here](https://www.brentozar.com/archive/2015/12/give-your-t-sql-a-semicolonoscopy/), and [here](https://sqlblog.org/2009/09/03/ladies-and-gentlemen-start-your-semi-colons). + Semicolon is mandority for: + 1. [Common table expression `WITH CTE `](https://docs.microsoft.com/sql/t-sql/queries/with-common-table-expression-transact-sql): + > When a CTE is used in a statement that is part of a batch, the statement before it must be followed by a semicolon. + 2. [`Merge`](https://docs.microsoft.com/sql/t-sql/statements/merge-transact-sql) statements: + > The MERGE statement requires a semicolon (;) as a statement terminator. Error 10713 is raised when a MERGE statement is run without the terminator. + 3. [`TROW`](https://docs.microsoft.com/sql/t-sql/language-elements/throw-transact-sql) exceptions: + > The statement before the THROW statement must be followed by the semicolon (;) statement terminator. + 4. All [Service Broker statements](https://docs.microsoft.com/sql/t-sql/statements/send-transact-sql): + > If the SEND statement isn't the first statement in a batch or stored procedure, the preceding statement must be terminated with a semicolon (;). + + - All script files should end with `GO` and line break. This is necessary for batching scripts run through `sqlcmd` or another tools. + - Keywords should be in **UPPERCASE**: `SELECT`, `FROM`, `GROUP BY` etc. This increases the readability of the code. + - Data types declaration should be in **lowercase**: `varchar(30)`, `int`, `real`, `nvarchar(max)` etc. + More details [here](https://www.sentryone.com/blog/aaronbertrand/backtobasics-lower-case-data-types). + - All system database and tables must be in **lowercase** for properly working for Case Sensitive instance: `master, sys.tables …`. + - Do not use [nested transactions](https://docs.microsoft.com/en-us/sql/ado/guide/data/transaction-processing#nested-transactions). + The commit of a nested transaction has absolutely no effect – as the only transaction that really exists as far as SQL Server is concerned is the outer one. + More details [here](https://www.sqlskills.com/blogs/paul/a-sql-server-dba-myth-a-day-2630-nested-transactions-are-real/). + - Whenever you have data modification on non-temporary tables, is to use [explicit transactions] over [autocommit]. + 1. If you have a stored procedure which is simply running a `SELECT` statement, use [autocommit]. + 2. If you have a stored procedure which performs data modification on non-temporary tables, use an [explicit transactions] only over the area which modifies data. + 3. If you are working with non-global temporary tables beforehand, don’t include any modification of those inside the explicit transaction. + 4. In a [loop](https://docs.microsoft.com/en-us/sql/t-sql/language-elements/while-transact-sql), choose whether you want to put the [explicit transactions] around the loop or inside it. In most cases, prefer to put the transaction inside the loop to minimize the amount of time that blocking other users. + 5. Outside of a stored procedure use [explicit transactions] if you’re doing something potentially risky. + 6. Watch out for nested transactions. In SQL Server, there’s very little utility in them and their behavior is weird. [Paul Randal explains in great detail just how broken they are](https://www.sqlskills.com/blogs/paul/a-sql-server-dba-myth-a-day-2630-nested-transactions-are-real/). + More details [here](https://36chambers.wordpress.com/2020/08/10/transaction-modes-in-sql-server/). + - Avoid using [Cross-Database Queries](https://docs.microsoft.com/en-us/sql/relational-databases/in-memory-oltp/cross-database-queries) because it increase backup/restore complexity (you restore one database, then realise you don’t have log backups to bring the other database to the same point in time). + Also Azure SQL Database does not support cross-database queries and you can not migrate into in future. + - Use `temp` tables to reduce network trafic, decrease query complexity and also to get better estimates for modification queries. More details [here](https://www.brentozar.com/archive/2020/04/how-to-get-better-estimates-for-modification-queries/). + - When more than one logical operator is used always use parentheses, even when they are not required. + This can improve the readability of queries, and reduce the chance of making a subtle mistake because of operator precedence. + There is no significant performance penalty in using parentheses. More details [here](https://docs.microsoft.com/en-us/sql/relational-databases/query-processing-architecture-guide#logical-operator-precedence). + ```sql + SELECT + ProductID + FROM Production.Product + WHERE (ProductModelID = 20 OR ProductModelID = 21) + AND Color = 'Red'; - - For database objects names in code please use only schema plus object name, do not hardcode server and database names in your code: `dbo.MyTable` is good and NOT `PRODSERVER.PRODDB.dbo.MyTable`. - More details [here](https://www.red-gate.com/simple-talk/opinion/editorials/why-you-shouldnt-hardcode-the-current-database-name-in-your-views-functions-and-stored-procedures/). - - Delimiters: spaces (not tabs) - - Avoid using asterisk in select statements `SELECT *`, use explicit column names. More details [here](https://www.red-gate.com/hub/product-learning/sql-prompt/finding-code-smells-using-sql-prompt-asterisk-select-list) - - No square brackets `[]` and [reserved words](https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Check_Reserved_Words_For_Object_Names.sql) in object names and alias, use only Latin symbols **`[A-z]`** and numeric **`[0-9]`** - - Prefer [ANSI syntax](http://standards.iso.org/ittf/PubliclyAvailableStandards/c053681_ISO_IEC_9075-1_2011.zip) and functions - - All finished expressions should have semicolon `;` at the end. This is ANSI standard and Microsoft announced with the SQL Server 2008 release that semicolon statement terminators will become mandatory in a future version so statement terminators other than semicolons (whitespace) are currently deprecated. This deprecation announcement means that you should always use semicolon terminators in new development. - More details [here](http://www.dbdelta.com/always-use-semicolon-statement-terminators/). - - All script files should end with `GO` and line break - - Avoid non-standard column aliases, use, if required, double-quotes and always `AS` keyword: `SELECT p.LastName AS "Last Name" FROM dbo.Person AS p;`. + ``` + - Always use aliases for table names. More details [here](https://sqlinthewild.co.za/index.php/2019/04/23/no-this-is-not-a-bug-in-t-sql/). + - Whenever you’re working with multiple tables in a join (explicit or, like this one, implicit), always specify which table each column comes from. Even if your code works just fine today, just adding an unfortunately named column many years later can break your code. More details [here](https://sqlsunday.com/2020/12/21/the-uncorrelated-correlated-subquery/). + - Avoid non-standard column and table aliases, use, if required, double-quotes for special characters and always `AS` keyword before alias: + ```sql + SELECT + p.LastName AS "Last Name" + FROM dbo.Person AS p; + ``` More details [here](https://www.red-gate.com/hub/product-learning/sql-prompt/sql-prompt-code-analysis-avoid-non-standard-column-aliases). All possible ways using aliases in SQL Server: - ```sql + ```tsql /* Recommended due to ANSI */ - SELECT SCHEMA_NAME(schema_id)+'.'+[name] AS "Tables" FROM sys.tables; + SELECT SCHEMA_NAME(schema_id) + '.' + "name" AS "Tables" FROM sys.tables; /* Not recommended but possible */ - SELECT Tables = SCHEMA_NAME(schema_id)+'.'+[name] FROM sys.tables; - SELECT "Tables" = SCHEMA_NAME(schema_id)+'.'+[name] FROM sys.tables; - SELECT [Tables] = SCHEMA_NAME(schema_id)+'.'+[name] FROM sys.tables; - SELECT 'Tables' = SCHEMA_NAME(schema_id)+'.'+[name] FROM sys.tables; - SELECT SCHEMA_NAME(schema_id)+'.'+[name] [Tables] FROM sys.tables; - SELECT SCHEMA_NAME(schema_id)+'.'+[name] 'Tables' FROM sys.tables; - SELECT SCHEMA_NAME(schema_id)+'.'+[name] "Tables" FROM sys.tables; - SELECT SCHEMA_NAME(schema_id)+'.'+[name] Tables FROM sys.tables; - SELECT SCHEMA_NAME(schema_id)+'.'+[name] AS [Tables] FROM sys.tables; - SELECT SCHEMA_NAME(schema_id)+'.'+[name] AS 'Tables' FROM sys.tables; - SELECT SCHEMA_NAME(schema_id)+'.'+[name] AS Tables FROM sys.tables; + SELECT SCHEMA_NAME(schema_id) + '.' + [name] AS "Tables" FROM sys.tables; + SELECT Tables = SCHEMA_NAME(schema_id) + '.' + [name] FROM sys.tables; + SELECT "Tables" = SCHEMA_NAME(schema_id) + '.' + [name] FROM sys.tables; + SELECT [Tables] = SCHEMA_NAME(schema_id) + '.' + [name] FROM sys.tables; + SELECT 'Tables' = SCHEMA_NAME(schema_id) + '.' + [name] FROM sys.tables; + SELECT SCHEMA_NAME(schema_id) + '.' + [name] [Tables] FROM sys.tables; + SELECT SCHEMA_NAME(schema_id) + '.' + [name] 'Tables' FROM sys.tables; + SELECT SCHEMA_NAME(schema_id) + '.' + [name] "Tables" FROM sys.tables; + SELECT SCHEMA_NAME(schema_id) + '.' + [name] Tables FROM sys.tables; + SELECT SCHEMA_NAME(schema_id) + '.' + [name] AS [Tables] FROM sys.tables; + SELECT SCHEMA_NAME(schema_id) + '.' + [name] AS 'Tables' FROM sys.tables; + SELECT SCHEMA_NAME(schema_id) + '.' + [name] AS Tables FROM sys.tables; + ``` + - Always consider using an explicit range condition when comparing dates for properly make use of an index. More details [here](https://use-the-index-luke.com/sql/where-clause/obfuscation/dates). + ```tsql + /* bad */ + SELECT sale_date + FROM sales + WHERE YEAR(sale_date) >= 1970 + AND YEAR(sale_date) < 1971; + + /* good */ + SELECT sale_date + FROM sales + WHERE sale_date >= CAST('1970-01-01' AS date) + AND sale_date < CAST('1971-01-01', AS date); + ``` + + - The first argument in `SELECT` expression should be on the next line: + ```sql + SELECT + FirstName ``` - - The first argument in `SELECT` expression should be on the same line with it: `SELECT LastName …` - Arguments are divided by line breaks, commas should be placed before an argument: - ```sql - SELECT FirstName - , LastName + SELECT + FirstName + , LastName ``` - - For SQL Server >= 2012 use `FETCH-OFFSET` instead `TOP`. - But if you use `TOP` avoid use `TOP` in a `SELECT` statement without an `ORDER BY`. + - For SQL Server >= 2012 use [`FETCH-OFFSET`] instead [`TOP`]. + More details [here](https://docs.microsoft.com/en-us/sql/t-sql/queries/select-order-by-clause-transact-sql#using-offset-and-fetch-to-limit-the-rows-returned). + But if you use [`TOP`] avoid use [`TOP`] in a `SELECT` statement without an `ORDER BY`. More details [here](https://www.red-gate.com/hub/product-learning/sql-prompt/finding-code-smells-using-sql-prompt-top-without-order-select-statement). - - Use `TOP` function with brackets because `TOP` has supports use of an expression, such as `(@Rows*2)`, or a subquery: `SELECT TOP(100) LastName …`. - More details [here](https://www.red-gate.com/hub/product-learning/sql-prompt/sql-prompt-code-analysis-avoiding-old-style-top-clause). Also `TOP` without brackets does not work with `UPDATE` and `DELETE` statements. - - ```sql + - If you using [`TOP`] (instead recommended [`FETCH-OFFSET`]) function with round brackets because [`TOP`] has supports use of an expression, such as `(@Rows*2)`, or a sub query: `SELECT TOP(100) LastName …`. + More details [here](https://www.red-gate.com/hub/product-learning/sql-prompt/sql-prompt-code-analysis-avoiding-old-style-top-clause). + Also [`TOP`] without brackets does not work with `UPDATE` and `DELETE` statements. + ```tsql /* Not working without brackets () */ DECLARE @n int = 1; SELECT TOP@n name FROM sys.objects; ``` - - For demo queries use `TOP(100)` or lower value because SQL Server uses one sorting method for `TOP` 1-100 rows, and a different one for 101+ rows. - More details [here](https://www.brentozar.com/archive/2017/09/much-can-one-row-change-query-plan-part-2/). - - Keywords and data types declaration should be in **UPPERCASE** - - All objects must used with schema names but without database and server name: `FROM dbo.Table`. - More details [here](https://www.sqlserverscience.com/basics/on-default-schemas-and-search-paths/) and for stored procedure more details [here](https://www.red-gate.com/hub/product-learning/sql-prompt/finding-code-smells-using-sql-prompt-procedures-lack-schema-qualification). - - All system database and tables must be in lower case for properly working for Case Sensitive instance: `master, sys.tables …` - - Avoid using [`ISNUMERIC`](https://docs.microsoft.com/en-us/sql/t-sql/functions/isnumeric-transact-sql) function. Use for SQL Server >= 2012 [`TRY_CONVERT`](https://docs.microsoft.com/en-us/sql/t-sql/functions/try-convert-transact-sql) function and for SQL Server < 2012 `LIKE` expression: - ```sql - CASE WHEN Stuff(LTrim(TapAngle),1,1,'') NOT LIKE '%[^-+.ED0123456789]%' --is it a float? - AND Left(LTrim(TapAngle),1) LIKE '[-.+0123456789]' - AND TapAngle LIKE '%[0123456789][ED][-+0123456789]%' - AND Right(TapAngle ,1) LIKE N'[0123456789]' - THEN 'float' - WHEN Stuff(LTrim(TapAngle),1,1,'') NOT LIKE '%[^.0123456789]%' --is it numeric - AND Left(LTrim(TapAngle),1) LIKE '[-.+0123456789]' - AND TapAngle LIKE '%.%' AND TapAngle NOT LIKE '%.%.%' - AND TapAngle LIKE '%[0123456789]%' - THEN 'float' - ELSE NULL - END - ``` - More details [here](https://www.red-gate.com/hub/product-learning/sql-prompt/sql-prompt-code-analysis-avoid-using-isnumeric-function-e1029). + - For demo queries use `TOP(100)` or lower value because SQL Server uses one sorting method for `TOP` 1-100 rows, and a different one for 101+ rows. + More details [here](https://www.brentozar.com/archive/2017/09/much-can-one-row-change-query-plan-part-2/) and [here](https://sqlsunday.com/2020/12/08/the-curious-case-of-the-top-n-sort/). +- Avoid specifying integers in the `ORDER BY` clause as positional representations of the columns in the select list. + The statement with integers is not as easily understood by others compared with specifying the actual column name. + In addition, changes to the select list, such as changing the column order or adding new columns, requires modifying the `ORDER BY` clause in order to avoid unexpected results. + More details [here](https://docs.microsoft.com/en-us/sql/t-sql/queries/select-order-by-clause-transact-sql#best-practices). + ```sql + /* bad */ + SELECT ProductID, Name FROM production.Production ORDER BY 2; + + /* good */ + SELECT ProductID, Name FROM production.Production ORDER BY Name; + ``` + + - Avoid wrapping functions around columns specified in the `WHERE` and `JOIN` clauses. + Doing so makes the columns non-deterministic and prevents the query processor from using indexes. + - Use `NULL` or `NOT NULL` for each column in a temporary table. The [`ANSI_NULL_DFLT_ON`](https://docs.microsoft.com/en-us/sql/t-sql/statements/set-ansi-null-dflt-on-transact-sql) option control the way the Database Engine assigns the `NULL` or `NOT NULL` attributes to columns when these attributes are not specified in a `CREATE TABLE` or `ALTER TABLE` statement. + If a connection executes a procedure with different settings for these options than the connection that created the procedure, the columns of the table created for the second connection can have different nullability and exhibit different behavior. If `NULL` or `NOT NULL` is explicitly stated for each column, the temporary tables are created by using the same nullability for all connections that execute the procedure. + - Use modification statements that convert nulls and include logic that eliminates rows with null values from queries. Be aware that in Transact-SQL, `NULL` is not an empty or "nothing" value. It is a placeholder for an unknown value and can cause unexpected behavior, especially when querying for result sets or using AGGREGATE functions. + - Use the `UNION ALL` operator instead of the `UNION` or `OR` operators, unless there is a specific need for distinct values. + The `UNION ALL` operator requires less processing overhead because duplicates are not filtered out of the result set. - Avoid using `INSERT INTO` a permanent table with `ORDER BY`. More details [here](https://www.red-gate.com/hub/product-learning/sql-prompt/sql-prompt-code-analysis-insert-permanent-table-order-pe020). - Avoid using shorthand (`wk, yyyy, d` etc.) with date/time operations, use full names: `month, day, year`. - More details [here](https://sqlblog.org/2011/09/20/bad-habits-to-kick-using-shorthand-with-date-time-operations). + More details [here](https://sqlblog.org/2011/09/20/bad-habits-to-kick-using-shorthand-with-date-time-operations) and [here][27]. - Avoid ambiguous formats for date-only literals, use `CAST('yyyymmdd' AS DATE)` format. - Avoid treating dates like strings and avoid calculations on the left-hand side of the `WHERE` clause. More details [here](https://sqlblog.org/2009/10/16/bad-habits-to-kick-mis-handling-date-range-queries). - - Avoid using [hints](https://docs.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql) except `OPTION(RECOMPILE)` if needed. + - Avoid using [hints](https://docs.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql) except `RECOMPILE` if needed and `NOEXPAND` (see next tip). More details [here](https://www.red-gate.com/hub/product-learning/sql-prompt/sql-prompt-code-analysis-a-hint-is-used-pe004-7). + - Use [`NOEXPAND`](https://docs.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-table#using-noexpand) hint for [indexed views](https://docs.microsoft.com/sql/relational-databases/views/create-indexed-views) on non enterprise editions and Prior to SQL Server 2016 (13.x) SP1 to let the query optimizer know that we have indexes. + More details [here](https://bornsql.ca/blog/using-indexed-views-dont-forget-this-important-tip/). + - Use [`LOOP JOIN`](https://docs.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-query#arguments) and [`FAST 1`](https://docs.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-query#arguments) query hints for deleting huge number of rows with `ON DELETE CASCADE` foreign keys specification. + More details [here](https://dba.stackexchange.com/a/262116). + - If you use [hints] always use it with `WITH` keyword because omitting the `WITH` keyword is a deprecated feature and will be removed from future Microsoft SQL Server versions. + One benefit of using the `WITH` keyword is that you can specify multiple table hints using the WITH keyword against the same table. + More details [here](https://www.sqlshack.com/understanding-impact-clr-strict-security-configuration-setting-sql-server-2017/). - Avoid use of `SELECT…INTO` for production code, use instead `CREATE TABLE` + `INSERT INTO …` approach. More details [here](https://www.red-gate.com/hub/product-learning/sql-prompt/use-selectinto-statement). - - Use only ISO standard JOINS syntaxes. The “old style” Microsoft/Sybase JOIN style for SQL, which uses the `=*` and `*=` syntax, has been deprecated and is no longer used. Queries that use this syntax will fail when the database engine level is 10 (SQL Server 2008) or later (compatibility level 100). The ANSI-89 table citation list (`FROM tableA, tableB`) is still ISO standard for `INNER JOINs` only. Neither of these styles are worth using. It is always better to specify the type of join you require` INNER`, `LEFT OUTER`, `RIGHT OUTER`, `FULL OUTER` and `CROSS`, which has been standard since ANSI SQL-92 was published. While you can choose any supported `JOIN `style, without affecting the query plan used by SQL Server, using the ANSI-standard syntax will make your code easier to understand, more consistent, and portable to other relational database systems. + - Use only ISO standard JOINS syntaxes. The *old style* Microsoft/Sybase `JOIN` style for SQL, which uses the `=*` and `*=` syntax, has been deprecated and is no longer used. + Queries that use this syntax will fail when the database engine level is 10 (SQL Server 2008) or later (compatibility level 100). The ANSI-89 table citation list (`FROM tableA, tableB`) is still ISO standard for `INNER JOINs` only. Neither of these styles are worth using. + It is always better to specify the type of join you require` INNER`, `LEFT OUTER`, `RIGHT OUTER`, `FULL OUTER` and `CROSS`, which has been standard since ANSI SQL-92 was published. While you can choose any supported `JOIN `style, without affecting the query plan used by SQL Server, using the ANSI-standard syntax will make your code easier to understand, more consistent, and portable to other relational database systems. More details [here](https://www.red-gate.com/hub/product-learning/sql-prompt/finding-code-smells-using-sql-prompt-old-style-join-syntax-st001). - Do not use a scalar user-defined function (UDF) in a `JOIN` condition, `WHERE` search condition, or in a `SELECT` list, unless the function is [schema-bound](https://docs.microsoft.com/en-us/sql/t-sql/statements/create-function-transact-sql#best-practices). More details [here](https://www.red-gate.com/hub/product-learning/sql-prompt/misuse-scalar-user-defined-function-constant-pe017). + - For scalar function use [`WITH SCHEMABINDING`](https://docs.microsoft.com/en-us/sql/t-sql/statements/create-function-transact-sql#best-practices) option to get a performance boost. More details [here](https://bertwagner.com/2018/12/04/two-words-for-faster-scalar-functions/) + - Do not use [`INFORMATION_SCHEMA`] views to determine the schema of an object. [`INFORMATION_SCHEMA`] views only represent a **subset of the metadata** of an object. + The only reliable way to find the schema of a object is to query the [`sys.objects`](https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-objects-transact-sql) catalog view. [`INFORMATION_SCHEMA`] does not represent every possible state of the objects in SQL. For example, [`filtered indexes`](https://docs.microsoft.com/en-us/sql/relational-databases/indexes/create-filtered-indexes). The [`INFORMATION_SCHEMA`] are incomplete. + More details [here](https://github.com/MicrosoftDocs/sql-docs/issues/4188). + - Do not use explicit transactions for DML and DDL especially for reorganize index because the locking behavior of this statemnets becomes more restrictive. + More details [here](https://github.com/MicrosoftDocs/sql-docs/pull/4011). + - In [sqlcmd](https://docs.microsoft.com/en-us/sql/tools/sqlcmd-utility) move the `-U`and `-P` parameters after the `-Q` parameter so that the password is at the end of the command. + More details [here](https://bornsql.ca/blog/the-curious-case-of-the-sqlcmd-password/) + ``` + sqlcmd -S MSSQLSERVER$EXPRESS -Q "dbcc checkdb ('master') with DATA_PURITY, NO_INFOMSGS;" -U maintenanceUser -P ""weirdPassword + ``` + - Only update rows that changed? Try using `EXISTS` and `EXCEPT` for perfomance reasons and code readanlity.More details [here](https://chadbaldwin.net/2020/12/30/only-update-rows-that-changed). - Use `EXISTS` or `NOT EXISTS` if referencing a subquery, and `IN` or `NOT IN` when have a list of literal values. More details [here](https://www.brentozar.com/archive/2018/08/a-common-query-error/). - For concatenate unicode strings: - always using the upper-case `N`; - - always store into a variable of type `NVARCHAR(MAX)`; - - avoid truncation of string literals, simply ensure that one piece is converted to `NVARCHAR(MAX)`. + - always store into a variable of type `nvarchar(max)`; + - avoid truncation of string literals, simply ensure that one piece is converted to `nvarchar(max)`. Example: - `SET @NVCmaxVariable = CONVERT(NVARCHAR(MAX), N'anything') + N'something else' + N'another';` + ```tsql + /* good */ + DECLARE @nvcmaxVariable nvarchar(max); + SET @nvcmaxVariable = CAST(N'ಠ russian anomaly ЯЁЪ ಠ ' AS nvarchar(max)) + N'something else' + N'another'; + SELECT @nvcmaxVariable; + ``` More details [here](https://themondaymorningdba.wordpress.com/2018/09/13/them-concatenatin-blues/). - - Always specify a length to any text-based data type such as `VARCHAR`, `NVARCHAR`, `CHAR`, `NCHAR`: - ```sql - /* Correct */ - DECLARE @myGoodVarchareVariable VARCHAR(50); - DECLARE @myGoodNVarchareVariable NVARCHAR(90); - DECLARE @myGoodCharVariable CHAR(7); - DECLARE @myGoodNCharVariable NCHAR(10); + - Always specify a length to any text-based data type such as `varchar`, `nvarchar`, `char`, `nchar`: + ```tsql + /* bad */ + DECLARE @myBadVarcharVariable varchar; + DECLARE @myBadNVarcharVariable nvarchar; + DECLARE @myBadCharVariable char; + DECLARE @myBadNCharVariable nchar; - /* Not correct */ - DECLARE @myBadVarcharVariable VARCHAR; - DECLARE @myBadNVarcharVariable NVARCHAR; - DECLARE @myBadCharVariable CHAR; - DECLARE @myBadNCharVariable NCHAR; + /* good */ + DECLARE @myGoodVarchareVariable varchar(50); + DECLARE @myGoodNVarchareVariable nvarchar(90); + DECLARE @myGoodCharVariable char(7); + DECLARE @myGoodNCharVariable nchar(10); ``` - More details [here](https://www.red-gate.com/hub/product-learning/sql-prompt/using-a-variable-length-datatype-without-explicit-length-the-whys-and-wherefores). + More details [here](https://www.red-gate.com/hub/product-learning/sql-prompt/using-a-variable-length-datatype-without-explicit-length-the-whys-and-wherefores) and [here](https://sqlblog.org/2009/10/09/bad-habits-to-kick-declaring-varchar-without-length). + - Use only [`ORIGINAL_LOGIN()`](https://docs.microsoft.com/en-us/sql/t-sql/functions/original-login-transact-sql) function because is the only function that consistently returns the actual login name that we started with regardless of impersonation. + More details [here](https://sqlstudies.com/2015/06/24/which-user-function-do-i-use/). + - Always use `IF` statement with `BEGIN-END` block to prevent errors with multi line statements: + ```tsql + DECLARE @x int = 0; + DECLARE @y int = 1; + + /* bad */ + IF @y > @x + SET @x = @x + 1; + SET @y = @y - 1; + ELSE + PRINT(1); + /* Msg 156, Level 15, State 1, Line 8 + Incorrect syntax near the keyword 'ELSE'. */ + + /* good */ + IF @y > @x + BEGIN + SET @x = @x + 1; + SET @y = @y - 1; + END; + ELSE + BEGIN + PRINT(1); + END; + ``` - `FROM, WHERE, INTO, JOIN, GROUP BY, ORDER BY` expressions should be aligned so, that all their arguments are placed under each other (see Example below) -Example: +TSQL Example with formating: -```sql +```tsql WITH CTE_MyCTE AS ( - SELECT t1.Value1 AS Val1 - , t1.Value2 AS Val2 - , t2.Value3 AS Val3 - INNER JOIN dbo.Table3 AS t2 - ON t1.Value1 = t2.Value1 - WHERE t1.Value1 > 1 - AND t2.Value2 >= 101 + SELECT + t1.Value1 AS Val1 + , t1.Value2 AS Val2 + , t2.Value3 AS Val3 + INNER JOIN dbo.Table3 AS t2 + ON t1.Value1 = t2.Value1 + WHERE t1.Value1 > 1 + AND t2.Value2 >= 101 ) -SELECT t1.Value1 AS Val1 - , t1.Value2 AS Val2 - , t2.Value3 AS Val3 -INTO #Table3 -FROM CTE_MyCTE AS t1 +SELECT + t1.Value1 AS Val1 + , t1.Value2 AS Val2 + , t2.Value3 AS Val3 +INTO #Table3 +FROM CTE_MyCTE AS t1 ORDER BY t2.Value2; ``` @@ -279,7 +564,11 @@ ORDER BY t2.Value2; ### Stored procedures and functions programming style - - All stored procedures and functions should use `ALTER` statement and start with the object presence check (see example below) +Recommendations from Microsoft: [Stored procedure Best practice][11] + + - All stored procedures and functions should use `ALTER` statement and start with the object presence check (see example below) for saving `GRANTs` on your object. + Also if you use Query Store and plan forcing and `DROP` and then `CREATE` new object you loosing plan forcing, more details [here](https://www.scarydba.com/2020/03/02/query-store-plan-forcing-and-drop-create/). + For SQL Server 2016 and higher you can use new `CREATE OR ALTER` statement. - `ALTER` statement should be preceded by 2 line breaks - Parameters name should be in **camelCase** - Parameters should be placed under procedure name divided by line breaks @@ -287,51 +576,57 @@ ORDER BY t2.Value2; - The procedure or function should begin with parameters checks (see example below) - Create `sp_` procedures only in `master` database - SQL Server will always scan through the system catalog first - Always use `BEGIN TRY` and `BEGIN CATCH` for error handling - - Always use multi-line comment `/* */` instead in-line comment `--` - - Use `SET NOCOUNT ON;` for stops the message that shows the count of the number of rows affected by a Transact-SQL statement and decreasing network traffic. - More details [here](https://www.red-gate.com/hub/product-learning/sql-prompt/finding-code-smells-using-sql-prompt-set-nocount-problem-pe008-pe009). + - Use `SET NOCOUNT ON;` for stops the message that shows the count of the number of rows affected by a Transact-SQL statement and decreasing network traffic. + More details [here](https://www.red-gate.com/hub/product-learning/sql-prompt/finding-code-smells-using-sql-prompt-set-nocount-problem-pe008-pe009) and [here][11]. - Do not use `SET NOCOUNT OFF;` because it is default behavior - Use `RAISERROR` instead `PRINT` if you want to give feedback about the state of the currently executing SQL batch without lags. More details [here](http://sqlity.net/en/984/print-vs-raiserror/) and [here](http://sqlservercode.blogspot.com/2019/01/print-disruptor-of-batch-deletes-in-sql.html). + - Call natively-compiled stored procedures without named parameters. + More details [here](https://sqlperformance.com/2015/06/t-sql-queries/how-not-to-call-hekaton-procedures). - All code should be self documenting - - TSQL code, triggers, stored procedures, functions, should have a standard comment-documentation banner: -```tsql -summary: > - This procedure returns an object build script as a single-row, single column - result. -Revisions: - - Author: Bill Gates - Version: 1.1 - Modification: dealt properly with heaps - date: 2017-07-15 - - version: 1.2 - modification: Removed several bugs and got column-level constraints working - date: 2017-06-30 -example: - - code: udf_MyFunction 'testValsue'; -returns: > - single row, single column result Build_Script. + - T-SQL code, triggers, stored procedures, functions, scripts, should have a standard comment-documentation banner: +``` + + Get all databases meta data using dynamic T-SQL + 1 data set: temp table #DatabaseInfo. + No + Konstantin Taranov + 2018-03-01 + 2019-11-14 by Konstantin Taranov + 1.2 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Databases_Report.sql + ``` **[⬆ back to top](#table-of-contents)** -Stored Procedure Example: + Stored Procedure Example: -```sql +```tsql IF OBJECT_ID('dbo.usp_StoredProcedure', 'P') IS NULL EXECUTE('CREATE PROCEDURE dbo.usp_StoredProcedure as SELECT 1'); GO -ALTER PROCEDURE dbo.usp_StoredProcedure ( - @parameterValue1 SMALLINT - , @parameterValue2 NVARCHAR(300) - , @debug BIT = 0 +ALTER PROCEDURE dbo.usp_StoredProcedure( + @parameterValue1 smallint + , @parameterValue2 nvarchar(300) + , @debug bit = 0 ) /* -EXECUTE dbo.usp_StoredProcedure - @parameterValue1 = 0 - , @parameterValue2 = N'BULK' + + Simple example of tsql procedure + nothing + No + Konstantin Taranov + 2019-01-01 + 2019-11-25 by Konstantin Taranov + 1.2 + - + EXECUTE dbo.usp_StoredProcedure + @parameterValue1 = 0 + , @parameterValue2 = N'BULK' + */ AS SET NOCOUNT ON; @@ -339,20 +634,19 @@ SET NOCOUNT ON; BEGIN TRY IF (@parameterValue1 < 0 OR @parameterValue2 NOT IN ('SIMPLE', 'BULK', 'FULL')) RAISERROR('Not valid data parameter!', 16, 1); - PRINT @parameterValue2; + IF (@debug) PRINT @parameterValue2; END TRY BEGIN CATCH /* Print error information. */ - PRINT 'Error: ' + CONVERT(varchar(50), ERROR_NUMBER()) + - ', Severity: ' + CONVERT(varchar(5), ERROR_SEVERITY()) + - ', State: ' + CONVERT(varchar(5), ERROR_STATE()) + - ', Procedure: ' + ISNULL(ERROR_PROCEDURE(), '-') + - ', Line: ' + CONVERT(varchar(5), ERROR_LINE()) + - ', User name: ' + CONVERT(sysname, CURRENT_USER); + PRINT 'Error: ' + CAST(ERROR_NUMBER()) AS varchar(50)) + + ', Severity: ' + CAST(ERROR_SEVERITY(), varchar(5)) + + ', State: ' + CAST(ERROR_STATE(), varchar(5) ) + + ', Procedure: ' + COALESCE(ERROR_PROCEDURE(), '-') + + ', Line: ' + CAST(ERROR_LINE(), varchar(5)) + + ', User name: ' + CAST(ORIGINAL_LOGIN(), sysname); PRINT ERROR_MESSAGE(); END CATCH; - GO ``` @@ -360,8 +654,119 @@ GO **[⬆ back to top](#table-of-contents)** + +### Dynamic T-SQL Recommendation + +**Highly recommended to read awesome detailed article about dynamic T-SQL by Erland Sommarskog: [The Curse and Blessings of Dynamic SQL](http://sommarskog.se/dynamic_sql.html)** + +Dynamic SQL is a programming technique that allows you to construct SQL statements dynamically at runtime. +It allows you to create more general purpose and flexible SQL statement because the full text of the SQL statements may be unknown at compilation. +For example, you can use the dynamic SQL to create a stored procedure that queries data against a table whose name is not known until runtime. + +More details [here](http://www.sqlservertutorial.net/sql-server-stored-procedures/sql-server-dynamic-sql/). + +- Do not use [nvarchar(max)][6] for your object’s name parameter, use [sysname](https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2008-r2/ms191240(v=sql.105)?redirectedfrom=MSDN) instead (synonym for nvarchar(128) except that, by default, sysname is NOT NULL). + ```tsql + /* Bad */ + DECLARE @tableName nvarchar(max) = N'MyTableName'; + + /* Good */ + DECLARE @tableName sysname = N'MyTableName'; + ``` +- Do quote the names of your objects properly. + ```tsql + /* Bad */ + DECLARE @tsql nvarchar(max); + DECLARE @tableName sysname = N'My badly named table!'; + SET @tsql = N'SELECT object_id FROM ' + @tableName; + + /* Good */ + DECLARE @tsql nvarchar(max); + DECLARE @tableName sysname = N'My badly named table 111!'; + SET @tsql = N'SELECT object_id FROM ' + QUOTENAME(@tableName); + ``` +- Always use [`sp_executesql`] instead [`EXEC`] to prevent sql injection. + Also [`sp_executesql`] can parameterizing your dynamic statement that means plans can be reused as well (when the value of the dynamic object is the same). + Also [`sp_executesql`] can even be used to output values as well (see example below). + ```tsql + /* Bad EXEC example with sql injection*/ + DECLARE @tsql nvarchar(max); + DECLARE @tableName sysname = N'master.sys.tables; SELECT * FROM master.sys.server_principals;'; + SET @tsql = N'SELECT "name" FROM ' + @tableName + N';'; + EXEC (@tsql); + + /* Good sp_executesql example*/ + DECLARE @tsql nvarchar(max); + DECLARE @tableName sysname = N'master.sys.tables'; + DECLARE @id int = 2107154552; + SET @tsql = N'SELECT name FROM ' + @tableName + + N' WHERE object_id = ' + CONVERT(nvarchar(max), @id); + EXEC sp_executesql @tsql, N'@ID int', @ID = @id; + + /* Good sp_executesql example with OUTPUT */ + DECLARE @tsql nvarchar(max); + DECLARE @tableName sysname = N'master.sys.tables'; + DECLARE @count bigint; + SET @tsql = N'SELECT @countOUT = COUNT(*) FROM ' + @tableName + N';'; + EXEC sp_executesql @tsql, N'@countOUT bigint OUTPUT', @countOUT = @count OUTPUT; + PRINT('@count = ' + CASE WHEN @count IS NULL THEN 'NULL' ELSE CAST(@count AS varchar(30)) END); + ``` +- Do not use dynamic T-SQL if your statement is not dynamic. + ```tsql + /* Bad */ + DECLARE @tsql nvarchar(max); + DECLARE @id int = 2107154552; + SET @tsql = N'SELECT object_id, "name" FROM master.sys.tables WHERE object_id = ' + CAST(@id AS nvarchar(max)); + EXEC sp_executesql @tsql; + + /* Good */ + DECLARE @id int = 2107154552; + SELECT object_id, "name" FROM master.sys.tables WHERE object_id = @id; + ``` +- Do not debug the code that creates the dynamic T-SQL first, debug the generated T-SQL statement instead. + Use `@debug` variable to print (or a `SELECT` statement if your dynamic T-SQL is over 4000 characters) dynamic statement instead executing it. + See example below. +- Do take the time to format your dynamic T-SQL. + ```tsql + /* Bad @tsql formating */ + DECLARE @tsql nvarchar(max); + DECLARE @sep nvarchar(30) = ' UNION ALL '; + DECLARE @debug bit = 1; + + SELECT @tsql = COALESCE(@tsql, N'') + + N'SELECT N' + QUOTENAME(name,'''') + + N' AS DBName, (SELECT COUNT(*) FROM ' + + QUOTENAME(name) + N'.sys.tables) AS TableCount' + + @sep + FROM sys.databases + ORDER BY name; + + SET @tsql = LEFT(@tsql, LEN(@tsql) - LEN(@sep)); + IF @debug = 1 SELECT @tsql AS "tsql" ELSE EXEC sp_executesql @tsql; + + /* Good @tsql formating */ + DECLARE @tsql nvarchar(max); + DECLARE @sep nvarchar(30) = ' UNION ALL '; + DECLARE @debug bit = 1; + DECLARE @crlf nvarchar(10) = NCHAR(13) + NCHAR(10); + + SELECT @tsql = COALESCE(@tsql, N'') + @crlf + + N'SELECT N' + QUOTENAME(name,'''') + N' AS DBName' + @crlf + + N' , (SELECT COUNT(*) FROM ' + QUOTENAME(name) + N'.sys.tables) AS TableCount' + @crlf + + @sep + FROM sys.databases + ORDER BY name; + + SET @tsql = LEFT(@tsql, LEN(@tsql) - LEN(@sep)) + N';'; + IF @debug = 1 SELECT @tsql AS "tsql" ELSE EXEC sp_executesql @tsql; + ``` + +**[⬆ back to top](#table-of-contents)** + + ## Official Reference and useful links + - [Transact-SQL Formatting Standards](https://www.simple-talk.com/sql/t-sql-programming/transact-sql-formatting-standards-%28coding-styles%29/) (by Robert Sheldon) - [Subjectivity: Naming Standards](http://blogs.sqlsentry.com/aaronbertrand/subjectivity-naming-standards/) (by Aaron Bertrand) - [General Database Conventions](http://kejser.org/database-naming-conventions/general-database-conventions/) (by Thomas Kejser) @@ -389,5 +794,18 @@ GO - [The Basics of Good T-SQL Coding Style – Part 3: Querying and Manipulating Data](https://www.simple-talk.com/sql/t-sql-programming/basics-good-t-sql-coding-style-part-3-querying-manipulating-data/) - [SQL naming conventions](https://www.red-gate.com/simple-talk/blogs/sql-naming-conventions/) (by Phi Factor) - [SQL Server Compact Object Limitations](http://technet.microsoft.com/en-us/library/ms172451%28v=sql.110%29.aspx) + - [Dos and Don'ts of Dynamic SQL](https://www.sqlservercentral.com/articles/dos-and-donts-of-dynamic-sql) (by Thom Andrews) **[⬆ back to top](#table-of-contents)** + +[`TOP`]:https://docs.microsoft.com/it-it/sql/t-sql/queries/top-transact-sql +[`FETCH-OFFSET`]:https://docs.microsoft.com/en-us/sql/t-sql/queries/select-order-by-clause-transact-sql +[`sp_executesql`]:https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-executesql-transact-sql +[`EXEC`]:https://docs.microsoft.com/en-us/sql/t-sql/language-elements/execute-transact-sql +[10]:https://docs.microsoft.com/en-us/sql/t-sql/functions/cast-and-convert-transact-sql +[`INFORMATION_SCHEMA`]:https://docs.microsoft.com/en-us/sql/relational-databases/system-information-schema-views/system-information-schema-views-transact-sql +[11]:https://docs.microsoft.com/en-us/sql/t-sql/statements/create-procedure-transact-sql#best-practices +[explicit transactions]:https://docs.microsoft.com/en-us/sql/t-sql/language-elements/transactions-transact-sql +[autocommit]:https://docs.microsoft.com/en-us/sql/t-sql/statements/set-implicit-transactions-transact-sql +[`ANSI`]:http://standards.iso.org/ittf/PubliclyAvailableStandards/c053681_ISO_IEC_9075-1_2011.zip +[hints]:https://docs.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql diff --git a/SQL Server People.md b/SQL Server People.md index 9eee4ad0..0c9cdfa2 100644 --- a/SQL Server People.md +++ b/SQL Server People.md @@ -60,7 +60,7 @@ Most valuable professionals in Microsoft SQL Server Database world | Dmitry Pilugin | [Dmitry Blog] | RUS | Moscow | [@SomewereSomehow] | pilugin@inbox.ru | 4 | [Pilugin MVP] | | Buck Woody | [Buck Blog] | | NULL | [@buckwoodymsft] | NULL | 0 | - | | Steve Stedman | [Steve Stedman Blog] | USA | Austin | [@stedman] | NULL | 0 | - | -| Daniel Hutmacher | [Daniel Hutmacher Blog] | USA | Austin | [@dhmacher] | NULL | 0 | - | +| Daniel Hutmacher | [Daniel Hutmacher Blog] | SWE | Stockholm | [@dhmacher] | NULL | 0 | - | | Niko Neugebauer | [Niko Blog] | PRT | NULL | [@NikoNeugebauer] | niko@nikoport.com | 6 | [Neugebauer MVP] | | Mike Fal | [Mike Fal Blog] | USA | Denver | [@Mike_Fal] | NULL | 0 | - | | Robert L Davis | [Robert Blog] | USA | New York | [@SQLSoldier] | NULL | 3 | [Davis MVP] | @@ -89,7 +89,9 @@ Most valuable professionals in Microsoft SQL Server Database world | Joe Obbish | [Joe Obbish Blog] | | NULL | NULL | NULL | 0 | | | Stephen Bennett | [Stephen Bennett Blog] | ENG | London | NULL | NULL | 0 | | | Brian Davis | [Brian Davis Articles] | USA | NULL | [@brian78] | NULL | 0 | | - +| Raul Gonzalez | [Raul Gonzalez Blog] | | NULL | [@SQLDoubleG] | NULL | 0 | | +| Hugo Kornelis | [Hugo Kornelis Blog] | | NULL | [@Hugo_Kornelis] | NULL | 12 | [Kornelis MVP] | +| Drew Furgiuele | [Drew Furgiuele Blog] | USA | Dublin | [@pittfurg] | NULL | 1 | [Furgiuele MVP] | [Stephen Wynkoop Site]:https://www.sswug.org/ [Cody Konior Blog]:https://www.codykonior.com/categories/#sql @@ -103,7 +105,7 @@ Most valuable professionals in Microsoft SQL Server Database world [Andrea Allred Blog]:https://royalsql.com/ [Randolph West Blog]:https://rabryst.ca/ [Dave Ballantyne]:clearskysql.co.uk/ -[Lori Edwards Blog]:https://blogs.sentryone.com/author/LoriEdwards/ +[Lori Edwards Blog]:https://www.sentryone.com/blog/author/lori-edwards [Brent Ozar Blog]:http://www.brentozar.com/ [SQLBlog]:http://sqlblog.com/ [Ola Maintenance Solution]:https://ola.hallengren.com/ @@ -177,7 +179,10 @@ Most valuable professionals in Microsoft SQL Server Database world [2]:http://nedotter.com/contact/ [Joe Obbish Blog]:https://orderbyselectnull.com/ [Stephen Bennett Blog]:https://sqlnotesfromtheunderground.wordpress.com/ -[Brian Davis Articles]:https://blogs.sentryone.com/author/briandavis/ +[Brian Davis Articles]:https://www.sentryone.com/blog/author/brian-davis +[Raul Gonzalez Blog]:http://www.sqldoubleg.com/ +[Hugo Kornelis Blog]:https://sqlserverfast.com/ +[Drew Furgiuele Blog]:https://port1433.com/ [@swynk]:https://twitter.com/swynk [@codykonior]:https://twitter.com/codykonior @@ -256,6 +261,9 @@ Most valuable professionals in Microsoft SQL Server Database world [@SqlQuantumLeap]:https://twitter.com/SqlQuantumLeap [@NedOtter]:https://twitter.com/NedOtter [@brian78]:https://twitter.com/brian78 +[@SQLDoubleG]:https://twitter.com/SQLDoubleG +[@Hugo_Kornelis]:https://twitter.com/Hugo_Kornelis +[@pittfurg]:https://twitter.com/pittfurg [Swell MVP]:https://mvp.microsoft.com/en-us/PublicProfile/5002693?fullName=Rob%20%20Sewell [Walsh MVP]:https://mvp.microsoft.com/en-us/PublicProfile/4032569?fullName=Mike%20%20Walsh @@ -298,3 +306,5 @@ Most valuable professionals in Microsoft SQL Server Database world [Feasel MVP]:https://mvp.microsoft.com/en-us/PublicProfile/5001922?fullName=Kevin%20%20Feasel [Sheffield MVP]:https://mvp.microsoft.com/en-us/PublicProfile/5002585?fullName=Wayne%20%20Sheffield [Korotkevitch MVP]:https://mvp.microsoft.com/en-us/PublicProfile/4039717?fullName=Dmitri%20%20Korotkevitch +[Kornelis MVP]:https://mvp.microsoft.com/en-us/PublicProfile/33298?fullName=Hugo%20Kornelis +[Furgiuele MVP]:https://mvp.microsoft.com/en-us/PublicProfile/5003244?fullName=Drew%20Furgiuele diff --git a/SQL Server Trace Flag.md b/SQL Server Trace Flag.md index d9b33155..452038d8 100644 --- a/SQL Server Trace Flag.md +++ b/SQL Server Trace Flag.md @@ -1,5 +1,5 @@ # Microsoft SQL Server Trace Flags -Detailed list of all (documented and undocumented) Microsoft SQL Server trace flags (**597** trace flags). +Detailed list of all discovered (documented and undocumented) Microsoft SQL Server trace flags (**622** trace flags). ⚠ **REMEMBER: Be extremely careful with trace flags, test in your development environment first. And consult professionals first if you are the slightest uncertain about the effects of your changes.** @@ -9,136 +9,129 @@ For more information on the applicable version, see the Microsoft Support articl ⚠ **Trace flag behavior may not be supported in future releases of SQL Server.** +⚠ **[Azure SQL Database Managed Instance](https://docs.microsoft.com/en-us/azure/sql-database/sql-database-managed-instance) supports the following global Trace Flags: [460](#460), [2301](#2301), [2389](#2389), [2390](#2390), [2453](#2453), [2467](#2467), [7471](#7471), [8207](#8207), [9389](#9389), [10316](#10316) and [11024](#11024). +Session trace-flags are not yet supported in Managed Instance.** + +⚠ **[When specifying a trace flag with the `-T` option](https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/database-engine-service-startup-options#list-of-startup-options), use an uppercase "**T**" to pass the trace flag number. +A lowercase "**t**" is accepted by SQL Server, but this sets other internal trace flags that are required only by SQL Server support engineers. +(Parameters specified in the Control Panel startup window are not read.)** + Headers: - - [Unknown trace flags](#unknown-trace-flags) - [What are Microsoft SQL Server Trace Flags?](#what-are-microsoft-sql-server-trace-flags) - [How do I turn Trace Flags on and off?](#how-do-i-turn-trace-flags-on-and-off) - [How do I know what Trace Flags are turned on at the moment?](#how-do-i-know-what-trace-flags-are-turned-on-at-the-moment) - [What Are the Optimizer Rules?](#what-are-the-optimizer-rules) + - [Remarks](#remarks) + - [Unknown trace flags](#unknown-trace-flags) - [Recommended Trace Flags](#recommended-trace-flags) - [Trace flags list](#trace-flags-list) Source links: - - [A Topical Collection of SQL Server Flags](https://sqlcrossjoin.wordpress.com/2013/10/28/a-topical-collection-of-sql-server-flags/) (by Aaron Morelli) - - [Steinar Andersen great post](http://www.sqlservice.se/updated-microsoft-sql-server-trace-flag-list/) - - [Yusuf Anis trace flag table](http://www.sqlservercentral.com/articles/trace+flags/70131/) - - [Docs Trace Flags] - - [Albert van der Sel TF list](http://antapex.org/traceflags_sqlserver.txt) - - [TECHNET List Of SQL Server Trace Flags] - - [Amit Banerjee TF list](http://troubleshootingsql.com/2012/07/01/sql-server-2008-trace-flags/) - - [Paul Randal discussing TF Pro’s and Con’s](http://www.sqlskills.com/blogs/paul/the-pros-and-cons-of-trace-flags/) - - **When specifying a trace flag with the -T option, use an uppercase "T" to pass the trace flag number. -A lowercase "t" is accepted by SQL Server, but this sets other internal trace flags that are required only by SQL Server support engineers. -(Parameters specified in the Control Panel startup window are not read.)**: https://technet.microsoft.com/en-us/en-en/library/ms190737%28v=sql.120%29.aspx - - [Enabling SQL Server Trace Flag for a Poor Performing Query Using QUERYTRACEON](https://www.mssqltips.com/sqlservertip/3320/enabling-sql-server-trace-flag-for-a-poor-performing-query-using-querytraceon/) - - [Disabling SQL Server Optimizer Rules with QUERYRULEOFF](https://www.mssqltips.com/sqlservertip/4175/disabling-sql-server-optimizer-rules-with-queryruleoff/) - - [SQLskills SQL101: Trace Flags](https://www.sqlskills.com/blogs/erin/sqlskills-101-trace-flags/) - - [Derik Hammer - Trace Flag Recommendation](http://www.sqlhammer.com/deriks-favorite-trace-flags/) - - [Brent Ozar - Bad Idea Jeans: Finding Undocumented Trace Flags](https://rebrand.ly/brent-finding-undocumented-trace-flags) - - [Joe Obbish - A Method to Find Trace Flags](https://rebrand.ly/joe-finding-undocumented-trace-flags) +- [Docs Trace Flags] +- [A Topical Collection of SQL Server Flags](https://sqlcrossjoin.wordpress.com/2013/10/28/a-topical-collection-of-sql-server-flags/) (by Aaron Morelli) +- [Steinar Andersen great post](http://www.sqlservice.se/updated-microsoft-sql-server-trace-flag-list/) +- [Yusuf Anis trace flag table](http://www.sqlservercentral.com/articles/trace+flags/70131/) +- [Albert van der Sel TF list](http://antapex.org/traceflags_sqlserver.txt) +- [TECHNET List Of SQL Server Trace Flags] +- [Amit Banerjee TF list](http://troubleshootingsql.com/2012/07/01/sql-server-2008-trace-flags/) +- [Paul Randal discussing TF Pro’s and Con’s](http://www.sqlskills.com/blogs/paul/the-pros-and-cons-of-trace-flags/) +- [Enabling SQL Server Trace Flag for a Poor Performing Query Using QUERYTRACEON](https://www.mssqltips.com/sqlservertip/3320/enabling-sql-server-trace-flag-for-a-poor-performing-query-using-querytraceon/) +- [Disabling SQL Server Optimizer Rules with QUERYRULEOFF](https://www.mssqltips.com/sqlservertip/4175/disabling-sql-server-optimizer-rules-with-queryruleoff/) +- [SQLskills SQL101: Trace Flags](https://www.sqlskills.com/blogs/erin/sqlskills-101-trace-flags/) +- [Derik Hammer - Trace Flag Recommendation](http://www.sqlhammer.com/deriks-favorite-trace-flags/) +- [Brent Ozar - Bad Idea Jeans: Finding Undocumented Trace Flags](https://rebrand.ly/brent-finding-undocumented-trace-flags) +- [Joe Obbish - A Method to Find Trace Flags](https://rebrand.ly/joe-finding-undocumented-trace-flags) **Great thanks to:** - - Aaron Morelli ([b](https://sqlcrossjoin.wordpress.com) | [@sqlcrossjoin](https://twitter.com/sqlcrossjoin)) - - Steinar Andersen ([b](http://www.sqlservice.se/) | [@SQLSteinar](https://twitter.com/SQLSteinar)) - - Brent Ozar ([b](https://www.brentozar.com/) | [@BrentO](https://twitter.com/BrentO)) - - Yusuf Anis - - Lars Utterström - - Martin Höglund - - Håkan Winther - - Toine Rozemeijer - - Robert L Davis ([b](http://www.sqlsoldier.com/wp/) | [@SQLSoldier](https://twitter.com/SQLSoldier)) - - Lonny Niederstadt ([b](http://sql-sasquatch.blogspot.ru/) | [@sql_handle](https://twitter.com/@sql_handle)) - - Andrzej Kukuła - - Alexander Titenko ([gtihub](https://github.com/AlexTitenko)) - - Albert van der Sel - - Amit Banerjee - - Erin Stellato ([b](http://www.sqlskills.com/blogs/erin/) | [@erinstellato](https://twitter.com/erinstellato)) - - Darik Hammer ([b](http://www.sqlhammer.com/) | [@drayhammer](https://twitter.com/drayhammer)) - - Erik Darling ([b](https://www.brentozar.com/archive/author/erik-darling/)) - - Joe Obbish ([b](https://orderbyselectnull.com/)) - - Glenn Berry ([b](https://sqlserverperformance.wordpress.com/) | [t](https://twitter.com/GlennAlanBerry)) - - Pedro Lopes ([b](https://social.msdn.microsoft.com/profile/Pedro+Lopes+%28PL%29) | [t](https://twitter.com/sqlpto)) - - Paul White ([b](http://sqlblog.com/blogs/paul_white/) | [t](https://twitter.com/SQL_Kiwi)) - - Alexey Nagorskiy ([github](https://github.com/fenixfx)) - - Niko Neugebauer ([b](http://www.nikoport.com/) | [t](https://twitter.com/@NikoNeugebauer)) - - Solomon Rutzky ([b](https://SqlQuantumLeap.com/) | [t](https://twitter.com/@SqlQuantumLeap)) - - Jason Brimhall ([b](http://jasonbrimhall.info/) | [t](https://twitter.com/sqlrnnr)) - - Victor Isakov ([b](https://victorisakov.wordpress.com/)) - - Scott Caldwell ([b](https://blog.rdx.com/) | [t](https://twitter.com/sqldroid)) - - Mike Fal ([b](http://www.mikefal.net) | [t](https://twitter.com/Mike_Fal)) - - Prince Kumar Rastogi ([b](http://www.sqlservergeeks.com/) | [t](https://twitter.com/princerastogi2)) - - Kendra Little ([b](http://www.littlekendra.com/) | [t](https://twitter.com/Kendra_Little)) - - Slava Oks ([t](https://twitter.com/slava_oks/)) - - John Sterrett ([b](https://www.procuresql.com/)) - - Pavel Málek ([t](https://twitter.com/malekpav)) - - Andrew Pruski ([b](https://dbafromthecold.com/) | [t](https://twitter.com/dbafromthecold)) - - - -## Unknown trace flags -List of Unknown trace flags enabled on default Azure SQL Server instances, see more details here: [Azure SQL DB Managed Instances: Trace Flags, Ahoy!](https://www.brentozar.com/archive/2018/03/azure-sql-db-managed-instances-trace-flags-ahoy/) -If you know behavior some of them please open an issue or contact me (taranov.pro). - - - [ ] 2591 - - [ ] 3447 (but 3448 is there, which is supposed to help fix an issue with hung Mirrored databases) - - [ ] 3978 - - [ ] 4141 - - [ ] 5521 - - [ ] 7838 - - [ ] 8037 - - [ ] 8054 - - [ ] 8057 - - [ ] 8063 - - [ ] 8065 - - [ ] 9041 - - [ ] 9537 - - [ ] 9570 - - [ ] 9883 - - [ ] 9905 - - [ ] 9934 - - [ ] 9940 - - [ ] 9941 +- Aaron Morelli ([b](https://sqlcrossjoin.wordpress.com) | [@sqlcrossjoin](https://twitter.com/sqlcrossjoin)) +- Steinar Andersen ([b](http://www.sqlservice.se/) | [@SQLSteinar](https://twitter.com/SQLSteinar)) +- Brent Ozar ([b](https://www.brentozar.com/)) +- Yusuf Anis +- Lars Utterström +- Martin Höglund +- Håkan Winther +- Toine Rozemeijer +- Robert L Davis ([b](http://www.sqlsoldier.com/wp/) | [@SQLSoldier](https://twitter.com/SQLSoldier)) +- Lonny Niederstadt ([b](http://sql-sasquatch.blogspot.ru/) | [@sql_handle](https://twitter.com/@sql_handle)) +- Andrzej Kukuła +- Alexander Titenko ([gtihub](https://github.com/AlexTitenko)) +- Albert van der Sel +- Amit Banerjee +- Erin Stellato ([b](http://www.sqlskills.com/blogs/erin/) | [@erinstellato](https://twitter.com/erinstellato)) +- Darik Hammer ([b](http://www.sqlhammer.com/) | [@drayhammer](https://twitter.com/drayhammer)) +- Erik Darling ([b](https://www.brentozar.com/archive/author/erik-darling/)) +- Joe Obbish ([b](https://orderbyselectnull.com/)) +- Glenn Berry ([b](https://sqlserverperformance.wordpress.com/) | [t](https://twitter.com/GlennAlanBerry)) +- Pedro Lopes ([b](https://social.msdn.microsoft.com/profile/Pedro+Lopes+%28PL%29) | [t](https://twitter.com/sqlpto)) +- Paul White ([b](https://www.sql.kiwi/) | [t](https://twitter.com/SQL_Kiwi)) +- Alexey Nagorskiy ([github](https://github.com/fenixfx)) +- Niko Neugebauer ([b](http://www.nikoport.com/) | [t](https://twitter.com/@NikoNeugebauer)) +- Solomon Rutzky ([b](https://SqlQuantumLeap.com/) | [t](https://twitter.com/@SqlQuantumLeap)) +- Jason Brimhall ([b](http://jasonbrimhall.info/) | [t](https://twitter.com/sqlrnnr)) +- Victor Isakov ([b](https://victorisakov.wordpress.com/)) +- Scott Caldwell ([b](https://blog.rdx.com/) | [t](https://twitter.com/sqldroid)) +- Mike Fal ([b](http://www.mikefal.net) | [t](https://twitter.com/Mike_Fal)) +- Prince Kumar Rastogi ([b](https://www.sqlservergeeks.com/author/princerastogi/) | [t](https://twitter.com/princerastogi2)) +- Kendra Little ([b](http://www.littlekendra.com/) | [t](https://twitter.com/Kendra_Little)) +- Slava Oks ([t](https://twitter.com/slava_oks/)) +- John Sterrett ([b](https://www.procuresql.com/)) +- Pavel Málek ([t](https://twitter.com/malekpav)) +- Andrew Pruski ([b](https://dbafromthecold.com/) | [t](https://twitter.com/dbafromthecold)) +- Josh Darnell ([b](https://joshthecoder.com/) | [t](https://twitter.com/josh_the_coder)) +- Andrzej Kukula +- Aaron Bertrand ([b](https://sqlperformance.com/author/abertrand) | [t](https://twitter.com/AaronBertrand)) +- Wilfred van Dijk +- Tracy Boggiano ([b](http://databasesuperhero.com) | [t](https://twitter.com/TracyBoggiano)) +- Danilo Zocco (https://github.com/CrazySwimmer) +- Michael Abair (https://github.com/abair34) +- Mikulas Mraz (https://github.com/Prohiller) ## What are Microsoft SQL Server Trace Flags? Trace Flags are settings that in some way or another alters the behavior of various SQL Server functions: [Docs Trace Flags] +Trace flags are used to set specific server characteristics or to alter a particular behavior. For example, trace flag [3226](#3226) is a commonly used startup trace flag which suppresses successful backup messages in the error log. +Trace flags are frequently used to diagnose performance issues or to debug stored procedures or complex computer systems, but they may also be recommended by Microsoft Support to address behavior that is negatively impacting a specific workload. +All documented trace flags and those recommended by Microsoft Support are fully supported in a production environment when used as directed. +Note that trace flags in this list may have additional considerations regarding their particular usage, so it is advisable to carefully review all the recommendations given here and/or by your support engineer. +Also, as with any configuration change in SQL Server, it is always best to thoroughly test the flag in a non-production environment before deploying. + ## How do I turn Trace Flags on and off? - You can use the [DBCC TRACEON] and [DBCC TRACEOFF] commands - You can use the [-T option](https://docs.microsoft.com/sql/database-engine/configure-windows/database-engine-service-startup-options "Official Microsoft Docs Database Engine Service Startup Options Article") in the startup configuration for the SQL Server Service. **When specifying a trace flag with the `-T` option, use an uppercase `"T"` to pass the trace flag number. A lowercase `"t"` is accepted by SQL Server, but this sets other internal trace flags that are required only by SQL Server support engineers. (Parameters specified in the Control Panel startup window are not read.)** - - You can also use the hint [QUERYTRACEON](https://support.microsoft.com/help/2801413 "Official QUERYTRACEON KB Article") in your queries: **<querytraceon_hint ::= {QUERYTRACEON trace_flag_number}>** + - You can also use the hint [QUERYTRACEON](https://support.microsoft.com/kb/2801413 "Official QUERYTRACEON KB Article") in your queries: **<querytraceon_hint ::= {QUERYTRACEON trace_flag_number}>** ## How do I know what Trace Flags are turned on at the moment? -From SSMS 16 every sql plan content information about trace flags in section `Trace flags` +From SSMS 16 every sql plan content information about trace flags in section `Trace flags`. -You can use the [DBCC TRACESTATUS](https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-tracestatus-transact-sql "Microsoft Docs DBCC TRACESTATUS") command +You can use the [DBCC TRACESTATUS] command. The following example displays the status of all trace flags that are currently enabled globally: -```sql +```tsql DBCC TRACESTATUS(-1); GO ``` The following example displays the status of trace flags 2528 and 3205: -```sql +```tsql DBCC TRACESTATUS (2528, 3205); GO ``` The following example displays whether trace flag 3205 is enabled globally: -```sql +```tsql DBCC TRACESTATUS (3205, -1); GO ``` The following example lists all the trace flags that are enabled for the current session: -```sql +```tsql DBCC TRACESTATUS (); GO ``` @@ -154,7 +147,7 @@ When we write a simple select statement with an inner join, the query optimizer To obtain the list of rules of your version of SQL Server we must use the undocumented DBCC commands SHOWONRULES and SHOWOFFRULES. Those commands display the enabled and disabled rules for the whole instance respectively. As you may guess, the number of rules varies amongst versions. -```sql +```tsql USE master; GO @@ -178,21 +171,76 @@ GO | LASJNtoSM | Left Anti Semi Join to Sort Merge | + +## Remarks +There are three scopes at which trace flags can work: query, session, and global. +- Query trace flags are active for the context of a specific query +- Session trace flags are active for a connection and are visible only to that connection +- Global trace flags are set at the server level and are visible to every connection on the server. + +Some flags can only be enabled as global, and some can be enabled at either global or session scope. + +⚠ **Some `USE HINT` hints may conflict with trace flags enabled at the global or session level, or database scoped configuration settings. In this case, the query level hint (`USE HINT`) always takes precedence. If a `USE HINT` conflicts with another query hint, or a trace flag enabled at the query level (such as by [QUERYTRACEON]), SQL Server will generate an error when trying to execute the query.** + +The following rules apply: +- A global trace flag must be enabled globally. Otherwise, the trace flag has no effect. We recommend that you enable global trace flags at startup, by using the `-T` command line option. This ensures the trace flag remains active after a server restart. Restart SQL Server for the trace flag to take effect. +- If a trace flag has either global, session or query scope, it can be enabled with the appropriate scope. A trace flag that is enabled at the session level never affects another session, and the effect of the trace flag is lost when the SPID that opened the session logs out. + +Trace flags are set `ON` or `OFF` by using either of the following methods: +- Using the [DBCC TRACEON] and [DBCC TRACEOFF] commands. +For example, to enable the 2528 trace flag globally, use `DBCC TRACEON` with the `-1` argument: `DBCC TRACEON (2528, -1)`. The effect of enabling a global trace flag with `DBCC TRACEON` is lost on server restart. To turn off a global trace flag, use `DBCC TRACEOFF` with the `-1` argument. +- Using the `-T` startup option to specify that the trace flag be set on during startup. +The `-T` startup option enables a trace flag globally. You cannot enable a session-level trace flag by using a startup option. This ensures the trace flag remains active after a server restart. For more information about startup options, see [Database Engine Service Startup Options](https://github.com/MicrosoftDocs/sql-docs/blob/live/docs/database-engine/configure-windows/database-engine-service-startup-options.md). +- At the query level, by using the [QUERYTRACEON][KB2801413] query hint. The [QUERYTRACEON][KB2801413] option is only supported for Query Optimizer trace flags documented in the [Docs Trace Flags]. However, this option will not return any error or warning if an unsupported trace flag number is used. If the specified trace flag is not one that affects a query execution plan, the option will be silently ignored. +More than one trace flag can be specified in the OPTION clause if `QUERYTRACEON` `trace_flag_number` is duplicated with different trace flag numbers. +Executing a query with the [QUERYTRACEON][KB2801413] option requires membership in the sysadmin fixed server role. +The [QUERYTRACEON][KB2801413] option can be used in [Plan Guides](https://docs.microsoft.com/en-us/sql/relational-databases/performance/plan-guides). + +Use the [DBCC TRACESTATUS] command to determine which trace flags are currently active. + + + +## Unknown trace flags +List of Unknown trace flags enabled on default Azure SQL Server instances, see more details here: [Azure SQL DB Managed Instances: Trace Flags, Ahoy!](https://www.brentozar.com/archive/2018/03/azure-sql-db-managed-instances-trace-flags-ahoy/) +If you know behavior some of them please open an issue or contact me (taranov.pro). + + - [ ] 2591 + - [ ] 3447 (but 3448 is there, which is supposed to help fix an issue with hung Mirrored databases) + - [ ] 3978 + - [ ] 4141 + - [ ] 5521 + - [ ] 7838 + - [ ] 8037 + - [ ] 8054 + - [ ] 8057 + - [ ] 8063 + - [ ] 8065 + - [ ] 9041 + - [ ] 9537 + - [ ] 9570 + - [ ] 9883 + - [ ] 9905 + - [ ] 9934 + - [ ] 9940 + - [ ] 9941 + + ## Recommended Trace Flags - [Trace Flag 272](#272) (for SQL Server 2012) - - [Trace Flag 460](#460) (for SQL Server 2019, >= 2017 CU14, >= 2016 SP2 CU6) + - [Trace Flag 460](#460) (2017 for >= CU14, 2016 for >= SP2 CU6) - [Trace Flag 1118](#1118) (for versions < SQL Server 2016) - [Trace Flag 3023](#3023) (for versions < SQL Server 2014) - [Trace Flag 3226](#3226) (for all versions) - [Trace Flag 3427](#3427) (for SQL Server 2016) - [Trace Flag 3449](#3449) (for versions SQL Server 2012 SP3 CU3 or later or SQL Server 2014 SP1 CU7 or later) - [Trace Flag 6534](#6534) (for versions SQL Server 2012, 2014, 2016) (if use [spatial data types](https://docs.microsoft.com/sql/relational-databases/spatial/spatial-data-sql-server)) - - [Trace Flag 7412](#7412) (for versions >= SQL Server 2016) + - [Trace Flag 7412](#7412) (for versions >= SQL Server 2016 and < SQL Server 2019) - [Trace Flag 7745](#7745) (for versions >= SQL Server 2016 and Query Store enabled) - - [Trace Flag 7752](#7752) (for versions >= SQL Server 2016 and Query Store enabled) + - [Trace Flag 7752](#7752) (for versions >= SQL Server 2016 and < 2019 and Query Store enabled) - [Trace Flag 7806](#7806) (for SQL Server Express Edition) + - [Trace Flag 8099](#8099) (for versions 2019 CU2 and 2019 CU3 only) **Trace Flag 272** prevents identity gap after restarting SQL Server 2012 instance, critical for columns with identity and `tinyint` and `smallint` data types. (Demo for repeating this issue [here](https://github.com/ktaranov/sqlserver-kit/Errors/Identity_gap_sql_server_2012.sql)) @@ -239,10 +287,12 @@ Use this trace flag if SQL Server is experiencing high number of [QDS_LOADDB](ht **Trace Flag: 7806** enables a dedicated administrator connection ([DAC]) on SQL Server Express. +**Trace Flag: 8099** enables a spinlock contention fix for high-end systems running SQL Server 2019 (15.x) serving many concurrent users. Starting with SQL 2019 CU 4 this fix is enabled by default. + ## Trace Flags List -Summary: **597 trace flags** +Summary: **622 trace flags** @@ -254,16 +304,20 @@ Link: http://www.sql-server-performance.com/2002/traceflags/ #### Trace Flag: 101 -Function: Verbose Merge Replication logging output for troubleshooting Merger repl performance
-Link: https://support.microsoft.com/help/2892633
-Scope: global only +Function: Increases the verboseness of the merge replication agent logging.
+**IMPORTANT**: Trace flag 101 can only be enabled for the [Replication Merge Agent] using the `-T` option when executing `replmerg.exe` from the command prompt.
+**WARNING**: Trace flag 101 is not meant to be enabled continuously in a production environment, but only for time-limited troubleshooting purposes.
+Link: https://support.microsoft.com/kb/2892633
+Scope: Replication Merge Agent only #### Trace Flag: 102 -Function: Verbose Merge Replication logging to msmerge\_history table for troubleshooting Merger repl performance
-Link: https://support.microsoft.com/help/2892633
-Scope: global only +Function: Increases the verboseness of the merge replication agent logging and directs it to the `..msmerge_history` table.
+**IMPORTANT**: Trace flag 102 can only be enabled for the pReplication Merge Agent[ using the `-T` option when executing `replmerg.exe` from the command prompt. +**WARNING**: Trace flag 102 is not meant to be enabled continuously in a production environment, but only for time-limited troubleshooting purposes. +Link: https://support.microsoft.com/kb/2892633
+Scope: Replication Merge Agent only @@ -311,7 +365,7 @@ Function: Forces correct conversion semantics in the scope of DBCC check command **Note: This trace flag applies to SQL Server 2016 RTM CU3, SQL Server 2016 SP1 and higher builds.**
**WARNING: Trace flag 139 is not meant to be enabled continuously in a production environment, and should be used for the sole purpose of performing database validation checks described in this Microsoft Support article. It should be immediately disabled after validation checks are completed.**
-Link: https://support.microsoft.com/help/4010261
+Link: https://support.microsoft.com/kb/4010261
Link: [Docs Trace Flags]
Scope: global only @@ -344,14 +398,14 @@ Scope: ? Function: Bugfix in ORDER BY. This hotfix introduces trace flag 168. After you apply this hotfix, you must enable trace flag 168. Trace flag 168 must be set before the database is migrated to SQL Server 2005. If trace flag 168 is set after the database is migrated, the query result will remain unsorted.
-Link: https://support.microsoft.com/help/926292 +Link: https://support.microsoft.com/kb/926292 #### Trace Flag: 174 Function: Increases the SQL Server Database Engine plan cache bucket count from 40,009 to 160,001 on 64-bit systems.
**Note: Please ensure that you thoroughly test this option, before rolling it into a production environment.**
-Link: https://support.microsoft.com/help/3026083/
+Link: https://support.microsoft.com/kb/3026083/
Link: [Docs Trace Flags]
Link: [SQL Server Plan Cache Limits]
Link: [KB2964518]
@@ -361,21 +415,23 @@ Scope: global only #### Trace Flag: 176 Function: Enables a fix to address errors when rebuilding partitions online for tables that contain a computed partitioning column.
-Link: https://support.microsoft.com/help/3213683/fix-unable-to-rebuild-the-partition-online-for-a-table-that-contains-a
+Link: https://support.microsoft.com/kb/3213683/
+Link: https://support.microsoft.com/kb/4541096/
Link: [Docs Trace Flags]
Scope: global or session #### Trace Flag: 204 -Function: SQL 6.5 – Backward compatibility switch that enables non-ansi standard behavior. E.g. previously SQL server ignored trailing blanks in the like statement and allowed queries that contained aggregated functions to have items in the group by clause that were not in the select list.
-Link: https://support.microsoft.com/help/153096/fix-sql-server-6.5-service-pack-1-fixlist +Function: SQL 6.5 – Backward compatibility switch that enables non-ansi standard behavior. +E.g. previously SQL server ignored trailing blanks in the like statement and allowed queries that contained aggregated functions to have items in the group by clause that were not in the select list.
+Link: [KB153096] #### Trace Flag: 205 Function: Reports to the error log when a statistics-dependent stored procedure is being recompiled as a result of auto-update statistics.
-Link: https://support.microsoft.com/help/195565
+Link: https://support.microsoft.com/kb/195565
Link: [Docs Trace Flags]
Scope: global only @@ -397,7 +453,7 @@ Link: None #### Trace Flag: 210 Function: SQL 9 – Error when you run a query against a view: "An error occurred while executing batch"
-Link: https://support.microsoft.com/help/945892 +Link: https://support.microsoft.com/kb/945892 @@ -546,7 +602,7 @@ Link: None #### Trace Flag: 323 Function: Outputs detailed info about updates
Link: [SQL Server 6.5: Some Useful Trace Flag]
-Link: https://support.microsoft.com/help/153096/fix-sql-server-6.5-service-pack-1-fixlist +Link: [KB153096] @@ -593,20 +649,23 @@ Link: None #### Trace Flag: 460 -**Note: Don’t leave this trace flag enabled on global scope for SQL Server 2017 CU12 and CU13. +Function: Replace error message ID [8152] with message ID [2628] (`String or binary data would be truncated. The statement has been terminated.`). +Description for [2628] message has useful information - which column had the truncation and which row. +Starting with SQL Server 2019 (15.x) CTP 2.4, to accomplish this at the database level, see the `VERBOSE_TRUNCATION_WARNINGS` option in [ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL)].
+**Note: This trace flag applies to SQL Server 2017 (14.x) CU12 and higher builds.**
+**Note: Starting with database compatibility level 150, message ID [2628] is the default and this trace flag has no effect.**
+**Note: Don’t leave this trace flag enabled on global scope for SQL Server 2017 CU12 and CU13.**
There’s at least one [bug](https://feedback.azure.com/forums/908035-sql-server/suggestions/36311467-traceflag-460-causing-truncation-errors-on-code-pa) on SQL Server 2017 CU13: table variables will throw errors saying their contents are being truncated even when no data is going into them.**
-Function: Replace error message [8152] with [2628] (`String or binary data would be truncated. The statement has been terminated.`). -Description for [2628] mesage has useful information - which column had the truncation and which row.
Link: [Docs Trace Flags]
Link: https://www.procuresql.com/blog/2018/09/26/string-or-binary-data-get-truncated/
Link: https://feedback.azure.com/forums/908035-sql-server/suggestions/32908417-binary-or-string-data-would-be-truncated-error
Link: https://blogs.msdn.microsoft.com/sql_server_team/string-or-binary-data-would-be-truncated-replacing-the-infamous-error-8152/
-Link: https://support.microsoft.com/help/4468101
+Link: https://support.microsoft.com/kb/4468101
Link: https://www.brentozar.com/archive/2019/03/how-to-fix-the-error-string-or-binary-data-would-be-truncated/
Link: https://feedback.azure.com/forums/908035-sql-server/suggestions/36311467-traceflag-460-causing-truncation-errors-on-code-pa
-Link: https://support.microsoft.com/help/4490142
+Link: https://support.microsoft.com/kb/4490142
Scope: global or session
-SQL Server Version: 2019, >= 2017 CU12, >= 2016 SP2 CU6
+SQL Server Version: >= 2017 CU12, >= 2016 SP2 CU6
Demo: https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Trace_Flag/Trace_Flag_460.sql @@ -619,7 +678,11 @@ Link: None #### Trace Flag: 610 -Function: Controls minimally logged inserts into indexed tables.
+Function: Controls minimally logged inserts into indexed tables. +This trace flag is not required starting SQL Server 2016 as minimal logging is turned on by default for indexed tables. +In SQL Server 2016, when the bulk load operation causes a new page to be allocated, all of the rows sequentially filling that new page are minimally logged if all the other pre-requisites for minimal logging are met. +Rows inserted into existing pages (no new page allocation) to maintain index order are still fully logged, as are rows that are moved as a result of page splits during the load. +It is also important to have `ALLOW_PAGE_LOCKS` turned `ON` for indexes (which is `ON` by default) for minimal logging operation to work as page locks are acquired during allocation and thereby only page or extent allocations are logged.
Link: http://msdn.microsoft.com/en-us/library/dd425070%28v=SQL.100%29.aspx
Link: https://www.pythian.com/blog/minimally-logged-operations-data-loads/
Link: https://msdn.microsoft.com/library/dd425070.aspx
@@ -657,21 +720,24 @@ You can control the timing of columnstore compression manually, by disabling the Link: [Niko Neugebauer Columnstore Indexes – part 35]
Link: [Docs Trace Flags]
Link: http://www.sqlservergeeks.com/trace-flag-634-disable-background-columnstore-compression/
+Link: [SQL Server 2019 Aggressive Clustered Columnstore Cleanup]
Scope: global only #### Trace Flag: 646 +**Undocumented trace flag**
Function: Serves for getting detailed information on which Columnstore were eliminated by the Query Optimiser right into the error log.
Link: [Niko Neugebauer Columnstore Indexes – part 35]
-Link: http://www.sqlskills.com/blogs/joe/exploring-columnstore-index-metadata-segment-distribution-and-elimination-behaviors +Link: http://www.sqlskills.com/blogs/joe/exploring-columnstore-index-metadata-segment-distribution-and-elimination-behaviors
+Scope: global or session #### Trace Flag: 647 Function: Avoids a new-in-SQL 2012 data check (done when adding a column to a table) that can cause ALTER TABLE... ADD operations to take a very long time. The KB has a useful query for determining the row size for a table.
-Link: https://support.microsoft.com/help/2986423/fix-it-takes-a-long-time-to-add-new-columns-to-a-table-when-the-row-size-exceeds-the-maximum-allowed-size
+Link: https://support.microsoft.com/kb/2986423
@@ -681,6 +747,7 @@ If you turn on trace flag 652, SQL Server no longer brings database pages into t If you turn on trace flag 652, queries that benefit from the page pre-fetching feature exhibit low performance.
Link: [KB920093]
Link: [Docs Trace Flags]
+Link: https://www.sqlservergeeks.com/sql-server-trace-flag-652/
Scope: global or session @@ -700,6 +767,8 @@ This behavior affects space consumption and the performance of scan operations. Link: [KB920093]
Link: [Docs Trace Flags]
Link: [Let’s talk about trace flags]
+Link: https://www.sqlservergeeks.com/sql-server-trace-flag-661/
+Link: [SQL Server 2019 Aggressive Clustered Columnstore Cleanup]
Scope: global or session @@ -714,7 +783,7 @@ Link: http://blogs.msdn.com/b/sqljourney/archive/2012/07/28/an-in-depth-look-at- #### Trace Flag: 669 Function: “...prevents user queries from queuing requests to the ghost cleanup process”. This flag is a workaround for stack dumps occurring right after SQL Server startup, where user queries (that queue pages for ghost cleanup) were running so quickly after SQL startup that they were queuing pages before the ghost cleanup process had actually initialized.
-Link: https://support.microsoft.com/help/3027860/error-17066-or-17310-during-sql-server-startup +Link: https://support.microsoft.com/kb/3027860 @@ -731,7 +800,8 @@ Starting SQL Server 2016, fast inserts is enabled by default leveraging minimal With fast inserts, each bulk load batch acquires new extent(s) bypassing the allocation lookup for existing extent with available free space to optimize insert performance. With fast inserts, bulk loads with small batch sizes can lead to increased unused space consumed by objects hence it is recommended to use large batch size for each batch to fill the extent completely. If increasing batch size is not feasible, this trace flag can help reduce unused space reserved at the expense of performance.
-**Note: This trace flag applies to SQL Server 2016 RTM and higher builds.** +**Note: This trace flag applies to SQL Server 2016 (13.x) RTM and higher builds.**
+Link: [Docs Trace Flags]
Link: https://blogs.msdn.microsoft.com/sql_server_team/sql-server-2016-minimal-logging-and-impact-of-the-batchsize-in-bulk-load-operations/
Scope: global or session @@ -761,7 +831,7 @@ Link: [Controlling SQL Server memory dumps] Function: Enables table lock for bulk load operations into a heap with no non-clustered indexes. When this trace flag is enabled, bulk load operations acquire bulk update (BU) locks when bulk copying data into a table. Bulk update (BU) locks allow multiple threads to bulk load data concurrently into the same table, while preventing other processes that are not bulk loading data from accessing the table. -The behavior is similar to when the user explicitly specifies TABLOCK hint while performing bulk load, or when the sp_tableoption table lock on bulk load is enabled for a given table. +The behavior is similar to when the user explicitly specifies `TABLOCK` hint while performing bulk load, or when the `sp_tableoption` table lock on bulk load is enabled for a given table. However, when this trace flag is enabled, this behavior becomes default without any query or database changes.
Link: [Docs Trace Flags]
Scope: global or session @@ -796,13 +866,15 @@ Link: https://blogs.msdn.microsoft.com/psssql/2012/11/12/how-can-reference-count #### Trace Flag: 818 -Function: Turn on ringbuffer to store info about IO write operations. -Used to troubleshoot IO problems
-Link: https://support.microsoft.com/help/826433/
+Function: Enables additional I/O diagnostics to check for Lost Write or Stale Read conditions during file I/O operations. +Trace flag 818 enables an in-memory ring buffer that is used for tracking the last 2,048 successful write operations that are performed by SQL Server, not including sort and workfile I/Os. +When errors such as Error 605, 823, or 3448 occur, the incoming buffer's log sequence number (LSN) value is compared to the recent write list. +If the LSN that is retrieved is older than the one specified during the write operation, a new error message is logged in the SQL Server Errorlog.
+Link: https://support.microsoft.com/kb/826433
Link: https://technet.microsoft.com/en-us/library/cc966500.aspx
-Link: https://support.microsoft.com/help/828339/
+Link: https://support.microsoft.com/kb/828339
Link: [Important Trace Flags That Every DBA Should Know]
-Scope: ? +Scope: global only @@ -822,14 +894,14 @@ Link: None #### Trace Flag: 828 Function: SQL 8 - When enabled checkpoint ignores the recovery interval target and keeps steady I/O otherwise it uses recovery interval setting as a target for the length of time that checkpoint will take
-Link: https://support.microsoft.com/help/906121 +Link: https://support.microsoft.com/kb/906121 Link: https://blogs.msdn.microsoft.com/psssql/2008/04/11/how-it-works-sql-server-checkpoint-flushcache-outstanding-io-target/ #### Trace Flag: 830 Function: SQL 9 – Disable the reporting of CPU Drift errors in the SQL Server errorlog like SQL Server has encountered 2 occurrence(s) of I/O requests taking longer than 15 seconds to complete
-Link: https://support.microsoft.com/help/897284
+Link: https://support.microsoft.com/kb/897284
Link: https://technet.microsoft.com/en-us/library/aa175396(v=SQL.80).aspx @@ -840,6 +912,20 @@ Function: Protect unchanged pages in the buffer pool to catch memory corruptions Link: None + +#### Trace Flag: 833 +**Undocumented trace flag**
+Function: Disable [superlatches](https://www.sqlshack.com/all-about-latches-in-sql-server/). +Starting with SQL Server 2005, superlatches (also called sublatches) were introduced to improve SQL Server efficiency in highly concurrent OLTP workloads for a certain pattern of usage (i.e. very high shared read only access to the page (SH) while write access is very low or not exists). +**Superlatches are used by SQL Server only in NUMA systems with 32+ logical processors.** +A Superlatch will behave as a single latch with sublatch structures and there can be one sublatch per partition per logical CPU core. +So when a superlatch is created, the CPU worker thread will just have to acquire the shared (SH) sublatch that is assigned to the scheduler. +This ensures that a shared (SH) superlatch uses less resources while at the same time access to pages is more efficient comparing to non-partitioned shared latches. +The reason for this is that the superlatch do not require any synchronization of the global state as it will access only the local NUMA memory.
+Link: https://www.sqlservercentral.com/forums/topic/sql-server-trace-flags-complete-list/page/3/#post-3679021
+Scope: global + + #### Trace Flag: 834 Function: Uses Microsoft Windows large-page allocations for the buffer pool. @@ -847,12 +933,14 @@ Trace flag 834 causes SQL Server to use Microsoft Windows large-page allocations The page size varies depending on the hardware platform, but the page size may be from 2 MB to 16 MB. Large pages are allocated at startup and are kept throughout the lifetime of the process. Trace flag 834 improves performance by increasing the efficiency of the translation look-aside buffer (TLB) in the CPU.
-**Note: If you are using the Columnstore Index feature of SQL Server 2012 to SQL Server 2016, we do not recommend turning on trace flag 834.**
+**Note: If you are using the Columnstore Index feature of SQL Server 2012 to SQL Server 2016, we do not recommend turning on trace flag 834. +If using SQL Server 2019 (15.x) and columnstore, see trace flag [876](#876) instead.**
Link: [KB920093]
-Link: https://support.microsoft.com/help/3210239
+Link: https://support.microsoft.com/kb/3210239
Link: [Docs Trace Flags]
Link: [Let’s talk about trace flags]
Link: [KB2964518]
+Link: https://www.sqlservergeeks.com/sql-server-trace-flag-834/
Scope: global only @@ -877,13 +965,15 @@ Scope: global only #### Trace Flag: 839 Function: (Apparently) forces SQL Server to treate all NUMA memory as “flat”, as if it was SMP.
-Link: https://blogs.msdn.microsoft.com/psssql/2010/04/02/how-it-works-soft-numa-io-completion-thread-lazy-writer-workers-and-memory-nodes +Link: https://blogs.msdn.microsoft.com/psssql/2010/04/02/how-it-works-soft-numa-io-completion-thread-lazy-writer-workers-and-memory-nodes
+Scope: global only #### Trace Flag: 840 Function: SQL 9 – When trace turned on, SQL Server can perform larger I/O extent reads to populate the buffer pool when SQL Server starts this populates the buffer pool faster. Additionally, the larger I/O extent reads improve the initial query compilation and the response time when SQL Server starts.
-Link: https://blogs.msdn.microsoft.com/ialonso/2011/12/09/the-read-ahead-that-doesnt-count-as-read-ahead +Link: https://blogs.msdn.microsoft.com/ialonso/2011/12/09/the-read-ahead-that-doesnt-count-as-read-ahead
+Scope: global only @@ -895,9 +985,12 @@ Link: None #### Trace Flag: 845 -Function: Enable Lock pages in Memory on Standard Edition
-Link: https://support.microsoft.com/help/970070
-Link: https://support.microsoft.com/help/2708594/fix-locked-page-allocations-are-enabled-without-any-warning-after-you-upgrade-to-sql-server-2012 +**Undocumented trace flag**
+Function: Enable Lock pages in Memory on Standard Edition for SQL Server 2005 and 2008.
+Link: https://support.microsoft.com/kb/970070
+Link: https://support.microsoft.com/kb/2708594
+Link: https://www.sqlservergeeks.com/sql-server-trace-flag-845/
+Scope: global only @@ -925,11 +1018,15 @@ Scope: ? #### Trace Flag: 876 -**Undocumented trace flag**
-Function: Turns 8k page allocations for Column Store segments into 2MB instead.
+Function: Uses large-page allocations for columnstore. +Turns 8k page allocations for Column Store segments into 2MB instead.
+**Note: Unlike trace flag [834](#834), using trace flag 876 does not pre-allocate SQLOS memory at instance startup, and unused memory can be released.**
+**Note: This trace flag applies to SQL Server 2019 (15.x) and higher builds.**
+**Note: Please ensure that you thoroughly test this option, before rolling it into a production environment.**
+Link: [Docs Trace Flags]
Link: https://twitter.com/slava_oks/status/1044257034361757696
Link: https://github.com/ktaranov/sqlserver-kit/issues/151
-Scope: ? +Scope: global only @@ -946,7 +1043,7 @@ If you encounter an error during script upgrade mode, it is recommended to conta **Warning: This trace flag is meant for troubleshooting of failed updates during script upgrade mode, and it is not supported to run it continuously in a production environment. Database upgrade scripts needs to execute successfully for a complete install of Cumulative Updates and Service Packs. Not doing so can cause unexpected issues with your SQL Server instance.**
-Link: https://support.microsoft.com/help/2163980
+Link: https://support.microsoft.com/kb/2163980
Link: [Docs Trace Flags]
Link: https://blogs.msdn.microsoft.com/luti/2017/05/17/sql-server-offline-after-applying-service-pack/
Link: https://blog.sqlauthority.com/2018/11/06/sql-server-script-level-upgrade-for-database-master-failed-because-upgrade-step-msdb110_upgrade-sql-encountered-error-926-state-1-severity-25/
@@ -963,14 +1060,15 @@ Link: None #### Trace Flag: 1106 Function: SQL 9 - Used space in tempdb increases continuously when you run a query that creates internal objects in tempdb
-Link: https://support.microsoft.com/help/947204
+Link: https://support.microsoft.com/kb/947204
Link: https://blogs.msdn.microsoft.com/arvindsh/2014/02/24/tracking-tempdb-internal-object-space-usage-in-sql-2012 #### Trace Flag: 1117 -Function: When a file in the filegroup meets the autogrow threshold, all files in the filegroup grow.
-**Note: Beginning with SQL Server 2016 this behavior is controlled by the AUTOGROW_SINGLE_FILE and AUTOGROW_ALL_FILES option of ALTER DATABASE, and trace flag 1117 has no affect. +Function: When a file in the filegroup meets the autogrow threshold, all files in the filegroup grow. +This trace flag affects all databases and is recommended only if every database is safe to be grow all files in a filegroup by the same amount.
+**Note: Beginning with SQL Server 2016 this behavior is controlled by the `AUTOGROW_SINGLE_FILE` and `AUTOGROW_ALL_FILES` option of `ALTER DATABASE`, and trace flag 1117 has no affect. For more information, see [ALTER DATABASE File and Filegroup Options (Transact-SQL)](https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-database-transact-sql-file-and-filegroup-options).**
Link: https://www.littlekendra.com/2017/01/03/parallelism-and-tempdb-data-file-usage-in-sql-server/
Link: [SQL Server 2016 : Getting tempdb a little more right]
@@ -981,25 +1079,27 @@ Link: http://sql-articles.com/articles/general/day-6trace-flag-1117-auto-grow-eq Link: http://www.ryanjadams.com/2017/05/trace-flag-1117-growth-contention/
Link: https://www.sqlskills.com/blogs/paul/misconceptions-around-tf-1118/
Link: [KB2964518]
+Link: https://www.sqlservergeeks.com/sql-server-trace-flag-1117/
Scope: global only #### Trace Flag: 1118 -Function: Removes most single page allocations on the server, reducing contention on the SGAM page. +Function: Forces page allocations on uniform extents instead of mixed extents, reducing contention on the SGAM page. When a new object is created, by default, the first eight pages are allocated from different extents (mixed extents). Afterwards, when more pages are needed, those are allocated from that same extent (uniform extent). The SGAM page is used to track these mixed extents, so can quickly become a bottleneck when numerous mixed page allocations are occurring. This trace flag allocates all eight pages from the same extent when creating new objects, minimizing the need to scan the SGAM page.
-**Note: Beginning with SQL Server 2016 this behavior is controlled by the SET MIXED_PAGE_ALLOCATION option of ALTER DATABASE, and trace flag 1118 has no affect. For more information, see ALTER DATABASE SET Options (Transact-SQL).**
+**Note: Beginning with SQL Server 2016 this behavior is controlled by the `SET MIXED_PAGE_ALLOCATION` option of `ALTER DATABASE`, and trace flag 1118 has no affect. For more information, see [ALTER DATABASE SET Options (Transact-SQL)](https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-database-transact-sql-set-options).**
Link: http://blogs.msdn.com/b/psssql/archive/2008/12/17/sql-server-2005-and-2008-trace-flag-1118-t1118-usage.aspx
Link: http://www.sqlskills.com/blogs/paul/misconceptions-around-tf-1118/
-Link: https://support.microsoft.com/help/328551
+Link: https://support.microsoft.com/kb/328551
Link: [SQL Server 2016 : Getting tempdb a little more right]
Link: [Docs Trace Flags]
Link: https://chrisadkin.org/2015/04/14/well-known-and-not-so-well-known-sql-server-tuning-knobs-and-switches
Link: [KB2964518]
+Link: https://www.sqlservergeeks.com/sql-server-trace-flag-1118/
Scope: global only @@ -1026,8 +1126,14 @@ Link: None #### Trace Flag: 1165 **Undocumented trace flag**
-Function: This [presentation](http://www.youtube.com/watch?v=SvseGMobe2w&feature=youtu.be) by Bob Ward says that this TF outputs the recalculated #’s (every 8192 allocations) for the proportional fill algorithm in database allocation when multiple files are present..
-Link: None +Function: In the Proportional Fill Algorithm, each database data file will be assigned with a ranking integer number to specify how many times this file will be skipped from the writing process to the next file depending on the free space of that file, this number is called the Skip Target where the minimum value equal to 1 means that a write process will be performed on that file. +The Skip Target can be measured by dividing the number of free extents in the file with the largest free space amount by the number of free extents in the current file, as integer value. The larger the free space in the database data file, the smaller Skip Target value. +To have one file to write on each loop, there should be minimum one data file with Skip Target value equal to 1. +Each time a new database data file is added or removed, or 8192 extents is filled in the database filegroup, the Skip Target value will be calculated again. In this way, all database data files will become full approximately at the same time. +The Skip Target calculation can be monitored by enabling the Trace Flag 1165.
+Link: https://www.sqlshack.com/understanding-sql-server-proportional-fill-algorithm/
+Scope: global or session +Demo: https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Trace_Flag/Trace_Flag_1165.sql @@ -1064,17 +1170,20 @@ Link: None #### Trace Flag: 1204 Function: Returns the resources and types of locks participating in a deadlock and also the current command affected. -Writes information about deadlocks to the ERRORLOG in a "text format"
-Link: https://support.microsoft.com/help/832524
+Writes information about deadlocks to the ERRORLOG in a "text format". +Trace flag 1204 provides node base information about deadlock in another words you can say that all nodes which are involved in deadlock. +Finally after all nodes information it also provides information about deadlock victim.
+Link: https://support.microsoft.com/kb/832524
Link: [Docs Trace Flags]
Link: [Important Trace Flags That Every DBA Should Know]
+Link: https://www.sqlservergeeks.com/sql-server-deadlock-trace-flag-1204/
Scope: global only #### Trace Flag: 1205 Function: More detailed information about the command being executed at the time of a deadlock. Documented in SQL 7 BOL.
-Link: https://support.microsoft.com/help/832524/sql-server-technical-bulletin---how-to-resolve-a-deadlock +Link: https://support.microsoft.com/kb/832524 @@ -1093,12 +1202,14 @@ Link: [KB169960] #### Trace Flag: 1211 Function: Disables lock escalation based on memory pressure, or based on number of locks. The SQL Server Database Engine will not escalate row or page locks to table locks. Using this trace flag can generate excessive numbers of locks. This can slow the performance of the Database Engine, or cause 1204 errors (unable to allocate lock resource) because of insufficient memory. -If both trace flag 1211 and 1224 are set, 1211 takes precedence over 1224. -However, because trace flag 1211 prevents escalation in every case, even under memory pressure, we recommend that you use 1224. +If both trace flag 1211 and [1224](#1224) are set, 1211 takes precedence over [1224](#1224). +However, because trace flag 1211 prevents escalation in every case, even under memory pressure, we recommend that you use [1224](#1224). This helps avoid "out-of-locks" errors when many locks are being used.
Link: [Docs Trace Flags]
Link: http://www.sqlskills.com/blogs/paul/a-sql-server-dba-myth-a-day-2330-lock-escalation
Link: [Important Trace Flags That Every DBA Should Know]
+Link: https://support.microsoft.com/kb/323630
+Link: https://www.sqlservergeeks.com/sql-server-trace-flag-1211/
Scope: global or session @@ -1118,11 +1229,13 @@ Link: None #### Trace Flag: 1222 -Function: Returns the resources and types of locks that are participating in a deadlock and also the current command affected, in an XML format that does not comply with any XSD schema.
+Function: Returns the resources and types of locks that are participating in a deadlock and also the current command affected, in an XML format that does not comply with any XSD schema. +Write deadlock information to sql server error log.
Link: [Docs Trace Flags]
Link: https://blogs.msdn.microsoft.com/bartd/2006/09/08/deadlock-troubleshooting-part-1/
Link: https://blog.sqlauthority.com/2017/01/09/sql-server-get-historical-deadlock-information-system-health-extended-events
Link: [Important Trace Flags That Every DBA Should Know]
+Link:
Scope: global only @@ -1133,12 +1246,13 @@ The Database Engine escalates row or page locks to table (or partition) locks if - Forty percent of the memory that is used by Database Engine. This is applicable only when the locks parameter of sp_configure is set to 0. - Forty percent of the lock memory that is configured by using the locks parameter of sp_configure. For more information, see [Server Configuration Options (SQL Server)](https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/server-configuration-options-sql-server). -If both trace flag 1211 and 1224 are set, 1211 takes precedence over 1224. +If both trace flag [1211](#1211) and 1224 are set, [1211](#1211) takes precedence over 1224. However, because trace flag 1211 prevents escalation in every case, even under memory pressure, we recommend that you use 1224. This helps avoid "out-of-locks" errors when many locks are being used.
-**Note: Lock escalation to the table- or HoBT-level granularity can also be controlled by using the LOCK_ESCALATION option of the ALTER TABLE statement.**
+**Note: Lock escalation to the table- or HoBT-level granularity can also be controlled by using the `LOCK_ESCALATION` option of the `ALTER TABLE` statement.**
Link: [Docs Trace Flags]
Link: [Important Trace Flags That Every DBA Should Know]
+Link: https://www.sqlservergeeks.com/sql-server-trace-flag-1224/
Scope: global or session @@ -1146,31 +1260,32 @@ Scope: global or session #### Trace Flag: 1228 Function: Enable lock partitioning. By default, lock partitioning is enabled when a server has 16 or more CPUs. Otherwise, lock partitioning is disabled. -Trace flag 1228 enables lock partitioning for 2 or more CPUs. Trace flag 1229 disables lock partitioning. -Trace flag 1229 overrides trace flag 1228 if trace flag 1228 is also set. +Trace flag 1228 enables lock partitioning for 2 or more CPUs. Trace flag [1229](#1229) disables lock partitioning. +Trace flag [1229](#1229) overrides trace flag 1228 if trace flag 1228 is also set. Lock partitioning is useful on multiple-CPU servers where some tables have very high lock rates. -You can turn on trace flag 1228 and trace flag 1229 only at startup.
+You can turn on trace flag 1228 and trace flag [1229](#1229) only at startup.
Link: [Trace Flag 1228 and 1229]
-Link: [Microsoft SQL Server 2005 TPC-C Trace Flags] +Link: [Microsoft SQL Server 2005 TPC-C Trace Flags]
+Scope: global only #### Trace Flag: 1229 -Function: Enable lock partitioning. -By default, lock partitioning is enabled when a server has 16 or more CPUs. Otherwise, lock partitioning is disabled. -Trace flag 1228 enables lock partitioning for 2 or more CPUs. Trace flag 1229 disables lock partitioning. -Trace flag 1229 overrides trace flag 1228 if trace flag 1228 is also set. -Lock partitioning is useful on multiple-CPU servers where some tables have very high lock rates. -You can turn on trace flag 1228 and trace flag 1229 only at startup.
+Function: Disables all lock partitioning regardless of the number of CPUs. +By default, SQL Server enables lock partitioning when a server has 16 or more CPUs, to improve the scalability characteristics of larger systems. +For more information on lock partitioning, see the [Transaction Locking and Row Versioning Guide](https://docs.microsoft.com/en-us/sql/relational-databases/sql-server-transaction-locking-and-row-versioning-guide?view=sql-server-2017#lock_partitioning)
+**WARNING: Trace flag 1229 can cause spinlock contention and poor performance.** +Link: [Docs Trace Flags]
Link: [Trace Flag 1228 and 1229]
-Link: [Microsoft SQL Server 2005 TPC-C Trace Flags] +Link: [Microsoft SQL Server 2005 TPC-C Trace Flags]
+Scope: global only #### Trace Flag: 1236 Function: Enables database lock partitioning. Fixes performance problem in scenarios with high lock activity in SQL 2012 and SQL 2014.
**Note: Beginning with SQL Server 2012 SP3 and SQL Server 2014 SP1 this behavior is controlled by the engine and trace flag 1236 has no effect.**
-Link: https://support.microsoft.com/help/2926217
+Link: https://support.microsoft.com/kb/2926217
Link: [Docs Trace Flags]
Link: [KB2964518]
Scope: global only @@ -1180,20 +1295,33 @@ Scope: global only #### Trace Flag: 1237 Function: Allows the `ALTER PARTITION FUNCTION` statement to honor the current user-defined session deadlock priority instead of being the likely deadlock victim by default.
**Note: Starting with SQL Server 2017 and database [compatibility level] 140 this is the default behavior and trace flag 1237 has no effect.**
-Link: https://support.microsoft.com/help/4025261
+Link: https://support.microsoft.com/kb/4025261
Link: [Docs Trace Flags]
Scope: global or session or query + + + +#### Trace Flag: 1252 +**Undocumented trace flag**
+Function: It prints some kind of lock related information when [3604](#3604) is also enabled. Example: +``` +SELECT * FROM master..spt_values +OPTION (QUERYTRACEON 1252, QUERYTRACEON 3604); +``` +
+Link: https://github.com/ktaranov/sqlserver-kit/issues/196
+Scope: ? #### Trace Flag: 1260 Function: Disabled mini-dump for non-yield condition. Disables mini-dump generation for "any of the 17883, 17884, 17887, or 17888 errors. -The trace flag can be used in conjunction with trace flag –T1262. For example, you -could enable –T1262 to get 10- and a 60-second interval reporting and also enable – T1260 to avoid getting mini-dumps."
+The trace flag can be used in conjunction with trace flag –T1262. For example, you could enable `–T1262` to get 10- and a 60-second interval reporting and also enable `–T1260` to avoid getting mini-dumps."
Link: [A Topical Collection of SQL Server Flags v6]
Link: [How To Diagnose and Correct Errors 17883, 17884, 17887, and 17888]
Link: [Docs Trace Flags]
+Link: https://www.sqlservergeeks.com/sql-trace-flag-1260/
Scope: global only @@ -1206,22 +1334,22 @@ Link: None #### Trace Flag: 1262 -Function: The default behavior (for 1788* errors) is for SQL to generate a mini-dump on the first -occurrence, but never after. 1262 changes the behavior: “When –T1262 is enabled, a -mini-dump is generated when the non-yielding condition is declared (15 seconds) and -at subsequent 60-second intervals for the same non-yield occurrence. A new nonDiagCorrect17883etc; -yielding occurrence causes dump captures to occur again.” +Function: The default behavior (for 1788* errors) is for SQL to generate a mini-dump on the first occurrence, but never after. +1262 changes the behavior: “When –T1262 is enabled, a mini-dump is generated when the non-yielding condition is declared (15 seconds) and at subsequent 60-second intervals for the same non-yield occurrence. +A new nonDiagCorrect17883etc; yielding occurrence causes dump captures to occur again.” In SQL 2000 this was a startup-only flag; in 2005+ it can be enabled via TRACEON. Note that the flag is also covered in Khen2005, p400, but with no new information.
Link: [A Topical Collection of SQL Server Flags v6]
-Link: [How To Diagnose and Correct Errors 17883, 17884, 17887, and 17888] +Link: [How To Diagnose and Correct Errors 17883, 17884, 17887, and 17888]
+Link: https://www.sqlservergeeks.com/sql-trace-flag-1262/
+Scope: global or session #### Trace Flag: 1264 Function: Collect process names in non-yielding scenario memory dumps
Link: [A Topical Collection of SQL Server Flags v6]
-Link: https://support.microsoft.com/help/2630458/ +Link: https://support.microsoft.com/kb/2630458 @@ -1249,7 +1377,7 @@ Scope: global only #### Trace Flag: 1449 Function: When you use SNAC to connect to an instance of a principal server in a database mirroring session: "The connection attempted to fail over to a server that does not have a failover partner".
-Link: https://support.microsoft.com/help/936179 +Link: https://support.microsoft.com/kb/936179 @@ -1334,8 +1462,11 @@ Link: None #### Trace Flag: 1800 -Function: Enables SQL Server optimization when disks of different sector sizes are used for primary and secondary replica log files, in SQL Server AG and Log Shipping environments.
-Link: https://support.microsoft.com/help/3009974
+Function: Enables SQL Server optimization when disks of different sector sizes are used for primary and secondary replica log files, in SQL Server Always On and Log Shipping environments. +This trace flag is only required to be enabled on SQL Server instances with transaction log file residing on disk with sector size of 512 bytes. +It is **not** required to be enabled on disk with 4k sector sizes.
+**Note: This trace flag applies to SQL Server 2012 (11.x) SP1 CU13, SQL Server 2012 (11.x) SP2 CU3, SQL Server 2014 (12.x) RTM CU5, and higher builds.**
+Link: https://support.microsoft.com/kb/3009974
Link: [Docs Trace Flags]
Scope: global only @@ -1343,7 +1474,7 @@ Scope: global only #### Trace Flag: 1802 Function: SQL 9 - After detaching a database that resides on network-attached storage, you cannot reattach the SQL Server database
-Link: https://support.microsoft.com/help/922804 +Link: https://support.microsoft.com/kb/922804 @@ -1353,7 +1484,7 @@ Used to guarantee the physical data file space acquisition during data file crea Link: http://technet.microsoft.com/en-au/library/cc917726.aspx
Link: https://blogs.msdn.microsoft.com/sql_pfe_blog/2009/12/22/how-and-why-to-enable-instant-file-initialization
Link: http://www.sqlskills.com/blogs/paul/a-sql-server-dba-myth-a-day-330-instant-file-initialization-can-be-controlled-from-within-sql-server
-Link: https://support.microsoft.com/help/2574695/file-initialization-takes-a-long-time-for-sql-server-database-related-operations
+Link: https://support.microsoft.com/kb/2574695
Link: [Important Trace Flags That Every DBA Should Know]
Scope: ? @@ -1362,7 +1493,7 @@ Scope: ? #### Trace Flag: 1807 Function: Enable option to have database files on SMB share for SQL Server 2008 and 2008R2
Link: http://blogs.msdn.com/b/varund/archive/2010/09/02/create-a-sql-server-database-on-a-network-shared-drive.aspx
-Link: https://support.microsoft.com/help/304261/description-of-support-for-network-database-files-in-sql-server +Link: https://support.microsoft.com/kb/304261 @@ -1383,6 +1514,15 @@ Function: Bob Ward briefly references this flag in his PASS 2014 SQL Server IO t Link: None + +#### Trace Flag: 1819 +Function: Allows [backup to URL](https://docs.microsoft.com/en-gb/sql/relational-databases/backup-restore/sql-server-backup-to-url?view=sql-server-ver15) to leverage a proxy server when accessing Azure block blobs. In addition to this trace flag, you must set the WinHTTP proxy configuration on the server via one of the following methods: +- The [`proxycfg.exe`](https://docs.microsoft.com/en-us/windows/win32/winhttp/proxycfg-exe--a-proxy-configuration-tool) utility on Windows XP or Windows Server 2003 and earlier. +- The [`netsh.exe`]() utility on Windows Vista and Windows Server 2008 or later.
+Link: [Docs Trace Flags] +Scope: global or session or query (QUERYTRACEON) + + #### Trace Flag: 1851 Function: Anecdotally, from a JustDave’s notes on an Amanda Ford talk at SQL Relay Reading 2014: “...disables the automerge functionality for in-memory oltp”
@@ -1401,6 +1541,17 @@ Function: Unknown
Link: [Upgrading an expired SQL Server 2016 Evaluation Edition] + +#### Trace Flag: 1906 +**Undocumented trace flag**
+Function: It enables SQL Server to read ETW tracing templates stored in the `etwcnf.xml` directory on SQL Server 2008. +When the flag is turned off, the file is not read, and a static in-memory ETW template is used instead. +It is not documented because it can cause SQL Server to hang on startup. +We will be supported by Microsoft running this trace flag as long as we do not experience start up "hangs". +Microsoft recommends using Xevents instead the template file.
+Link: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/0489f308-2e0c-479f-85a8-9a5661b2462f/trace-flag-1906?forum=sqldatabaseengine + + #### Trace Flag: 2301 Function: Trace flag 2301 enables advanced optimizations that are specific to decision support queries. @@ -1409,6 +1560,7 @@ Link: [KB920093]
Link: [Docs Trace Flags]
Link: http://www.queryprocessor.com/ce_join_base_containment_assumption
Link: https://connect.microsoft.com/SQLServer/feedback/details/772232/make-optimizer-estimations-more-accurate-by-using-metadata
+Link: https://www.sqlservergeeks.com/sql-server-trace-flag-2301/
Scope: global or session or query @@ -1421,11 +1573,14 @@ Link: http://blog.dbi-services.com/sql-server-2014-new-incremental-statistics #### Trace Flag: 2312 -Function: Enables you to set the query optimizer cardinality estimation model to the SQL Server 2014 through SQL Server 2016 versions, dependent of the compatibility level of the database.
+Function: Sets the query optimizer cardinality estimation model to the SQL Server 2014 (12.x) through SQL Server 2017 versions, dependent of the compatibility level of the database. +Starting with SQL Server 2016 (13.x) SP1, to accomplish this at the query level, add the USE HINT 'FORCE_DEFAULT_CARDINALITY_ESTIMATION' query hint instead of using this trace flag.
+**Note: If the database compatibility level is lower than 120, enabling trace flag 2312 uses the cardinality estimation model of SQL Server 2014 (12.x) (120).** Link: [KB2801413]
Link: [New Features in SQL Server 2016 Service Pack 1]
Link: [Docs Trace Flags]
Link: http://www.sqlservergeeks.com/sql-server-2014-trace-flags-2312/
+Link: [KB2801413]
Scope: global or session or query @@ -1472,7 +1627,7 @@ Link: https://chrisadkin.org/2015/04/14/well-known-and-not-so-well-known-sql-ser #### Trace Flag: 2332 Function: PWhite: “Force DML Request Sort (CUpdUtil::FDemandRowsSortedForPerformance)”
-Link: http://sqlblog.com/blogs/paul_white/archive/2013/01/26/optimizing-t-sql-queries-that-change-data.aspx +Link: [Optimizing T-SQL queries that change data] @@ -1481,9 +1636,10 @@ Function: Causes SQL Server to assume a fixed amount of memory is available duri The memory configured for SQL Server will still be used by data cache, query execution and other consumers.
**Note: Please ensure that you thoroughly test this option, before rolling it into a production environment.**
Link: https://www.brentozar.com/archive/2018/08/how-trace-flag-2335-affects-memory-grants/
-Link: https://support.microsoft.com/help/2413549
+Link: https://support.microsoft.com/kb/2413549
Link: [Docs Trace Flags]
Link: http://dba.stackexchange.com/questions/53726/difference-in-execution-plans-on-uat-and-prod-server
+Link: [KB2801413]
Scope: global or session or query @@ -1495,28 +1651,34 @@ Link: None #### Trace Flag: 2340 -Function: Causes SQL Server not to use a sort operation (batch sort) for optimized nested loop joins when generating a plan. -Beginning with SQL Server 2016 SP1, to accomplish this at the query level, add the USE HINT query hint instead of using this trace flag.
+Function: Causes SQL Server not to use a sort operation (batch sort) for optimized Nested Loops joins when generating a plan. +By default, SQL Server can use an optimized Nested Loops join instead of a full scan or a Nested Loops join with an explicit Sort, when the Query Optimizer concludes that a sort is most likely not required, but still a possibility in the event that the cardinality or cost estimates are incorrect. +Starting with SQL Server 2016 (13.x) SP1, to accomplish this at the query level, add the USE HINT 'DISABLE_OPTIMIZED_NESTED_LOOP' query hint instead of using this trace flag..
**Note: Please ensure that you thoroughly test this option, before rolling it into a production environment.**
Link: [New Features in SQL Server 2016 Service Pack 1]
Link: [Docs Trace Flags]
Link: https://blogs.msdn.microsoft.com/psssql/2010/01/11/high-cpu-after-upgrading-to-sql-server-2005-from-2000-due-to-batch-sort
Link: http://www.queryprocessor.com/batch-sort-and-nested-loops
+Link: [KB2801413]
+Link: https://www.sqlservergeeks.com/trace-flag-2340/
Scope: global or session or query #### Trace Flag: 2341 Function: Enables the use of a hash join for joins to column store indexes even when the join clause would normally be removed “during query normalization”.
-Link: https://support.microsoft.com/help/3146123/query-plan-generation-improvement-for-some-columnstore-queries-in-sql-server-2014-or-2016 +Link: https://support.microsoft.com/kb/3146123 #### Trace Flag: 2363 -Function: TF Selectivity
+Function: TF Selectivity. can be used with the new cardinality estimation model to see the derivation of the distinct estimate on the outer input to an apply, and cardinality estimation in general.
Link: [Cardinality Estimation Framework 2014 First Look]
Link: http://www.queryprocessor.com/ce-process
Link: https://sqlperformance.com/2014/01/sql-plan/cardinality-estimation-for-multiple-predicates +Link: [Nested Loops Joins and Performance Spools]
+Link: [Cardinality Estimation for Multiple Predicates]
+Scope: session or query @@ -1529,14 +1691,18 @@ Scope: ? #### Trace Flag: 2371 -Function: Changes the fixed auto update statistics threshold to dynamic auto update statistics threshold.
-**Note: Beginning with SQL Server 2016 this behavior is controlled by the engine and trace flag 2371 has no effect.**
-Link: https://support.microsoft.com/help/2754171
-Link: http://blogs.msdn.com/b/saponsqlserver/archive/2011/09/07/changes-to-automatic-update-statistics-in-sql-server-traceflag-2371.aspx
+Function: Changes the fixed update statistics threshold to a linear update statistics threshold. +Change a fixed rate 20% of rows changed for Recompilation Thresholds (RT) on new formula - **SQRT(1000 * table rows)**
+**Note: Starting with SQL Server 2016 (13.x) and under the database compatibility level 130 or above, this behavior is controlled by the engine and trace flag 2371 has no effect.**
+Link: https://support.microsoft.com/kb/2754171
+Link: https://blogs.msdn.microsoft.com/saponsqlserver/2011/09/07/changes-to-automatic-update-statistics-in-sql-server-traceflag-2371/
Link: https://blogs.msdn.microsoft.com/axinthefield/sql-server-trace-flag-2371-for-dynamics-ax/
Link: [Docs Trace Flags]
Link: [KB2964518]
-Scope: global only +Link: https://www.sqlservergeeks.com/sql-server-trace-flag-2371/
+Link: [Temporary Table Caching in Stored Procedures]
+Scope: global or session +Demo: https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Trace_Flag/Trace_Flag_2371.sql @@ -1572,8 +1738,11 @@ Link: None #### Trace Flag: 2387 **Undocumented trace flag**
-Function: There was a small change in CPU and IO costs for some operators. Full effect unknown.
+Function: can be used to reduce the CPU cost of reading rows from a lazy index spool. +This flag affects general CPU cost estimates for reading a range of rows from a b-tree. +This flag tends to make index spool selection more likely, for cost reasons.
Link: [New Undocumented Trace Flags]
+Link: [Nested Loops Joins and Performance Spools]
Scope: ? @@ -1594,10 +1763,11 @@ Scope: session only #### Trace Flag: 2389 Function: Enable automatically generated quick statistics for ascending keys (histogram amendment). If trace flag 2389 is set, and a leading statistics column is marked as ascending, then the histogram used to estimate cardinality will be adjusted at query compile time.
-Link: [KB2801413]
+**Note: This trace flag does not apply to CE version 120 or above. Use trace flag [4139](#4139) instead.**
+Link:
Link: http://blogs.msdn.com/b/ianjo/archive/2006/04/24/582227.aspx
Link: http://www.sqlmag.com/article/tsql3/making-the-most-of-automatic-statistics-updating--96767
-Link: http://sqlperformance.com/2016/07/sql-statistics/trace-flag-2389-new-cardinality-estimator
+Link: https://sqlperformance.com/2016/07/sql-statistics/trace-flag-2389-new-cardinality-estimator
Link: https://www.sswug.org/sswugresearch/community/trace-flag-2389-and-the-new-cardinality-estimator/
Link: [New Features in SQL Server 2016 Service Pack 1]
Link: [Docs Trace Flags]
@@ -1610,13 +1780,15 @@ Scope: global or session or query #### Trace Flag: 2390 Function: Enable automatically generated quick statistics for ascending or unknown keys (histogram amendment). If trace flag 2390 is set, and a leading statistics column is marked as ascending or unknown, then the histogram used to estimate cardinality will be adjusted at query compile time
+**Use this flag only with [2389](#2389) trace flag.**
+**Note: This trace flag does not apply to CE version 120 or above. Use trace flag [4139](#4139) instead.**
Link: http://blogs.msdn.com/b/ianjo/archive/2006/04/24/582227.aspx
Link: [KB2801413]
Link: http://www.sqlmag.com/article/tsql3/making-the-most-of-automatic-statistics-updating--96767
Link: [Docs Trace Flags]
Link: https://blogs.msdn.microsoft.com/ianjo/2006/04/24/ascending-keys-and-auto-quick-corrected-statistics
Link: [SQL Server - estimates outside of the histogram - half-baked draft]
-Link: http://www.sqlservergeeks.com/sql-server-trace-flag-2390/ +Link: http://www.sqlservergeeks.com/sql-server-trace-flag-2390/
Scope: global or session or query @@ -1629,14 +1801,17 @@ The problem is, it will not disable/enable missing index stats collection unless If you set it as a startup TF and restart SQL Server, then no missing index stats are collected. If you then subsequently disable TF 2392 while SQL Server is running, it still won’t collect any missing index stats (despite what you may expect).
Link: https://www.sqlskills.com/blogs/glenn/sql-server-missing-indexes-feature-and-trace-flag-2392/
-Link: https://support.microsoft.com/help/4042232/fix-access-violation-when-you-cancel-a-pending-query-if-the-missing-in
+Link: https://support.microsoft.com/kb/4042232
Scope: global only #### Trace Flag: 2398 -Function: Another one I stumbled upon myself...outputs info about “Smart Seek costing”: e.g.: “Smart seek costing (75.2) :: 1.34078e+154 , 1”
-Link: None +**Undocumented trace flag**
+Function: Disable SSC (Smart Seek Costing). +SSC attempts to assess inner side seek I/O cost in more detail, perhaps by considering local ordering and/or the range of values to fetch.
+Link: https://dba.stackexchange.com/a/149933/107045
+Scope: session or query @@ -1659,15 +1834,15 @@ Scope: ? #### Trace Flag: 2422 Function: Enables the SQL Server Database Engine to abort a request when the maximum time set by Resource Governor REQUEST_MAX_CPU_TIME_SEC configuration is exceeded.
**Note: This trace flag applies to SQL Server 2017 CU3 and higher builds.**
-Link: https://support.microsoft.com/help/4038419
+Link: https://support.microsoft.com/kb/4038419
Scope: global only #### Trace Flag: 2430 Function: Fixes performance problem when using large numbers of locks
-Link: https://support.microsoft.com/help/2754301
-Link: https://support.microsoft.com/help/2746341/fix-high-cpu-usage-when-you-execute-an-update-statement-that-includes-a-where-current-of-cursor-clause-in-sql-server-2008 +Link: https://support.microsoft.com/kb/2754301
+Link: https://support.microsoft.com/kb/2746341 @@ -1689,8 +1864,8 @@ Scope: global only #### Trace Flag: 2453 Function: Allow a table variable to trigger recompile when enough number of rows are changed with may allow the query optimizer to choose a more efficient plan.
**Note: Please ensure that you thoroughly test this option, before rolling it into a production environment.**
-Link: http://sqlperformance.com/2014/06/t-sql-queries/table-variable-perf-fix
-Link: https://support.microsoft.com/help/2952444
+Link: https://sqlperformance.com/2014/06/t-sql-queries/table-variable-perf-fix
+Link: https://support.microsoft.com/kb/2952444
Link: [Docs Trace Flags]
Link: https://www.brentozar.com/archive/2017/02/using-trace-flag-2453-improve-table-variable-performance
Link: https://www.brentozar.com/archive/2018/03/table-valued-parameters-unexpected-parameter-sniffing
@@ -1740,7 +1915,7 @@ Link: [SQL Server Parallel Query Placement Decision Logic] #### Trace Flag: 2469 Function: Enables alternate exchange for `INSERT INTO ... SELECT` into a partitioned columnstore index.
Link: [Docs Trace Flags]
-Link: https://support.microsoft.com/help/3204769/
+Link: https://support.microsoft.com/kb/3204769/
Scope: global or session or query @@ -1748,7 +1923,7 @@ Scope: global or session or query #### Trace Flag: 2470 **Undocumented trace flag**
Function: Fixes performance problem when using AFTER triggers on partitioned tables
-Link: https://support.microsoft.com/help/2606883 +Link: https://support.microsoft.com/kb/2606883 @@ -1813,18 +1988,16 @@ Link: None #### Trace Flag: 2528 -Function: Disables parallel checking of objects by `DBCC CHECKDB`, `DBCC CHECKFILEGROUP`, and `DBCC CHECKTABLE`. -By default, the degree of parallelism is automatically determined by the query processor. -The maximum degree of parallelism is configured just like that of parallel queries. -For more information, see [Configure the max degree of parallelism Server Configuration Option](https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-max-degree-of-parallelism-server-configuration-option). -Parallel `DBCC` should typically be left enabled. -For `DBCC CHECKDB`, the query processor reevaluates and automatically adjusts parallelism with each table or batch of tables checked. -Sometimes, checking may start when the server is almost idle. -An administrator who knows that the load will increase before checking is complete may want to manually decrease or disable parallelism. -Disabling parallel checking of DBCC can cause `DBCC` to take much longer to complete and if `DBCC` is run with the `TABLOCK` feature enabled and parallelism set off, tables may be locked for longer periods of time.
+Function: Disables parallel checking of objects by DBCC CHECKDB, DBCC CHECKFILEGROUP, and DBCC CHECKTABLE. By default, the degree of parallelism is automatically determined by the query processor. +The maximum degree of parallelism is configured just like that of parallel queries. For more information, see [Configure the max degree of parallelism Server Configuration Option](https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/configure-the-max-degree-of-parallelism-server-configuration-option). +**Note: Parallel DBCC checks should typically be enabled (default). The query processor reevaluates and automatically adjusts parallelism for each table or batch of tables checked by DBCC CHECKDB.** +The typical use scenario is when a system administrator knows that server load will increase before DBCC CHECKDB completes, and so chooses to manually decrease or disable parallelism, in order to increase concurrency with other user workload. However, disabling parallel checks in DBCC CHECKDB can cause it to take longer to complete. +**Note: If DBCC CHECKDB is executed using the TABLOCK option and parallelism is disabled, tables may be locked for longer periods of time.** +**Note: Starting with SQL Server 2014 (12.x) SP2, a MAXDOP option is available to override the max degree of parallelism configuration option of sp_configure for the DBCC statements.** Link: [Docs Trace Flags]
Link: http://www.sqlskills.com/blogs/paul/checkdb-from-every-angle-how-long-will-checkdb-take-to-run
Link: [Important Trace Flags That Every DBA Should Know]
+Link: https://www.sqlservergeeks.com/sql-server-trace-flag-2528/
Scope: global or session @@ -1846,44 +2019,55 @@ Link: http://www.sqlsoldier.com/wp/sqlserver/day19of31daysofdisasterrecoveryhowm #### Trace Flag: 2537 **Undocumented trace flag**
-Function: Allows you to see inactive records in transaction log using fn\_dblog
+Function: By using this trace flag, function `fn_dblog()` will read both active and inactive portions of transaction log.
Link: http://www.sqlsoldier.com/wp/sqlserver/day19of31daysofdisasterrecoveryhowmuchlogcanabackuplog
Link: http://www.sqlskills.com/blogs/paul/finding-out-who-dropped-a-table-using-the-transaction-log
Link: http://sqlserverandme.blogspot.ru/2014/03/how-to-view-transaction-log.html
+Link: https://www.sqlservergeeks.com/trace-flag-2537/
Scope: session only #### Trace Flag: 2540 +**Undocumented trace flag**
Function: Unknown, but related to controlling the contents of a memory dump
Link: [KB917825] #### Trace Flag: 2541 +**Undocumented trace flag**
Function: Unknown, but related to controlling the contents of a memory dump
Link: [KB917825] #### Trace Flag: 2542 -Function: Unknown, but related to controlling the contents of a memory dump
+**Undocumented trace flag**
+Function: SQL Server error log still tells you about the dump. But it never gets written. +The error log still tells you about the stack text file, which still gets generated even with T2542 in place. Looks like that takes about 6 seconds rather than the dumps which were always over 1 minute. +[@sqL_handLe](https://twitter.com/sqL_handLe) used it to resolve an issue where a production environment (with > 1 TB of RAM) was experiencing unhelpful memory dumps that would take more than 100 seconds to complete. 100 seconds is the max Availability Group lease timeout threshold.
Link: [KB917825]
-Link: [Controlling SQL Server memory dumps] +Link: [Controlling SQL Server memory dumps]
+Link: [197](https://github.com/ktaranov/sqlserver-kit/issues/197) #### Trace Flag: 2543 +**Undocumented trace flag**
Function: Unknown, but related to controlling the contents of a memory dump
Link: [KB917825] #### Trace Flag: 2544 +**Undocumented trace flag**
Function: Produces a full memory dump
Link: [KB917825]
Link: https://blogs.msdn.microsoft.com/askjay/2010/02/05/how-can-i-create-a-dump-of-sql-server
-Link: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/13ce4292-b8a7-41fa-a173-645693957d70/sqldumper?forum=sqldisasterrecovery&forum=sqldisasterrecovery +Link: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/13ce4292-b8a7-41fa-a173-645693957d70/sqldumper?forum=sqldisasterrecovery&forum=sqldisasterrecovery
+Link: [SQL Server Trace Flag 2544, Trace Flag 2546 and Trace Flag 2551]
+Scope: Session @@ -1894,11 +2078,13 @@ Link: [KB917825] #### Trace Flag: 2546 -Function: Dumps all threads for SQL Server in the dump file
+Function: Generates dump file for all threads of SQL Server (mini dump).
Link: [KB917825]
Link: https://blogs.msdn.microsoft.com/askjay/2010/02/05/how-can-i-create-a-dump-of-sql-server
Link: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/13ce4292-b8a7-41fa-a173-645693957d70/sqldumper?forum=sqldisasterrecovery&forum=sqldisasterrecovery
-Link: https://blogs.msdn.microsoft.com/psssql/2008/09/12/sql-server-2000-2005-2008-recoveryrollback-taking-longer-than-expected +Link: https://blogs.msdn.microsoft.com/psssql/2008/09/12/sql-server-2000-2005-2008-recoveryrollback-taking-longer-than-expected
+Link: [SQL Server Trace Flag 2544, Trace Flag 2546 and Trace Flag 2551]
+Scope: Session @@ -1913,20 +2099,19 @@ Link: [KB917825] Function: Shrink will run faster with this trace flag if there are LOB pages that need conversion and/or compaction, because that actions will be skipped.
Link: http://blogs.msdn.com/b/psssql/archive/2008/03/28/how-it-works-sql-server-2005-dbcc-shrink-may-take-longer-than-sql-server-2000.aspx -*Thanks to: Andrzej Kukula* - #### Trace Flag: 2549 -Function: Runs the DBCC CHECKDB command assuming each database file is on a unique disk drive. -DBCC CHECKDB command builds an internal list of pages to read per unique disk drive across all database files. -This logic determines unique disk drives based on the drive letter of the physical file name of each file.
-**Note: Do not use this trace flag unless you know that each file is based on a unique physical disk. -Although this trace flag improve the performance of the DBCC CHECKDB commands which target usage of the PHYSICAL_ONLY option, some users may not see any improvement in performance. +Function: Forces the `DBCC CHECKDB` command to assume each database file is on a unique disk drive but treating different physical files as one logical file. +`DBCC CHECKDB` command builds an internal list of pages to read per unique disk drive across all database files. +This logic determines unique disk drives based on the drive letter of the physical file name of each file. +**Note: Do not use this trace flag unless you know that each file is based on a unique physical disk.** +**Note: Although this trace flag improve the performance of the DBCC CHECKDB commands which target usage of the `PHYSICAL_ONLY` option, some users may not see any improvement in performance. While this trace flag improves disk I/O resources usage, the underlying performance of disk resources may limit the overall performance of the DBCC CHECKDB command.**
+Link: [Minimizing the impact of DBCC CHECKDB] Link: http://blogs.msdn.com/b/saponsqlserver/archive/2011/12/22/faster-dbcc-checkdb-released-in-sql-2008-r2-sp1-traceflag-2562-amp-2549.aspx
-Link: https://support.microsoft.com/help/2634571
-Link: https://support.microsoft.com/help/2732669
+Link: [KB2634571]
+Link: https://support.microsoft.com/kb/2732669
Link: [Docs Trace Flags]
Link: [KB2964518]
Scope: global only @@ -1934,16 +2119,20 @@ Scope: global only #### Trace Flag: 2550 +**Undocumented trace flag**
Function: Unknown, but related to controlling the contents of a memory dump
Link: [KB917825] #### Trace Flag: 2551 +**Undocumented trace flag**
Function: Produces a filtered memory dump
Link: [KB917825]
Link: https://connect.microsoft.com/SQLServer/feedback/details/477863/sql-server-is-terminating-because-of-fatal-exception-c0150014
-Link: [Let’s talk about trace flags] +Link: [Let’s talk about trace flags]
+Link: [SQL Server Trace Flag 2544, Trace Flag 2546 and Trace Flag 2551]
+Scope: Session @@ -1999,15 +2188,14 @@ Link: [KB917825] #### Trace Flag: 2562 Function: Runs the `DBCC CHECKDB` command in a single "batch" regardless of the number of indexes in the database. -By default, the `DBCC CHECKDB` command tries to minimize `tempdb` resources by limiting the number of indexes or "facts" that it generates by using a "batches" concept. -This trace flag forces all processing into one batch. -One effect of using this trace flag is that the space requirements for `tempdb` may increase. -`tempdb` may grow to as much as 5% or more of the user database that is being processed by the `DBCC CHECKDB` command.
-**Note: Although this trace flag improve the performance of the `DBCC CHECKDB` commands which target usage of the PHYSICAL_ONLY option, some users may not see any improvement in performance. -While this trace flag improves disk I/O resources usage, the underlying performance of disk resources may limit the overall performance of the DBCC CHECKDB command.**
+By default, the `DBCC CHECKDB` command tries to minimize TempDB resources by limiting the number of indexes or "facts" that it generates by using a "batches" concept. +But this trace flag forces all processing into one batch. +One effect of using this trace flag is that the space requirements for TempDB may increase. TempDB may grow to as much as 5% or more of the user database that is being processed by the DBCC CHECKDB command. +**Note: Although this trace flag improve the performance of the DBCC CHECKDB commands which target usage of the `PHYSICAL_ONLY` option, some users may not see any improvement in performance. While this trace flag improves disk I/O resources usage, the underlying performance of disk resources may limit the overall performance of the DBCC CHECKDB command.**
+Link: [Minimizing the impact of DBCC CHECKDB] Link: http://blogs.msdn.com/b/saponsqlserver/archive/2011/12/22/faster-dbcc-checkdb-released-in-sql-2008-r2-sp1-traceflag-2562-amp-2549.aspx
-Link: https://support.microsoft.com/help/2634571
-Link: https://support.microsoft.com/help/2732669
+Link: [KB2634571]
+Link: https://support.microsoft.com/kb/2732669
Link: [Docs Trace Flags]
Link: [KB2964518]
Scope: global only @@ -2015,13 +2203,13 @@ Scope: global only #### Trace Flag: 2566 -Function: Runs the `DBCC CHECKDB` command without data purity check unless DATA_PURITY option is specified.
+Function: Runs the `DBCC CHECKDB` command without data purity check unless `DATA_PURITY` option is specified.
**Note: Column-value integrity checks are enabled by default and do not require the DATA_PURITY option. For databases upgraded from earlier versions of SQL Server, column-value checks are not enabled by default until `DBCC CHECKDB WITH DATA_PURITY` has been run error free on the database at least once. After this, `DBCC CHECKDB` checks column-value integrity by default.**
Link: [Docs Trace Flags]
-Link: https://sqlperformance.com/2012/11/io-subsystem/minimize-impact-of-checkdb
-Link: https://support.microsoft.com/help/2888996/
+Link: [Minimizing the impact of DBCC CHECKDB]
+Link: https://support.microsoft.com/kb/2888996
Link: [KB2964518]
Scope: global only @@ -2035,6 +2223,16 @@ Link: http://www.sqlskills.com/blogs/paul/dbcc-writepage/
Scope: session only + +#### Trace Flag: 2592 +Function: When used in conjunction with trace flag [3656](#3656), enables symbol resolution on stack dumps when the Debugging Tools for Windows are installed. +For more information, see this [Microsoft Whitepaper](https://www.microsoft.com/download/details.aspx?id=26666).
+**WARNING: This is a debugging trace flag and not meant for production environment use.**
+**Note: This trace flag applies to SQL Server 2019 (15.x) and higher builds.**
+Link: [Docs Trace Flags]
+Scope: global or session + + #### Trace Flag: 2701 Function: SQL 6.5 - Sets the `@@ERROR` system function to 50000 for `RAISERROR` messages with severity levels of 10 or less. When disabled, sets the @@ERROR system function to 0 for RAISERROR messages with severity levels of 10 or less
@@ -2046,7 +2244,9 @@ Link: None **Undocumented trace flag**
**TF2861 only exists in SQL Server 2000 SP3 and SP4, was removed before 2005 shipped, and if you’re using it now you’re definitely incorrect and should removed it from your startup parameters/application code that enables it.** Function: Keep zero cost plans in cache. Tip: Avoid Using Trace Flag 2861 to Cache Zero-Cost Query Plan
-Link: http://www.seangallardy.com/trace-flag-2861-the-trace-flag-the-myth-the-legend/ +Link: http://www.seangallardy.com/trace-flag-2861-the-trace-flag-the-myth-the-legend/
+Link: https://web.archive.org/web/20121008074923/http://support.microsoft.com/kb/325607
+Scope: global only #### Trace Flag: 2880 @@ -2073,27 +2273,30 @@ Link: https://blogs.msdn.microsoft.com/psssql/2008/01/23/how-it-works-what-is-re Link: [Important Trace Flags That Every DBA Should Know]
Link: https://blogs.msdn.microsoft.com/sql_pfe_blog/2009/12/22/how-and-why-to-enable-instant-file-initialization/
Link: [Undocumented Trace Flags: Inside the Restore Process]
+Link: https://www.sqlservergeeks.com/sql-server-trace-flag-3004/
Scope: session only #### Trace Flag: 3014 -Function: Returns more info about backups to the errorlog: Backup activity, Restore activity , File creation.
+Function: Returns more info about backups to the errorlog: Backup activity, Restore activity, File creation.
Link: [Important Trace Flags That Every DBA Should Know]
Link: https://blogs.msdn.microsoft.com/psssql/2008/02/06/how-it-works-how-does-sql-server-backup-and-restore-select-transfer-sizes
Link: [Undocumented Trace Flags: Inside the Restore Process]
Link: [What’s CHECKDB doing in my database restore?]
+Link: https://www.sqlservergeeks.com/sql-server-trace-flag-3014/
Scope: session only #### Trace Flag: 3023 -Function: Enables CHECKSUM option as default for BACKUP command
+Function: Enables `CHECKSUM` option as default for `BACKUP` command.
**Note: Beginning with SQL Server 2014 this behavior is controlled by setting the backup checksum default configuration option. For more information, see [Server Configuration Options (SQL Server)](https://msdn.microsoft.com/en-us/library/ms189631.aspx)**.
-Link: https://support.microsoft.com/help/2656988
+Link: https://support.microsoft.com/kb/2656988
Link: [Docs Trace Flags]
+Link: https://www.sqlservergeeks.com/sql-server-trace-flag-3023/
Scope: global or session @@ -2132,7 +2335,7 @@ Link: https://blogs.msdn.microsoft.com/ialonso/2012/02/24/vdi-backups-and-backup Function: Bypasses the default backup compression pre-allocation algorithm to allow the backup file to grow only as needed to reach its final size. This trace flag is useful if you need to save on space by allocating only the actual size required for the compressed backup. Using this trace flag might cause a slight performance penalty (a possible increase in the duration of the backup operation). For more information about the pre-allocation algorithm, see [Backup Compression (SQL Server)](https://msdn.microsoft.com/en-us/library/bb964719.aspx).
Link: [Docs Trace Flags]
-Link: https://support.microsoft.com/help/2001026/inf-space-requirements-for-backup-devices-in-sql-server
+Link: https://support.microsoft.com/kb/2001026
Link: https://blogs.msdn.microsoft.com/psssql/2011/08/11/how-compressed-is-your-backup/
Link: https://docs.microsoft.com/en-us/sql/relational-databases/backup-restore/backup-compression-sql-server
Link: https://sqlstudies.com/2017/03/16/compressed-backup-errors-and-tf-3042/
@@ -2150,13 +2353,13 @@ Scope: global only #### Trace Flag: 3057 Function: Enables functionality after a hotfix that allows a log backup that was taken on a t-logfile hosted on a drive with “Bytes per physical sector”=512 to be restored onto a log file/drive that has “Bytes per physical sector”=4096
-Link: https://support.microsoft.com/help/2987585/restore-log-with-standby-mode-on-an-advanced-format-disk-may-cause-a-9004-error-in-sql-server-2008-r2-or-sql-server-2012 +Link: https://support.microsoft.com/kb/2987585 #### Trace Flag: 3101 Function: Fix performance problems when restoring database with CDC
-Link: https://support.microsoft.com/help/2567366/ +Link: https://support.microsoft.com/kb/2567366 @@ -2239,6 +2442,7 @@ Link: [Docs Trace Flags]
Link: http://www.sqlskills.com/blogs/paul/fed-up-with-backup-success-messages-bloating-your-error-logs
Link: https://blogs.msdn.microsoft.com/sqlserverstorageengine/2007/10/30/when-is-too-much-success-a-bad-thing
Link: [Important Trace Flags That Every DBA Should Know]
+Link: https://www.sqlservergeeks.com/sql-server-trace-flag-3226/
Scope: global only @@ -2283,7 +2487,7 @@ Link: None Function: Cause auditing of transaction log records as they're read (during transaction rollback or log recovery). This is useful because there is no equivalent to page checksums for transaction log records and so no way to detect whether log records are being corrupted e careful with these trace flags - I don't recommend using them unless you are experiencing corruptions that you can't diagnose. Turning them on will cause a big CPU hit because of the extra auditing that's happening.
-Link: https://support.microsoft.com/help/215458
+Link: https://support.microsoft.com/kb/215458
Link: http://www.sqlskills.com/blogs/paul/how-to-tell-if-the-io-subsystem-is-causing-corruptions
Link: http://technet.microsoft.com/en-au/library/cc917726.aspx
Link: [Important Trace Flags That Every DBA Should Know]
@@ -2292,9 +2496,13 @@ Scope: ? #### Trace Flag: 3427 -Function: Enables fix for issue when many consecutive transactions inserting data into temp table in SQL Server 2016 consume more CPU than in SQL Server 2014. Another change in SQL Server 2016 behavior that could impact tempdb-heavy workloads has to do with Common Criteria Compliance (CCC), also known as C2 auditing. We introduced functionality to allow for transaction-level auditing in CCC which can cause some additional overhead, particularly in workloads that do heavy inserts and updates in temp tables. Unfortunately, this overhead is incurred whether you have CCC enabled or not. In SQL Server 2016 you can enable trace flag 3427 to bypass this overhead starting with SP1 CU2. Starting in SQL Server 2017 CU4, we automatically bypass this code if CCC is disabled.
+Function: Enables fix for issue when many consecutive transactions inserting data into temp table in SQL Server 2016 consume more CPU than in SQL Server 2014. +Another change in SQL Server 2016 behavior that could impact tempdb-heavy workloads has to do with Common Criteria Compliance (CCC), also known as C2 auditing. +We introduced functionality to allow for transaction-level auditing in CCC which can cause some additional overhead, particularly in workloads that do heavy inserts and updates in temp tables +Unfortunately, this overhead is incurred whether you have CCC enabled or not. In SQL Server 2016 you can enable trace flag 3427 to bypass this overhead starting with SP1 CU2. Starting in SQL Server 2017 CU4, we automatically bypass this code if CCC is disabled.
+**Note: This trace flag applies to SQL Server 2016 (13.x) SP1 CU2 through SQL Server 2016 (13.x) SP2 CU2. Starting with SQL Server 2016 (13.x) SP2 CU3 and SQL Server 2017 (14.x), this trace flag has no effect.**
Link: [Docs Trace Flags]
-Link: https://support.microsoft.com/help/3216543
+Link: https://support.microsoft.com/kb/3216543
Link: [TEMPDB – Files and Trace Flags and Updates]
Scope: global only @@ -2304,15 +2512,15 @@ Scope: global only Function: Introduced in the KB to fix a race condition leading to a hung database in mirroring failover situations. “ This trace flag forces new connections to keep checking for database state every two seconds instead of waiting for a lock for infinite time. It helps ending the connection tasks faster as the mirroring reac hes the start of the recovery phase and releasing more worker threads to be used by database mirroring.”
-Link: https://support.microsoft.com/help/2970421/ +Link: https://support.microsoft.com/kb/2970421 #### Trace Flag: 3449 Function: If you enable global TF 3449 (and you are on SQL Server 2012 SP3 CU3 or later or SQL Server 2014 SP1 CU7 or later), you will get much better performance by avoiding a FlushCache call in a number of different common scenarios, such as backup database, -backup transaction log, create database, add a file to a database, restore a transaction log, recover a database, shrink a database file, and a SQL Server “graceful” shutdown. -Link: https://support.microsoft.com/help/3158396/
+backup transaction log, create database, add a file to a database, restore a transaction log, recover a database, shrink a database file, and a SQL Server “graceful” shutdown.
+Link: https://support.microsoft.com/kb/3158396
Link: https://blogs.msdn.microsoft.com/psssql/2017/06/29/sql-server-large-ram-and-db-checkpointing/
Link: [Hidden Performance & Manageability Improvements in SQL Server 2012 / 2014]
Link: [KB2964518]
@@ -2325,11 +2533,11 @@ Function: Disables parallel redo. Assume that you use an Always On availability group (AG) that contains heap tables. Starting in SQL Server 2016, parallel thread for redo operations is used in secondary replicas. In this case, heap tables redo operation may generate a runtime assert dump or the SQL Server may crash with an access violation error in some cases.
-**Note: This trace flag applies to SQL Server 2016 (13.x) and SQL Server 2017 (14.x).**
+**Note: This trace flag applies to SQL Server 2016 (13.x), SQL Server 2017 (14.x), and higher builds.**
Link: [Docs Trace Flags]
-Link: https://support.microsoft.com/help/3200975/
-Link: https://support.microsoft.com/help/4101554/
-Link: https://support.microsoft.com/help/4339858/
+Link: https://support.microsoft.com/kb/3200975
+Link: https://support.microsoft.com/kb/4101554
+Link: https://support.microsoft.com/kb/4339858
Scope: global only @@ -2338,6 +2546,7 @@ Scope: global only Function: Disables [indirect checkpoints](https://docs.microsoft.com/en-us/sql/relational-databases/logs/database-checkpoints-sql-server?view=sql-server-2017#IndirectChkpt) on `tempdb`.
**Note: This trace flag applies to SQL Server 2016 (13.x) SP1 CU5, SQL Server 2017 (14.x) CU1 and higher builds.**
Link: [Docs Trace Flags]
+Link: https://techcommunity.microsoft.com/t5/SQL-Server/Indirect-Checkpoint-and-tempdb-8211-the-good-the-bad-and-the-non/bc-p/851152#M1351 Scope: global only @@ -2350,35 +2559,46 @@ Link: None #### Trace Flag: 3502 -Function: Writes info about checkpoints to error log.
+**Undocumented trace flag**
+Function: Write checkpoint start and end messages in the SQL Server error log.
Link: [Important Trace Flags That Every DBA Should Know]
Link: https://blogs.msdn.microsoft.com/joaol/2008/11/20/sql-server-checkpoint-problems/
-Link: http://www.sqlskills.com/blogs/paul/a-sql-server-dba-myth-a-day-1530-checkpoint-only-writes-pages-from-committed-transactions/
+Link: [A SQL Server DBA myth a day: (15/30) checkpoint only writes pages from committed transactions]
+Link: https://www.sqlservergeeks.com/sql-server-trace-flag-3502/
Scope: session only #### Trace Flag: 3503 +**Undocumented trace flag**
Function: Indicates whether the checkpoint at the end of automatic recovery was skipped for a database (this applies only to read-only databases)
Link: http://www.sql-server-performance.com/2002/traceflags/ #### Trace Flag: 3504 -Function: For internal testing. Will raise a bogus log-out-of-space condition from checkpoint
+**Undocumented trace flag**
+Function: writes to the error log information about what is written to disk. +For internal testing. Will raise a bogus log-out-of-space condition from checkpoint.
Link: https://blogs.msdn.microsoft.com/joaol/2008/11/20/sql-server-checkpoint-problems/
-Link: http://www.sqlskills.com/blogs/paul/a-sql-server-dba-myth-a-day-1530-checkpoint-only-writes-pages-from-committed-transactions/ +Link: [A SQL Server DBA myth a day: (15/30) checkpoint only writes pages from committed transactions]
+Link: https://www.sqlservergeeks.com/sql-server-trace-flag-3504/
+Link: https://www.sqlshack.com/sql-server-checkpoint-lazy-writer-eager-writer-and-dirty-pages-in-sql-server/
+Link: https://docs.microsoft.com/en-us/archive/blogs/psssql/how-it-works-when-is-the-flushcache-message-added-to-sql-server-error-log
+Scope: session only #### Trace Flag: 3505 +**Undocumented trace flag**
Function: Disables automatic checkpoints. Setting trace flag 3505 may increase recovery time and can prevent log space reuse until the next checkpoint is issued. Make sure to issue manual checkpoints on all read/write databases at appropriate time intervals. "For high availability systems, such as clusters, Microsoft recommends that you do not change the recovery interval because it may affect data safety and availability."
Link: http://www.sqlskills.com/blogs/paul/benchmarking-1-tb-table-population-part-2-optimizing-log-block-io-size-and-how-log-io-works/
Link: [Important Trace Flags That Every DBA Should Know]
-Scope: ? +Link: https://www.sqlservergeeks.com/sql-server-trace-flag-3505/
+Scope: global only @@ -2390,7 +2610,7 @@ Link: https://blogs.msdn.microsoft.com/sqlserverfaq/2009/05/27/info-sql-2000-msd #### Trace Flag: 3602 Function: Records all error and warning messages sent to the client
-Link: https://support.microsoft.com/help/199037/ +Link: https://support.microsoft.com/kb/199037 @@ -2401,6 +2621,7 @@ Link: https://blogs.msdn.microsoft.com/sqlserverfaq/2009/05/27/info-sql-2000-msd #### Trace Flag: 3604 +**Undocumented trace flag**
Function: Enables the output from a large number of trace flags and DBCC commands to be sent back to the client. The Connect issue notes that problems can occur when using 3604 with a query that executes across a linked server. [This CSS page](https://blogs.msdn.microsoft.com/psssql/2009/05/11/how-do-i-determine-which-dump-triggers-are-enabled/) points out that 3604 is necessary for DBCC DumpTrigger(‘display’)
@@ -2411,6 +2632,8 @@ Link: [How to Find the Statistics Used to Compile an Execution Plan]
Link: [A Row Goal Riddle]
Link: [Undocumented Trace Flags: Inside the Restore Process]
Link: [What’s CHECKDB doing in my database restore?]
+Link: https://www.sqlservergeeks.com/sql-server-trace-flag-3604/
+Link: [Cardinality Estimation for Multiple Predicates]
Scope: session only @@ -2421,6 +2644,7 @@ Often referenced in KB and blog articles in the context of other trace flags (e. Link: https://blogs.msdn.microsoft.com/askjay/2011/01/21/why-do-we-need-trace-flag-3604-for-dbcc-statements/
Link: [Undocumented Trace Flags: Inside the Restore Process]
Link: [What’s CHECKDB doing in my database restore?]
+Link: https://www.sqlservergeeks.com/sql-server-trace-flag-3605/
Scope: session only @@ -2434,9 +2658,8 @@ Link: https://blogs.msdn.microsoft.com/ialonso/2012/10/24/why-does-restoring-a-d #### Trace Flag: 3608 Function: Prevents SQL Server from automatically starting and recovering any database except the master database. -If activities that require tempdb are initiated, then model is recovered and tempdb is created. Other databases will be started and recovered when accessed. -Some features, such as snapshot isolation and read committed snapshot, might not work. -Use for Move System Databases and Move User Databases.
+If activities that require TempDB are initiated, then model is recovered and TempDB is created. Other databases will be started and recovered when accessed. +Some features, such as snapshot isolation and read committed snapshot, might not work. Use for [Move System Databases](https://docs.microsoft.com/en-us/sql/relational-databases/databases/move-system-databases?view=sql-server-2017) and [Move User Databases](https://docs.microsoft.com/en-us/sql/relational-databases/databases/move-user-databases?view=sql-server-2017).
**Note: Do not use during normal operation.**
Link: [Docs Trace Flags]
Link: [Importance of Performing DBCC CHECKDB on all SQL Server Databases]
@@ -2466,6 +2689,16 @@ Function: Modifies the order of startup operations so that SQL Server can succes Link: None + +#### Trace Flag: 3618 +**Undocumented trace flag**
+Function: Disable the new Metadata-Only Column Changes in SQL Server 2016 and upper versions. +This trace flag is not effective when used at the session level. +There is no way to specify a query-level trace flag with an `ALTER COLUMN` command.
+Link: https://sqlperformance.com/2020/04/database-design/new-metadata-column-changes-sql-server-2016
+Scope: globa only + + #### Trace Flag: 3625 Function: Limits the amount of information returned to users who are not members of the sysadmin fixed server role, by masking the parameters of some error messages using '******'. @@ -2518,15 +2751,19 @@ Scope: ? Function: Apparently increases info found in the sys.dm_os_memory_allocations DMV (which appears to have replaced the DBCC MEMOBJLIST command) Bob Ward also discusses it in his PASS 2013 session, saying that it turns on tracing for all memory allocations done by “Memory Objects” (a specific SQLOS memory term). This flag will have a significant impact on system performance.
Link: https://blogs.msdn.microsoft.com/psssql/2012/11/12/how-can-reference-counting-be-a-leading-memory-scribbler-cause
Link: https://blogs.msdn.microsoft.com/slavao/2005/08/30/talking-points-around-memory-manager-in-sql-server-2005
-Link: https://support.microsoft.com/help/2888658/ +Link: https://support.microsoft.com/kb/2888658 #### Trace Flag: 3656 -Function: Enables resolve of all call stacks in extended events
+Function: Enables symbol resolution on stack dumps when the Debugging Tools for Windows are installed. +For more information, see this [Microsoft Whitepaper](https://www.microsoft.com/en-us/download/details.aspx?id=26666).
+**WARNING: This is a debugging trace flag and not meant for production environment use.**
+Link: [Docs Trace Flags]
Link: http://sqlcat.com/sqlcat/b/msdnmirror/archive/2010/05/11/resolving-dtc-related-waits-and-tuning-scalability-of-dtc.aspx
Link: [Controlling SQL Server memory dumps]
-Link: http://www.sqlskills.com/blogs/paul/determine-causes-particular-wait-type +Link: http://www.sqlskills.com/blogs/paul/determine-causes-particular-wait-type
+Scope: global or session @@ -2553,13 +2790,13 @@ Link: http://blogs.msdn.com/b/psssql/archive/2011/01/07/discussion-about-sql-ser #### Trace Flag: 3688 Function: Removes messages to error log about traces started and stopped
-Link: https://support.microsoft.com/help/922578 +Link: https://support.microsoft.com/kb/922578 #### Trace Flag: 3689 Function: Logs extended errors to errorlog when network disconnect occurs, turned off by default. Will dump out the socket error code this can sometimes give you a clue as to the root cause.
-Link: https://support.microsoft.com/help/922578 +Link: https://support.microsoft.com/kb/922578 @@ -2576,8 +2813,19 @@ Link: None #### Trace Flag: 3861 -Function: This flag allows the SQL Server DB startup code to move system tables to the primary filegroup. Introduced due to behavior in the SQL 2014 upgrade process, where system tables could be created in a secondary filegroup (if that FG was the default).
-Link: https://support.microsoft.com/help/3003760/ +Function: This flag allows the SQL Server DB startup code to move system tables to the primary filegroup. +Introduced due to behavior in the SQL 2014 upgrade process, where system tables could be created in a secondary filegroup (if that FG was the default).
+Link: https://support.microsoft.com/kb/3003760 + + + +#### Trace Flag: 3895 +**Undocumented trace flag**
+Function: In SQL Server 2019, when you enable the [Memory-Optimized TempDB Metadata](https://docs.microsoft.com/en-us/sql/relational-databases/databases/tempdb-database) feature, this trace flag is automatically enabled as a global session flag after the next restart. +When you disable that feature, the trace flag is automatically removed as a global session flag after the next restart. +Also, if you add trace flag 3895 to startup parameters after restarting SQL Server option `IsTempdbMetadataMemoryOptimized` will be enabled. NOTE: It is NOT recommended to add trace flag 3895 as a startup trace flag to enable TempDB Memory-Optimized Metadata. Although this technically enables the option, you will no longer be able to disable it using sp_configure or ALTER SERVER CONFIGURATION. The only way you'll be able to disable this feature is to manually remove this trace flag from startup parameters in the SQL Server Configuration Manager startup properties
+Link: https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Trace_Flag/Trace_Flag_3895.sql
+Scope: global only @@ -2595,13 +2843,15 @@ Link: None #### Trace Flag: 3923 Function: Let SQL Server throw an exception to the application when the 3303 warning message is raised
-Link: https://support.microsoft.com/help/3014867 +Link: https://support.microsoft.com/kb/3014867 #### Trace Flag: 3924 -Function: Enables a fix where “XA” transactions started within a JDBC-connected Java app are not closed properly and stay open indefinitely.
-Link: https://support.microsoft.com/help/3145492/ +Function: Enables automatic removal of orphaned DTC transactions with `SPID=-2`, which is a problem for some 3rd party transaction monitors.
+Link: https://support.microsoft.com/kb/4519668
+Link: https://support.microsoft.com/kb/4511816
+Scope: global only @@ -2618,8 +2868,8 @@ SQL Server opens database data and log files with FILE_FLAG_WRITE_THROUGH, mappi Linux Default: Trace flag considered **Off** Windows Default: Trace flag considered **On ** **The trace flag does not apply to SQL Server on Linux SQL 2017 RTM thru CU5. The behavior is assumed enabled prior to CU 6. -** The trace flag does not apply to Windows. On Windows it is always assumed to be enabled.** -On Linux, you need a file system that provides DpuFua=1 enablement or you have confirmed your system is O_DIRECT safe. +**The trace flag does not apply to Windows. On Windows it is always assumed to be enabled.** +On Linux, you need a file system that provides `DpuFua=1` enabled or you have confirmed your system is O_DIRECT safe. By enabling the trace flag you disable the batch flush requests from SQL Server and are trusting SQLPAL, HE and the I/O subsystem configuration to achieve durability.
Link: [SQL Server On Linux: Forced Unit Access (Fua) Internals]
Scope: global @@ -2634,7 +2884,7 @@ Linux Default: Trace flag is considered **On** Windows Default: Trace flag is considered **Off** **Microsoft retains the policy that SQL Server should always be run on a system with stable media configurations. The trace flag is NOT supported on Windows.** -[This article](https://support.microsoft.com/help/86903/) highlights these support boundaries. +[This article](https://support.microsoft.com/kb/86903) highlights these support boundaries. It was written by David Campbell, Bob Ward, Keith Elmore and I many years ago and the forced flush feature does not alter the intent: “SQL Server requires systems to support ‘ guaranteed delivery to stable media ’ as outlined under the Microsoft SQL Server Always-On Storage Solution Review program. For more information about the input and output requirements for the SQL Server database engine. When running on Linux kernels or file systems that do not support optimized Fua capabilities. @@ -2711,7 +2961,7 @@ Scope: global only #### Trace Flag: 4032 Function: Traces the SQL commands coming in from the client. When enabled with 3605 it will direct those all to the error log.
-Link: https://support.microsoft.com/help/199037/
+Link: https://support.microsoft.com/kb/199037
Link: http://www.sqlservergeeks.com/sql-server-trace-flag-4032/
Scope: global only @@ -2738,13 +2988,13 @@ Link: None #### Trace Flag: 4101 Function: “FIX: Reorder outer joins with filter criteria before non-selective joins and outer joins” Enabling this flag may increase the chance that selective filter criteria on an OUTER JOIN will influence the OJ earlier in the plan, rather than the more typical behavior of INNER JOINs being prioritized before OJs. Note that 4101 is also required to enable KB942444.
-Link: https://support.microsoft.com/help/318530/ +Link: https://support.microsoft.com/kb/318530 #### Trace Flag: 4102 Function: SQL 9 - Query performance is slow if the execution plan of the query contains semi join operators Typically, semi join operators are generated when the query contains the IN keyword or the EXISTS keyword. Enable flag 4102 and 4118 to overcome this.
-Link: https://support.microsoft.com/help/946020/ +Link: https://support.microsoft.com/kb/946020 @@ -2787,7 +3037,7 @@ Link: None #### Trace Flag: 4109 Function: “FIX: Error message when you run a query that uses a fast forward-only cursor in SQL Server 2005: "Query processor could not produce a query plan because of the hints defined in this query”
-Link: https://support.microsoft.com/help/926773/ +Link: https://support.microsoft.com/kb/926773 @@ -2808,7 +3058,7 @@ Function: Enables a fix for a problem that occurs when a linked server from 2005 execution plan that has a remote query. SQL Server 2005 must execute the remote query against SQL Server 2000 to retrieve the required data. SQL Server 2000 cannot handle the remote query. Therefore, error 107 occurs in SQL Server 2000. Then, error 107 is propagated back to SQL Server 2005. Therefore, error 107 occurs in SQL Server 2005, and error 8180 occurs in SQL Server 2005.”
-Link: https://support.microsoft.com/help/936223/ +Link: https://support.microsoft.com/kb/936223 @@ -2838,7 +3088,7 @@ Link: None #### Trace Flag: 4120 Function: “FIX: Error message when you perform an update operation by using a cursor in SQL Server 2005: Transaction (Process ID ) was deadlocked on lock resources with another process and has been chosen as the deadlock victim” This issue is apparently due to deadlock issues related to upgrading a U lock to an X lock.
-Link: https://support.microsoft.com/help/953948/ +Link: https://support.microsoft.com/kb/953948 @@ -2868,7 +3118,7 @@ Link: None #### Trace Flag: 4126 Function: “FIX: The synchronization process is slow, and the CPU usage is high on the computer that is configured as the Distributor in SQL Server 2005” The problem manifested as a replication performance issue, but the following phrase found in the KB article indicates that it is a query processor issue: “the query that performs poorly shows that a join predicate is not pushed down to a Clustered Index Seek operator.”
-Link: https://support.microsoft.com/help/959013/ +Link: https://support.microsoft.com/kb/959013 @@ -2881,7 +3131,7 @@ Link: Note #### Trace Flag: 4128 Function: “FIX: When you update rows by using a cursor in SQL Server 2005, the update may take a long time to finish”
-Link: https://support.microsoft.com/help/957872/ +Link: https://support.microsoft.com/kb/957872 @@ -2905,7 +3155,7 @@ Link: None #### Trace Flag: 4133 Function: “FIX: The size of the SQL Server 2005 error log file or of the SQL Server 2008 error log file grows very quickly when query notifications are created and destroyed in a high ratio” & “FIX: The restore operation takes a long time when you restore a database that has query notification enabled in SQL Server 2005 or in SQL Server 2008”
-Link: https://support.microsoft.com/help/958006/ +Link: https://support.microsoft.com/kb/958006 @@ -2914,7 +3164,7 @@ Function: Bugfix for error: parallel query returning different results every tim The trace flag disables an optimization in the query optimizer. The optimization caused the issue described in the KB article when you try to insert into a table by selecting from the table itself. As turning on the trace flag could result in a perf degradation, you only should use it if you run into the issue described in the KB article.
-Link: https://support.microsoft.com/help/2546901
+Link: https://support.microsoft.com/kb/2546901
Link: http://sql-sasquatch.blogspot.se/2014/04/whaddayaknow-bout-sqlserver-trace-flag.html
Link: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/9ea718c2-e0e0-40cf-b12b-3269130448b7/trace-flag-4135-sql-server-2008?forum=sqldatabaseengine @@ -2922,16 +3172,17 @@ Link: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/9ea718c2-e0e0-40c #### Trace Flag: 4135 Function: Bugfix for error inserting to temp table
-Link: https://support.microsoft.com/help/960770
+Link: https://support.microsoft.com/kb/960770
Link: https://connect.microsoft.com/SQLServer/feedback/details/541352/tempdb-errors-during-statistics-auto-update #### Trace Flag: 4136 Function: Disables parameter sniffing unless OPTION(RECOMPILE), WITH RECOMPILE or OPTIMIZE FOR value is used. -To accomplish this at the database level, see [ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL)]. -To accomplish this at the query level, add the OPTIMIZE FOR UNKNOWN query hint. -Beginning with SQL Server 2016 SP1, to accomplish this at the query level, add the USE HINT query hint instead of using this trace flag. +Starting with SQL Server 2016 (13.x), to accomplish this at the database level, see the PARAMETER_SNIFFING option in [ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL)]. +To accomplish the same result at the query level, add the OPTIMIZE FOR UNKNOWN [query hint](https://docs.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-query?view=sql-server-2017). +The `OPTIMIZE FOR UNKNOWN` hint doesn't disable the parameter sniffing mechanism, but effectively bypasses it to achieve the same intended result. +Starting with SQL Server 2016 (13.x) SP1, a second option to accomplish this at the query level is to add the USE HINT 'DISABLE_PARAMETER_SNIFFING' query hint instead of using this trace flag. **Note: Please ensure that you thoroughly test this option, before rolling it into a production environment.**
Link: http://blogs.msdn.com/b/axinthefield/archive/2010/11/04/sql-server-trace-flags-for-dynamics-ax.aspx
Link: [New Features in SQL Server 2016 Service Pack 1]
@@ -2939,30 +3190,35 @@ Link: [Docs Trace Flags]
Link: http://kejser.org/trace-flag-4136-2/
Link: http://www.sqlservergeeks.com/sql-server-trace-flag-4136/
Link: http://www.sqlservergeeks.com/sql-server-did-you-know-about-trace-flag-4136/
+Link: [KB2801413]
Scope: global or session or query #### Trace Flag: 4137 -Function: Causes SQL Server to generate a plan using minimum selectivity when estimating AND predicates for filters to account for correlation, under the query optimizer cardinality estimation model of SQL Server 2012 and earlier versions
-Beginning with SQL Server 2016 SP1, to accomplish this at the query level, add the USE HINT query hint instead of using this trace flag. +Function: Causes SQL Server to generate a plan using minimum selectivity when estimating AND predicates for filters to account for partial correlation instead of independence, under the query optimizer cardinality estimation model of SQL Server 2012 (11.x) and earlier versions (70).
+Starting with SQL Server 2016 (13.x) SP1, to accomplish this at the query level, add the USE HINT 'ASSUME_MIN_SELECTIVITY_FOR_FILTER_ESTIMATES' query hint instead of using this trace flag when using the CE 70. **Note: Please ensure that you thoroughly test this option, before rolling it into a production environment.**
-Link: https://support.microsoft.com/help/2658214
+**Note: This trace flag does not apply to CE version 120 or above. Use trace flag [9471](#9471) instead.**
+Link: https://support.microsoft.com/kb/2658214
Link: [New Features in SQL Server 2016 Service Pack 1]
Link: [Docs Trace Flags]
+Link: [KB2801413]
+Link: [Cardinality Estimation for Multiple Predicates]
Scope: global or session or query #### Trace Flag: 4138 -Function: Causes SQL Server to generate a plan that does not use row goal adjustments with queries that contain TOP, OPTION (FAST N), IN, or EXISTS keywords
-Beginning with SQL Server 2016 SP1, to accomplish this at the query level, add the USE HINT query hint instead of using this trace flag. +Function: Causes SQL Server to generate a plan that does not use row goal adjustments with queries that contain `TOP`, `OPTION (FAST N)`, `IN`, or `EXISTS` keywords
+Beginning with SQL Server 2016 SP1, to accomplish this at the query level, add the `USE HINT` query hint instead of using this trace flag. **Note: Please ensure that you thoroughly test this option, before rolling it into a production environment.**
-Link: https://support.microsoft.com/help/2667211
+Link: https://support.microsoft.com/kb/2667211
Link: [New Features in SQL Server 2016 Service Pack 1]
Link: [Docs Trace Flags]
Link: https://answers.sqlperformance.com/questions/1609/trying-to-figure-out-how-to-resolve-the-data-skew.html
Link: http://dba.stackexchange.com/questions/55198/huge-slowdown-to-sql-server-query-on-adding-wildcard-or-top
+Link: [KB2801413]
Scope: global or session or query @@ -2972,38 +3228,47 @@ Function: Enable automatically generated quick statistics (histogram amendment) If trace flag 4139 is set, regardless of the leading statistics column status (ascending, descending, or stationary), the histogram used to estimate cardinality will be adjusted at query compile time
Beginning with SQL Server 2016 SP1, to accomplish this at the query level, add the USE HINT query hint instead of using this trace flag. **Note: Please ensure that you thoroughly test this option, before rolling it into a production environment.**
-Link: https://support.microsoft.com/help/2952101
+Link: https://support.microsoft.com/kb/2952101
Link: [Docs Trace Flags]
Link: [SQL Server - estimates outside of the histogram - half-baked draft]
Link: [Parallelism in Hekaton (In-Memory OLTP)]
Link: [Important Trace Flags That Every DBA Should Know]
-Link: https://support.microsoft.com/help/974006
+Link: https://support.microsoft.com/kb/974006
Scope: global or session or query #### Trace Flag: 4199 +**Important: Query Optimizer fixes that address wrong results or access violation errors are not enabled by trace flag 4199. +Those fixes are not considered optional and become enabled by default once the update package is installed.**
Function: Enables query optimizer (QO) changes released in SQL Server Cumulative Updates and Service Packs. -QO changes that are made to previous releases of SQL Server are enabled by default under the latest database compatibility level in a given product release, without trace flag 4199 enabled.
+QO changes that are made to previous releases of SQL Server are enabled by default under the latest database [compatibility level](https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-database-transact-sql-compatibility-level) in a given product release, without trace flag 4199 enabled.
The following table summarizes the behavior when using specific database compatibility levels and trace flag 4199: -| Database compatibility level | TF 4199 | QO changes from previous database compatibility levels | QO changes for current version post-RTM | -|------------------------------|-------------|--------------------------------------------------------|-----------------------------------------| -| 100 to 120 | Off
On | Disabled
Enabled | Disabled
Enabled | -| 130 | Off
On | Enabled
Enabled | Disabled
Enabled | -| 140 | Off
On | Enabled
Enabled | Disabled
Enabled | - -To enable this at the database level, see [ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL)].
-**Note: Starting with SQL Server 2016 SP1, to accomplish this at the query level, add the USE HINT [query hint](https://docs.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-query) instead of using this trace flag.**
-Link: https://support.microsoft.com/help/974006
+|Database Engine (DE) version | Database compatibility level | TF 4199 | QO changes from all previous Database Compatibility Levels | QO changes for DE version post-RTM | +|---------------------------------------------------------------|------------------------------|-------------|------------------------------------------------------------|------------------------------------| +| 13 (SQL Server 2016 (13.x)) | 100 to 120 | Off
On | Disabled
Enabled | Disabled
Enabled | +| | 130 (Default) | Off
On | Enabled
Enabled | Disabled
Enabled | +| 14 (SQL Server 2017 (14.x)) | 100 to 120 | Off
On | Disabled
Enabled | Disabled
Enabled | +| | 130 | Off
On | Enabled
Enabled | Disabled
Enabled | +| | 140 (Default) | Off
On | Enabled
Enabled | Disabled
Enabled | +| 15 (SQL Server 2019 (15.x))
and 12 (Azure SQL Database) | 100 to 120 | Off
On | Disabled
Enabled | Disabled
Enabled | +| | 130 to 140 | Off
On | Enabled
Enabled | Disabled
Enabled | +| | 150 (Default) | Off
On | Enabled
Enabled | Disabled
Enabled | + +Starting with SQL Server 2016 (13.x), to accomplish this at the database level, see the QUERY_OPTIMIZER_HOTFIXES option in [ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL)](https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-database-scoped-configuration-transact-sql). +Starting with SQL Server 2016 (13.x) SP1, to accomplish this at the query level, add the USE HINT [query hint](https://docs.microsoft.com/en-us/sql/t-sql/queries/hints-transact-sql-query) instead of using this trace flag.
+Link: https://support.microsoft.com/kb/974006
Link: [New Features in SQL Server 2016 Service Pack 1]
Link: [Docs Trace Flags]
-Link: https://support.microsoft.com/help/974006/
+Link: https://support.microsoft.com/kb/974006
Link: https://sqlworkbooks.com/2017/04/selectively-enabletrace-flag-4199-and-query_optimizer_hotfixes-in-sql-server-2016/
Link: https://sqlworkbooks.com/2017/04/trace-flag-4199-no-per-session-override-if-you-enable-it-globally/
Link: http://www.sqlservergeeks.com/sql-server-2016-database-scoped-configuration-and-trace-flag-4199/
+Link: https://nebraskasql.blogspot.com/2018/11/things-i-learned-at-summit-v20-trace.html
Link: [Let’s talk about trace flags]
Link: [KB2964518]
+Link: [KB2801413]
Scope: global or session or query @@ -3016,8 +3281,9 @@ Link: https://blogs.msdn.microsoft.com/sqlserverfaq/2008/07/31/upgrade-of-sql-se #### Trace Flag: 4610 -Function: When you use trace flag 4618 together with trace flag 4610, the number of entries in the cache store is limited to 8,192. When the limit is reached, SQL 2005 removes some entries from the TokenAndPermUserStore cache store.
-Link: https://support.microsoft.com/help/959823
+Function: Increases the size of the hash table that stores the cache entries by a factor of 8. +When used together with trace flag 4618 increases the number of entries in the TokenAndPermUserStore cache store to 8,192.
+Link: https://support.microsoft.com/kb/959823
Link: [Docs Trace Flags]
Link: https://blogs.msdn.microsoft.com/psssql/2008/06/16/query-performance-issues-associated-with-a-large-sized-security-cache/
Scope: global only @@ -3038,7 +3304,7 @@ Link: http://blogs.msdn.com/b/lcris/archive/2007/02/19/sql-server-2005-some-new- #### Trace Flag: 4614 Function: Enables SQL Server authenticated logins that use Windows domain password policy enforcement to log on to the instance even though the SQL Server service account is locked out or disabled on the Windows domain controller.
-Link: https://support.microsoft.com/help/925744 +Link: https://support.microsoft.com/kb/925744 @@ -3048,7 +3314,7 @@ In SQL Server, an application role cannot access metadata outside its own databa This is a change of behavior from earlier versions of SQL Server. Setting this global flag disables the new restrictions, and allows for application roles to access server-level metadata.
Link: [Docs Trace Flags]
-Link: https://support.microsoft.com/help/906549/
+Link: https://support.microsoft.com/kb/906549
Scope: global only @@ -3059,8 +3325,8 @@ It may incur a small CPU overhead as when removing old cache entries when new en It performs this action to limit the size of the cache store growth. However, the CPU overhead is spread over time. When used together with trace flag 4610 increases the number of entries in the TokenAndPermUserStore cache store to 8192
Link: [Docs Trace Flags]
-Link: https://support.microsoft.com/help/933564
-Link: https://support.microsoft.com/help/959823/
+Link: https://support.microsoft.com/kb/933564
+Link: https://support.microsoft.com/kb/959823
Scope: global only @@ -3074,7 +3340,22 @@ Link: https://connect.microsoft.com/SQLServer/feedback/details/467661/sql-server #### Trace Flag: 4621 Function: SQL 9 – After 4610 & 4618 you can still customize the quota for TokenAndPermUserStore cache store that is based on the current workload
-Link: https://support.microsoft.com/help/959823 +Link: https://support.microsoft.com/kb/959823 + + + +#### Trace Flag: 4631 +Function: Disables SHA2_256/AES256 for hashing passwords that generate encryption keys. Starting in SQL Server 2017 (14.x), SHA2 is used instead of SHA1. This means extra steps might be necessary to have your SQL Server 2017 (14.x) installation decrypt items that were encrypted by SQL Server 2016 (13.x)
+Link: [Encryption Changes in SQL Server 2017 CU2](https://learn.microsoft.com/en-us/sql/relational-databases/security/encryption/create-identical-symmetric-keys-on-two-servers?view=sql-server-ver17#encryption-changes-in-sql-server-2017-cu2)
+Link: [KB 4053407: SQL Server 2017 cannot decrypt data encrypted by earlier versions of SQL Server using the same symmetric key](https://support.microsoft.com/kb/4053407)
+Scope: global only + + + +#### Trace Flag: 4675 +Function: Enable checks on create credential for managed identity on a SQL Server on Azure VM if Microsoft Entra authentication is enabled. Enables diagnostics for the CREATE CREDENTAIL WITH IDENTITY = 'Managed Identity' statement. The trace flag provides information about the primary managed identity and its setting for SQL Server on Azure VM.
+Link: [DBCC TRACEON Trace Flags](https://learn.microsoft.com/en-us/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql?view=sql-server-ver17)
+Scope: global or session @@ -3103,15 +3384,16 @@ Link: http://dba.fyicenter.com/Interview-Questions/SYBASE/What_is_Trace_Flag_Def #### Trace Flag: 5302 Function: Alters default behavior of select…INTO (and other processes) that lock system tables for the duration of the transaction. This trace flag disables such locking during an implicit transaction.
-Link: https://support.microsoft.com/help/153096/ +Link: [KB153096] #### Trace Flag: 6498 -Function: Enables more than one large query compilation to gain access to the big gateway when there is sufficient memory available. +Function: Enables more than one large query compilation to gain access to the big gateway when there is sufficient memory available. +This trace flag can be used to keep memory usage for the compilation of incoming queries under control, avoiding compilation waits for concurrent large queries. It is based on the 80 percentage of SQL Server Target Memory, and it allows for one large query compilation per 25 gigabytes (GB) of memory.
**Note: Beginning with SQL Server 2014 SP2 and SQL Server 2016 this behavior is controlled by the engine and trace flag 6498 has no effect.**
-Link: https://support.microsoft.com/help/3024815
+Link: https://support.microsoft.com/kb/3024815
Link: [Docs Trace Flags]
Link: http://blogs.msdn.com/b/sql_server_team/archive/2015/10/09/query-compile-big-gateway-policy-changes-in-sql-server.aspx
Link: [KB2964518]
@@ -3135,7 +3417,7 @@ Scope: global only Function: Enables a hotfix for “ FIX: Slow performance in SQL Server 2012 or SQL Server 2014 when you build an index on a spatial data type of a large table”
Link: https://blogs.msdn.microsoft.com/psssql/2013/11/19/spatial-indexing-from-4-days-to-4-hours
-Link: https://support.microsoft.com/help/2896720/ +Link: https://support.microsoft.com/kb/2896720 #### Trace Flag: 6531 @@ -3143,7 +3425,7 @@ Function: Enables adjustment in the SQLOS scheduling layer to handle queries tha This fix introduces the trace flag 6531 to indicate to the SQLOS hosting layer that the spatial data type should avoid preemptive protections. This can reduce the CPU consumption and improve the overall performance for spatial activities. Only use this trace flag if the individual, spatial method invocations (per row and column) take less than ~4ms. Longer invocations without preemptive protection could lead to scheduler concurrency issues and SQLCLR punishment messages logged to the error log.”
-Link: https://support.microsoft.com/help/3005300/ +Link: https://support.microsoft.com/kb/3005300 @@ -3170,12 +3452,12 @@ Scope: global or session #### Trace Flag: 6534 Function: Enables performance improvement of query operations with spatial data types in SQL Server 2012, SQL Server 2014 and SQL Server 2016. The performance gain will vary, depending on the configuration, the types of queries, and the objects.
-Link: https://support.microsoft.com/help/3054180
+Link: https://support.microsoft.com/kb/3054180
Link: [KB3107399]
Link: https://blogs.msdn.microsoft.com/bobsql/2016/06/03/sql-2016-it-just-runs-faster-native-spatial-implementations/
Link: [Docs Trace Flags]
Link: [KB2964518]
-Scope: global or session +Scope: global only @@ -3185,10 +3467,52 @@ When enabled, this option will require that _all_ assemblies, regardless of `PER Please note: 1. This TF can only be specified as a startup parameter!
1. This TF is only available in instances that have been updated / patched with a Service Pack (SP), Cumulative Update (CU), or GDR that was released on or after 2017-08-08.
- +**Note: This trace flag applies to SQL Server 2012 (11.x) SP3 CU10, SQL Server 2014 (12.x) SP2 CU6, SQL Server 2016 (13.x) RTM CU7, SQL Server 2016 (13.x) SP1 CU4, and higher builds. +Starting with SQL Server 2017 (14.x) this feature is enabled by default and trace flag 6545 has no effect.**
Link: [SQLCLR vs. SQL Server 2012 & 2014 & 2016, Part 7: “CLR strict security” – The Problem Continues … in the Past (Wait, What?!?)][TF6545-b]
Link: [Update adds the "CLR strict security" feature to SQL Server 2016][TF6545-a] ( KB4018930 )
-Scope: global +Link: https://support.microsoft.com/kb/3107399 +Scope: global only + + + +#### Trace Flag: 6559 +Function: avoids blocking from orphaned CLR sessions. Enables new functionality in SQL Server 2016 SP1 CU10, SQL Server 2017 CU18, and SQL Server 2019 CU1. Based on the description, this behavior will never be the default, and even though it is available in all versions after 2019, you have to opt into it with the trace flag.
+Link: https://support.microsoft.com/kb/4517771
+Scope: global only
+SQL Server Version: >= 2019 CU1, >= 2017 CU18, >= 2016 SP1 CU10 + + + +#### Trace Flag: 6773 +Function: Enables a fix to address an out of memory issue that occurs when bulk copying XML data where the sum of all XML attributes are > 2MB. This flag can help in circumstances where a client is running bulk copy of XML data and it receives sql error 6303 "XML parsing: Document parsing required too much memory".
+Link: https://support.microsoft.com/en-us/topic/kb4019125-fix-system-center-configuration-manager-replication-process-by-using-bcp-apis-fails-when-there-is-a-large-value-in-an-xml-column-53a969d5-801c-63ab-a557-bc89fe264394
+SQL Server Version: >= 2016 CU7, >= 2014 SP2 CU6, >= 2014 SP1 CU13, >= 2012 SP3 CU9 + + + +#### Trace Flag: 6950 +**Undocumented trace flag**
+Function: Disable SQL Server 2022's TempDB contention improvements around GAM/SGAM access.
+Link: [Github disable gamsgam]
+Scope: global only
+SQL Server Version: >= 2022 + + + +#### Trace Flag: 6962 +**Undocumented trace flag**
+Function: Disable SQL Server 2022's TempDB contention improvements around GAM/SGAM access.
+Link: [Github disable gamsgam]
+Scope: global only
+SQL Server Version: >= 2022 + + + +#### Trace Flag: 6981 +Function: Handle large objects (LOBs) when rebuilding the index that has an assertion issue (Location: blobbase.cpp:345; Expression: IS_ON (BLB_TI_END, m_status)). After turning on this trace flag and rebuilding the affected index, the assertion dump shouldn't be generated again. Added in SQL Server 2019 CU29.
+Link: [SQL Server 2019 CU29 Documentation](https://learn.microsoft.com/en-us/troubleshoot/sql/releases/sqlserver-2019/cumulativeupdate29#3370476)
+SQL Server Version: >= 2019 CU29 @@ -3201,9 +3525,9 @@ Link: None #### Trace Flag: 7300 Function: Outputs extra info about linked server errors
-Link: https://support.microsoft.com/help/314530
-Link: https://support.microsoft.com/help/280106/
-Link: https://support.microsoft.com/help/280102/
+Link: https://support.microsoft.com/kb/314530
+Link: https://support.microsoft.com/kb/280106
+Link: https://support.microsoft.com/kb/280102
Link: https://connect.microsoft.com/SQLServer/feedback/details/306380/trace-flag-issue-7300-3604 @@ -3216,14 +3540,14 @@ Link: None #### Trace Flag: 7311 Function: Offers a new alternative to handling the tricky problem of converting Oracle NUMBER types (across OLEDB linked server queries) with unknown precision/scale to a valid SQL Server data type, by treating all such types as NUMERIC(38,10).
-Link: https://support.microsoft.com/help/3051993/ +Link: https://support.microsoft.com/kb/3051993 #### Trace Flag: 7314 Function: Forces NUMBER values with unknown precision/scale to be treated as double values with OLE DB provider
Link: [Docs Trace Flags]
-Link: https://support.microsoft.com/help/3051993
+Link: https://support.microsoft.com/kb/3051993
Scope: global or session @@ -3231,7 +3555,7 @@ Scope: global or session #### Trace Flag: 7352 Function: Show the optimizer output and the post-optimization rewrite in action (After Post Optimization Rewrite)
Link: [Internals of the Seven SQL Server Sorts – Part 1]
-Link: http://sqlblog.com/blogs/paul_white/archive/2013/08/31/sql-server-internals-nested-loops-prefetching.aspx
+Link: https://www.sql.kiwi/2013/08/sql-server-internals-nested-loops-prefetching.html
Link: http://www.queryprocessor.com/batch-sort-and-nested-loops
Link: [Query Optimizer Deep Dive - Part 4]
Link: [Few Outer Rows Optimization]
@@ -3270,8 +3594,11 @@ Scope: ? #### Trace Flag: 7470 -Function: Fixes a problem where under certain (unknown) conditions, a sort spill occurs for large sorts
-Link: https://support.microsoft.com/help/3088480/ +Function: Enables additional computations for memory grants required for sort operations.
+**Note: This trace flag applies to SQL Server 2012 (11.x) SP2 CU8, SQL Server 2014 (12.x) RTM CU10, SQL Server 2014 (12.x) SP1 CU3, and higher builds.**
+**WARNING: Trace flag 7470 will increase memory requirements for queries using sort operators and may impact memory availability for other concurrent queries.**
+Link: https://support.microsoft.com/kb/3088480/
+Scope: global or session or query @@ -3279,9 +3606,10 @@ Link: https://support.microsoft.com/help/3088480/ Function: Enables the lightweight query execution statistics profiling infrastructure. unless your server is already CPU bound, like you’re running all the time with 95% CPU, unless you are at that point, turn on this trace flag at any server you have. This would be my advice here because this enables that lightweight profiling infrastructure there and then you’ll see in a few minutes what it unleashes here. -So one thing that happens when I enable the lightweight profiling is that the sys.dm_exec_query_profiles DMV, which is something that actually populates the live query stats ability or feature of SSMS, now also is also populated with this lightweight profiling, which means that for all essence, we are now able to run a live query stats on all fashions at any given point in time, and this is extremely useful for let’s say a production DBA that someone calls and says, “Hey, you have a problem. To tap into running system and look at what it’s doing.”
+So one thing that happens when I enable the lightweight profiling is that the sys.dm_exec_query_profiles DMV, which is something that actually populates the live query stats ability or feature of SSMS, now also is also populated with this lightweight profiling, which means that for all essence, we are now able to run a live query stats on all fashions at any given point in time, and this is extremely useful for let’s say a production DBA that someone calls and says, “Hey, you have a problem. To tap into running system and look at what it’s doing.” +**Applies to: SQL Server 2016 (13.x) Service Pack 1 and later versions. Starting with SQL Server 2019 (15.x), this trace flag has no effect because lightweight profiling is enabled by default.**
Link: [Docs Trace Flags]
-Link: https://support.microsoft.com/help/3170113
+Link: https://support.microsoft.com/kb/3170113
Link: https://www.brentozar.com/archive/2017/10/get-live-query-plans-sp_blitzwho/
Link: https://groupby.org/conference-session-abstracts/enhancements-that-will-make-your-sql-database-engine-roar-2016-sp1-edition/
Link: https://www.scarydba.com/2018/06/11/plan-metrics-without-the-plan-trace-flag-7412/
@@ -3292,7 +3620,7 @@ Scope: global only #### Trace Flag: 7470 Function: Fix for sort operator spills to tempdb in SQL Server 2012 or SQL Server 2014 when estimated number of rows and row size are correct
-Link: https://support.microsoft.com/help/3088480 +Link: https://support.microsoft.com/kb/3088480 @@ -3303,8 +3631,8 @@ Rather the engine acquires an (update) `U LOCK` on each individual statistics ob This behavior improves the overall concurrency of the update statistics job run executing in parallel and improves its performance.
** TF 7471 can increase the possibility of deadlock especially when creation of new statistics and updating of existing statistics are executed simultaneously. So the recommended best practice is to use TF 7471 only as a part of maintenance when update statistics jobs are run in parallel and should be turned off otherwise.** -Link: https://support.microsoft.com/help/3156157
-Link: http://sqlperformance.com/2016/05/sql-performance/parallel-rebuilds
+Link: https://support.microsoft.com/kb/3156157
+Link: https://sqlperformance.com/2016/05/sql-performance/parallel-rebuilds
Link: [KB2964518]
Link: https://blogs.msdn.microsoft.com/sql_server_team/boosting-update-statistics-performance-with-sql-2014-sp1cu6/
Scope: global only @@ -3371,6 +3699,12 @@ Function: SQL 9 - Full-text index population for the indexed view is very slow +#### Trace Flag: 7617 +Function: Skip dropping full-text index fragments marked as deletion during a database recovery process. Added in SQL Server 2019 CU29.
+Link: [SQL Server 2019 CU29 Documentation](https://learn.microsoft.com/en-us/troubleshoot/sql/releases/sqlserver-2019/cumulativeupdate29#3540450) + + #### Trace Flag: 7646 Function: SQL 10 - Avoids blocking when using full text indexing. @@ -3391,7 +3725,8 @@ Scope: global only #### Trace Flag: 7752 Function: Enables asynchronous load of Query Store.
-Note: Use this trace flag if SQL Server is experiencing high number of QDS_LOADDB waits related to Query Store synchronous load (default behavior).
+**Note: Use this trace flag if SQL Server is experiencing high number of [QDS_LOADDB](https://www.sqlskills.com/help/waits/qds_loaddb/) waits related to Query Store synchronous load (default behavior).**
+**Note: Starting with SQL Server 2019 this behavior is controlled by the engine and trace flag 7752 has no effect.**
Link: [Docs Trace Flags]
Link: [Query Store Trace Flags]
Link: [Let’s talk about trace flags]
@@ -3425,7 +3760,7 @@ Link: https://connect.microsoft.com/SQLServer/feedback/details/518158/-packet-er #### Trace Flag: 7833 Function: SQL 2012 SP2 CU8 introduced a fix for a “silent error” condition in the sqlcmd tool. The CU also included this flag to allow customers to revert to pre-CU fix behavior.
-Link: https://support.microsoft.com/help/3082877/ +Link: https://support.microsoft.com/kb/3082877 @@ -3470,7 +3805,7 @@ Link: https://technet.microsoft.com/en-us/library/cc917726.aspx #### Trace Flag: 8010 Function: Disables the “idle state” behavior that a SQL instance can enter (see TF 8009). Fixes problem that SQL Server services can not be stopped
-Link: https://support.microsoft.com/help/2633271 +Link: https://support.microsoft.com/kb/2633271 Link: https://technet.microsoft.com/en-us/library/cc917726.aspx @@ -3602,7 +3937,7 @@ Link: [Controlling SQL Server memory dumps] #### Trace Flag: 8030 Function: Fix for performance bug
-Link: https://support.microsoft.com/help/917035
+Link: https://support.microsoft.com/kb/917035
@@ -3619,7 +3954,7 @@ Scope: global only #### Trace Flag: 8033 Function: Suppresses messages of the form “The time stamp counter of CPU on scheduler id 1 is not synchronized with other CPUs” from being placed in the SQL Error log when CPU drift is noticed
**Warning: SQL 9 - Disable the reporting of CPU Drift errors in the SQL Server error log like time stamp counter of CPU on scheduler id 1 is not synchronized with other CPUs.**
-Link: https://support.microsoft.com/help/931279/
+Link: https://support.microsoft.com/kb/931279
Link: https://blogs.msdn.microsoft.com/psssql/2007/08/19/sql-server-2005-rdtsc-truths-and-myths-discussed @@ -3639,10 +3974,12 @@ Link: http://www.sqlservergeeks.com/blogs/AmitBansal/sql-server-bi/64/sql-server #### Trace Flag: 8048 -**Note: Beginning with SQL Server 2014 SP2 and SQL Server 2016 this behavior is controlled by the engine and trace flag 8048 has no effect.**
+According [Docs Trace Flags]: Beginning with SQL Server 2014 SP2 and SQL Server 2016 this behavior is controlled by the engine and trace flag 8048 has no effect.
+**BUT [according SQL Server ultra expert Erik Darling](https://github.com/ktaranov/sqlserver-kit/issues/195): The trace flag does still has effect. The engine behavior will partition memory if `CMEMTHREAD` contention is detected. Turning on TF 8048 forces the partitioning without having to hit the internal thresholds. +I trust Eric's opinion (and bold it).**
Function: Converts NUMA partitioned memory objects into CPU partitioned
Link: http://sql-sasquatch.blogspot.se/2013/04/startup-trace-flags-i-love.html
-Link: https://support.microsoft.com/help/2809338
+Link: https://support.microsoft.com/kb/2809338
Link: http://blogs.msdn.com/b/psssql/archive/2012/12/20/how-it-works-cmemthread-and-debugging-them.aspx
Link: [Docs Trace Flags]
Link: http://blogs.msdn.com/b/psssql/archive/2011/09/01/sql-server-2008-2008-r2-on-newer-machines-with-more-than-8-cpus-presented-per-numa-node-may-need-trace-flag-8048.aspx
@@ -3671,7 +4008,7 @@ Function: Enables a fix (after applying the appropriate CU) for x64 VAS exhausti Assume that you install the 64-bit version of Microsoft SQL Server 2014, 2016 or 2017 on a computer that's running Windows Server 2012 or an earlier version of Windows operating system. When SQL Server uses up all the user-mode virtual address space, you may receive an out of memory error message in the SQL Server error log. Additionally, queries take a long time to finish execution, and the `SOS_MEMORY_TOPLEVELBLOCKALLOCATOR` wait occurs.
-Link: https://support.microsoft.com/help/3074434/
+Link: https://support.microsoft.com/kb/3074434
Link: [KB2964518]
Scope: global only @@ -3690,12 +4027,19 @@ Link: https://blogs.msdn.microsoft.com/sqlreleaseservices/sql-server-2012-servic Link: [Hidden Performance & Manageability Improvements in SQL Server 2012 / 2014]
Link: [KB2964518]
Scope: global only + + + +#### Trace Flag: 8101 +Function: Enables a spinlock contention fix for high-end systems running SQL Server 2019 (15.x) serving many concurrent users.
+Note: This trace flag applies to SQL Server 2019 (15.x) CU2 and higher builds.
+Link: https://support.microsoft.com/kb/4538688
+Scope: global only #### Trace Flag: 8202 -Function: Used to replicate UPDATE as DELETE/INSERT pair at the publisher. i.e. -UPDATE commands at the publisher can be run as an "on-page DELETE/INSERT" or a "full DELETE/INSERT". +Function: Used to replicate `UPDATE` as `DELETE/INSERT` pair at the publisher. i.e. UPDATE commands at the publisher can be run as an "on-page DELETE/INSERT" or a "full DELETE/INSERT". If the UPDATE command is run as an "on-page DELETE/INSERT," the Logreader send UDPATE command to the subscriber, If the UPDATE command is run as a "full DELETE/INSERT," the Logreader send UPDATE as DELETE/INSERT Pair. If you turn on trace flag 8202, then UPDATE commands at the publisher will be always send to the subscriber as DELETE/INSERT pair.
@@ -3741,16 +4085,15 @@ Link: None #### Trace Flag: 8295 Function: Creates a secondary index on the identifying columns on the change tracking side table at enable time
Link: https://social.msdn.microsoft.com/forums/sqlserver/en-US/00250311-7991-47b0-b788-7fae2e102254/trace-flag-8295
-Link: https://support.microsoft.com/help/2476322/
+Link: https://support.microsoft.com/kb/2476322
Link: https://www.brentozar.com/archive/2014/06/performance-tuning-sql-server-change-tracking
Link: https://blogs.technet.microsoft.com/smartinez/2013/03/06/sql-server-for-configmgr-2012-ebook-and-top-10-database-issues
-Thanks to: Wilfred van Dijk #### Trace Flag: 8446 Function: Databases in SQL 8 do not have a Service Broker ID. If you restore these databases on SQL 9 by using the WITH NORECOVERY option, these databases will not be upgraded causing mirroring & log-shipping configurations to fail.
-Link: https://support.microsoft.com/help/959008 +Link: https://support.microsoft.com/kb/959008 @@ -3759,6 +4102,12 @@ Function: Writes detailed information about Ms-DTC context & state changes to th Link: None + +#### Trace Flag: 8531 +Function: Fixes a contention issue with high KTM_RECOVERY_MANAGER wait times that you might encounter when running XA distributed transactions. Note: You need to turn on trace flag 8531 as a startup trace flag.
+Link: [SQL Server 2019 CU29 Documentation](https://learn.microsoft.com/en-us/troubleshoot/sql/releases/sqlserver-2019/cumulativeupdate29#3417392) + + #### Trace Flag: 8599 Function: Allows you to use a save-point within a distributed transaction
@@ -3782,7 +4131,9 @@ Demo: https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Trace_Flag/T Function: Displays logical and physical trees used during the optimization process
Link: [More Undocumented Query Optimizer Trace Flags]
Link: [Yet another X-Ray for the QP]
-Link: [Query Optimizer Deep Dive - Part 4] +Link: [Query Optimizer Deep Dive - Part 4]
+Link: [Query Optimizer Deep Dive - Part 1]
+Scope: session or query @@ -3810,7 +4161,7 @@ Scope: session only Function: Shows the initial Memo structure
Link: http://www.queryprocessor.ru/optimizer-part-3-full-optimiztion-optimization-search0
Link: http://www.benjaminnevarez.com/2012/04/inside-the-query-optimizer-memo-structure
-Link: http://sqlblog.com/blogs/paul_white/archive/2012/04/29/query-optimizer-deep-dive-part-3.aspx
+Link: [Query Optimizer Deep Dive – Part 3]
Link: [Query Optimizer Deep Dive - Part 4] @@ -3826,7 +4177,7 @@ Scope: session only #### Trace Flag: 8612 Function: Add Extra Info to the Trees Output
Link: [Cardinality Estimation Framework 2014 First Look]
-Link: http://sqlblog.com/blogs/paul_white/archive/2013/06/11/hello-operator-my-switch-is-bored.aspx +Link: [Hello Operator, My Switch Is Bored] @@ -3843,7 +4194,7 @@ Scope: session only #### Trace Flag: 8619 **Undocumented trace flag**
Function: Show Applied Transformation Rules
-Link: http://sqlblog.com/blogs/paul_white/archive/2013/02/06/incorrect-results-with-indexed-views.aspx
+Link: https://www.sql.kiwi/2013/02/incorrect-results-with-indexed-views.html
Link: [Cardinality Estimation Framework 2014 First Look]
Link: [Yet another X-Ray for the QP]
Link: [A Row Goal Riddle]
@@ -3880,18 +4231,24 @@ Link: [Yet another X-Ray for the QP] #### Trace Flag: 8633 Function: PWhite: “Enable prefetch (CUpdUtil::FPrefetchAllowedForDML and CPhyOp_StreamUpdate::FDoNotPrefetch)”
-Link: http://sqlblog.com/blogs/paul_white/archive/2013/01/26/optimizing-t-sql-queries-that-change-data.aspx +Link: [Optimizing T-SQL queries that change data] #### Trace Flag: 8649 -Function: Set Cost Threshold for parallelism from 1 to 0
-Link: http://sqlblog.com/blogs/paul_white/archive/2011/12/23/forcing-a-parallel-query-execution-plan.aspx
-Link: http://sqlblog.com/blogs/adam_machanic/archive/2013/07/11/next-level-parallel-plan-porcing.aspx
+**Undocumented trace flag**
+Function: Set Cost Threshold for parallelism from 1 to 0, Forcing a Parallel Query Execution Plan. +Possible drawbacks: you'll run out of worker threads (if max worker threads is at default value) and unintentionally reduce DOP for queries that could really use parallelism. +Also be queries that looked fine with a serial merge join that, with a parallel merge join now have an order-preserving repartition streams and their performance will go to crap. +In the new version of SQL Server 2017 there is one more way to force parallel plan, that involves using the undocumented hint `ENABLE_PARALLEL_PLAN_PREFERENCE`.
+Link: https://www.sql.kiwi/2011/12/forcing-a-parallel-query-execution-plan.html
+Link: https://www.sqlshack.com/sql-server-2017-how-to-get-a-parallel-plan/
Link: [What You Need to Know about the Batch Mode Window Aggregate Operator in SQL Server 2016: Part 1]
Link: [Few Outer Rows Optimization]
Link: [Next-Level Parallel Plan Forcing: An Alternative to 8649]
-Scope: session only +Link: https://logicalread.com/2015/10/30/sql-server-query-parallelizing-mc11/
+Link: https://twitter.com/erikdarlingdata/status/1233449807907303425
+Scope: global or session or query @@ -3918,6 +4275,14 @@ Link: https://sql-sasquatch.blogspot.com/2018/12/fun-with-sql-server-plan-cache- Link: [Fun with SQL Server Plan Cache, Trace Flag 8666, and Trace Flag 2388]
Scope: global or session + + +#### Trace Flag: 8670 +**Undocumented trace flag**
+Function: Skip search 2 in plan?
+Link: [Query Optimizer Deep Dive - Part 4]
+Scope: ? + #### Trace Flag: 8671 @@ -3931,7 +4296,7 @@ Link: http://www.queryprocessor.ru/optimizer_unleashed_2 #### Trace Flag: 8675 Function: Displays the query optimization phases for a specific optimization
Link: [More Undocumented Query Optimizer Trace Flags]
-Link: http://sqlblog.com/blogs/paul_white/archive/2012/04/29/query-optimizer-deep-dive-part-3.aspx
+Link: [Query Optimizer Deep Dive – Part 3]
Link: https://sqlperformance.com/2013/06/sql-indexes/recognizing-missed-optimizations @@ -3982,13 +4347,15 @@ But in vast majority of situations, you don’t need to manually disable spool w Link: https://blogs.msdn.microsoft.com/psssql/2015/12/15/spool-operator-and-trace-flag-8690/
Link: http://dba.stackexchange.com/questions/52552/index-not-making-execution-faster-and-in-some-cases-is-slowing-down-the-query
Link: http://connect.microsoft.com/SQL/feedback/ViewFeedback.aspx?FeedbackID=453982 - +Link: [Nested Loops Joins and Performance Spools]
+Scope: ? #### Trace Flag: 8691 **Undocumented trace flag**
Function: 'performance spool' optimization to the RegEx execution, reduces the number of executions of the RegEx function.
Link: [Splitting Strings Based on Patterns]
+Link: [Nested Loops Joins and Performance Spools]
Scope: ? @@ -4014,7 +4381,7 @@ Link: http://www.hanlincrest.com/SQLserverStoredProcRecompiles.htm #### Trace Flag: 8721 Function: Reports to the error log when auto-update statistics executes
-Link: https://support.microsoft.com/help/195565
+Link: https://support.microsoft.com/kb/195565
Link: [Docs Trace Flags]
Link: http://www.sqlservergeeks.com/sql-server-trace-flag-8721/
Scope: global only @@ -4026,6 +4393,28 @@ Function: Disable all hints except locking hints
Link: http://sqlmag.com/sql-server/investigating-trace-flags + +#### Trace Flag: 8726
+**Undocumented trace flag**
+Function: Disables the heuristic that discourages the optimizer from producing an index union plan.
+Link: [Why are (seemingly) suitable indexes not used on a LEFT JOIN with OR]
+Link: https://github.com/ktaranov/sqlserver-kit/issues/170
+Link: https://dba.stackexchange.com/a/23779
+Link: https://dba.stackexchange.com/a/261790
+Scope: query only
+Demo: https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Trace_Flag/Trace_Flag_8726.sql + + + +#### Trace Flag: 8727
+**Undocumented trace flag**
+Function: Can be used to prevent unwanted index union plans.
+Link: [Why are (seemingly) suitable indexes not used on a LEFT JOIN with OR]
+Link: https://github.com/ktaranov/sqlserver-kit/issues/170
+Scope: query only
+Demo: https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Trace_Flag/Trace_Flag_8727.sql + + #### Trace Flag: 8738 Function: (Apparently) disables an optimization where rows are sorted before a Key Lookup operator. (The optimization is meant to promote Sequential IO rather than the random nature of IO from Key Lookups). @@ -4066,10 +4455,10 @@ Scope: ? #### Trace Flag: 8744 Function: Disable pre-fetching for the Nested Loop operator. -Incorrect use of this trace flag may cause additional physical reads when SQL Server executes plans that contain the Nested Loops operator.
+**WARNING: Incorrect use of this trace flag may cause additional physical reads when SQL Server executes plans that contain the Nested Loops operator.**
Link: [KB920093]
Link: [Docs Trace Flags]
-Link: http://sqlblog.com/blogs/paul_white/archive/2013/03/08/execution-plan-analysis-the-mystery-work-table.aspx
+Link: https://www.sql.kiwi/2013/03/execution-plan-analysis-the-mystery-work-table.html
Link: https://connect.microsoft.com/SQLServer/feedback/details/780194/make-dbcc-trace-flags-available-as-option-querytraceon
Scope: global or session @@ -4098,15 +4487,16 @@ Link: http://sqlmag.com/sql-server/investigating-trace-flags #### Trace Flag: 8757 Function: Skip trivial plan optimization and force a full optimization
Link: [More Undocumented Query Optimizer Trace Flags]
-Link: http://sqlblog.com/blogs/paul_white/archive/2012/04/28/query-optimizer-deep-dive-part-1.aspx +Link: [Query Optimizer Deep Dive - Part 1]
+Scope: session or query #### Trace Flag: 8758 Function: “A [workaround to the MERGE bug described] is to apply Trace Flag 8758 –unfortunately this disables a number of optimisations, not just the one above, so it’s not really recommended for long term use.” “Disable rewrite to a single operator plan (CPhyOp_StreamUpdate::PqteConvert)”
-Link: http://sqlblog.com/blogs/paul_white/archive/2010/08/04/another-interesting-merge-bug.aspx
-Link: http://sqlblog.com/blogs/paul_white/archive/2013/01/26/optimizing-t-sql-queries-that-change-data.aspx
+Link: https://www.sql.kiwi/2010/08/another-interesting-merge-bug.html
+Link: [Optimizing T-SQL queries that change data]
@@ -4141,15 +4531,15 @@ Link: None #### Trace Flag: 8790 Function: PWhite: “Undocumented trace flag 8790 forces a wide update plan for any data-changing query (remember that a wide update plan is always possible)”
-Link: https://support.microsoft.com/help/956718/
-Link: http://sqlblog.com/blogs/paul_white/archive/2012/12/10/merge-bug-with-filtered-indexes.aspx
+Link: https://support.microsoft.com/kb/956718
+Link: https://www.sql.kiwi/2012/12/merge-bug-with-filtered-indexes.html
Link: https://sqlperformance.com/2014/06/sql-plan/filtered-index-side-effect #### Trace Flag: 8795 Function: PWhite: “Disable DML Request Sort (CUpdUtil::FDemandRowsSortedForPerformance)”
-Link: http://sqlblog.com/blogs/paul_white/archive/2013/01/26/optimizing-t-sql-queries-that-change-data.aspx
+Link: [Optimizing T-SQL queries that change data]
Link: https://sqlperformance.com/2014/10/t-sql-queries/performance-tuning-whole-plan @@ -4184,7 +4574,7 @@ Link: None #### Trace Flag: 8903 Function: Allows SQL Server to use a specific API (SetFileIoOverlappedRange) when Locked Pages in Memory is enabled.
Link: https://blogs.msdn.microsoft.com/psssql/2012/03/20/setfileiooverlappedrange-can-lead-to-unexpected-behavior-for-sql-server-2008-r2-or-sql-server-2012-denali
-Link: https://support.microsoft.com/help/2679255/
+Link: https://support.microsoft.com/kb/2679255
Link: https://blogs.msdn.microsoft.com/psssql/2013/10/16/every-time-i-attach-database-sql-logs-error-1314-for-setfileiooverlappedrange @@ -4192,7 +4582,7 @@ Link: https://blogs.msdn.microsoft.com/psssql/2013/10/16/every-time-i-attach-dat #### Trace Flag: 9024 Function: Converts a global log pool memory object into NUMA node partitioned memory object
**Note: Beginning with SQL Server 2012 SP3 and SQL Server 2014 SP1 this behavior is controlled by the engine and trace flag 9024 has no effect.**
-Link: https://support.microsoft.com/help/2809338
+Link: https://support.microsoft.com/kb/2809338
Link: [Docs Trace Flags]
Link: [KB2964518]
Scope: global only
@@ -4279,40 +4669,46 @@ Link: None #### Trace Flag: 9109 Function: Used to workaround a problem with query notifications and restoring a DB with the NEW_BROKER option enabled.
-Link: https://support.microsoft.com/help/2483090/ +Link: https://support.microsoft.com/kb/2483090 #### Trace Flag: 9114 **Undocumented trace flag**
-Function: Implemented a (SELECT 1) = 1 predicate as a join instead of optimizing it away.
+Function: Prevents the optimizer rewriting the apply as a join.
Link: [New Undocumented Trace Flags]
-Scope: ? +Link: https://dba.stackexchange.com/a/274195/107045
+Scope: global or session or query
+Versions: 2008-2019 #### Trace Flag: 9115 Function: PWhite: “Disable prefetch (CUpdUtil::FPrefetchAllowedForDML)” Dima: “Disables both [NLoop Implicit Batch Sort {TF 2340} and NL Prefetching {TF 8744}], and not only on the Post Optimization, but the explicit Sort also”
-Link: http://sqlblog.com/blogs/paul_white/archive/2013/01/26/optimizing-t-sql-queries-that-change-data.aspx
+Link: [Optimizing T-SQL queries that change data]
Link: http://www.hanlincrest.com/SQLServerLockEscalation.htm
Link: http://www.queryprocessor.com/batch-sort-and-nested-loops #### Trace Flag: 9130 +**Undocumented trace flag**
Function: Disables the particular copy out stage rewrite from Filter + (Scan or Seek) to (Scan or Seek) + Residual Predicate. -Enabling this flag retains the Filter in the final execution plan, resulting in a SQL Server 2008+ plan that mirrors the 2005 version.
-Link: http://sqlblog.com/blogs/paul_white/archive/2012/10/15/cardinality-estimation-bug-with-lookups-in-sql-server-2008-onward.aspx
+Enabling this flag retains the Filter in the final execution plan, resulting in a SQL Server 2008+ plan that mirrors the 2005 version. +Before Service Pack 3 of SQL Server 2012, we didn't have property `Number of Rows Read` in execution plan, and to get a feel for the difference between the `Number of Rows Read` and the `Actual Number of Rows`, we'd need to use trace flag 9130.
+Link: https://www.sql.kiwi/2012/10/cardinality-estimation-bug-with-lookups-in-sql-server-2008-onward.html
Link: http://sqlblogcasts.com/blogs/sqlandthelike/archive/2012/12/06/my-new-favourite-traceflag.aspx
-Link: http://sqlblog.com/blogs/paul_white/archive/2013/06/11/hello-operator-my-switch-is-bored.aspx
+Link: [Hello Operator, My Switch Is Bored]
Link: https://connect.microsoft.com/SQLServer/feedback/details/767395/cardinality-estimation-error-with-pushed-predicate-on-a-lookup
-Link: http://www.theboreddba.com/Categories/FunWithFlags/Revealing-Predicates-in-Execution-Plans-(TF-9130).aspx +Link: http://www.theboreddba.com/Categories/FunWithFlags/Revealing-Predicates-in-Execution-Plans-(TF-9130).aspx
+Link: https://sqlperformance.com/2016/06/sql-indexes/actual-rows-read-warnings-plan-explorer
+Scope: global or session or query #### Trace Flag: 9134 Function: SQL 8 - Does additional reads to test if the page is allocated & linked correctly this checks IAM & PFS. Fixes error 601 for queries under Isolation level read uncommitted. In case performance is affected (because of a bug) apply SP4.
-Link: https://support.microsoft.com/help/815008/ +Link: https://support.microsoft.com/kb/815008 @@ -4361,12 +4757,21 @@ Link: None Related to: [9205](#9205) + +#### Trace Flag: 9198 +**Undocumented trace flag**
+Function: Ccan be used to disable lazy index performance spools specifically. +You may still get a lazy table or row count spool instead (with or without sort optimization), depending on costing.
+Link: [Nested Loops Joins and Performance Spools]
+Scope: ? + #### Trace Flag: 9204 Function: Output Statistics used by Query Optimizer. When enabled and a plan is compiled or recompiled there is a listing of statistics which is being fully loaded & used to produce cardinality and distribution estimates for some plan alternative or other.
Link: [How to Find the Statistics Used to Compile an Execution Plan]
Link: http://www.sqlservergeeks.com/sql-server-trace-flag-9204/
-Scope: global only +Link: https://www.sqlpassion.at/archive/2013/10/29/fixing-cardinality-estimation-errors-with-filtered-statistics/
+Scope: global or query Related to: [9292](#9292) @@ -4426,6 +4831,15 @@ Link: [New Undocumented Trace Flags]
Scope: ? + +#### Trace Flag: 9265 +**Undocumented trace flag**
+Function: MS engineering team has decided to generate a DUMP from SQL 2019+ every time a “PLAN cannot be generated”. Once a Dump freezes connections during the generation, the cluster will probably lost the connectivity to the cluster and the AG can be down/failover if it has automatic failover configured. The mitigation for this issue (avoid DUMP generation) is to enable TF Trace Flag 9265 on Startup. +Once TF 9265 is enabled, SQL Server stops generating DUMP on the “PLAN cannot be generated” error but only writes a message to ERRORLOG file (Internal Query Processor Error: The query processor could not produce a query plan. For more information, contact Customer Support Services). +
+Link: None + + #### Trace Flag: 9268 Function: SQL 8 - When SQL Server runs a parameterized query that contains several IN clauses, each with a large number of values, SQL Server may return the following error message after a minute or more of high CPU utilization: KB 325658. Server: Msg 8623, Level 16, State 1. Internal Query Processor Error: The query processor could not produce a query plan. Contact your primary support provider for more information.
@@ -4459,7 +4873,7 @@ Scope: ? **Undocumented trace flag**
Function: Effects around local and global aggregates - choose coerce partial and global aggregation over scalar aggregation.
Link: https://github.com/ktaranov/sqlserver-kit/issues/93
-Scope: local only +Scope: session only @@ -4490,7 +4904,7 @@ Scope: ? #### Trace Flag: 9347 Function: Disables batch mode for sort operator. SQL Server 2016 introduces a new batch mode sort operator that boosts performance for many analytical queries.
-Link: https://support.microsoft.com/help/3172787
+Link: https://support.microsoft.com/kb/3172787
Link: [Docs Trace Flags]
Link: [Niko Neugebauer Columnstore Indexes – part 86]
Scope: global or session or query @@ -4499,7 +4913,7 @@ Scope: global or session or query #### Trace Flag: 9348 Function: Sets a row limit (based on cardinality estimates) that controls whether a bulk insert is attempted or not (assuming conditions are met for a bulk insert). Introduced as a workaround for memory errors encountered with bulk insert.
-Link: https://support.microsoft.com/help/2998301/ +Link: https://support.microsoft.com/kb/2998301 @@ -4507,7 +4921,7 @@ Link: https://support.microsoft.com/help/2998301/ Function: Disables batch mode for top N sort operator. SQL Server 2016 introduces a new batch mode top sort operator that boosts performance for many analytical queries.
Link: [Docs Trace Flags]
Link: [Niko Neugebauer Columnstore Indexes – part 86]
-Link: https://support.microsoft.com/help/3172787
+Link: https://support.microsoft.com/kb/3172787
Scope: global or session or query @@ -4535,7 +4949,7 @@ set statistics xml, time off; #### Trace Flag: 9358 Function: Disable batch mode sort operations in a complex parallel query. For example, this flag could apply if the query contains merge join operations.
Link: [Niko Neugebauer Columnstore Indexes – part 86]
-Link: https://support.microsoft.com/help/3171555
+Link: https://support.microsoft.com/kb/3171555
Scope: global or session or query @@ -4549,11 +4963,13 @@ Scope: ? #### Trace Flag: 9389 -Function: Enables dynamic memory grant for batch mode operators. If a query does not get all the memory it needs, it spills data to tempdb, incurring additional I/O and potentially impacting query performance. -If the dynamic memory grant trace flag is enabled, a batch mode operator may ask for additional memory and avoid spilling to tempdb if additional memory is available.
+Function: Enables additional dynamic memory grant for batch mode operators. +If a query does not get all the memory it needs, it spills data to TempDB, incurring additional I/O and potentially impacting query performance. +If the dynamic memory grant trace flag is enabled, a batch mode operator may ask for additional memory and avoid spilling to TempDB if additional memory is available. +For more information, see the *Effects of min memory per query* section of the [Memory Management Architecture Guide](https://docs.microsoft.com/en-us/sql/relational-databases/memory-management-architecture-guide?view=sql-server-2017#effects-of-min-memory-per-query).
Link: [Niko Neugebauer Columnstore Indexes – part 86]
Link: [Docs Trace Flags]
-Scope: global or session or query +Scope: global or session @@ -4567,8 +4983,8 @@ Scope: ? #### Trace Flag: 9394 Function: Apparently enables a fix for an access violation when a table with Japanese characters has an indexed changed.
-Link: https://support.microsoft.com/help/3142595/
-Link: https://support.microsoft.com/help/3138659/ +Link: https://support.microsoft.com/kb/3142595
+Link: https://support.microsoft.com/kb/3138659 @@ -4591,7 +5007,7 @@ Scope: ? #### Trace Flag: 9410 **Undocumented trace flag**
Function: Fix slowly query runs when SQL Server uses hash aggregate in the query plan.
-Link: https://support.microsoft.com/help/3167159/
+Link: https://support.microsoft.com/kb/3167159
Scope: ? @@ -4611,6 +5027,30 @@ Link: [SQL Server 2017: Adaptive Join Internals]
Scope: ? + +#### Trace Flag: 9424 +**Undocumented trace flag**
+Function: Sets the number of splits to four. +The SQL Server 2019 query optimizer has a new trick available to improve the performance of large aggregations. +The new exploration abilities are encoded in two new closely-related optimizer rules: `GbAggSplitToRanges` and `SelOnGbAggSplitToRanges`. +The extended event `query_optimizer_batch_mode_agg_split is` provided to track when this new optimization is considered. +The description of this event is: Occurs when the query optimizer detects batch mode aggregation is likely to spill and tries to split it into multiple smaller aggregations.
+Link: [SQL Server 2019 Aggregate Splitting]
+Scope: session or query + + + +#### Trace Flag: 9426 +**Undocumented trace flag**
+Function: Disables the aggregate splitting feature. +The SQL Server 2019 query optimizer has a new trick available to improve the performance of large aggregations. +The new exploration abilities are encoded in two new closely-related optimizer rules: `GbAggSplitToRanges` and `SelOnGbAggSplitToRanges`. +The extended event `query_optimizer_batch_mode_agg_split is` provided to track when this new optimization is considered. +The description of this event is: Occurs when the query optimizer detects batch mode aggregation is likely to spill and tries to split it into multiple smaller aggregations.
+Link: [SQL Server 2019 Aggregate Splitting]
+Scope: session or query + + #### Trace Flag: 9447 **Undocumented trace flag**
@@ -4637,19 +5077,25 @@ Link: [What You Need to Know about the Batch Mode Window Aggregate Operator in S #### Trace Flag: 9471 -Function: Causes SQL Server to generate a plan using minimum selectivity for single-table filters, under the query optimizer cardinality estimation model of SQL Server 2014 through SQL Server 2016 versions. -Beginning with SQL Server 2016 SP1, to accomplish this at the query level, add the USE HINT query hint instead of using this trace flag.
+Function: Causes SQL Server to generate a plan using minimum selectivity for single-table filters, under the query optimizer cardinality estimation model of SQL Server 2014 (12.x) and later versions. +Starting with SQL Server 2016 (13.x) SP1, to accomplish this at the query level, add the USE HINT 'ASSUME_MIN_SELECTIVITY_FOR_FILTER_ESTIMATES' query hint instead of using this trace flag.
**Note: Please ensure that you thoroughly test this option, before rolling it into a production environment.**
+**Note: This trace flag does not apply to CE version 70. Use trace flag [4137](#4137) instead.**
Link: [New Features in SQL Server 2016 Service Pack 1]
Link: [Docs Trace Flags]
+Link: [Cardinality Estimation for Multiple Predicates]
Scope: global or session or query #### Trace Flag: 9472 -Function: Assumes independence for multiple WHERE predicates in the SQL 2014 cardinality estimation model. Predicate independence was the default for versions prior to SQL Server 2014, and thus this flag can be used to more closely emulate pre-SQL 2014 cardinality estimate behavior in a more specific fashion than TF 9481.
+**Undocumented trace flag**
+Function: Assumes independence for multiple WHERE predicates in the SQL 2014 cardinality estimation model. +Predicate independence was the default for versions prior to SQL Server 2014, and thus this flag can be used to more closely emulate pre-SQL 2014 cardinality estimate behavior in a more specific fashion than TF 9481.
Link: https://sqlperformance.com/2014/01/sql-plan/cardinality-estimation-for-multiple-predicates
-Link: https://connect.microsoft.com/SQLServer/feedback/details/801908/sql-server-2014-cardinality-estimation-regression +Link: https://connect.microsoft.com/SQLServer/feedback/details/801908/sql-server-2014-cardinality-estimation-regression
+Link: [Cardinality Estimation for Multiple Predicates]
+Scope: global or session or query @@ -4674,7 +5120,7 @@ Scope: ? Function: Causes SQL Server to generate a plan using the Simple Containment assumption instead of the default Base Containment assumption, under the query optimizer cardinality estimation model of SQL Server 2014 through SQL Server 2016 versions. Beginning with SQL Server 2016 SP1, to accomplish this at the query level, add the USE HINT query hint instead of using this trace flag. **Note: Please ensure that you thoroughly test this option, before rolling it into a production environment.**
-Link: https://support.microsoft.com/help/3189675
+Link: https://support.microsoft.com/kb/3189675
Link: [New Features in SQL Server 2016 Service Pack 1]
Link: [Docs Trace Flags]
Scope: global or session or query @@ -4717,13 +5163,15 @@ Scope: ? #### Trace Flag: 9481 Function: Enables you to set the query optimizer cardinality estimation model to the SQL Server 2012 and earlier version independent of the compatibility level of the database. To accomplish this at the database level, see [ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL)]. -To accomplish this at the query level, add the QUERYTRACEON query hint
+To accomplish this at the query level, add the QUERYTRACEON query hint.
Link: [New Features in SQL Server 2016 Service Pack 1]
Link: https://sqlserverscotsman.wordpress.com/2016/11/28/a-guide-on-forcing-the-legacy-ce/
Link: [Docs Trace Flags]
Link: [KB2801413]
Link: http://www.sqlservergeeks.com/sql-server-2014-trace-flags-9481/
-Link: https://sqlperformance.com/2019/01/sql-performance/compatibility-levels-and-cardinality-estimation-primer +Link: https://sqlperformance.com/2019/01/sql-performance/compatibility-levels-and-cardinality-estimation-primer
+Link: [KB2801413]
+Link: [Cardinality Estimation for Multiple Predicates]
Scope: global or session or query @@ -4756,7 +5204,7 @@ Scope: ? #### Trace Flag: 9485 Function: Disables SELECT permission for DBCC SHOW\_STATISTICS
-Link: https://support.microsoft.com/help/2683304
+Link: https://support.microsoft.com/kb/2683304
Link: [Docs Trace Flags]
Link: http://www.benjaminnevarez.com/2013/02/dbcc-show_statistics-works-with-select-permission
Scope: global only @@ -4795,11 +5243,21 @@ Scope: ? #### Trace Flag: 9495 Function: Disables parallelism during insertion for INSERT...SELECT operations and it applies to both user and temporary tables
-Link: https://support.microsoft.com/help/3180087
+Link: https://support.microsoft.com/kb/3180087
Link: [Docs Trace Flags]
Scope: global or session + +#### Trace Flag: 9497 +**Undocumented trace flag**
+Function: For SQL Server versions where the behaviour previously enabled under TF [2371](#2371) is the default, start-up trace flag 9497 reverts to the original behaviour for the statistics update recompilation threshold. +The formula to compute RT (Recompilation Thresholds) values is different when trace flag [2371](#2371) is enabled (or for versions and compatibility settings where the sublinear behaviour is default (if trace flag 9497 is off)). +The new formula for RT is SQRT(1000 * table rows).
+Link: [Temporary Table Caching in Stored Procedures]
+Scope: global only + + #### Trace Flag: 9532 Function: SQL 11 CTP3 - to get more than 1 availability group replica in CTP3 Scope Startup
@@ -4919,8 +5377,11 @@ Link: http://gsl.azurewebsites.net/Portals/0/Users/dewitt/talks/HekatonWhitePape #### Trace Flag: 9929 -Function: Enables an update that reduces the “disk footprint [of In-Memory OLTP] by reducing the In-Memory checkpoint files to 1 MB (megabytes) each.”
-Link: https://support.microsoft.com/help/3147012/ +Function: Enables an update that reduces the “disk footprint [of In-Memory OLTP] by reducing the In-Memory checkpoint files to 1 MB (megabytes) each.” + Because this traceflag is instance level, it affects the size of checkpoint files for all databases with a memory optimized filegroup on that instance. + Be cautious when you use this traceflag.
+Link: https://support.microsoft.com/kb/3147012/ +Scope: global or session @@ -4935,6 +5396,7 @@ Scope: global or session #### Trace Flag: 9989 +**Undocumented trace flag**
Function: In CTP2, enabled functionality for reading in-memory tables on a readable secondary
Link: https://connect.microsoft.com/SQLServer/feedback/details/795360/secondary-db-gets-suspect-when-i-add-in-memory-table-to-db-which-is-part-of-alwayson-availability-group @@ -4961,7 +5423,7 @@ Scope: global or session or query #### Trace Flag: 10207 Function: When a Clustered Columnstore index has corrupted segments, turning on this flag suppresses errors 5288 and 5289 and allows a scan of a clustered columns store to skip corrupt segments and complete (though with results that do not include the corrupted segment(s)). This flag is helpful when attempting to copy-out data in a corrupt CCI.
-Link: https://support.microsoft.com/help/3067257/
+Link: https://support.microsoft.com/kb/3067257/
Link: https://blogs.msdn.microsoft.com/sqlreleaseservices/partial-results-in-a-query-of-a-clustered-columnstore-index-in-sql-server-2014 @@ -4988,7 +5450,7 @@ If you have specific query pattern that includes columns which are not covered b Please be aware that creating additional indexes may introduce overhead for DML operations that update or delete rows in the current table. With the additional indexes you should aim to find the right balance between performance of temporal queries and additional DML overhead.**
Link: [Docs Trace Flags]
-Link: https://support.microsoft.com/help/3198846
+Link: https://support.microsoft.com/kb/3198846
Link: https://blogs.msdn.microsoft.com/sqlcat/2016/12/08/improve-query-performance-on-memory-optimized-tables-with-temporal-using-new-index-creation-enhancement-in-sp1/
Scope: global or session @@ -5012,7 +5474,7 @@ Scope: ? #### Trace Flag: 11023 Function: Disables the use of the last persisted sample rate, for all subsequent statistics update where a sample rate is not specified explicitly as part of the [UPDATE STATISTICS](https://docs.microsoft.com/en-us/sql/t-sql/statements/update-statistics-transact-sql) statement.
-Link: https://support.microsoft.com/help/4039284
+Link: https://support.microsoft.com/kb/4039284
Link: [Docs Trace Flags]
Scope: global or session @@ -5020,13 +5482,15 @@ Scope: global or session #### Trace Flag: 11024 Function: In Microsoft SQL Server 2017, when incremental statistics are built on the top of partitioned tables, the sum of modification counts of all partitions is stored as the modification count of the root node. -When the modification count of the root node exceeds a threshold, the auto update of statistics is triggered. +When the modification count of the root node exceeds a [threshold](https://docs.microsoft.com/en-us/sql/relational-databases/statistics/statistics#AutoUpdateStats), the auto update of statistics is triggered. However, if the modification count of any single partition does not exceed the local threshold, the statistics are not updated. Additionally, the modification count of the root node is reset to zero. This may cause delay in the auto update of incremental statistics. When trace flag 11024 is enabled, the modification count of the root node is kept as the sum of modification counts of all partitions.
-**Note: This trace flag applies to SQL Server 2017 CU3 and higher builds.**
-Link: https://support.microsoft.com/help/4041811
-Scope: global or session +**Note: This trace flag applies to SQL Server 2016 (13.x) SP2, SQL Server 2017 (14.x) CU3, and higher builds.**
+Link: https://support.microsoft.com/kb/4041811
+Link: [Docs Trace Flags]
+Scope: global or session
+SQL Server Version: >= 2019 RTM, >= 2017 CU3, >= 2016 SP2 @@ -5037,52 +5501,224 @@ Link: [New Undocumented Trace Flags]
Scope: ? + +#### Trace Flag: 11047 +Function: Applies the default timeout set by `query wait (s)` or the Resource Governor `REQUEST_MEMORY_GRANT_TIMEOUT_SEC` configuration to Columnstore index build operations.
+**Note: This trace flag applies to SQL Server 2016 (13.x) SP2 CU5, SQL Server 2017 (14.x) CU14, and higher builds.**
+Link: [Docs Trace Flags]
+Link: https://support.microsoft.com/kb/4480641
+Scope: global or session
+SQL Server Version: >= 2019 RTM, >= 2017 CU14, >= 2016 SP2 CU5 + + + +#### Trace Flag: 11064 +Function: Improves the scalability of data loading operations into columnstore indexes, by optimizing memory distribution between the `SELECT` and `INSERT` statements.
+For more information on loading data into a columnstore index, see [Columnstore indexes - Data loading guidance](https://docs.microsoft.com/en-gb/sql/relational-databases/indexes/columnstore-indexes-data-loading-guidance). +**Note: This trace flag applies to SQL Server 2019 (15.x) and higher builds.**
+Link: [Docs Trace Flags]
+Link: https://support.microsoft.com/en-us/topic/kb4588980-fix-higher-than-expected-number-of-single-row-columnstore-rowgroups-may-be-generated-for-columnstore-bulk-insert-when-both-large-page-allocator-and-scalable-columnstore-bulk-insert-features-are-turned-on-0d74afa4-96e7-2026-b486-122d2619554a - if you turn on trace flags 876, 11064, and 11068, SQL Server may generate single row columnstore rowgroups. Fixed in 2019 CU9.
+Scope: global only
+SQL Server Version: >= 2019 RTM + + + +#### Trace Flag: 11068 +Function: Uses the configured max degree of parallelism (MAXDOP) value for columnstore index insert operations. +For more information on overriding degrees of parallelism, see the [Query Processing Architecture Guide](https://docs.microsoft.com/en-gb/sql/relational-databases/query-processing-architecture-guide#overriding-degrees-of-parallelism).
+**Important: This trace flag is only effective if trace flag [11064](#11064) is also enabled.**
+**Important: Use this trace flag when faster data loads are preferred over maintaining [columnstore segment](https://docs.microsoft.com/en-gb/sql/relational-databases/indexes/columnstore-indexes-overview#column-segment) quality. +For example, using this trace flag when loading 1,048,577 rows into a columnstore may result in more than one compressed rowgroup, if the insert operation is executing in parallel mode. +Without this trace flag, the insert operation would result in one compressed rowgroup.**
+**Note: This trace flag applies to SQL Server 2019 (15.x) and higher builds.**
+Link: [Docs Trace Flags]
+Link: https://support.microsoft.com/en-us/topic/kb4588980-fix-higher-than-expected-number-of-single-row-columnstore-rowgroups-may-be-generated-for-columnstore-bulk-insert-when-both-large-page-allocator-and-scalable-columnstore-bulk-insert-features-are-turned-on-0d74afa4-96e7-2026-b486-122d2619554a - if you turn on trace flags [876](#876), [11064](#11064), and [11068](#11068), SQL Server may generate single row columnstore rowgroups. Fixed in 2019 CU9.
+Scope: global only
+SQL Server Version: >= 2019 RTM + + + +#### Trace Flag: 11631 +Function: When reorganizing a columnstore index, use a threshold of 10% of the actual number of rows in the rowgroup. By default, without this trace flag, SQL Server uses 10% of a theoretical max of ~1M rows in the rowgroup, 100K rows, which meant that small rowgroups would never get reorganized. +**Note: This trace flag applies to SQL Server 2019 CU9 (15.x) and higher builds.**
+Link: https://techcommunity.microsoft.com/t5/sql-server-support/new-trace-flags-for-better-maintenance-of-deleted-rows-in/ba-p/2127034 +Link: [Docs Trace Flags]
+Scope: global only
+SQL Server Version: >= 2019 CU9 + + + +#### Trace Flag: 11634 +Function: When reorganizing a columnstore index, use a threshold of 1% of the rows in the rowgroup rather than the default of 10%. Keep in mind that unless you also enable trace flag [11631](#11631), then it's 1% of the theoretical maximum number of rows in the rowgroup (~1M) rather than the actual number of rows in the rowgroup. Use both [11631](#11631) and 11634 trace flags together for the most accurate thresholds of when to rebuild a rowgroup. +**Note: This trace flag applies to SQL Server 2019 CU9 (15.x) and higher builds.**
+Link: https://techcommunity.microsoft.com/t5/sql-server-support/new-trace-flags-for-better-maintenance-of-deleted-rows-in/ba-p/2127034 +Link: [Docs Trace Flags]
+Scope: global only
+SQL Server Version: >= 2019 CU9 + + + +#### Trace Flag: 12306 +Function: Enable setting maximum [group commit time](https://www.sqlshack.com/sql-server-wait-type-hadr-group-commit/). This TF can be enabled during SQL Server startup or dynamically (through `DBCC TRACEON(12306, -1)`).
+After TF 12306 is enabled, you can further enable 12311, 12312, 12314, 12318. These represent maximum group commit times of 1ms, 2ms, 4ms, and 8ms, respectively. They settings are additive. The maximum group commit time setting is capped at 10ms. However, these should not be repeated. For example, do not specify the same TF more than one time.
+If you do not want to set maximum group commit time but want, instead, to revert to the default behavior of 10ms, disable TF 12306. +The effect of TFs 12311, 12312, 12314, and 12318 occurs when there is a checkpoint in the database. You can rely on the setting of SQL Server or the database to let the checkpoint automatically occur. If you want to let the TFs take effect immediately, you can issue a manual checkpoint. +In the SQL Server error log, you can see entries about this actions.
+Link: [KB4565944]
+Link: https://aboutsqlserver.com/2019/06/09/hadr-sync-commit/
+Scope: global or session
+SQL Server Version: >= 2019 CU9, >= 2017 CU21 + + + +#### Trace Flag: 12310 +Function: Availability groups are designed with flow control gates on the primary replica to avoid excessive resource consumption, such as network and memory resources, on all availability replicas. SQL Server 2022 (16.x) increases the limits to the number of messages that each gate allows. By using trace flag 12310, the increased limit is also available to the following versions of SQL Server: SQL Server 2019 (15.x) CU9, SQL Server 2017 (14.x) CU18, SQL Server 2016 (13.x) SP1 CU16.
+Link: https://learn.microsoft.com/en-us/sql/database-engine/availability-groups/windows/monitor-performance-for-always-on-availability-groups?tabs=new-limits#flow-control-gates
+Scope: global
+SQL Server Version: >= 2019 CU9, >= 2017 CU18, >= 2016 SP1 CU16 + + + +#### Trace Flag: 12311 +Function: After TF [12306](#12306) is enabled, you can further enable 12311 trace flag that represent maximum group commit times of **1ms**. This TF is additive whith [12312](#12312), [12314](#12314), and [12318](#12318). The maximum group commit time setting is capped at 10ms. However, these should not be repeated. For example, do not specify the same TF more than one time.
+If you do not want to set maximum group commit time but want, instead, to revert to the default behavior of 10ms, disable TF [12306](#12306). +The effect of TFs 12311, [12312](#12312), [12314](#12314), and [12318](#12318) occurs when there is a checkpoint in the database. You can rely on the setting of SQL Server or the database to let the checkpoint automatically occur. If you want to let the TFs take effect immediately, you can issue a manual checkpoint. +In the SQL Server error log, you can see entries about this actions.
+Link: [KB4565944]
+Link: https://aboutsqlserver.com/2019/06/09/hadr-sync-commit/
+Scope: global or session
+SQL Server Version: >= 2019 CU9, >= 2017 CU21 + + + +#### Trace Flag: 12312 +Function: After TF [12306](#12306) is enabled, you can further enable 12312 trace flag that represent maximum group commit times of **2ms**. This TF is additive whith [12311](#12311), [12314](#12314), and [12318](#12318). The maximum group commit time setting is capped at 10ms. However, these should not be repeated. For example, do not specify the same TF more than one time.
+If you do not want to set maximum group commit time but want, instead, to revert to the default behavior of 10ms, disable TF [12306](#12306). +The effect of TFs [12311](#12311), 12312, [12314](#12314), and [12318](#12318) occurs when there is a checkpoint in the database. You can rely on the setting of SQL Server or the database to let the checkpoint automatically occur. If you want to let the TFs take effect immediately, you can issue a manual checkpoint. +In the SQL Server error log, you can see entries about this actions.
+Link: [KB4565944]
+Link: https://aboutsqlserver.com/2019/06/09/hadr-sync-commit/
+Scope: global or session
+SQL Server Version: >= 2019 CU9, >= 2017 CU21 + + + +#### Trace Flag: 12314 +Function: After TF [12306](#12306) is enabled, you can further enable 12314 trace flag that represent maximum group commit times of **4ms**. This TF is additive whith [12311](#12311), [12312](#12312), and [12318](#12318). The maximum group commit time setting is capped at 10ms. However, these should not be repeated. For example, do not specify the same TF more than one time.
+If you do not want to set maximum group commit time but want, instead, to revert to the default behavior of 10ms, disable TF [12306](#12306). +The effect of TFs [12311](#12311), [12312](#12312), 12314, and [12318](#12318) occurs when there is a checkpoint in the database. You can rely on the setting of SQL Server or the database to let the checkpoint automatically occur. If you want to let the TFs take effect immediately, you can issue a manual checkpoint. +In the SQL Server error log, you can see entries about this actions.
+Link: [KB4565944]
+Link: https://aboutsqlserver.com/2019/06/09/hadr-sync-commit/
+Scope: global or session
+SQL Server Version: >= 2019 CU9, >= 2017 CU21 + + + +#### Trace Flag: 12318 +Function: After TF [12306](#12306) is enabled, you can further enable 12318 trace flag that represent maximum group commit times of **8ms**. This TF is additive whith [12311](#12311), [12312](#12312), and [12314](#12314). The maximum group commit time setting is capped at 10ms. However, these should not be repeated. For example, do not specify the same TF more than one time.
+If you do not want to set maximum group commit time but want, instead, to revert to the default behavior of 10ms, disable TF [12306](#12306). +The effect of TFs [12311](#12311), [12312](#12312), [12314](#12314), and 12318 occurs when there is a checkpoint in the database. You can rely on the setting of SQL Server or the database to let the checkpoint automatically occur. If you want to let the TFs take effect immediately, you can issue a manual checkpoint. +In the SQL Server error log, you can see entries about this actions.
+Link: [KB4565944]
+Link: https://aboutsqlserver.com/2019/06/09/hadr-sync-commit/
+Scope: global or session
+SQL Server Version: >= 2019 CU9, >= 2017 CU21 + + +### Trace Flag: 12502 +Function: Disables external authorization policies for on-premises SQL Server instances. +Use this flag when you see increased PREEMPTIVE_OS_QUERYREGISTRY waits to occur. Due to a bug a SQL Server might lookup Windows Registry values even for a simple queries which do not work with operating system at all. +Link: [Docs Trace Flags](https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql) +Link: [SQL Server 2022 CU5 Documentation](https://learn.microsoft.com/en-us/troubleshoot/sql/releases/sqlserver-2022/cumulativeupdate5#2351584) +Scope: global
+SQL Server Version: >= 2022 CU5 + + +Note: In my case vast majority of queries executed against SQL Server started looking up non-existing registry value at: +`HKLM\Software\Microsoft\Microsoft SQL Server\MSSQL16.MSSQLSERVER\MSSQLServer\PurviewConfig` +so this buggy behavior might be triggered only after other software gets integrated with SQL Server 2022. + + + +#### Trace Flag: 12606 +Function: Enables Query Store for secondary replicas.
+Link: https://learn.microsoft.com/en-us/sql/relational-databases/performance/query-store-for-secondary-replicas?view=sql-server-ver16
+Scope: global
+SQL Server Version: >= 2022 + + + +#### Trace Flag: 12618 +Function: Introduces a new plan regression detection model for Automatic Plan Correction that includes multiple consecutive checks.
+Link: [SQL Server 2022 CU4 Documentation](https://learn.microsoft.com/en-us/troubleshoot/sql/releases/sqlserver-2022/cumulativeupdate4#2344871)
+Scope: global
+SQL Server Version: >= 2022 CU4 + + + +#### Trace Flag: 12656 +Function: For Automatic Plan Correction, introduces the ability to use a time-based plan regression check that will occur five minutes after a plan change is discovered, which avoids biasing the regression checks by queries that execute quickly.
+Link: [SQL Server 2022 CU4 Documentation](https://learn.microsoft.com/en-us/troubleshoot/sql/releases/sqlserver-2022/cumulativeupdate4#2344871)
+Scope: global
+SQL Server Version: >= 2022 CU4 + + +#### Trace Flag: 15915 +Function: Fixes a performance issue that you might encounter only when sp_lock is called frequently from multiple connections, which might cause a memory leak. The memory isn't cleaned up until you restart the SQL Server service. Added in SQL Server 2019 CU29.
+Link: [SQL Server 2019 CU29 Documentation](https://learn.microsoft.com/en-us/troubleshoot/sql/releases/sqlserver-2019/cumulativeupdate29#3180085)
+SQL Server Version: >= 2019 CU29 + + + [Docs Trace Flags]:https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql -[Query Store Trace Flags]: https://www.sqlskills.com/blogs/erin/query-store-trace-flags/ +[Query Store Trace Flags]:https://www.sqlskills.com/blogs/erin/query-store-trace-flags/ [DBCC TRACEON]:https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceon-transact-sql [DBCC TRACEOFF]:https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceoff-transact-sql -[DBCC CHECKDB]: https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-checkdb-transact-sql -[DBCC CHECKTABLE]: https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-checktable-transact-sql -[DBCC CHECKCONSTRAINTS]: https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-checkconstraints-transact-sql -[Niko Neugebauer Columnstore Indexes – part 86]: http://www.nikoport.com/2016/07/29/columnstore-indexes-part-86-new-trace-flags-in-sql-server-2016/ -[Niko Neugebauer Columnstore Indexes – part 35]: http://www.nikoport.com/2014/07/24/clustered-columnstore-indexes-part-35-trace-flags-query-optimiser-rules/ -[Microsoft SQL Server 2005 TPC-C Trace Flags]: http://webcache.googleusercontent.com/search?q=cache:Nttlt2Dp8egJ:blogs.msmvps.com/gladchenko/2009/08/21/sql_trace_flags_tpc-c/+&cd=6&hl=en&ct=clnk&gl=ru -[Trace Flag 1228 and 1229]: http://www.sqlservercentral.com/Forums/Topic741825-146-1.aspx -[A Topical Collection of SQL Server Flags v6]: https://sqlcrossjoin.files.wordpress.com/2016/04/sqlcrossjoin_traceflagrepository_v6.pdf -[How To Diagnose and Correct Errors 17883, 17884, 17887, and 17888]: https://msdn.microsoft.com/library/cc917684.aspx -[Trace flags in sql server from trace flag 902 to trace flag 1462]: http://www.sqlserverf1.com/tag/sql-server-trace-flag-1448/ -[TECHNET List Of SQL Server Trace Flags]: http://social.technet.microsoft.com/wiki/contents/articles/13105.trace-flags-in-sql-server.aspx -[Cardinality Estimation Framework 2014 First Look]: http://www.somewheresomehow.ru/cardinality-estimation-framework-2014-first-look/ -[Query Optimizer Deep Dive - Part 4]: http://sqlblog.com/blogs/paul_white/archive/2012/05/01/query-optimizer-deep-dive-part-4.aspx -[KB920093]: https://support.microsoft.com/help/920093 -[KB972767]: https://support.microsoft.com/help/972767 -[Tune compression for availability group]: https://docs.microsoft.com/sql/database-engine/availability-groups/windows/tune-compression-for-availability-group -[More Undocumented Query Optimizer Trace Flags]: http://www.benjaminnevarez.com/2012/04/more-undocumented-query-optimizer-trace-flags/ -[KB3107399]: https://support.microsoft.com/help/3107399 -[KB2801413]: https://support.microsoft.com/help/2801413 -[New Features in SQL Server 2016 Service Pack 1]: https://www.mssqltips.com/sqlservertip/4574/new-features-in-sql-server-2016-service-pack-1/ -[Internals of the Seven SQL Server Sorts – Part 1]: https://sqlperformance.com/2015/04/sql-plan/internals-of-the-seven-sql-server-sorts-part-1 -[Yet another X-Ray for the QP]: http://www.queryprocessor.com/tf_8628/ -[How It Works: SQL Server 2012 Database Engine Task Scheduling]: https://blogs.msdn.microsoft.com/psssql/2013/08/13/how-it-works-sql-server-2012-database-engine-task-scheduling/ -[What You Need to Know about the Batch Mode Window Aggregate Operator in SQL Server 2016: Part 1]: http://sqlmag.com/sql-server/what-you-need-know-about-batch-mode-window-aggregate-operator-sql-server-2016-part-1 -[SQL Server 2016 : Getting tempdb a little more right]: https://blogs.sentryone.com/aaronbertrand/sql-server-2016-tempdb-fixes/ -[Importance of Performing DBCC CHECKDB on all SQL Server Databases]: https://www.mssqltips.com/sqlservertip/4581/importance-of-performing-dbcc-checkdb-on-all-sql-server-databases/ -[SQL Server Parallel Query Placement Decision Logic]: https://blogs.msdn.microsoft.com/psssql/2016/03/04/sql-server-parallel-query-placement-decision-logic/ -[compatibility level]: https://docs.microsoft.com/sql/t-sql/statements/alter-database-transact-sql-compatibility-level -[Bad Idea Jeans: Finding Undocumented Trace Flags]: https://www.brentozar.com/archive/2017/10/bad-idea-jeans-finding-undocumented-trace-flags/ -[SQL Server - estimates outside of the histogram - half-baked draft]: http://sql-sasquatch.blogspot.ru/2017/09/sql-server-estimates-outside-of.html -[Upgrading an expired SQL Server 2016 Evaluation Edition]: https://www.codykonior.com/2017/11/30/upgrading-an-expired-sql-server-2016-evaluation-edition/ -[How to Find the Statistics Used to Compile an Execution Plan]: http://sqlblog.com/blogs/paul_white/archive/2011/09/21/how-to-find-the-statistics-used-to-compile-an-paul_white -[New Undocumented Trace Flags]: https://orderbyselectnull.com/2018/01/09/45-new-trace-flags/ -[Statistics and Cardinality Estimation]: http://topicaltraceflags.readthedocs.io/en/latest/cat/qry_StatsAndEst.html -[Splitting Strings Based on Patterns]: https://www.sqlservercentral.com/Forums/Topic1390297-3122-5.aspx -[SQL Server 2017: Adaptive Join Internals]: http://www.queryprocessor.com/adaptive-join-internals/ -[Parallelism in Hekaton (In-Memory OLTP)]: http://www.nikoport.com/2018/01/20/parallelism-in-hekaton-in-memory-oltp/ -[Hidden Performance & Manageability Improvements in SQL Server 2012 / 2014]: https://sqlperformance.com/2018/01/sql-performance/hidden-performance-manageability-improvements-sql-server-2012-2014 -[KB917825]: https://support.microsoft.com/help/917825/ -[TF6545-a]: https://support.microsoft.com/help/4018930/ -[TF6545-b]: https://SqlQuantumLeap.com/2018/02/23/sqlclr-vs-sql-server-2012-2014-2016-part-7-clr-strict-security-the-problem-continues-in-the-past-wait-what/ -[Controlling SQL Server memory dumps]: https://blogs.msdn.microsoft.com/psssql/2009/11/17/how-it-works-controlling-sql-server-memory-dumps +[DBCC TRACESTATUS]:https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-tracestatus-transact-sql +[DBCC CHECKDB]:https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-checkdb-transact-sql +[DBCC CHECKTABLE]:https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-checktable-transact-sql +[DBCC CHECKCONSTRAINTS]:https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-checkconstraints-transact-sql +[KB2801413]:https://support.microsoft.com/kb/2801413 +[Niko Neugebauer Columnstore Indexes – part 86]:http://www.nikoport.com/2016/07/29/columnstore-indexes-part-86-new-trace-flags-in-sql-server-2016/ +[Niko Neugebauer Columnstore Indexes – part 35]:http://www.nikoport.com/2014/07/24/clustered-columnstore-indexes-part-35-trace-flags-query-optimiser-rules/ +[Microsoft SQL Server 2005 TPC-C Trace Flags]:http://webcache.googleusercontent.com/search?q=cache:Nttlt2Dp8egJ:blogs.msmvps.com/gladchenko/2009/08/21/sql_trace_flags_tpc-c/+&cd=6&hl=en&ct=clnk&gl=ru +[Trace Flag 1228 and 1229]:http://www.sqlservercentral.com/Forums/Topic741825-146-1.aspx +[A Topical Collection of SQL Server Flags v6]:https://sqlcrossjoin.files.wordpress.com/2016/04/sqlcrossjoin_traceflagrepository_v6.pdf +[How To Diagnose and Correct Errors 17883, 17884, 17887, and 17888]:https://msdn.microsoft.com/library/cc917684.aspx +[Trace flags in sql server from trace flag 902 to trace flag 1462]:http://www.sqlserverf1.com/tag/sql-server-trace-flag-1448/ +[TECHNET List Of SQL Server Trace Flags]:http://social.technet.microsoft.com/wiki/contents/articles/13105.trace-flags-in-sql-server.aspx +[Cardinality Estimation Framework 2014 First Look]:http://www.somewheresomehow.ru/cardinality-estimation-framework-2014-first-look/ +[Query Optimizer Deep Dive - Part 4]:https://www.sql.kiwi/2012/05/query-optimizer-deep-dive-part-4.html +[KB920093]:https://support.microsoft.com/kb/920093 +[KB972767]:https://support.microsoft.com/kb/972767 +[Tune compression for availability group]:https://docs.microsoft.com/sql/database-engine/availability-groups/windows/tune-compression-for-availability-group +[More Undocumented Query Optimizer Trace Flags]:http://www.benjaminnevarez.com/2012/04/more-undocumented-query-optimizer-trace-flags/ +[KB3107399]:https://support.microsoft.com/kb/3107399 +[KB2801413]:https://web.archive.org/web/20131202110153/https://support.microsoft.com/kb/2801413 +[New Features in SQL Server 2016 Service Pack 1]:https://www.mssqltips.com/sqlservertip/4574/new-features-in-sql-server-2016-service-pack-1/ +[Internals of the Seven SQL Server Sorts – Part 1]:https://sqlperformance.com/2015/04/sql-plan/internals-of-the-seven-sql-server-sorts-part-1 +[Yet another X-Ray for the QP]:http://www.queryprocessor.com/tf_8628/ +[How It Works: SQL Server 2012 Database Engine Task Scheduling]:https://blogs.msdn.microsoft.com/psssql/2013/08/13/how-it-works-sql-server-2012-database-engine-task-scheduling/ +[What You Need to Know about the Batch Mode Window Aggregate Operator in SQL Server 2016: Part 1]:http://sqlmag.com/sql-server/what-you-need-know-about-batch-mode-window-aggregate-operator-sql-server-2016-part-1 +[SQL Server 2016 : Getting tempdb a little more right]:https://www.sentryone.com/blog/aaronbertrand/sql-server-2016-tempdb-fixes +[Importance of Performing DBCC CHECKDB on all SQL Server Databases]:https://www.mssqltips.com/sqlservertip/4581/importance-of-performing-dbcc-checkdb-on-all-sql-server-databases/ +[SQL Server Parallel Query Placement Decision Logic]:https://blogs.msdn.microsoft.com/psssql/2016/03/04/sql-server-parallel-query-placement-decision-logic/ +[compatibility level]:https://docs.microsoft.com/sql/t-sql/statements/alter-database-transact-sql-compatibility-level +[Bad Idea Jeans: Finding Undocumented Trace Flags]:https://www.brentozar.com/archive/2017/10/bad-idea-jeans-finding-undocumented-trace-flags/ +[SQL Server - estimates outside of the histogram - half-baked draft]:http://sql-sasquatch.blogspot.ru/2017/09/sql-server-estimates-outside-of.html +[Upgrading an expired SQL Server 2016 Evaluation Edition]:https://www.codykonior.com/2017/11/30/upgrading-an-expired-sql-server-2016-evaluation-edition/ +[How to Find the Statistics Used to Compile an Execution Plan]:https://www.sql.kiwi/2011/09/how-to-find-the-statistics-used-to-compile-an-execution-plan.html +[New Undocumented Trace Flags]:https://orderbyselectnull.com/2018/01/09/45-new-trace-flags/ +[Statistics and Cardinality Estimation]:http://topicaltraceflags.readthedocs.io/en/latest/cat/qry_StatsAndEst.html +[Splitting Strings Based on Patterns]:https://www.sqlservercentral.com/Forums/Topic1390297-3122-5.aspx +[SQL Server 2017: Adaptive Join Internals]:http://www.queryprocessor.com/adaptive-join-internals/ +[Parallelism in Hekaton (In-Memory OLTP)]:http://www.nikoport.com/2018/01/20/parallelism-in-hekaton-in-memory-oltp/ +[Hidden Performance & Manageability Improvements in SQL Server 2012 / 2014]:https://sqlperformance.com/2018/01/sql-performance/hidden-performance-manageability-improvements-sql-server-2012-2014 +[KB917825]:https://support.microsoft.com/kb/917825 +[TF6545-a]:https://support.microsoft.com/kb/4018930 +[TF6545-b]:https://SqlQuantumLeap.com/2018/02/23/sqlclr-vs-sql-server-2012-2014-2016-part-7-clr-strict-security-the-problem-continues-in-the-past-wait-what/ +[Controlling SQL Server memory dumps]:https://blogs.msdn.microsoft.com/psssql/2009/11/17/how-it-works-controlling-sql-server-memory-dumps [Change SQL Server Collation – Back to Basics]:http://jasonbrimhall.info/2018/04/12/change-sql-server-collation/ [Important Trace Flags That Every DBA Should Know]:http://victorisakov.files.wordpress.com/2011/10/sql_pass_summit_2011-important_trace_flags_that_every_dba_should_know-victor_isakov.pdf [A Row Goal Riddle]:https://orderbyselectnull.com/2018/03/30/a-row-goal-riddle/ @@ -5101,5 +5737,23 @@ Scope: ? [Fun with SQL Server Plan Cache, Trace Flag 8666, and Trace Flag 2388]:http://sql-sasquatch.blogspot.com/2018/12/fun-with-sql-server-plan-cache-trace_6.html [Let’s talk about trace flags]:https://blogs.msdn.microsoft.com/sql_server_team/lets-talk-about-trace-flags/ [SQL Server Plan Cache Limits]:https://www.sqlskills.com/blogs/erin/sql-server-plan-cache-limits/ -[KB2964518]:https://support.microsoft.com/help/2964518 +[KB2964518]:https://support.microsoft.com/kb/2964518 [SQL Server On Linux: Forced Unit Access (Fua) Internals]:http://bobsql.com/sql-server-on-linux-forced-unit-access-fua-internals/ +[SQL Server Trace Flag 2544, Trace Flag 2546 and Trace Flag 2551]:https://www.sqlservergeeks.com/trace-flag-2544/ +[Nested Loops Joins and Performance Spools]:https://sqlperformance.com/2019/09/sql-performance/nested-loops-joins-performance-spools +[Query Optimizer Deep Dive - Part 1]:https://www.sql.kiwi/2012/04/query-optimizer-deep-dive-part-1.html +[Optimizing T-SQL queries that change data]:https://www.sql.kiwi/2013/01/optimizing-t-sql-queries-that-change-data.html +[Query Optimizer Deep Dive – Part 3]:https://www.sql.kiwi/2012/04/query-optimizer-deep-dive-part-3.html +[Hello Operator, My Switch Is Bored]:https://www.sql.kiwi/2013/06/hello-operator-my-switch-is-bored.html +[Cardinality Estimation for Multiple Predicates]:https://sqlperformance.com/2014/01/sql-plan/cardinality-estimation-for-multiple-predicates +[Temporary Table Caching in Stored Procedures]:https://www.sql.kiwi/2012/08/temporary-tables-in-stored-procedures.html +[Replication Merge Agent]:https://docs.microsoft.com/en-us/sql/relational-databases/replication/agents/replication-merge-agent +[Why are (seemingly) suitable indexes not used on a LEFT JOIN with OR]:https://topanswers.xyz/databases?q=815#a960 +[A SQL Server DBA myth a day: (15/30) checkpoint only writes pages from committed transactions]:http://www.sqlskills.com/blogs/paul/a-sql-server-dba-myth-a-day-1530-checkpoint-only-writes-pages-from-committed-transactions/ +[SQL Server 2019 Aggressive Clustered Columnstore Cleanup]:https://www.tarynpivots.com/post/aggressive-clustered-columnstore-cleanup/ +[KB153096]:https://support.microsoft.com/kb/153096 +[SQL Server 2019 Aggregate Splitting]:https://www.sql.kiwi/2020/08/sql-server-2019-aggregate-splitting.html +[Minimizing the impact of DBCC CHECKDB]:https://sqlperformance.com/2012/11/io-subsystem/minimize-impact-of-checkdb +[KB2634571]:https://web.archive.org/web/20150303213855/http://support.microsoft.com/kb/2634571 +[KB4565944]:https://support.microsoft.com/kb/4565944 +[Github disable gamsgam]:https://github.com/microsoft/bobsql/blob/master/demos/sqlserver2022/tempdb/disablegamsgam.cmd diff --git a/SQL Server Version.md b/SQL Server Version.md index 8f602fc0..2aae3268 100644 --- a/SQL Server Version.md +++ b/SQL Server Version.md @@ -9,7 +9,6 @@ Headers: - [SQL Server Developer Edition Info](#sql-server-developer-edition-info) - [SQL Server Express direct download links](#sql-server-express-direct-download-links) - [Internal Database Version and Compatibility Level](#internal-database-version-and-compatibility-level) - - [Quick summary for SQL Server Service Packs](#quick-summary-for-sql-server-service-packs) - [Microsoft SQL Server 2019 Builds](#microsoft-sql-server-2019-builds) - [Microsoft SQL Server 2017 Builds](#microsoft-sql-server-2017-builds) - [Microsoft SQL Server 2016 Builds](#microsoft-sql-server-2016-builds) @@ -26,36 +25,37 @@ Headers: Useful links: - [KB321185 How to determine the version, edition and update level of SQL Server and its components](https://support.microsoft.com/help/321185) - [KB822499 Naming schema for Microsoft SQL Server software update packages](https://support.microsoft.com/help/822499) - - [Microsoft SQL Server Support Lifecycle](https://support.microsoft.com/en-us/lifecycle?x=5&y=11&c2=1044) + - [Microsoft SQL Server Support Lifecycle](https://support.microsoft.com/lifecycle?x=5&y=11&c2=1044) - [Microsoft Update Catalog](http://www.catalog.update.microsoft.com) - [SQL Server packages for Linux](https://packages.microsoft.com/) - - [Release notes for SQL Server 2017 on Linux](https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-release-notes?view=sql-server-linux-2017) + - [Release notes for SQL Server 2017 on Linux](https://docs.microsoft.com/sql/linux/sql-server-linux-release-notes?view=sql-server-linux-2017) - [KB824684 Description of the standard terminology that is used to describe Microsoft software updates](https://support.microsoft.com/help/824684) - [KB935897 An Incremental Servicing Model is available from the SQL Server team to deliver hotfixes for reported problems](https://support.microsoft.com/help/935897) - [KB2964518 Recommended updates and configuration options for SQL Server 2012 and SQL Server 2014 with high-performance workloads](https://support.microsoft.com/help/2964518) - - [Azure SQL Server Updates](https://azure.microsoft.com/en-us/updates/?product=sql-database&update-type=general-availability) - - [Most Recent KBs for Microsoft SQL Server RSS](https://support.microsoft.com/en-us/rss?rssid=1044) + - [Azure SQL Server Updates](https://azure.microsoft.com/updates/?product=sql-database&update-type=general-availability) + - [Most Recent KBs for Microsoft SQL Server RSS](https://support.microsoft.com/rss?rssid=1044) - [Testing and Developing Supportability Roadmaps for ISV Applications (PDF)](http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-85-48-files/0827.testing-and-developing-supportability-roadmaps-for-isv-applications.pdf) - [SQL Server Updates by Brent Ozar team](http://sqlserverupdates.com/) - [Which Version of SQL Server Should You Use?](https://www.brentozar.com/archive/2019/01/which-version-of-sql-server-should-you-use/) - [SQL Server Builds by SQLSentry](http://blogs.sqlsentry.com/category/sql-server-builds/) + - [SQL Server Builds by SQLPerformance.com](https://sqlperformance.com/latest-builds) - [SQL Server Release Services](https://blogs.msdn.microsoft.com/sqlreleaseservices/) - [Why I have high hopes for the quality of SQL Server 2016 release by Remus Rusanu](https://medium.com/@rusanu/why-i-have-high-hopes-for-the-quality-of-sql-server-2016-release-6173bc1fbc82#.44kg2ktmg) - [Unofficial SQL Server build chart lists](http://sqlserverbuilds.blogspot.ru/) - [Unofficial SQL Server build chart lists in table representation](http://sqlbuilds.ekelmans.com/) - - [Hardware and Software Requirements for Installing SQL Server](https://msdn.microsoft.com/en-us//library/ms143506.aspx) + - [Hardware and Software Requirements for Installing SQL Server](https://msdn.microsoft.com//library/ms143506.aspx) - [Wikipedia Microsoft SQL Server](https://en.wikipedia.org/wiki/Microsoft_SQL_Server) - - [SQL Server 2005 Downloads](https://msdn.microsoft.com/en-us/sqlserver/bb671254.aspx) - - [SQL Server 2000 Downloads](https://msdn.microsoft.com/en-us/sqlserver/bb895925) - - [SQL Server 7.0 Downloads](https://msdn.microsoft.com/en-us/sqlserver/bb671066) + - [SQL Server 2005 Downloads](https://msdn.microsoft.com/sqlserver/bb671254.aspx) + - [SQL Server 2000 Downloads](https://msdn.microsoft.com/sqlserver/bb895925) + - [SQL Server 7.0 Downloads](https://msdn.microsoft.com/sqlserver/bb671066) Useful articles: - [How to identify your SQL Server version and edition](http://support.microsoft.com/kb/321185/en-us) - [SQL Server Internal Database Versions](http://sqlserverbuilds.blogspot.ru/2014/01/sql-server-internal-database-versions.html) - - [Microsoft SQL Server Support Lifecycle](https://support.microsoft.com/en-us/lifecycle/) + - [Microsoft SQL Server Support Lifecycle](https://support.microsoft.com/lifecycle/) - [Microsoft SQL Server Home](http://www.microsoft.com/sql) - [Microsoft SQL Server Developer Center](http://msdn.microsoft.com/sqlserver) - - [Microsoft TechNet: Microsoft SQL Server](http://technet.microsoft.com/en-us/sqlserver) + - [Microsoft TechNet: Microsoft SQL Server](http://technet.microsoft.com/sqlserver) - [SQL Server Patching Shortcut](http://www.sqlservercentral.com/articles/SQL+Server+patching/138693/) **All SQL Server service packs and Cumulative Updates are cumulative, meaning that each new service pack and cumulative update contains all the fixes that are included with previous service packs and any new fixes.** @@ -98,8 +98,8 @@ Like Cumulative Updates, Service Packs are cumulative. If you are applying SP3, - **Hotfix**: A single, cumulative package that includes one or more files that are used to address a problem in a product and are cumulative at the binary and file level. A hotfix addresses a specific customer situation and may not be distributed outside the customers organization. ### References - - [KB #824684 : Description of the standard terminology that is used to describe Microsoft software updates](https://support.microsoft.com/en-us/kb/824684) - - [KB #935897 : An Incremental Servicing Model is available from the SQL Server team to deliver hotfixes for reported problems](https://support.microsoft.com/en-us/kb/935897) + - [KB #824684 : Description of the standard terminology that is used to describe Microsoft software updates](https://support.microsoft.com/kb/824684) + - [KB #935897 : An Incremental Servicing Model is available from the SQL Server team to deliver hotfixes for reported problems](https://support.microsoft.com/kb/935897) - [QFE vs GDR/LDR hotfixes](https://blogs.technet.microsoft.com/instan/2009/03/04/qfe-vs-gdrldr-hotfixes/) - [GDR, QFE, LDR… WTH?](http://blogs.technet.com/b/mrsnrub/archive/2009/05/14/gdr-qfe-ldr-wth.aspx) - [GDR & LDR : The Next Generation](http://blogs.technet.com/b/mrsnrub/archive/2009/05/14/gdr-qfe-ldr-wth.aspx) @@ -129,39 +129,42 @@ Profits: | Version | Latest Update | Build Number | Release Date | Lifecycle Start | Mainstream Support | Extended Support | Other Updates | |---------|-----------------------------------------------------------------------|----------------------------------------------|------------------------------------------|-----------------|--------------------|------------------|-------------------------------------------------------------------| -| 2019 | [Install 2019 CTP 3.1] | 15.0.1700.0 | 2019-06-26 | ? | ? | ? | [Other SQL 2019 Updates](#microsoft-sql-server-2019-builds) | -| 2017 | [Install 2017 RTM] then [CU15 KB4510083] | 14.0.1000.169
14.0.3208.1 | 2017-10-02
2019-07-09 | 2017-08-28 | 2022-11-10 | 2027-12-10 | [Other SQL 2017 Updates](#microsoft-sql-server-2017-builds) | -| 2016 | [Install 2016 SP2] then [CU7 KB4510807] | 13.0.5026.0
13.0.5382.0 | 2018-04-24
2019-05-22 | 2016-11-16 | 2021-07-13 | 2026-07-14 | [Other SQL 2016 Updates](#microsoft-sql-server-2016-builds) | -| 2014 | [Install 2014 SP3] then
[GDR KB4505422] | 12.0.6024.0
12.0.6293.0 | 2018-10-30
2019-07-09 | 2016-07-14 | 2019-07-09 | 2024-07-09 | [Other SQL 2014 Updates](#microsoft-sql-server-2014-builds) | -| 2012 | [Install 2012] then
[SP4 2012] then
[ADV180002 (GDR)] | 11.0.2100.60
11.0.7001.0
11.0.7462.6 | 2012-02-14
2017-10-05
2018-01-12 | 2015-12-01 | 2017-07-11 | 2022-07-12 | [Other SQL 2012 Updates](#microsoft-sql-server-2012-builds) | -| 2008 R2 | [Install 2008 R2] then
[SP3 2008 R2] then
[SU KB3045311] | 10.50.1600
10.50.6000
10.50.6220.0 | 2010-11-21
2014-09-30
2015-07-14 | Review Note | 2014-07-08 | 2019-07-09 | [Other SQL 2008 R2 Updates](#microsoft-sql-server-2008-r2-builds) | -| 2008 | [Install 2008] then
[SP4 2008] then
[SU KB3045316] | 10.0.1600.0
10.0.6000
10.0.6241.0 | 2008-01-19
2014-09-30
2015-07-14 | 2014-07-07 | 2014-07-08 | 2019-07-09 | [Other SQL 2008 Updates](#microsoft-sql-server-2008-builds) | - -**For downloading distributive for SQL Server 2008 R2 and SQL Server 2008 you must have MSDN subscription, see [Install 2008 R2] and [Install 2008] links.** - -[Install 2019 CTP 3.1]:https://www.microsoft.com/en-us/sql-server/sql-server-2019#Install -[Install 2017 RTM]:https://www.microsoft.com/en-us/sql-server/sql-server-downloads -[CU15 KB4510083]:https://support.microsoft.com/help/4510083 -[Install 2016 SP2]:https://go.microsoft.com/fwlink/?LinkID=799011 -[CU7 KB4510807]:https://support.microsoft.com/help/4510807 +| 2019 | [Install 2019 RTM] then [CU12 KB5004524] | 15.0.2070.41
15.0.4153.1 | 2019-11-04
2021-08-04 | 2019-11-04 | 2025-01-07 | 2030-01-08 | [Other SQL 2019 Updates](#microsoft-sql-server-2019-builds) | +| 2017 | [Install 2017 RTM] then [CU26 KB5005226] | 14.0.1000.169
14.0.3411.3 | 2017-10-02
2021-09-14 | 2017-09-29 | 2022-11-10 | 2027-12-10 | [Other SQL 2017 Updates](#microsoft-sql-server-2017-builds) | +| 2016 | [Install 2016 SP2] then [SP3 2016] | 13.0.5026.0
13.0.5026.0 | 2018-04-24
2021-09-15 | 2016-01-06 | 2021-07-13 | 2026-07-14 | [Other SQL 2016 Updates](#microsoft-sql-server-2016-builds) | +| 2014 | [Install 2014 SP3] then [KB4583462] | 12.0.6024.0
12.0.6433.1 | 2018-10-30
2021-01-12 | 2016-07-14 | 2019-07-09 | 2024-07-09 | [Other SQL 2014 Updates](#microsoft-sql-server-2014-builds) | +| 2012 | [Install 2012] then
[SP4 2012] then
[KB4583465] | 11.0.2100.60
11.0.7001.0
11.0.7507.2 | 2012-02-14
2017-10-05
2021-01-12 | 2015-12-01 | 2017-07-11 | 2022-07-12 | [Other SQL 2012 Updates](#microsoft-sql-server-2012-builds) | +| 2019 | [Install 2019 RTM] then [CU7 KB4570012] | 15.0.2070.41
15.0.4063.15 | 2019-11-04
2020-09-02 | 2019-11-04 | 2025-01-07 | 2030-01-08 | [Other SQL 2019 Updates](#microsoft-sql-server-2019-builds) | +| 2017 | [Install 2017 RTM] then [CU21 KB4557397] | 14.0.1000.169
14.0.3335.7 | 2017-10-02
2020-07-01 | 2017-09-29 | 2022-11-10 | 2027-12-10 | [Other SQL 2017 Updates](#microsoft-sql-server-2017-builds) | +| 2016 | [Install 2016 SP2] then [CU14 KB4564903] | 13.0.5026.0
13.0.5830.85 | 2018-04-24
2020-08-06 | 2016-01-06 | 2021-07-13 | 2026-07-14 | [Other SQL 2016 Updates](#microsoft-sql-server-2016-builds) | +| 2014 | [Install 2014 SP3] then
[KB4583462] | 12.0.6024.0
12.0.6433.1 | 2018-10-30
2021-01-07 | 2016-07-14 | 2019-07-09 | 2024-07-09 | [Other SQL 2014 Updates](#microsoft-sql-server-2014-builds) | +| 2012 | [Install 2012] then
[SP4 2012] then
[KB4532098] | 11.0.2100.60
11.0.7001.0
11.0.7493.4 | 2012-02-14
2017-10-05
2020-02-11 | 2015-12-01 | 2017-07-11 | 2022-07-12 | [Other SQL 2012 Updates](#microsoft-sql-server-2012-builds) | +| 2008 R2 | [Install 2008 R2] then
[SP3 2008 R2] then
[SU KB3045311] | 10.50.1600
10.50.6000
10.50.6220.0 | 2010-11-21
2014-09-30
2015-07-14 | 2010-07-20 | 2014-07-08 | 2019-07-09 | [Other SQL 2008 R2 Updates](#microsoft-sql-server-2008-r2-builds) | +| 2008 | [Install 2008] then
[SP4 2008] then
[SU KB3045316] | 10.0.1600.0
10.0.6000
10.0.6241.0 | 2008-01-19
2014-09-30
2015-07-14 | 2010-07-20 | 2014-07-08 | 2019-07-09 | [Other SQL 2008 Updates](#microsoft-sql-server-2008-builds) | + +[Install 2019 RTM]:https://www.microsoft.com/sql-server/sql-server-2019#Install +[CU12 KB5005226]:https://support.microsoft.com/help/5005226 +[Install 2017 RTM]:https://www.microsoft.com/en-us/sql-server/sql-server-2017 +[CU25 KB5003830]:https://support.microsoft.com/help/50038307 +[Install 2016 SP3]:https://www.microsoft.com/en-us/download/details.aspx?id=103440 [Install 2014 SP3]:https://www.microsoft.com/evalcenter/evaluate-sql-server-2014-sp3 -[GDR KB4505422]:https://support.microsoft.com/help/4505422 -[Install 2012]:https://www.microsoft.com/en-us/evalcenter/evaluate-sql-server-2012 -[SP4 2012]:https://support.microsoft.com/en-us/help/4018073 -[ADV180002 (GDR)]:https://support.microsoft.com/en-us/help/4057116 -[CU9 KB3098512]:https://support.microsoft.com/en-us/kb/3098512 +[KB4583462]:https://support.microsoft.com/help/4583462 +[Install 2012]:https://www.microsoft.com/evalcenter/evaluate-sql-server-2012 +[SP4 2012]:https://support.microsoft.com/help/4018073 +[KB4583465]:https://support.microsoft.com/help/4583465 +[CU9 KB3098512]:https://support.microsoft.com/kb/3098512 [Install 2008 R2]:https://msdn.microsoft.com/subscriptions/securedownloads/#searchTerm=sql%20server%202008%20r2&ProductFamilyId=0&Languages=en&FileExtensions=.iso&PageSize=10&PageIndex=0&FileId=0 -[SP3 2008 R2]:http://www.microsoft.com/en-us/download/details.aspx?id=44271 +[SP3 2008 R2]:http://www.microsoft.com/download/details.aspx?id=44271 [SU KB3045311]:https://www.microsoft.com/downloads/details.aspx?familyid=7af16cb8-c944-41cb-a897-c6fc373869cd [Install 2008]:https://msdn.microsoft.com/subscriptions/securedownloads/#searchTerm=sql%20server%202008&ProductFamilyId=0&Languages=en&FileExtensions=.iso&PageSize=10&PageIndex=0&FileId=0 -[SP4 2008]:http://www.microsoft.com/en-us/download/details.aspx?id=44278 +[SP4 2008]:http://www.microsoft.com/download/details.aspx?id=44278 [SU KB3045316]:https://support.microsoft.com/help/3045311 -[Developer Free]:https://www.microsoft.com/en-us/cloud-platform/sql-server-editions-developers +[Developer Free]:https://www.microsoft.com/cloud-platform/sql-server-editions-developers ## Microsoft SQL Server installation files info -`SHA1` hash you can easy get with default Windows utility [certutil](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/certutil 'certutil Microsoft docs'). +`SHA1` hash you can easy get with default Windows utility [certutil](https://docs.microsoft.com/windows-server/administration/windows-commands/certutil 'certutil Microsoft docs'). For example, for single file: ```bat @@ -175,42 +178,44 @@ FOR /R "d:\SQL Server" %I IN (*.exe) DO certUtil -hashfile "%I" sha1 Alternative download link for all English x64 distributives: https://rebrand.ly/sql-server-distribs -| Direct x64 Download Link | File Name | Release Date | Build Number | Size, MB | SHA1 | -|---------------------------------------|-------------------------------------------------------------------|--------------|--------------:|---------:|------------------------------------------| -| [SQL Server 2019] | SQLServer2019CTP3.1-x64-ENU.iso | 2019-06-26 | 15.0.1700.0 | 1341 | b8ab9012977d67a6dda05d594ce11cb95d540de5 | -| [SQL Server 2017] | SQLServer2017-x64-ENU-Dev.iso | 2017-10-02 | 14.0.1000.169 | 1476 | 0280ff6c1447d287a6bd3b86b81e459fe252d17a | -| [SQL Server 2017 CU15] | SQLServer2017-KB4510083-x64.exe | 2019-07-09 | 14.0.3208.1 | 528 | 61e727e0183ce605bfa2b2a114a1baa9f9272332 | -| [SQL Server 2016 SP2] | SQLServer2016SP1-KB3182545-x64-ENU.exe | 2018-04-24 | 13.0.5026.0 | 2832 | 6309d729a0f063d11c0bb7f840f1069483406755 | -| [SQL Server 2016 SP2 CU7] | SQLServer2016-KB4510807-x64.exe | 2019-07-09 | 13.0.5382.0 | 714 | 486a4a4da5f0dcc2fbf807988d100107fe8173e8 | -| [SQL Server 2014 SP3] | SQLServer2014SP3-FullSlipstream-x64-ENU.iso | 2018-10-30 | 12.0.6024.0 | 3190 | 6041e06548c46862c9f3536e28113f598bb6ae00 | -| [SQL Server 2014 SP3 GDR KB4505422] | SQLServer2014-KB4505422-x64.exe | 2019-07-09 | 12.0.6293.0 | 656 | 1eb492c57bf397234bbe2dfdd2abad571b345a67 | -| [SQL Server 2012] | SQLFULL_ENU.iso | 2012-02-14 | 11.0.2100.60 | 4300 | be00942cc56d033e2c9dce8a17a6f2654f5184a3 | -| [SQL Server 2012 SP4] | SQLServer2012SP4-KB4018073-x64-ENU.exe | 2017-10-05 | 11.0.7001.0 | 1024 | 95127ee2e8dfef180752e531a83cd948c24a3a87 | -| [SQL Server 2012 SP4 ADV180002 (GDR)] | SQLServer2012-KB4057116-x64.exe | 2018-01-12 | 11.0.7462.6 | 672 | c0c2e0e6519363a5bb3d3ca78d55ef664a8c8995 | -| SQL Server 2008 R2 RTM | SW_DVD9_SQL_Svr_Enterprise_Edtn_2008_R2_English_MLF_X16-29540.ISO | 2010-04-21 | 10.50.1600.1 | 4177 | 18105db70f0f0b23418f5005a6ce4b25317c6d03 | -| [SQL Server 2008 R2 SP3] | SQLServer2008R2SP3-KB2979597-x64-ENU.exe | 2014-09-30 | 10.50.6220.0 | 358 | 194cd740d5812b12639b47886ebde0d04774b4ec | -| [SQL Server 2008 R2 SU] | SQLServer2008R2-KB3045316-x64.exe | 2015-07-14 | 10.50.6000 | 58 | 3aa4d820553b1e5d96735541cbb55d97322c286e | -| [SQL Server 2008] | ? | 2008-01-19 | 10.0.1600.0 | ? | ? | -| [SQL Server 2008 SP4] | SQLServer2008SP4-KB2979596-x64-ENU.exe | 2014-09-30 | 10.0.6241.0 | 378 | 13610d6cb39e37fcd4a3338244a3ca2a8a404cd8 | -| [SQL Server 2008 SU] | SQLServer2008-KB3045311-x64.exe | 2015-07-14 | 10.00.6000 | 61 | 37a197c60990d2e83e98d1090109a4ab3f2abe4b | - -**For downloading distributive for SQL Server 2008 R2 and SQL Server 2008 you must have MSDN subscription, see [Install 2008 R2] and [Install 2008] links.** - -[SQL Server 2019]:https://go.microsoft.com/fwlink/?linkid=866664 -[SQL Server 2017]:https://go.microsoft.com/fwlink/?linkid=853016 -[SQL Server 2017 CU15]:http://download.microsoft.com/download/3/7/3/3731A492-B575-4E8E-9B4F-3E14460AF065/SQLServer2017-KB4510083-x64.exe -[SQL Server 2016]:http://care.dlservice.microsoft.com/dl/download/F/E/9/FE9397FA-BFAB-4ADD-8B97-91234BC774B2/SQLServer2016-x64-ENU.iso -[SQL Server 2016 SP2]:https://go.microsoft.com/fwlink/?LinkID=799011 -[SQL Server 2016 SP2 CU7]:http://download.microsoft.com/download/C/4/2/C42DB537-DC1F-4AAD-9954-D1FF29960C2F/SQLServer2016-KB4510807-x64.exe -[SQL Server 2014 SP3]:http://download.microsoft.com/download/7/9/F/79F4584A-A957-436B-8534-3397F33790A6/SQLServer2014SP3-FullSlipstream-x64-ENU.iso -[SQL Server 2014 SP3 GDR KB4505422]:https://download.microsoft.com/download/6/4/2/64207134-52D5-45EB-BC48-D0F684F24762/SQLServer2014-KB4505422-x64.exe -[SQL Server 2012]:https://download.microsoft.com/download/4/C/7/4C7D40B9-BCF8-4F8A-9E76-06E9B92FE5AE/ENU/SQLFULL_ENU.iso +| Direct x64 Download Link | File Name | Release Date | Build Number | Size, MB | SHA1 | +|:--------------------------------|:------------------------------------------------------------------|:-------------|--------------:|---------:|------------------------------------------| +| [SQL Server 2019 RTM] | SQLServer2019-x64-ENU.iso | 2019-11-04 | 15.0.2000.5 | 1360 | d41eb957a037add32441e2302a734268bda94709 | +| [SQL Server 2019 CU12] | SQLServer2019-KB5004524-x64.exe | 2021-08-04 | 15.0.4153.1 | 669 | f145a82e48219e5bf80c7dcf57ea3c902c4d395f | +| [SQL Server 2017 RTM] | SQLServer2017-x64-ENU-Dev.iso | 2017-10-02 | 14.0.1000.169 | 1476 | 0280ff6c1447d287a6bd3b86b81e459fe252d17a | +| [SQL Server 2017 CU26] | SQLServer2017-KB5005226-x64.exe | 2021-09-14 | 14.0.3411.3 | 533 | e31b28ba9c4c0b63ddbb356f630e8ea631da97fe | +| [SQL Server 2016 SP2] | SQLServer2016SP2-FullSlipstream-x64-ENU.iso | 2018-04-24 | 13.0.5026.0 | 2832 | 6309d729a0f063d11c0bb7f840f1069483406755 | +| [SQL Server 2016 SP3] | SQLServer2016SP3-KB5003279-x64-ENU.exe | 2021-09-15 | 13.0.6300.2 | 821 | 1a97cb64a8807bde83443b911fd84616432612f3 | +| [SQL Server 2014 SP3] | SQLServer2014SP3-FullSlipstream-x64-ENU.iso | 2018-10-30 | 12.0.6024.0 | 3190 | 6041e06548c46862c9f3536e28113f598bb6ae00 | +| [SQL Server 2014 SP3 KB4583462] | SQLServer2014-KB4583462-x64.exe | 2021-01-12 | 12.0.6433.1 | 596 | 0dc4f56583828865365340dcb95436f1a41754b9 | +| [SQL Server 2012 RTM] | SQLFULL_ENU.iso | 2012-02-14 | 11.0.2100.60 | 4300 | be00942cc56d033e2c9dce8a17a6f2654f5184a3 | +| [SQL Server 2012 SP4] | SQLServer2012SP4-KB4018073-x64-ENU.exe | 2017-10-05 | 11.0.7001.0 | 1024 | 95127ee2e8dfef180752e531a83cd948c24a3a87 | +| [SQL Server 2012 SP4 KB4583465] | SQLServer2012-KB4583465-x64.exe | 2021-01-12 | 11.0.7507.2 | 856 | c6e5ea14425fed26b885ab6b70aba8622817fd8c | +| SQL Server 2008 R2 RTM | SW_DVD9_SQL_Svr_Enterprise_Edtn_2008_R2_English_MLF_X16-29540.ISO | 2010-04-21 | 10.50.1600.1 | 4177 | 18105db70f0f0b23418f5005a6ce4b25317c6d03 | +| [SQL Server 2008 R2 SP3] | SQLServer2008R2SP3-KB2979597-x64-ENU.exe | 2014-09-30 | 10.50.6220.0 | 358 | 194cd740d5812b12639b47886ebde0d04774b4ec | +| [SQL Server 2008 R2 SU] | SQLServer2008R2-KB3045316-x64.exe | 2015-07-14 | 10.50.6000 | 58 | 3aa4d820553b1e5d96735541cbb55d97322c286e | +| SQL Server 2008 | ? | 2008-01-19 | 10.0.1600.0 | ? | ? | +| [SQL Server 2008 SP4] | SQLServer2008SP4-KB2979596-x64-ENU.exe | 2014-09-30 | 10.0.6241.0 | 378 | 13610d6cb39e37fcd4a3338244a3ca2a8a404cd8 | +| [SQL Server 2008 SU] | SQLServer2008-KB3045311-x64.exe | 2015-07-14 | 10.00.6000 | 61 | 37a197c60990d2e83e98d1090109a4ab3f2abe4b | + +**For downloading distributive for SQL Server 2008 R2 and SQL Server 2008 you must have MSDN subscription, see [SQL Server 2008 R2] and [SQL Server 2008] links.** + +[SQL Server 2019 RTM]:https://go.microsoft.com/fwlink/?linkid=866664 +[SQL Server 2019 CU12]:https://download.microsoft.com/download/6/e/7/6e72dddf-dfa4-4889-bc3d-e5d3a0fd11ce/SQLServer2019-KB5004524-x64.exe +[SQL Server 2017 RTM]:https://go.microsoft.com/fwlink/?linkid=853016 +[SQL Server 2017 CU26]:https://download.microsoft.com/download/C/4/F/C4F908C9-98ED-4E5F-88D5-7D6A5004AEBD/SQLServer2017-KB5005226-x64.exe +[SQL Server 2016 SP2]:https://www.microsoft.com/en-us/evalcenter/evaluate-sql-server-2016 +[SQL Server 2016 SP3]:https://download.microsoft.com/download/a/7/7/a77b5753-8fe7-4804-bfc5-591d9a626c98/SQLServer2016SP3-KB5003279-x64-ENU.exe +[SQL Server 2016 SP2 CU17]:https://download.microsoft.com/download/6/0/6/606B3A2E-0EAE-4DCD-930D-178686370921/SQLServer2016-KB5001092-x64.exe +[SQL Server 2014 SP3]:https://www.microsoft.com/en-us/evalcenter/evaluate-sql-server-2014-sp3 +[SQL Server 2014 SP3 KB4583462]:https://www.microsoft.com/en-us/download/details.aspx?id=102623 +[SQL Server 2012 RTM]:https://download.microsoft.com/download/4/C/7/4C7D40B9-BCF8-4F8A-9E76-06E9B92FE5AE/ENU/SQLFULL_ENU.iso [SQL Server 2012 SP4]:https://download.microsoft.com/download/E/A/B/EABF1E75-54F0-42BB-B0EE-58E837B7A17F/SQLServer2012SP4-KB4018073-x64-ENU.exe -[SQL Server 2012 SP4 ADV180002 (GDR)]:https://download.microsoft.com/download/F/6/1/F618E667-BA6E-4428-A36A-8B4F5190FCC8/SQLServer2012-KB4057116-x64.exe +[SQL Server 2012 SP4 KB4583465]:https://www.microsoft.com/en-us/download/confirmation.aspx?id=102625 [SQL Server 2008 R2]:https://msdn.microsoft.com/subscriptions/securedownloads/#searchTerm=sql%20server%202008%20r2&ProductFamilyId=0&Languages=en&FileExtensions=.iso&PageSize=10&PageIndex=0&FileId=0 [SQL Server 2008 R2 SP3]:https://download.microsoft.com/download/D/7/A/D7A28B6C-FCFE-4F70-A902-B109388E01E9/ENU/SQLServer2008R2SP3-KB2979597-x64-ENU.exe [SQL Server 2008 R2 SU]:https://download.microsoft.com/download/4/D/A/4DAE6F9E-960E-4A59-BDE7-1D92DA508315/SQLServer2008R2-KB3045316-x64.exe -[SQL Server 2008]:https://download.microsoft.com/download/D/D/B/DDB17DC1-A879-44DD-BD11-C0991D292AD7/6001.18000.080118-1840_amd64fre_Server_en-us-KRMSXFRE_EN_DVD.exe +[SQL Server 2008]:https://msdn.microsoft.com/subscriptions/securedownloads/#searchTerm=sql%20server%202008&ProductFamilyId=0&Languages=en&FileExtensions=.iso&PageSize=10&PageIndex=0&FileId=0 [SQL Server 2008 SP4]:https://download.microsoft.com/download/5/E/7/5E7A89F7-C013-4090-901E-1A0F86B6A94C/ENU/SQLServer2008SP4-KB2979596-x64-ENU.exe [SQL Server 2008 SU]:https://download.microsoft.com/download/E/C/0/EC0A7C15-9A6D-4F41-9B9F-BCA10CC3937C/SQLServer2008-KB3045311-x64.exe @@ -219,66 +224,67 @@ Alternative download link for all English x64 distributives: https://rebrand.ly/ **Now it is free!!!** [SQL Server Developer Edition Download page](https://my.visualstudio.com/downloads?q=sql%20server%20developer) -For downloading your copy SQL Server Developer Edition you just need to join the [Visual Studio Dev Essentials program](https://www.visualstudio.com/en-us/products/visual-studio-dev-essentials-vs.aspx) +For downloading your copy SQL Server Developer Edition you just need to join the [Visual Studio Dev Essentials program](https://www.visualstudio.com/products/visual-studio-dev-essentials-vs.aspx) | Edition\Direct Download Link | Release Date | File name | Size, Mb | SHA1 | |-----------------------------------------------------------------------------|--------------|------------------------------------------------------------------------------|---------:|------------------------------------------| -| SQL Server 2017 Developer (x64) - DVD (English) | 2017-10-02 | en_sql_server_2017_developer_x64_dvd_11296168.iso | 1475 | 0280FF6C1447D287A6BD3B86B81E459FE252D17A | -| SQL Server 2016 Developer with Service Pack 2 (x64) - DVD (English) | 2018-05-22 | en_sql_server_2016_developer_with_service_pack_2_x64_dvd_12194995.iso | 2800 | 74279286C2ABFBA9E9FF6DBEE60B71669BD234D2 | -| SQL Server 2016 Developer (x64) - DVD (English) | 2016-06-01 | en_sql_server_2016_developer_x64_dvd_8777069.iso | 2100 | 1B23982FE56DF3BFE0456BDF0702612EB72ABF75 | -| SQL Server 2014 Developer Edition with Service Pack 1 (x64) - DVD (English) | 2015-05-21 | en_sql_server_2014_developer_edition_with_service_pack_1_x64_dvd_6668542.iso | 3025 | BFEE1F300C39638DA0D2CD594636698C6207C852 | -| SQL Server 2014 Developer Edition with Service Pack 1 (x86) - DVD (English) | 2015-05-21 | en_sql_server_2014_developer_edition_with_service_pack_1_x86_dvd_6668541.iso | 2462 | ED3C70507A73BCC63D67CFA272CD849B9418A18E | -| SQL Server 2014 Developer Edition (x64) - DVD (English) | 2014-04-01 | en_sql_server_2014_developer_edition_x64_dvd_3940406.iso | 2486 | F73F430F55A71DA219FC7257A3A28E8FC142530F | -| SQL Server 2014 Developer Edition (x86) - DVD (English) | 2014-04-01 | en_sql_server_2014_developer_edition_x86_dvd_3938200.iso | 2039 | 395B35FD80AA959B02B0C399DA1BB0C020DB6310 | +| SQL Server 2019 Developer (x64) - DVD (English) | 2019-11-05 | en_sql_server_2019_developer_x64_dvd_baea4195.iso | 1367 | 22974e466987d7d4659437aab06ac0798657c700 | +| SQL Server 2017 Developer (x64) - DVD (English) | 2017-10-02 | en_sql_server_2017_developer_x64_dvd_11296168.iso | 1475 | 0280ff6c1447d287a6bd3b86b81e459fe252d17a | +| SQL Server 2016 Developer with Service Pack 2 (x64) - DVD (English) | 2018-05-22 | en_sql_server_2016_developer_with_service_pack_2_x64_dvd_12194995.iso | 2800 | 74279286c2abfba9e9ff6dbee60b71669bd234d2 | +| SQL Server 2016 Developer with Service Pack 1 (x64) - DVD (English) | 2016-11-16 | en_sql_server_2016_developer_with_service_pack_1_x64_dvd_9548071.iso | 2590 | b12af2cc5112f22a784a14f8d32b49ee56d296b3 | +| SQL Server 2016 Developer (x64) - DVD (English) | 2016-06-01 | en_sql_server_2016_developer_x64_dvd_8777069.iso | 2100 | 1b23982fe56df3bfe0456bdf0702612eb72abf75 | +| SQL Server 2014 Developer Edition with Service Pack 1 (x64) - DVD (English) | 2015-05-21 | en_sql_server_2014_developer_edition_with_service_pack_1_x64_dvd_6668542.iso | 3025 | bfee1f300c39638da0d2cd594636698c6207c852 | +| SQL Server 2014 Developer Edition with Service Pack 1 (x86) - DVD (English) | 2015-05-21 | en_sql_server_2014_developer_edition_with_service_pack_1_x86_dvd_6668541.iso | 2462 | ed3c70507a73bcc63d67cfa272cd849b9418a18e | +| SQL Server 2014 Developer Edition (x64) - DVD (English) | 2014-04-01 | en_sql_server_2014_developer_edition_x64_dvd_3940406.iso | 2486 | f73f430f55a71da219fc7257a3a28e8fc142530f | +| SQL Server 2014 Developer Edition (x86) - DVD (English) | 2014-04-01 | en_sql_server_2014_developer_edition_x86_dvd_3938200.iso | 2039 | 395b35fd80aa959b02b0c399da1bb0c020db6310 | ## SQL Server Express direct download links -Original post written by Scott Hanselman: http://www.hanselman.com/blog/DownloadSQLServerExpress.aspx
-Official Microsoft SQL Server Express page: https://www.microsoft.com/en-us/server-cloud/products/sql-server-editions/sql-server-express.aspx - - -### [Download SQL Server 2017 Express](https://www.microsoft.com/en-us/download/details.aspx?id=55994) - -### [Download SQL Server 2016 Express](https://www.microsoft.com/en-us/download/details.aspx?id=52679) - - -### [Download SQL Server 2014 Express](http://www.microsoft.com/en-us/download/details.aspx?id=42299) -[Download Microsoft SQL Server 2014 Service Pack 1 (SP1) Express ](https://www.microsoft.com/en-us/download/details.aspx?id=46697)
-You likely just want SQL Server 2014 Express with Tools. This download includes SQL Management Studio: - - [SQL Server 2014 Express x64](http://download.microsoft.com/download/E/A/E/EAE6F7FC-767A-4038-A954-49B8B05D04EB/ExpressAndTools%2064BIT/SQLEXPRWT_x64_ENU.exe) - - [SQL Server 2014 Express x86](http://download.microsoft.com/download/E/A/E/EAE6F7FC-767A-4038-A954-49B8B05D04EB/ExpressAndTools%2032BIT/SQLEXPRWT_x86_ENU.exe) - -Here's just SQL Server 2014 Management Studio: - - [SQL Management Studio x64](http://download.microsoft.com/download/E/A/E/EAE6F7FC-767A-4038-A954-49B8B05D04EB/MgmtStudio%2064BIT/SQLManagementStudio_x64_ENU.exe) - - [SQL Management Studio x86](http://download.microsoft.com/download/E/A/E/EAE6F7FC-767A-4038-A954-49B8B05D04EB/MgmtStudio%2032BIT/SQLManagementStudio_x86_ENU.exe) - -SQL Server 2014 Express with Advanced Services: - - [Advanced Services x64](http://download.microsoft.com/download/E/A/E/EAE6F7FC-767A-4038-A954-49B8B05D04EB/ExpressAdv%2064BIT/SQLEXPRADV_x64_ENU.exe) - - [Advanced Services x86](http://download.microsoft.com/download/E/A/E/EAE6F7FC-767A-4038-A954-49B8B05D04EB/ExpressAdv%2032BIT/SQLEXPRADV_x86_ENU.exe) - - -### [Download SQL Server 2012 Express](http://www.microsoft.com/en-us/download/details.aspx?id=29062) -[Download Microsoft SQL Server 2012 Service Pack 1 (SP1) Express ](https://www.microsoft.com/en-us/download/details.aspx?id=35579)
-You likely just want SQL Server 2012 Express with Tools. This download includes SQL Management Studio: - - [SQL Server 2012 Express x64](http://download.microsoft.com/download/8/D/D/8DD7BDBA-CEF7-4D8E-8C16-D9F69527F909/ENU/x64/SQLEXPRWT_x64_ENU.exe) - -Here's just SQL Server 2012 Management Studio: - - [SQL Management Studio x64](http://download.microsoft.com/download/8/D/D/8DD7BDBA-CEF7-4D8E-8C16-D9F69527F909/ENU/x64/SQLManagementStudio_x64_ENU.exe) - - [SQL Management Studio x86](http://download.microsoft.com/download/8/D/D/8DD7BDBA-CEF7-4D8E-8C16-D9F69527F909/ENU/x86/SQLManagementStudio_x86_ENU.exe) - - -### [Download SQL Server 2008 Express R2 SP2](http://www.microsoft.com/en-us/download/details.aspx?id=30438) -You likely just want SQL Server 2008 Express with Tools. This download includes SQL Management Studio: - - [SQL Server 2008 Express x64](http://download.microsoft.com/download/0/4/B/04BE03CD-EAF3-4797-9D8D-2E08E316C998/SQLEXPRWT_x64_ENU.exe) - - [SQL Server 2008 Express x86](http://download.microsoft.com/download/0/4/B/04BE03CD-EAF3-4797-9D8D-2E08E316C998/SQLEXPRWT_x86_ENU.exe) - -Here's just SQL Server 2008 Management Studio: - - [SQL Management Studio x64](http://download.microsoft.com/download/0/4/B/04BE03CD-EAF3-4797-9D8D-2E08E316C998/SQLManagementStudio_x64_ENU.exe) - - [SQL Management Studio x86](http://download.microsoft.com/download/0/4/B/04BE03CD-EAF3-4797-9D8D-2E08E316C998/SQLManagementStudio_x86_ENU.exe) - - -### [Download SQL Server 2005 Express](https://www.microsoft.com/en-us/download/details.aspx?id=21844) +Great thanks Scott Hanselman for Original post: [Download SQL Server Express](http://downloadsqlserverexpress.com) + +- [SQL Server 2019 Express Edition](https://www.microsoft.com/Download/details.aspx?id=101064) + - [Download SQL Server 2019 Express Basic (English)](https://download.microsoft.com/download/7/c/1/7c14e92e-bdcb-4f89-b7cf-93543e7112d1/SQLEXPR_x64_ENU.exe) + - [Download SQL Server 2019 Express Advanced (English)](https://download.microsoft.com/download/7/c/1/7c14e92e-bdcb-4f89-b7cf-93543e7112d1/SQLEXPRADV_x64_ENU.exe) + - [Download SQL Server 2019 Express LocalDB (English)](https://download.microsoft.com/download/7/c/1/7c14e92e-bdcb-4f89-b7cf-93543e7112d1/SqlLocalDB.msi) +- [Download SQL Server 2017 Express](https://www.microsoft.com/download/details.aspx?id=55994) + - [Download SQL Server 2017 Express Basic (English)](https://download.microsoft.com/download/E/F/2/EF23C21D-7860-4F05-88CE-39AA114B014B/SQLEXPR_x64_ENU.exe) + - [Download SQL Server 2017 Express Advanced (English)](https://download.microsoft.com/download/E/F/2/EF23C21D-7860-4F05-88CE-39AA114B014B/SQLEXPRADV_x64_ENU.exe) + - [Download SQL Server 2017 Express LocalDB (English)](https://download.microsoft.com/download/E/F/2/EF23C21D-7860-4F05-88CE-39AA114B014B/SqlLocalDB.msi) +- SQL Server 2016 Express + - [Download SQL Server 2016 SP2 Express Basic (English)](https://download.microsoft.com/download/4/1/A/41AD6EDE-9794-44E3-B3D5-A1AF62CD7A6F/sql16_sp2_dlc/en-us/SQLEXPR_x64_ENU.exe) + - [Download SQL Server 2016 SP2 Express Advanced (English)](https://download.microsoft.com/download/4/1/A/41AD6EDE-9794-44E3-B3D5-A1AF62CD7A6F/sql16_sp2_dlc/en-us/SQLEXPRADV_x64_ENU.exe) + - [Download SQL Server 2016 SP2 Express LocalDB (English)](https://download.microsoft.com/download/4/1/A/41AD6EDE-9794-44E3-B3D5-A1AF62CD7A6F/sql16_sp2_dlc/en-us/SqlLocalDB.msi) +- SQL Server 2016 Express + - [Download SQL Server 2016 SP1 Express Basic (English)](https://download.microsoft.com/download/9/0/7/907AD35F-9F9C-43A5-9789-52470555DB90/ENU/SQLEXPR_x64_ENU.exe) + - [Download SQL Server 2016 SP1 Express Advanced (English)](https://download.microsoft.com/download/9/0/7/907AD35F-9F9C-43A5-9789-52470555DB90/ENU/SQLEXPRADV_x64_ENU.exe) + - [Download SQL Server 2016 SP1 Express LocalDB (English)](https://download.microsoft.com/download/9/0/7/907AD35F-9F9C-43A5-9789-52470555DB90/ENU/SqlLocalDB.msi) +- [Download SQL Server 2014 Express](http://www.microsoft.com/download/details.aspx?id=42299) +- [Download Microsoft SQL Server 2014 Service Pack 1 (SP1) Express](https://www.microsoft.com/download/details.aspx?id=46697) + - You likely just want SQL Server 2014 Express with Tools. This download includes SQL Management Studio: + - [SQL Server 2014 Express x64](http://download.microsoft.com/download/E/A/E/EAE6F7FC-767A-4038-A954-49B8B05D04EB/ExpressAndTools%2064BIT/SQLEXPRWT_x64_ENU.exe) + - [SQL Server 2014 Express x86](http://download.microsoft.com/download/E/A/E/EAE6F7FC-767A-4038-A954-49B8B05D04EB/ExpressAndTools%2032BIT/SQLEXPRWT_x86_ENU.exe) + - Here's just SQL Server 2014 Management Studio: + - [SQL Management Studio x64](http://download.microsoft.com/download/E/A/E/EAE6F7FC-767A-4038-A954-49B8B05D04EB/MgmtStudio%2064BIT/SQLManagementStudio_x64_ENU.exe) + - [SQL Management Studio x86](http://download.microsoft.com/download/E/A/E/EAE6F7FC-767A-4038-A954-49B8B05D04EB/MgmtStudio%2032BIT/SQLManagementStudio_x86_ENU.exe) + - SQL Server 2014 Express with Advanced Services: + - [Advanced Services x64](http://download.microsoft.com/download/E/A/E/EAE6F7FC-767A-4038-A954-49B8B05D04EB/ExpressAdv%2064BIT/SQLEXPRADV_x64_ENU.exe) + - [Advanced Services x86](http://download.microsoft.com/download/E/A/E/EAE6F7FC-767A-4038-A954-49B8B05D04EB/ExpressAdv%2032BIT/SQLEXPRADV_x86_ENU.exe) +- [Download SQL Server 2012 Express](http://www.microsoft.com/download/details.aspx?id=29062) +- [Download Microsoft SQL Server 2012 Service Pack 1 (SP1) Express ](https://www.microsoft.com/download/details.aspx?id=35579) + - You likely just want SQL Server 2012 Express with Tools. This download includes SQL Management Studio: + - [SQL Server 2012 Express x64](http://download.microsoft.com/download/8/D/D/8DD7BDBA-CEF7-4D8E-8C16-D9F69527F909/ENU/x64/SQLEXPRWT_x64_ENU.exe) + - Here's just SQL Server 2012 Management Studio: + - [SQL Management Studio x64](http://download.microsoft.com/download/8/D/D/8DD7BDBA-CEF7-4D8E-8C16-D9F69527F909/ENU/x64/SQLManagementStudio_x64_ENU.exe) + - [SQL Management Studio x86](http://download.microsoft.com/download/8/D/D/8DD7BDBA-CEF7-4D8E-8C16-D9F69527F909/ENU/x86/SQLManagementStudio_x86_ENU.exe) +- [Download SQL Server 2008 Express R2 SP2](http://www.microsoft.com/download/details.aspx?id=30438) + - You likely just want SQL Server 2008 Express with Tools. This download includes SQL Management Studio: + - [SQL Server 2008 Express x64](http://download.microsoft.com/download/0/4/B/04BE03CD-EAF3-4797-9D8D-2E08E316C998/SQLEXPRWT_x64_ENU.exe) + - [SQL Server 2008 Express x86](http://download.microsoft.com/download/0/4/B/04BE03CD-EAF3-4797-9D8D-2E08E316C998/SQLEXPRWT_x86_ENU.exe) + - Here's just SQL Server 2008 Management Studio: + - [SQL Management Studio x64](http://download.microsoft.com/download/0/4/B/04BE03CD-EAF3-4797-9D8D-2E08E316C998/SQLManagementStudio_x64_ENU.exe) + - [SQL Management Studio x86](http://download.microsoft.com/download/0/4/B/04BE03CD-EAF3-4797-9D8D-2E08E316C998/SQLManagementStudio_x86_ENU.exe) +- [Download SQL Server 2005 Express](https://www.microsoft.com/download/details.aspx?id=21844) ## Internal Database Version and Compatibility Level @@ -328,7 +334,9 @@ As you upgrade the database to new SQL Server edition (you can not go backward) This is done automatically regardless of what method you use to upgrade the database to the new version of SQL Server. ```sql -/* 1 using DBCC PAGE to look at the boot page (9) of the database */ +/* 1 using DBCC PAGE to look at the boot page (9) of the database +Search dbi_version string + */ DBCC TRACEON(3604); DBCC PAGE('DatabaseName', 1, 9, 3); DBCC TRACEOFF(3604); @@ -341,7 +349,7 @@ DBCC TRACEOFF(3604); GO /* 3 using database property */ -SELECT DatabaseProperty('DatabaseNameHere','version'); +SELECT DatabaseProperty('DatabaseNameHere', 'version'); GO /* 4 using RESTORE HEADERONLY for backup files, field DatabaseVersion */ @@ -361,32 +369,31 @@ Execute the following query to determine the version of the Database Engine that SELECT SERVERPROPERTY('ProductVersion'); ``` -| SQL Server Version | Database Engine | Code Name | Release Year | Internal Database Version | Compatibility Level Designation | Supported Compatibility Level | -|:---------------------------------------------|----------------:|:-------------|-------------:|--------------------------:|--------------------------------:|------------------------------:| -| SQL Server 2019 | 15 | 2019 | 2019 | 895,896,897 | 150 | 150, 140, 130, 120, 110 | -| SQL Server 2017 | 14 | 2017 | 2017 | 869 | 140 | 140, 130, 120, 110, 100 | -| SQL Server 2016 | 13 | 2016 | 2016 | 852 | 130 | 130, 120, 110, 100 | -| Azure SQL Database | 14 | CloudDB | 2010 (2018) | 862 | 140 | 140, 130, 120, 110, 100 | -| SQL Server 2014 | 12 | SQL14 | 2014 | 782 | 120 | 120, 110, 100 | -| SQL Server 2012 | 11 | Denali | 2012 | 706 | 110 | 110, 100, 90 | -| SQL Server 2012 CTP1 | 11 | Denali | 2010 | 684 | 110 | 110, 100, 90 | -| SQL Server 2008 R2 | 10.5 | Kilimanjaro | 2010 | 660 / 661 | 100 | 100, 90, 80 | -| SQL Server 2008 | 10 | Katmai | 2008 | 655 | 100 | 100, 90, 80 | -| SQL Server 2005 SP2+ with VarDecimal enabled | 9 | Yukon | 2005 | 612 | 90 | 90, 80 | -| SQL Server 2005 | 9 | Yukon | 2005 | 611 | 90 | 90, 80 | -| SQL Server 2000 | 8 | Shiloh | 2000 | 539 | 80 | 80 | -| SQL Server 7.0 | ? | Sphinx | 1998 | 515 | 70 | 70 | -| SQL Server 6.5 | ? | Hydra | 1996 | 408 | 65 | 65 | -| SQL Server 6.0 | ? | SQL95 | 1995 | ? | 60 | ? | -| SQL Server 4.21 | ? | SQLNT | 1993 | ? | 60 | ? | -| SQL Server 1.1 (16 bit) | ? | ? | 1991 | ? | 60 | ? | -| SQL Server 1.0 (16 bit) | ? | Ashton-Tate | 1989 | ? | 60 | ? | +| SQL Server Version | Database Engine | Code Name | Release Year | Internal DB Version | Compatibility Level Designation | Supported Compatibility Level | +|:---------------------------------------------|----------------:|:------------|-------------:|--------------------:|--------------------------------:|------------------------------:| +| SQL Server 2019 | 15 | 2019 | 2019 | 895-904 | 150 | 150, 140, 130, 120, 110 | +| SQL Server 2017 | 14 | 2017 | 2017 | 869-894 | 140 | 140, 130, 120, 110, 100 | +| SQL Server 2016 | 13 | Helsinki | 2016 | 852 | 130 | 130, 120, 110, 100 | +| Azure SQL Database | 14 | CloudDB | 2010 (2018) | 862 | 140 | 140, 130, 120, 110, 100 | +| SQL Server 2014 | 12 | Hekaton | 2014 | 782 | 120 | 120, 110, 100 | +| SQL Server 2012 | 11 | Denali | 2012 | 706 | 110 | 110, 100, 90 | +| SQL Server 2008 R2 | 10.5 | Kilimanjaro | 2010 | 660 / 661 | 100 | 100, 90, 80 | +| SQL Server 2008 | 10 | Katmai | 2008 | 655 | 100 | 100, 90, 80 | +| SQL Server 2005 SP2+ with VarDecimal enabled | 9 | Yukon | 2005 | 612 | 90 | 90, 80 | +| SQL Server 2005 | 9 | Yukon | 2005 | 611 | 90 | 90, 80 | +| SQL Server 2000 | 8 | Shiloh | 2000 | 539 | 80 | 80 | +| SQL Server 7.0 | ? | Sphinx | 1998 | 515 | 70 | 70 | +| SQL Server 6.5 | ? | Hydra | 1996 | 408 | 65 | 65 | +| SQL Server 6.0 | ? | SQL95 | 1995 | ? | 60 | ? | +| SQL Server 4.21 | ? | SQLNT | 1993 | ? | 60 | ? | +| SQL Server 1.1 (16 bit) | ? | Pietro | 1991 | ? | 60 | ? | +| SQL Server 1.0 (16 bit) | ? | Filipi | 1989 | ? | 60 | ? | **Azure SQL Database V12** was released in December 2014. One aspect of that release was that newly created databases had their compatibility level set to 120. In 2015 SQL Database began support for level 130, although the default remained 120. Starting in mid-June 2016, in Azure SQL Database, the default compatibility level will be 130 instead of 120 for newly created databases. Existing databases created before mid-June 2016 will not be affected, and will maintain their current compatibility level (100, 110, or 120). -If you want level 130 for your database generally, but you have reason to prefer the level 110 cardinality estimation algorithm, see [ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL)](https://msdn.microsoft.com/en-us/library/mt629158.aspx), and in particular its keyword LEGACY_CARDINALITY_ESTIMATION =ON. +If you want level 130 for your database generally, but you have reason to prefer the level 110 cardinality estimation algorithm, see [ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL)](https://msdn.microsoft.com/library/mt629158.aspx), and in particular its keyword LEGACY_CARDINALITY_ESTIMATION =ON. For details about how to assess the performance differences of your most important queries, between two compatibility levels on Azure SQL Database, see [Improved Query Performance with Compatibility Level 130 in Azure SQL Database](http://azure.microsoft.com/documentation/articles/sql-database-compatibility-level-query-performance-130/). @@ -398,83 +405,69 @@ For details about how to assess the performance differences of your most importa - [Database Version vs Database Compatibility Level](http://sqlblog.com/blogs/jonathan_kehayias/archive/2009/07/28/database-version-vs-database-compatibility-level.aspx) (by Jonathan Kehayias) -## Quick summary for SQL Server Service Packs - - -| Version | Codename | RTM (no SP) | SP1 | SP2 | SP3 | SP4 | -|:-------------------|:------------|:----------------|:---------------|:--------------------------------|:----------------------------------|:--------------------------------| -| SQL Server 2017 | 2017 | [14.0.1000.169] | | | | | -| SQL Server 2016 | 2016 | [13.0.1601.5] | [13.0.4001.0] | [13.5026.0] | | | -| SQL Server 2014 | SQL14 | 12.0.2000.8 | [12.0.4100.1] | [12.0.5000.0] | | | -| SQL Server 2012 | Denali | 11.0.2100.60 | [11.0.3000.0] | [11.0.5058.0] | [11.0.6020.0] | [11.0.7001.0] | -| SQL Server 2008 R2 | Kilimanjaro | 10.50.1600.1 | [10.50.2500.0] | [10.50.4000.0]
10.52.4000.0 | [10.50.6000.34]
10.53.6000.34 | | -| SQL Server 2008 | Katmai | 10.0.1600.22 | [10.0.2531.0] | [10.0.4000.0]
10.2.4000.0 | [10.0.5500.0]
10.3.5500.0 | [10.0.6000.29]
10.4.6000.29 | -| SQL Server 2005 | Yukon | 9.0.1399.06 | [9.0.2047] | [9.0.3042] | [9.0.4035] | [9.0.5000] | -| SQL Server 2000 | Shiloh | 8.0.194 | [8.0.384] | [8.0.532] | [8.0.760] | [8.0.2039] | -| SQL Server 7.0 | Sphinx | 7.0.623 | 7.0.699 | 7.0.842 | 7.0.961 | [7.0.1063] | - -[14.0.1000.169]:https://www.microsoft.com/en-us/sql-server/sql-server-downloads -[13.5026.0]:https://go.microsoft.com/fwlink/?LinkID=799011 -[13.0.1601.5]:https://www.microsoft.com/en-in/evalcenter/evaluate-sql-server-2016 -[13.0.4001.0]:https://support.microsoft.com/en-us/kb/3182545 -[12.0.5000.0]:https://support.microsoft.com/en-us/kb/3171021 -[12.0.4100.1]:http://www.microsoft.com/en-us/download/details.aspx?id=46694 -[11.0.3000.0]:http://www.microsoft.com/en-us/download/details.aspx?id=35575 -[11.0.5058.0]:http://www.microsoft.com/en-us/download/details.aspx?id=43340 -[11.0.6020.0]:http://www.microsoft.com/en-us/download/details.aspx?id=49996 -[11.0.7001.0]:https://www.microsoft.com/en-us/download/details.aspx?id=56040 -[10.50.2500.0]:http://www.microsoft.com/en-us/download/details.aspx?id=26727 -[10.50.4000.0]:http://www.microsoft.com/en-us/download/details.aspx?id=30437 -[10.50.6000.34]:http://www.microsoft.com/en-us/download/details.aspx?id=44271 -[10.0.2531.0]:http://www.microsoft.com/downloads/details.aspx?familyid=66AB3DBB-BF3E-4F46-9559-CCC6A4F9DC19 -[10.0.4000.0]:http://www.microsoft.com/downloads/en/details.aspx?FamilyID=8FBFC1DE-D25E-4790-88B5-7DDA1F1D4E17 -[10.0.5500.0]:http://www.microsoft.com/download/en/details.aspx?id=27594 -[10.0.6000.29]:http://www.microsoft.com/en-us/download/details.aspx?id=44278 -[9.0.2047]:http://www.microsoft.com/downloads/details.aspx?FamilyID=CB6C71EA-D649-47FF-9176-E7CAC58FD4BC -[9.0.3042]:http://www.microsoft.com/downloads/details.aspx?FamilyId=d07219b2-1e23-49c8-8f0c-63fa18f26d3a -[9.0.4035]:http://www.microsoft.com/downloads/details.aspx?FamilyId=ae7387c3-348c-4faa-8ae5-949fdfbe59c4 -[9.0.5000]:http://www.microsoft.com/downloads/details.aspx?FamilyId=b953e84f-9307-405e-bceb-47bd345baece -[8.0.384]:http://www.microsoft.com/downloads/details.aspx?FamilyID=DFF43C50-51DF-4FE0-9717-DE41FB48556E -[8.0.532]:http://www.microsoft.com/downloads/details.aspx?FamilyID=75672496-af8e-40dc-853e-ad2c9fe96882 -[8.0.760]:http://www.microsoft.com/downloads/details.aspx?familyid=90DCD52C-0488-4E46-AFBF-ACACE5369FA3 -[8.0.2039]:http://www.microsoft.com/downloads/details.aspx?FamilyId=8E2DFC8D-C20E-4446-99A9-B7F0213F8BC5 -[7.0.1063]:https://www.microsoft.com/en-us/download/details.aspx?id=7959 - - ## Microsoft SQL Server 2019 Builds More additional information about latest vNext SQL Server release you can find in this articles: - - [What's new in SQL Server 2019](https://docs.microsoft.com/en-us/sql/sql-server/what-s-new-in-sql-server-ver15?view=sql-server-ver15#utf-8-support) - - [What's New in the First Public CTP of SQL Server 2019](https://www.mssqltips.com/sqlservertip/5710/whats-new-in-the-first-public-ctp-of-sql-server-2019/) - - [Froid: How SQL Server vNext Might Fix the Scalar Functions Problem](https://www.brentozar.com/archive/2018/01/froid-sql-server-vnext-might-fix-scalar-functions-problem/) + - [What's new in SQL Server 2019](https://docs.microsoft.com/sql/sql-server/what-s-new-in-sql-server-ver15?view=sql-server-ver15#utf-8-support) - [What’s New in SQL Server 2019 System Tables](https://www.brentozar.com/archive/2018/09/whats-new-in-sql-server-2019-system-tables/) - [What’s New in SQL Server 2019’s sys.messages: More Unannounced Features](https://www.brentozar.com/archive/2018/09/whats-new-in-sql-server-2019s-sys-messages-more-unannounced-features/) - [What’s New in SQL Server 2019: Faster Table Variables (And New Parameter Sniffing Issues)](https://www.brentozar.com/archive/2018/09/sql-server-2019-faster-table-variables-and-new-parameter-sniffing-issues/) - [What’s New in SQL Server 2019: Adaptive Memory Grants](https://www.brentozar.com/archive/2018/09/whats-new-in-sql-server-2019-adaptive-memory-grants/) - [Leaked: SQL Server 2019 Big Data Clusters Introduction Video](https://www.brentozar.com/archive/2018/09/leaked-sql-server-2019-big-data-clusters-introduction-video/) - - [Native UTF-8 Support in SQL Server 2019: Savior, False Prophet, or Both?](https://sqlquantumleap.com/2018/09/28/native-utf-8-support-in-sql-server-2019-savior-false-prophet-or-both/) Here is the latest output from `SELECT @@VERSION` for SQL Server 2019 CTP Developer Edition: ``` -Microsoft SQL Server 2019 (CTP3.1) - 15.0.1700.0 (X64) - Jun 20 2019 00:00:00 +Microsoft SQL Server 2019 (RTM-CU12) (KB5004524) - 15.0.4153.1 (X64) + Jul 19 2021 15:37:34 Copyright (C) 2019 Microsoft Corporation Developer Edition (64-bit) on … ``` -| Build | File version | Branch | Type | KB / Description | Release Date | Build Date | Fixes | Public | Size, Mb | -|---------------|-------------------|--------|------|----------------------------------- |--------------|------------|------:|-------:|---------:| -| 15.0.1700.0 | 2019.150.1700.0 | CTP | CTP | [Microsoft SQL Server 2019 CTP3.1] | 2019-06-26 | 2019-06-20 | | | 1341 | -| 15.0.1600.8 | 2019.150.1600.8 | CTP | CTP | Microsoft SQL Server 2019 CTP3.0 | 2019-05-22 | 2019-05-17 | | | 1339 | -| 15.0.1500.28 | 2019.150.1500.28 | CTP | CTP | Microsoft SQL Server 2019 CTP2.5 | 2019-04-23 | 2019-04-16 | | | 1340 | -| 15.0.1400.75 | 2019.150.1400.75 | CTP | CTP | Microsoft SQL Server 2019 CTP2.4 | 2019-03-27 | 2019-03-17 | | | 1331 | -| 15.0.1300.359 | 2019.150.1200.359 | CTP | CTP | Microsoft SQL Server 2019 CTP2.3 | 2019-03-01 | 2019-02-16 | | | 1331 | -| 15.0.1200.24 | 2018.150.1200.24 | CTP | CTP | Microsoft SQL Server 2019 CTP2.2 | 2018-12-11 | 2018-11-02 | | | 1302 | -| 15.0.1100.94 | 2018.150.1100.34 | CTP | CTP | Microsoft SQL Server 2019 CTP2.1 | 2018-11-06 | 2018-11-02 | | | 1299 | -| 15.0.1000.34 | 2018.150.1000.34 | CTP | CTP | Microsoft SQL Server 2019 CTP2.0 | 2018-09-24 | 2018-09-18 | | | 1532 | - -[Microsoft SQL Server 2019 CTP3.1]:https://www.microsoft.com/en-us/sql-server/sql-server-2019#Install +| Build | File version | Branch | Type | Info | KB | Description/Link | Release Date | Build Date | Fixes | Public | Size, Mb | DB Version | +|---------------|-------------------|--------|------|---------------|---------|-------------------------------------------------------------|--------------|------------|------:|-------:|---------:|-----------:| +| 15.0.4153.1 | 2019.150.4153.1 | RTM | CU | **Latest CU** | 5004524 | [Cumulative Update 12 for SQL Server 2019] | 2021-08-04 | ? | 40 | 29 | 669 | 904 | +| 15.0.4138.2 | 2019.150.4138.2 | RTM | CU | | 5003249 | [Cumulative Update 11 for SQL Server 2019] | 2021-06-10 | ? | 62 | 35 | ? | 904 | +| 15.0.4123.1 | 2019.150.4123.1 | RTM | CU | | 5001090 | [Cumulative Update 10 for SQL Server 2019] | 2021-04-06 | ? | 63 | 39 | ? | 904 | +| 15.0.4102.2 | 2019.150.4102.2 | RTM | CU | | 5000642 | [Cumulative Update 9 for SQL Server 2019] | 2021-02-11 | ? | 140 | 89 | ? | 904 | +| 15.0.4083.2 | 2019.150.4083.2 | RTM | GDR | CVE-2021-1636 | 4583459 | [Security update for SQL Server 2019 CU8: January 12, 2021] | 2021-01-12 | ? | 1 | 1 | ? | 904 | +| 15.0.4073.23 | 2019.150.4073.23 | RTM | CU | | 4577194 | [Cumulative Update 8 for SQL Server 2019] | 2020-10-01 | 2020-07-25 | 104 | 81 | 607 | 904 | +| 15.0.4063.15 | 2019.150.4063.15 | RTM | CU | **Withdrawn** | 4570012 | [Cumulative Update 7 for SQL Server 2019] | 2020-09-02 | 2020-07-25 | 56 | 49 | 604 | 904 | +| 15.0.4053.23 | 2019.150.4053.23 | RTM | CU | | 4563110 | [Cumulative Update 6 for SQL Server 2019] | 2020-08-04 | 2020-07-25 | 51 | 42 | 604 | 904 | +| 15.0.4043.16 | 2019.150.4043.16 | RTM | CU | | 4552255 | [Cumulative Update 5 for SQL Server 2019] | 2020-06-22 | 2020-06-10 | 86 | 58 | 603 | 904 | +| 15.0.4033.1 | 2019.150.4033.1 | RTM | CU | | 4548597 | [Cumulative Update 4 for SQL Server 2019] | 2020-03-31 | 2020-03-04 | 50 | 38 | 571 | 904 | +| 15.0.4023.6 | 2019.150.4023.6 | RTM | CU | | 4538853 | [Cumulative Update 3 for SQL Server 2019] | 2020-03-12 | 2020-02-20 | 56 | 11 | 572 | 904 | +| 15.0.4013.40 | 2019.150.4013.40 | RTM | CU | | 4536075 | [Cumulative Update 2 for SQL Server 2019] | 2020-02-07 | 2020-02-03 | 134 | 88 | 537 | 904 | +| 15.0.4003.23 | 2019.150.4003.23 | RTM | CU | | 4527376 | [Cumulative Update 1 for SQL Server 2019] | 2020-01-07 | 2019-12-06 | 83 | 62 | 452 | 904 | +| 15.0.2070.41 | 2019.150.2070.41 | RTM | GDR | | 4517790 | [Servicing Update for SQL Server 2019 RTM] | 2019-11-04 | 2019-10-28 | 1 | 1 | 452 | 904 | +| 15.0.2000.5 | 2019.150.2000.5 | RTM | RTM | | | [Microsoft SQL Server 2019 RTM] | 2019-11-04 | 2019-09-24 | | | 1360 | 904 | +| 15.0.1900.47 | 2019.150.1900.47 | CTP | RC | | | Microsoft SQL Server 2019 Release Candidate 1.1 (RC1.1) | 2019-08-28 | 2019-08-17 | | | 1360 | 904 | +| 15.0.1900.25 | 2019.150.1900.25 | CTP | RC | | | Microsoft SQL Server 2019 Release Candidate 1 (RC1) | 2019-08-21 | 2019-08-17 | | | 1360 | 904 | +| 15.0.1800.32 | 2019.150.1800.32 | CTP | CTP | | | Microsoft SQL Server 2019 CTP3.2 | 2019-07-24 | 2019-07-18 | | | 1358 | 904 | +| 15.0.1700.0 | 2019.150.1700.0 | CTP | CTP | | | Microsoft SQL Server 2019 CTP3.1 | 2019-06-26 | 2019-06-20 | | | 1341 | 902 | +| 15.0.1600.8 | 2019.150.1600.8 | CTP | CTP | | | Microsoft SQL Server 2019 CTP3.0 | 2019-05-22 | 2019-05-17 | | | 1339 | 902 | +| 15.0.1500.28 | 2019.150.1500.28 | CTP | CTP | | | Microsoft SQL Server 2019 CTP2.5 | 2019-04-23 | 2019-04-16 | | | 1340 | 897 | +| 15.0.1400.75 | 2019.150.1400.75 | CTP | CTP | | | Microsoft SQL Server 2019 CTP2.4 | 2019-03-27 | 2019-03-17 | | | 1331 | 897 | +| 15.0.1300.359 | 2019.150.1200.359 | CTP | CTP | | | Microsoft SQL Server 2019 CTP2.3 | 2019-03-01 | 2019-02-16 | | | 1331 | 897 | +| 15.0.1200.24 | 2018.150.1200.24 | CTP | CTP | | | Microsoft SQL Server 2019 CTP2.2 | 2018-12-11 | 2018-11-02 | | | 1302 | 896 | +| 15.0.1100.94 | 2018.150.1100.34 | CTP | CTP | | | Microsoft SQL Server 2019 CTP2.1 | 2018-11-06 | 2018-11-02 | | | 1299 | 896 | +| 15.0.1000.34 | 2018.150.1000.34 | CTP | CTP | | | Microsoft SQL Server 2019 CTP2.0 | 2018-09-24 | 2018-09-18 | | | 1532 | 895 | + +[Cumulative Update 12 for SQL Server 2019]:https://support.microsoft.com/help/5003249 +[Cumulative Update 11 for SQL Server 2019]:https://support.microsoft.com/help/5003249 +[Cumulative Update 10 for SQL Server 2019]:https://support.microsoft.com/help/5001090 +[Cumulative Update 9 for SQL Server 2019]:https://support.microsoft.com/help/5000642 +[Security update for SQL Server 2019 CU8: January 12, 2021]:https://support.microsoft.com/help/4583459 +[Cumulative Update 8 for SQL Server 2019]:https://support.microsoft.com/help/4577194 +[Cumulative Update 7 for SQL Server 2019]:https://support.microsoft.com/help/4570012 +[Cumulative Update 6 for SQL Server 2019]:https://support.microsoft.com/help/4563110 +[Cumulative Update 5 for SQL Server 2019]:https://support.microsoft.com/help/4552255 +[Cumulative Update 4 for SQL Server 2019]:https://support.microsoft.com/help/4548597 +[Cumulative Update 3 for SQL Server 2019]:https://support.microsoft.com/help/4538853 +[Cumulative Update 2 for SQL Server 2019]:https://support.microsoft.com/help/4536075 +[Cumulative Update 1 for SQL Server 2019]:https://support.microsoft.com/help/4527376 +[Servicing Update for SQL Server 2019 RTM]:https://support.microsoft.com/help/4517790 +[Microsoft SQL Server 2019 RTM]:https://www.microsoft.com/sql-server/sql-server-2019#Install ## Microsoft SQL Server 2017 Builds @@ -485,80 +478,99 @@ All SQL Server 2017 CU downloads: [Catalog Update Microsoft SQL Server 2017](htt Here is the latest output from `SELECT @@VERSION` for SQL Server 2017 Developer Edition: ``` -Microsoft SQL Server 2017 (RTM-CU15-OD) (KB4510083) - 14.0.3208.1 (X64) - Jun 25 2019 16:08:21 +Microsoft SQL Server 2017 (RTM-CU26) (KB5005226) - 14.0.3411.3 (X64) + Aug 28 2021 21:00:00 Copyright (C) 2017 Microsoft Corporation Developer Edition (64-bit) on … ``` -Useful articles: - - [Release notes for SQL Server 2017 on Linux](https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-release-notes) - - [How I spot not-yet-documented features in SQL Server CTPs](https://blogs.sentryone.com/aaronbertrand/fishing-for-features-in-ctps/) - - [More ways to discover changes in new versions of SQL Server](https://blogs.sentryone.com/aaronbertrand/more-changes-sql-server/) - -| Build | File version | Branch | Type | KB / Description | Release Date | Build Date | Fixes | Public | Size, Mb | -|---------------|-------------------|--------|------|----------------------------------------------------------------------------------------------------------|--------------|------------|------:|-------:|---------:| -| 14.0.3208.1 | 2017.140.3208.1 | RTM | CU | **Latest CU** [4510083 On-demand hotfix update package 2 for SQL Server 2017 Cumulative update 15 (CU15)]| 2019-07-09 | 2019-06-26 | 2 | 2 | 528 | -| 14.0.3192.2 | 2017.140.3192.2 | RTM | GDR | [4505225 Security update for SQL Server 2017 CU15 GDR: July 9, 2019] **CVE-2019-1068** | 2019-07-09 | 2019-06-26 | 1 | 1 | 528 | -| 14.0.3164.1 | 2017.140.3164.1 | RTM | COD | [4506633 On-demand hotfix update package for SQL Server 2017 Cumulative update 15 (CU15)] | 2019-06-20 | 2019-05-16 | 1 | 1 | 528 | -| 14.0.3162.1 | 2017.140.3162.1 | RTM | CU | [4498951 Microsoft SQL Server 2017 CU15] | 2019-05-23 | 2019-05-16 | 52 | 45 | 528 | -| 14.0.3103.1 | 2017.140.3103.1 | RTM | GDR | [4494352 Description of the security update for SQL Server 2017 CU 14 GDR: May 14, 2019] CVE-2019-0819 | 2019-05-14 | 2019-03-23 | 1 | 1 | 491 | -| 14.0.3076.1 | 2017.140.3076.1 | RTM | CU | [4484710 Microsoft SQL Server 2017 CU14] | 2019-03-25 | 2019-03-12 | 51 | 34 | 491 | -| 14.0.3049.1 | 2017.140.3049.1 | RTM | COD | [4483666 On-demand hotfix update package for SQL Server 2017 CU13] | 2019-01-08 | 2018-12-15 | 3 | 3 | 488 | -| 14.0.3048.4 | 2017.140.3048.4 | RTM | CU | **Withdrawn** [4466404 Microsoft SQL Server 2017 CU13] | 2018-12-18 | 2018-12-01 | 62 | 50 | 488 | -| 14.0.3045.24 | 2017.140.3045.24 | RTM | CU | [4464082 Microsoft SQL Server 2017 CU12] | 2018-10-24 | 2018-10-19 | 22 | 18 | 488 | -| 14.0.3038.14 | 2017.140.3038.14 | RTM | CU | [4462262 Microsoft SQL Server 2017 CU11] | 2018-09-20 | 2018-09-14 | 21 | 14 | 487 | -| 14.0.3037.1 | 2017.140.3037.1 | RTM | CU | [4342123 Microsoft SQL Server 2017 CU10] | 2018-08-27 | 2018-07-27 | 30 | 22 | 486 | -| 14.0.3035.2 | 2017.140.3035.2 | RTM | COD | [4293805 Security update for SQL Server 2017 CU: August 14, 2018] **CVE-2018-8273** | 2018-08-14 | 2018-07-07 | 1 | 1 | 486 | -| 14.0.3030.27 | 2017.140.3030.27 | RTM | CU | [4341265 Microsoft SQL Server 2017 CU9] | 2018-07-18 | 2018-06-30 | 27 | 18 | 486 | -| 14.0.3029.16 | 2017.140.3029.16 | RTM | CU | [4338363 Microsoft SQL Server 2017 CU8] | 2018-06-21 | 2018-06-13 | 60 | 31 | 475 | -| 14.0.3026.27 | 2017.140.3026.27 | RTM | CU | [4229789 Microsoft SQL Server 2017 CU7] | 2018-05-24 | 2018-05-10 | 47 | 28 | 473 | -| 14.0.3025.34 | 2017.140.3025.34 | RTM | CU | [4101464 Microsoft SQL Server 2017 CU6] | 2018-04-19 | 2018-03-03 | 39 | 39 | 473 | -| 14.0.3023.8 | 2017.140.3023.8 | RTM | CU | [4092643 Microsoft SQL Server 2017 CU5] | 2018-03-20 | 2018-03-03 | 22 | 13 | 472 | -| 14.0.3022.28 | 2017.140.3022.28 | RTM | CU | [4056498 Microsoft SQL Server 2017 CU4] | 2018-02-20 | 2018-02-10 | 81 | 55 | 472 | -| 14.0.3015.40 | 2017.140.3015.40 | RTM | CU | [4052987 Microsoft SQL Server 2017 CU3] | 2017-01-03 | 2017-12-23 | 14 | 13 | 459 | -| 14.0.3008.27 | 2017.140.3008.27 | RTM | CU | [4052574 Microsoft SQL Server 2017 CU2] | 2017-11-28 | 2017-11-16 | 56 | 33 | 276 | -| 14.0.3006.16 | 2017.140.3006.16 | RTM | CU | [4038634 Microsoft SQL Server 2017 CU1] | 2017-10-24 | 2017-10-19 | 72 | 68 | 250 | -| 14.0.2027.2 | 2017.140.2027.2 | RTM | COD | [4505224 Security update for SQL Server 2017 GDR: July 9, 2019] **CVE-2019-1068** | 2019-07-09 | 2019-06-15 | 1 | 1 | 447 | -| 14.0.2014.14 | 2017.140.2014.14 | RTM | COD | [4494351 Security update for SQL Server 2017 GDR: May 14, 2019] **CVE-2019-0819** | 2019-05-14 | 2019-04-05 | 1 | 1 | 447 | -| 14.0.2002.14 | 2017.140.2002.14 | RTM | COD | [4293803 Security update for SQL Server 2017 GDR: August 14, 2018] **CVE-2018-8273** | 2018-08-14 | 2018-07-21 | 1 | 1 | 433 | -| 14.0.2000.63 | 2017.140.2000.63 | RTM | COD | [4057122 Security update for SQL Server 2017 GDR: January 3, 2018] **CVE-2017-5715,2017-5753,2017-5754** | 2018-01-03 | 2017-12-23 | 1 | 1 | 431 | -| 14.0.1000.169 | 2017.140.1000.169 | RTM | RTM | [Microsoft SQL Server 2017 RTM] | 2017-10-02 | 2017-08-23 | | | 1475 | -| 14.0.900.75 | 2017.140.900.75 | RC | RC | Microsoft SQL Server 2017 Release Candidate 2 | 2017-08-02 | 2017-07-27 | | | 1473 | -| 14.0.800.90 | 2017.140.800.90 | RC | RC | Microsoft SQL Server 2017 Release Candidate 1 | 2017-07-17 | 2017-07-11 | | | 1473 | -| 14.0.600.250 | 2017.140.600.250 | CTP | CTP | Microsoft SQL Server 2017 Community Technology Preview 2.1 (CTP2.1) | 2017-05-17 | 2017-05-10 | | | 1606 | -| 14.0.500.272 | 2017.140.500.272 | CTP | CTP | Microsoft SQL Server vNext Community Technology Preview 2.0 (CTP2.0) | 2017-04-19 | 2017-04-13 | | | 1721 | -| 14.0.405.198 | 2017.140.405.198 | CTP | CTP | Microsoft SQL Server vNext Community Technology Preview 1.4 (CTP1.4) | 2017-03-17 | 2017-03-11 | | | 2001 | -| 14.0.304.138 | 2016.140.304.138 | CTP | CTP | Microsoft SQL Server vNext Community Technology Preview 1.3 (CTP1.3) | 2017-02-17 | 2017-02-14 | | | 1978 | -| 14.0.200.24 | 2016.140.200.24 | CTP | CTP | Microsoft SQL Server vNext Community Technology Preview 1.2 (CTP1.2) | 2017-01-18 | 2017-01-11 | | | 1975 | -| 14.0.100.187 | 2016.140.100.187 | CTP | CTP | Microsoft SQL Server vNext Community Technology Preview 1.1 (CTP1.1) | 2016-12-16 | 2016-12-11 | | | 1975 | -| 14.0.1.246 | 2016.140.1.246 | CTP | CTP | Microsoft SQL Server vNext Community Technology Preview 1 (CTP1) | 2016-11-16 | 2016-11-02 | | | 1983 | - -[4510083 On-demand hotfix update package 2 for SQL Server 2017 Cumulative update 15 (CU15)]:https://support.microsoft.com/help/4510083/ -[4505225 Security update for SQL Server 2017 CU15 GDR: July 9, 2019]:https://support.microsoft.com/help/4505225/ -[4506633 On-demand hotfix update package for SQL Server 2017 Cumulative update 15 (CU15)]:https://support.microsoft.com/help/4506633/ -[4498951 Microsoft SQL Server 2017 CU15]:https://support.microsoft.com/help/4498951/ -[4494352 Description of the security update for SQL Server 2017 CU 14 GDR: May 14, 2019]:https://support.microsoft.com/help/4494352 -[4484710 Microsoft SQL Server 2017 CU14]:https://support.microsoft.com/help/4484710 -[4483666 On-demand hotfix update package for SQL Server 2017 CU13]:https://support.microsoft.com/help/4483666 -[4466404 Microsoft SQL Server 2017 CU13]:https://support.microsoft.com/help/4466404 -[4464082 Microsoft SQL Server 2017 CU12]:https://support.microsoft.com/help/4464082 -[4462262 Microsoft SQL Server 2017 CU11]:https://support.microsoft.com/help/4462262 -[4342123 Microsoft SQL Server 2017 CU10]:https://support.microsoft.com/help/4342123 -[4293805 Security update for SQL Server 2017 CU: August 14, 2018]:https://support.microsoft.com/help/4293805 -[4341265 Microsoft SQL Server 2017 CU9]:https://support.microsoft.com/help/4341265 -[4338363 Microsoft SQL Server 2017 CU8]:https://support.microsoft.com/help/4338363 -[4229789 Microsoft SQL Server 2017 CU7]:https://support.microsoft.com/help/4229789 -[4101464 Microsoft SQL Server 2017 CU6]:https://support.microsoft.com/help/4101464 -[4092643 Microsoft SQL Server 2017 CU5]:https://support.microsoft.com/help/4092643 -[4056498 Microsoft SQL Server 2017 CU4]:https://support.microsoft.com/help/4056498 -[4052987 Microsoft SQL Server 2017 CU3]:https://support.microsoft.com/help/4052987 -[4052574 Microsoft SQL Server 2017 CU2]:https://support.microsoft.com/help/4052574 -[4505224 Security update for SQL Server 2017 GDR: July 9, 2019]:https://support.microsoft.com/help/4505224 -[4494351 Security update for SQL Server 2017 GDR: May 14, 2019]:https://support.microsoft.com/help/4494351 -[4038634 Microsoft SQL Server 2017 CU1]:https://support.microsoft.com/help/4038634 -[4293803 Security update for SQL Server 2017 GDR: August 14, 2018]:https://support.microsoft.com/help/4293803 -[4057122 Security update for SQL Server 2017 GDR: January 3, 2018]:https://support.microsoft.com/help/4057122 +| Build | File version | Branch | Type | Info | KB | Description/Link | Release Date | Build Date | Fixes | Public | Size, Mb | +|---------------|-------------------|--------|------|-----------------------------------|---------|-------------------------------------------------------------------------------------|--------------|------------|------:|-------:|---------:| +| 14.0.3411.3 | 2017.140.3411.3 | RTM | CU | **Latest CU** | 5005226 | [Microsoft SQL Server 2017 CU26] | 2021-07-12 | 2021-09-14 | 31 | 22 | 533 | +| 14.0.3401.7 | 2017.140.3401.7 | RTM | CU | | 5003830 | [Microsoft SQL Server 2017 CU25] | 2021-07-12 | 2021-06-26 | 19 | 18 | 533 | +| 14.0.3391.2 | 2017.140.3391.2 | RTM | CU | | 5001228 | [Microsoft SQL Server 2017 CU24] | 2021-05-10 | ? | 30 | 24 | 533 | +| 14.0.3381.3 | 2017.140.3381.3 | RTM | CU | | 5000685 | [Microsoft SQL Server 2017 CU23] | 2021-02-24 | ? | 58 | 47 | 533 | +| 14.0.3370.1 | 2017.140.3370.1 | RTM | GDR | CVE-2021-1636 | 4583457 | [Description of the security update for SQL Server 2017 CU22: January 12, 2021] | 2021-01-12 | ? | 1 | 1 | 533 | +| 14.0.3356.20 | 2017.140.3356.20 | RTM | CU | | 4577467 | [Microsoft SQL Server 2017 CU22] | 2020-09-10 | ? | 42 | 38 | 533 | +| 14.0.3335.7 | 2017.140.3335.7 | RTM | CU | | 4535007 | [Microsoft SQL Server 2017 CU21] | 2020-07-01 | 2020-06-13 | 35 | 33 | 533 | +| 14.0.3294.2 | 2017.140.3294.2 | RTM | CU | | 4541283 | [Microsoft SQL Server 2017 CU20] | 2020-04-07 | 2020-03-14 | 40 | 36 | 530 | +| 14.0.3281.6 | 2017.140.3281.6 | RTM | CU | | 4535007 | [Microsoft SQL Server 2017 CU19] | 2020-02-05 | 2020-01-23 | 38 | 31 | 530 | +| 14.0.3257.3 | 2017.140.3257.3 | RTM | CU | | 4527377 | [Microsoft SQL Server 2017 CU18] | 2019-12-09 | 2019-11-16 | 35 | 28 | 529 | +| 14.0.3238.1 | 2017.140.3238.1 | RTM | CU | | 4515579 | [Microsoft SQL Server 2017 CU17] | 2019-10-01 | 2019-09-14 | 41 | 34 | 528 | +| 14.0.3223.3 | 2017.140.3223.3 | RTM | CU | | 4508218 | [Microsoft SQL Server 2017 CU16] | 2019-08-01 | 2019-07-13 | 50 | 37 | 529 | +| 14.0.3208.1 | 2017.140.3208.1 | RTM | COD | | 4510083 | [On-demand hotfix update package 2 for SQL Server 2017 Cumulative update 15 (CU15)] | 2019-07-09 | 2019-06-26 | 2 | 2 | 528 | +| 14.0.3192.2 | 2017.140.3192.2 | RTM | GDR | CVE-2019-1068 | 4505225 | [Security update for SQL Server 2017 CU15 GDR: July 9, 2019] | 2019-07-09 | 2019-06-26 | 1 | 1 | 528 | +| 14.0.3164.1 | 2017.140.3164.1 | RTM | COD | | 4506633 | [On-demand hotfix update package for SQL Server 2017 Cumulative update 15 (CU15)] | 2019-06-20 | 2019-05-16 | 1 | 1 | 528 | +| 14.0.3162.1 | 2017.140.3162.1 | RTM | CU | | 4498951 | [Microsoft SQL Server 2017 CU15] | 2019-05-23 | 2019-05-16 | 52 | 45 | 528 | +| 14.0.3103.1 | 2017.140.3103.1 | RTM | GDR | CVE-2019-0819 | 4494352 | [Description of the security update for SQL Server 2017 CU 14 GDR: May 14, 2019] | 2019-05-14 | 2019-03-23 | 1 | 1 | 491 | +| 14.0.3076.1 | 2017.140.3076.1 | RTM | CU | | 4484710 | [Microsoft SQL Server 2017 CU14] | 2019-03-25 | 2019-03-12 | 51 | 34 | 491 | +| 14.0.3049.1 | 2017.140.3049.1 | RTM | COD | | 4483666 | [On-demand hotfix update package for SQL Server 2017 CU13] | 2019-01-08 | 2018-12-15 | 3 | 3 | 488 | +| 14.0.3048.4 | 2017.140.3048.4 | RTM | CU | **Withdrawn** | 4466404 | [Microsoft SQL Server 2017 CU13] | 2018-12-18 | 2018-12-01 | 62 | 50 | 488 | +| 14.0.3045.24 | 2017.140.3045.24 | RTM | CU | | 4464082 | [Microsoft SQL Server 2017 CU12] | 2018-10-24 | 2018-10-19 | 22 | 18 | 488 | +| 14.0.3038.14 | 2017.140.3038.14 | RTM | CU | | 4462262 | [Microsoft SQL Server 2017 CU11] | 2018-09-20 | 2018-09-14 | 21 | 14 | 487 | +| 14.0.3037.1 | 2017.140.3037.1 | RTM | CU | | 4342123 | [Microsoft SQL Server 2017 CU10] | 2018-08-27 | 2018-07-27 | 30 | 22 | 486 | +| 14.0.3035.2 | 2017.140.3035.2 | RTM | COD | CVE-2018-8273 | 4293805 | [Security update for SQL Server 2017 CU: August 14, 2018] | 2018-08-14 | 2018-07-07 | 1 | 1 | 486 | +| 14.0.3030.27 | 2017.140.3030.27 | RTM | CU | | 4341265 | [Microsoft SQL Server 2017 CU9] | 2018-07-18 | 2018-06-30 | 27 | 18 | 486 | +| 14.0.3029.16 | 2017.140.3029.16 | RTM | CU | | 4338363 | [Microsoft SQL Server 2017 CU8] | 2018-06-21 | 2018-06-13 | 60 | 31 | 475 | +| 14.0.3026.27 | 2017.140.3026.27 | RTM | CU | | 4229789 | [Microsoft SQL Server 2017 CU7] | 2018-05-24 | 2018-05-10 | 47 | 28 | 473 | +| 14.0.3025.34 | 2017.140.3025.34 | RTM | CU | | 4101464 | [Microsoft SQL Server 2017 CU6] | 2018-04-19 | 2018-03-03 | 39 | 39 | 473 | +| 14.0.3023.8 | 2017.140.3023.8 | RTM | CU | | 4092643 | [Microsoft SQL Server 2017 CU5] | 2018-03-20 | 2018-03-03 | 22 | 13 | 472 | +| 14.0.3022.28 | 2017.140.3022.28 | RTM | CU | | 4056498 | [Microsoft SQL Server 2017 CU4] | 2018-02-20 | 2018-02-10 | 81 | 55 | 472 | +| 14.0.3015.40 | 2017.140.3015.40 | RTM | CU | | 4052987 | [Microsoft SQL Server 2017 CU3] | 2017-01-03 | 2017-12-23 | 14 | 13 | 459 | +| 14.0.3008.27 | 2017.140.3008.27 | RTM | CU | | 4052574 | [Microsoft SQL Server 2017 CU2] | 2017-11-28 | 2017-11-16 | 56 | 33 | 276 | +| 14.0.3006.16 | 2017.140.3006.16 | RTM | CU | | 4038634 | [Microsoft SQL Server 2017 CU1] | 2017-10-24 | 2017-10-19 | 72 | 68 | 250 | +| 14.0.2027.2 | 2017.140.2027.2 | RTM | GDR | CVE-2019-1068 | 4505224 | [Security update for SQL Server 2017 GDR: July 9, 2019] | 2019-07-09 | 2019-06-15 | 1 | 1 | 447 | +| 14.0.2014.14 | 2017.140.2014.14 | RTM | GDR | CVE-2019-0819 | 4494351 | [Security update for SQL Server 2017 GDR: May 14, 2019] | 2019-05-14 | 2019-04-05 | 1 | 1 | 447 | +| 14.0.2002.14 | 2017.140.2002.14 | RTM | GDR | CVE-2018-8273 | 4293803 | [Security update for SQL Server 2017 GDR: August 14, 2018] | 2018-08-14 | 2018-07-21 | 1 | 1 | 433 | +| 14.0.2000.63 | 2017.140.2000.63 | RTM | GDR | CVE-2017-5715,2017-5753,2017-5754 | 4057122 | [Security update for SQL Server 2017 GDR: January 3, 2018] | 2018-01-03 | 2017-12-23 | 1 | 1 | 431 | +| 14.0.1000.169 | 2017.140.1000.169 | RTM | RTM | | | [Microsoft SQL Server 2017 RTM] | 2017-10-02 | 2017-08-23 | | | 1475 | +| 14.0.900.75 | 2017.140.900.75 | RC | RC | | | Microsoft SQL Server 2017 Release Candidate 2 | 2017-08-02 | 2017-07-27 | | | 1473 | +| 14.0.800.90 | 2017.140.800.90 | RC | RC | | | Microsoft SQL Server 2017 Release Candidate 1 | 2017-07-17 | 2017-07-11 | | | 1473 | +| 14.0.600.250 | 2017.140.600.250 | CTP | CTP | | | Microsoft SQL Server 2017 Community Technology Preview 2.1 (CTP2.1) | 2017-05-17 | 2017-05-10 | | | 1606 | +| 14.0.500.272 | 2017.140.500.272 | CTP | CTP | | | Microsoft SQL Server vNext Community Technology Preview 2.0 (CTP2.0) | 2017-04-19 | 2017-04-13 | | | 1721 | +| 14.0.405.198 | 2017.140.405.198 | CTP | CTP | | | Microsoft SQL Server vNext Community Technology Preview 1.4 (CTP1.4) | 2017-03-17 | 2017-03-11 | | | 2001 | +| 14.0.304.138 | 2016.140.304.138 | CTP | CTP | | | Microsoft SQL Server vNext Community Technology Preview 1.3 (CTP1.3) | 2017-02-17 | 2017-02-14 | | | 1978 | +| 14.0.200.24 | 2016.140.200.24 | CTP | CTP | | | Microsoft SQL Server vNext Community Technology Preview 1.2 (CTP1.2) | 2017-01-18 | 2017-01-11 | | | 1975 | +| 14.0.100.187 | 2016.140.100.187 | CTP | CTP | | | Microsoft SQL Server vNext Community Technology Preview 1.1 (CTP1.1) | 2016-12-16 | 2016-12-11 | | | 1975 | +| 14.0.1.246 | 2016.140.1.246 | CTP | CTP | | | Microsoft SQL Server vNext Community Technology Preview 1 (CTP1) | 2016-11-16 | 2016-11-02 | | | 1983 | + +[Microsoft SQL Server 2017 CU26]:https://support.microsoft.com/help/5005226 +[Microsoft SQL Server 2017 CU25]:https://support.microsoft.com/help/5003830 +[Microsoft SQL Server 2017 CU24]:https://support.microsoft.com/help/5001228 +[Microsoft SQL Server 2017 CU23]:https://support.microsoft.com/help/5000685 +[Description of the security update for SQL Server 2017 CU22: January 12, 2021]:https://support.microsoft.com/help/4583457 +[Microsoft SQL Server 2017 CU22]:https://support.microsoft.com/help/4577467 +[Microsoft SQL Server 2017 CU21]:https://support.microsoft.com/help/4557397 +[Microsoft SQL Server 2017 CU20]:https://support.microsoft.com/help/4541283 +[Microsoft SQL Server 2017 CU19]:https://support.microsoft.com/help/4535007 +[Microsoft SQL Server 2017 CU18]:https://support.microsoft.com/help/4527377 +[Microsoft SQL Server 2017 CU17]:https://support.microsoft.com/help/4515579 +[Microsoft SQL Server 2017 CU16]:https://support.microsoft.com/help/4508218 +[On-demand hotfix update package 2 for SQL Server 2017 Cumulative update 15 (CU15)]:https://support.microsoft.com/help/4510083/ +[Security update for SQL Server 2017 CU15 GDR: July 9, 2019]:https://support.microsoft.com/help/4505225/ +[On-demand hotfix update package for SQL Server 2017 Cumulative update 15 (CU15)]:https://support.microsoft.com/help/4506633/ +[Microsoft SQL Server 2017 CU15]:https://support.microsoft.com/help/4498951/ +[Description of the security update for SQL Server 2017 CU 14 GDR: May 14, 2019]:https://support.microsoft.com/help/4494352 +[Microsoft SQL Server 2017 CU14]:https://support.microsoft.com/help/4484710 +[On-demand hotfix update package for SQL Server 2017 CU13]:https://support.microsoft.com/help/4483666 +[Microsoft SQL Server 2017 CU13]:https://support.microsoft.com/help/4466404 +[Microsoft SQL Server 2017 CU12]:https://support.microsoft.com/help/4464082 +[Microsoft SQL Server 2017 CU11]:https://support.microsoft.com/help/4462262 +[Microsoft SQL Server 2017 CU10]:https://support.microsoft.com/help/4342123 +[Security update for SQL Server 2017 CU: August 14, 2018]:https://support.microsoft.com/help/4293805 +[Microsoft SQL Server 2017 CU9]:https://support.microsoft.com/help/4341265 +[Microsoft SQL Server 2017 CU8]:https://support.microsoft.com/help/4338363 +[Microsoft SQL Server 2017 CU7]:https://support.microsoft.com/help/4229789 +[Microsoft SQL Server 2017 CU6]:https://support.microsoft.com/help/4101464 +[Microsoft SQL Server 2017 CU5]:https://support.microsoft.com/help/4092643 +[Microsoft SQL Server 2017 CU4]:https://support.microsoft.com/help/4056498 +[Microsoft SQL Server 2017 CU3]:https://support.microsoft.com/help/4052987 +[Microsoft SQL Server 2017 CU2]:https://support.microsoft.com/help/4052574 +[Security update for SQL Server 2017 GDR: July 9, 2019]:https://support.microsoft.com/help/4505224 +[Security update for SQL Server 2017 GDR: May 14, 2019]:https://support.microsoft.com/help/4494351 +[Microsoft SQL Server 2017 CU1]:https://support.microsoft.com/help/4038634 +[Security update for SQL Server 2017 GDR: August 14, 2018]:https://support.microsoft.com/help/4293803 +[Security update for SQL Server 2017 GDR: January 3, 2018]:https://support.microsoft.com/help/4057122 [Microsoft SQL Server 2017 RTM]:https://www.microsoft.com/sql-server/sql-server-downloads @@ -567,535 +579,589 @@ Useful articles: All SQL Server 2016 CU downloads: [Catalog Update Microsoft SQL Server 2016](http://www.catalog.update.microsoft.com/Search.aspx?q=sql%20server%202016) -Here is the latest output from `SELECT @@VERSION` for SQL Server 2016 Developer Edition on Windows: +Here is the latest output from `SELECT @@VERSION` for SQL Server 2016 SP2 Developer Edition on Windows: ``` -Microsoft SQL Server 2016 (SP2-CU7) (KB4495256) - 13.0.5337.0 (X64) - May 16 2019 02:24:21 +Microsoft SQL Server 2016 (SP2-CU17) (KB5001092) - 13.0.5888.11 (X64) + Mar 20 2021 08:57:07 Copyright (c) Microsoft Corporation Developer Edition (64-bit) on … ``` -| Build | File version | Branch | Type | KB / Description | Release Date | Build Date | Fixes | Public | Size, Mb | -|---------------|-------------------|--------|------|--------------------------------------------------------------------------------------------------------------------------------|--------------|------------|------:|-------:|---------:| -| 13.0.5382.0 | 2015.131.5382.0 | RTM | CU | [4510807 On-demand hotfix update package 2 for SQL Server 2016 Service Pack 2 (SP2) Cumulative update 7 (CU7)] | 2019-07-09 | 2019-06-15 | 2 | 2 | 714 | -| 13.0.5366.0 | 2015.131.5366.0 | RTM | GDR | [4505222 Security update for SQL Server 2016 SP2 CU7 GDR: July 9, 2019] **CVE-2019-1068** | 2019-07-09 | 2019-06-15 | 2 | 2 | 714 | -| 13.0.5343.1 | 2015.131.5343.1 | RTM | COD | [4508636 On-demand hotfix update package for SQL Server 2016 Service Pack 2 (SP2) Cumulative update 7 (CU7)] | 2019-06-24 | 2019-06-15 | 2 | 2 | 714 | -| 13.0.5337.0 | 2015.131.5337.0 | SP2 | CU | **Latest SP2 CU**[4495256 Cumulative Update 7 for SQL Server 2016 SP2] | 2019-05-22 | 2019-05-16 | 28 | 27 | 714 | -| 13.0.5292.0 | 2015.131.5292.0 | SP2 | CU | [4488536 Cumulative Update 6 for SQL Server 2016 SP2] | 2019-03-19 | 2019-03-12 | 29 | 24 | 714 | -| 13.0.5270.0 | 2015.131.5270.0 | SP2 | COD | [4490133 On-demand hotfix update package for SQL Server 2016 SP2 CU5] | 2019-02-14 | 2019-02-08 | 1 | 1 | 712 | -| 13.0.5264.1 | 2015.131.5264.1 | SP2 | CU | [4475776 Cumulative Update 5 for SQL Server 2016 SP2] | 2019-01-23 | 2019-01-11 | 52 | 43 | 712 | -| 13.0.5239.0 | 2015.131.5239.0 | SP2 | COD | [4482972 On-demand hotfix update package 2 for SQL Server 2016 SP2 CU4] | 2018-12-20 | 2018-12-03 | 3 | 3 | 690 | -| 13.0.5233.0 | 2015.131.5233.0 | SP2 | CU | [4464106 Cumulative Update 4 for SQL Server 2016 SP2] | 2018-11-13 | 2018-11-03 | 42 | 36 | 690 | -| 13.0.5216.0 | 2015.131.5216.0 | SP2 | CU | [4458871 Cumulative Update 3 for SQL Server 2016 SP2] | 2018-09-21 | 2018-09-14 | 41 | 27 | 688 | -| 13.0.5201.2 | 2015.131.5201.2 | SP2 | CU | [4458621 Security update for SQL Server 2016 SP2 CU: August 19, 2018] **CVE-2018-8273** | 2018-08-19 | 2018-08-18 | 1 | 0 | 672 | -| 13.0.5161.0 | 2015.131.5161.0 | SP2 | CU | **Withdrawn** [4293807 Security update for SQL Server 2016 SP2 (CU): August 14, 2018] **CVE-2018-8273** | 2018-08-14 | 2018-07-18 | 1 | 0 | 672 | -| 13.0.5153.0 | 2015.131.5153.0 | SP2 | CU | [4340355 Cumulative Update 2 for SQL Server 2016 SP2] | 2018-07-16 | 2018-06-29 | 29 | 21 | 671 | -| 13.0.5149.0 | 2015.131.5149.0 | SP2 | CU | [4135048 Cumulative Update 1 for SQL Server 2016 SP2] | 2018-05-30 | 2018-05-19 | 45 | 28 | 549 | -| 13.0.5101.9 | 2015.131.5101.9 | SP2 | GDR | [4505220 Security update for SQL Server 2016 SP2 GDR: July 9, 2019] **CVE-2019-1068** | 2019-07-09 | 2019-06-15 | 2 | 2 | 491 | -| 13.0.5081.1 | 2015.131.5081.1 | SP2 | COD | [4293802 Security update for SQL Server 2016 SP2 GDR: August 14, 2018] **CVE-2018-8273** | 2018-05-30 | 2018-05-19 | 1 | 0 | 492 | -| 13.0.5026.0 | 2015.131.5026.0 | SP2 | SP | [4052908 SQL Server 2016 Service Pack 2 release information] | 2018-04-24 | 2018-03-18 | 50 | 50 | 774 | -| 13.0.4604.0 | 2015.130.4604.0 | SP1 | GDR | [4505221 Security update for SQL Server 2016 SP1 CU15 GDR: July 9, 2019] **CVE-2019-1068** | 2019-07-09 | 2019-06-15 | 2 | 2 | 761 | -| 13.0.4577.0 | 2015.130.4577.0 | SP1 | COD | [4508471 On-demand hotfix update package for SQL Server 2016 Service Pack 1 (SP1) Cumulative update 15 (CU15)] | 2019-06-20 | 2019-06-15 | 2 | 2 | 761 | -| 13.0.4574.0 | 2015.130.4574.0 | SP1 | CU | **Last SP1 CU** [4495257 Cumulative Update 15 for SQL Server 2016 SP1] | 2019-05-16 | 2019-04-28 | 7 | 7 | 761 | -| 13.0.4560.0 | 2015.130.4560.0 | SP1 | CU | [4488535 Cumulative update 14 (CU14) for SQL Server 2016 Service Pack 1] | 2019-03-19 | 2019-03-12 | 7 | 7 | 761 | -| 13.0.4550.1 | 2015.130.4550.1 | SP1 | CU | [4475775 Cumulative Update 13 for SQL Server 2016 SP1] | 2019-01-23 | 2019-01-11 | 12 | 9 | 761 | -| 13.0.4541.0 | 2015.130.4541.0 | SP1 | CU | [4464343 Cumulative Update 12 for SQL Server 2016 SP1] | 2018-11-13 | 2018-10-27 | 21 | 16 | 761 | -| 13.0.4531.0 | 2015.130.4531.0 | SP1 | COD | [4465443 FIX: The "modification_counter" in DMV sys.dm_db_stats_properties shows incorrect value when partitions are merged] | 2018-09-27 | 2018-09-22 | 1 | 1 | 759 | -| 13.0.4528.0 | 2015.130.4528.0 | SP1 | CU | [4459676 Cumulative Update 11 for SQL Server 2016 SP1] | 2018-09-18 | 2018-08-31 | 14 | 8 | 762 | -| 13.0.4522.0 | 2015.130.4522.0 | SP1 | CU | **Withdrawn** [4293808 Security update for SQL Server 2016 SP1 (CU): August 14, 2018] **CVE-2018-8273** | 2018-08-14 | 2018-07-18 | 1 | 0 | 774 | -| 13.0.4514.0 | 2015.130.4514.0 | SP1 | CU | [4341569 Cumulative Update 10 for SQL Server 2016 SP1] | 2018-07-16 | 2018-06-23 | 26 | 21 | 761 | -| 13.0.4502.0 | 2015.130.4502.0 | SP1 | CU | [4100997 Cumulative Update 9 for SQL Server 2016 SP1] | 2018-05-30 | 2018-05-15 | 39 | 25 | 761 | -| 13.0.4474.0 | 2015.130.4474.0 | SP1 | CU | [4077064 Cumulative Update 8 for SQL Server 2016 SP1] | 2018-03-19 | 2018-02-24 | 57 | 37 | 760 | -| 13.0.4466.4 | 2015.130.4466.4 | SP1 | CU | [4057119 Cumulative Update 7 for SQL Server 2016 SP1] | 2018-01-03 | 2017-11-09 | 15 | 14 | 758 | -| 13.0.4457.0 | 2015.130.4457.0 | SP1 | CU | [4037354 Cumulative Update 6 for SQL Server 2016 SP1] | 2017-11-21 | 2017-11-09 | 55 | 41 | 689 | -| 13.0.4451.0 | 2015.130.4451.0 | SP1 | CU | [4040714 Cumulative Update 5 for SQL Server 2016 SP1] | 2017-09-18 | 2017-09-06 | 49 | 44 | 689 | -| 13.0.4446.0 | 2015.130.4446.0 | SP1 | CU | [4024305 Cumulative Update 4 for SQL Server 2016 SP1] | 2017-08-08 | 2017-07-16 | 63 | 49 | 534 | -| 13.0.4435.0 | 2015.130.4435.0 | SP1 | CU | [4019916 Cumulative Update 3 for SQL Server 2016 SP1] | 2017-05-15 | 2017-04-27 | 70 | 57 | 534 | -| 13.0.4422.0 | 2015.130.4422.0 | SP1 | CU | [4013106 Cumulative Update 2 for SQL Server 2016 SP1] | 2017-03-20 | 2017-03-06 | 117 | 100 | 415 | -| 13.0.4411.0 | 2015.130.4411.0 | SP1 | CU | [3208177 Cumulative update 1 for SQL Server 2016 Service Pack 1] | 2017-01-18 | 2017-01-06 | 63 | 55 | 439 | -| 13.0.4259.0 | 2015.130.4223.10 | SP1 | GDR | [4505219 Security update for SQL Server 2016 SP1 GDR: July 9, 2019] **CVE-2019-1068** | 2019-07-09 | 2019-06-15 | 2 | 2 | 699 | -| 13.0.4224.16 | 2015.130.4224.16 | SP1 | CU | [4458842 Security update for SQL Server 2016 SP1 GDR: August 22, 2018] **CVE-2018-8273** | 2018-08-22 | | 1 | 0 | 700 | -| 13.0.4223.10 | 2015.130.4223.10 | SP1 | CU | **Withdrawn** [4293801 Security update for SQL Server 2016 SP1 GDR: August 14, 2018] **CVE-2018-8273** | 2018-08-14 | | 1 | 0 | | -| 13.0.4210.6 | 2015.130.4210.6 | SP1 | CU | [4057118 Description of the security update for SQL Server 2016 SP1 GDR: January 3, 2018] **CVE-2017-5715,2017-5753,2017-5754**|2018-01-03 | | 1 | 0 | 696 | -| 13.0.4206.0 | 2015.130.4206.0 | SP1 | COD | [4019089 Description of the security update for SQL Server 2016 Service Pack 1 GDR: August 8, 2017] | 2017-07-16 | | 1 | 1 | 364 | -| 13.0.4202.0 | 2015.130.4202.0 | SP1 | COD | [3210089 GDR update package for SQL Server 2016 SP1] | 2016-12-16 | 2016-12-13 | 3 | 3 | 378 | -| 13.0.4199.0 | 2015.130.4199.0 | SP1 | COD | [3207512 Important update for SQL Server 2016 SP1 Reporting Services] | 2016-11-23 | 2016-11-18 | 2 | 2 | 521 | -| 13.0.4001.0 | 2015.130.4001.0 | SP1 | SP | [3182545 SQL Server 2016 Service Pack 1 release information] | 2016-11-16 | 2016-10-29 | 33 | 33 | 552 | -| 13.0.2218.0 | 2015.130.2218.0 | RTM | COD | [4058559 Security update for SQL Server 2016 CU: January 6, 2018] **CVE-2017-5715,2017-5753,2017-5754** | 2018-01-06 | | | | 918 | -| 13.0.2216.0 | 2015.130.2216.0 | RTM | CU | [4037357 Cumulative Update 9 for SQL Server 2016] | 2017-11-21 | 2017-11-09 | 26 | 21 | 865 | -| 13.0.2213.0 | 2015.130.2213.0 | RTM | CU | [4040713 Cumulative Update 8 for SQL Server 2016] | 2017-09-18 | 2017-09-06 | 19 | 17 | 864 | -| 13.0.2210.0 | 2015.130.2210.0 | RTM | CU | [4024304 Cumulative Update 7 for SQL Server 2016] | 2017-08-08 | 2017-07-16 | 33 | 30 | 815 | -| 13.0.2204.0 | 2015.130.2204.0 | RTM | CU | [4019914 Cumulative Update 6 for SQL Server 2016] | 2017-05-15 | 2017-04-20 | 28 | 22 | 814 | -| 13.0.2197.0 | 2015.130.2197.0 | RTM | CU | [4013105 Cumulative Update 5 for SQL Server 2016] | 2017-03-20 | 2017-02-25 | 56 | 47 | 700 | -| 13.0.2193.0 | 2015.130.2193.0 | RTM | CU | [3205052 Cumulative update 4 for SQL Server 2016] | 2017-01-18 | 2017-01-06 | 65 | 57 | 699 | -| 13.0.2190.2 | 2015.130.2190.2 | RTM | COD | [3210110 On-demand hotfix update package for SQL Server 2016 CU3] | 2016-12-16 | 2016-12-13 | 3 | 3 | 691 | -| 13.0.2186.6 | 2015.130.2186.6 | RTM | CU | [3194717 MS16-136: Description of the security update for SQL Server 2016 CU] | 2016-11-08 | 2016-10-31 | 31 | 31 | 691 | -| 13.0.2186.6 | 2015.130.2186.6 | RTM | CU | [3205413 Cumulative update 3 for SQL Server 2016] **Duplicate KB3194717** | 2016-11-08 | 2016-10-31 | | | 691 | -| 13.0.2170.0 | 2015.130.2170.0 | RTM | COD | [3199171 On-demand hotfix update package for SQL Server 2016 CU2] | 2016-11-01 | 2016-10-11 | 4 | 4 | 689 | -| 13.0.2169.0 | 2015.130.2169.0 | RTM | COD | [3195813 On-demand hotfix update package for SQL Server 2016 CU2] | 2016-10-26 | 2016-10-05 | 4 | 4 | 689 | -| 13.0.2164.0 | 2015.130.2164.0 | RTM | CU | [3182270 Cumulative Update 2 for SQL Server 2016] | 2016-09-22 | 2016-09-09 | 68 | 64 | 689 | -| 13.0.2149.0 | 2015.130.2149.0 | RTM | CU | [3164674 Cumulative Update 1 for SQL Server 2016] | 2016-07-25 | 2016-07-11 | 192 | 146 | 665 | -| 13.0.1745.2 | 2015.130.1745.2 | RTM | COD | [4058560 Description of the security update for SQL Server 2016 GDR: January 6, 2018] **CVE-2017-5715,2017-5753,2017-5754** | 2018-01-06 | | | | 687 | -| 13.0.1742.0 | 2015.130.1742.0 | RTM | COD | [4019088 Security update for SQL Server 2016 RTM GDR: August 8, 2017] **CVE-2017-8516** | 2017-08-08 | | | | 451 | -| 13.0.1728.2 | 2015.130.1728.2 | RTM | COD | [3210111 GDR update package for SQL Server 2016 RTM] | 2016-12-16 | | | | 339 | -| 13.0.1722.0 | 2015.130.1722.0 | RTM | COD | [3194716 MS16-136: Description of the security update for SQL Server 2016 GDR] | 2016-11-08 | 2016-10-31 | 3 | 3 | 342 | -| 13.0.1711.0 | 2015.130.1711.0 | RTM | COD | [3179258 Processing a partition causes data loss on other partitions after the database is restored in SQL Server 2016 (1200)] | 2016-08-17 | 2016-07-30 | | | 282 | -| 13.0.1708.0 | 2015.130.1708.0 | RTM | COD | [3164398 Critical update for SQL Server 2016 MSVCRT prerequisites] | 2016-06-04 | 2016-06-02 | | | 265 | -| 13.0.1601.5 | 2015.130.1601.5 | RTM | RTM | [Microsoft SQL Server 2016 RTM] | 2016-06-01 | 2016-04-29 | | | 2050 | -| 13.0.1400.361 | 2015.130.1400.361 | RC | RC | Microsoft SQL Server 2016 Community Technology Release Candidate 3 (RC3) | 2016-04-15 | 2016-04-09 | | | 2114 | -| 13.0.1300.275 | 2015.130.1300.275 | RC | RC | Microsoft SQL Server 2016 Community Technology Release Candidate 2 (RC2) | 2016-04-01 | 2016-03-26 | | | 2101 | -| 13.0.1200.242 | 2015.130.1200.242 | RC | RC | Microsoft SQL Server 2016 Community Technology Release Candidate 1 (RC1) | 2016-03-18 | 2016-03-10 | | | 2083 | -| 13.0.1100.288 | 2015.130.1100.288 | RC | RC | Microsoft SQL Server 2016 Community Technology Release Candidate 0 (RC0) | 2016-03-07 | 2016-02-29 | | | | -| 13.0.1000.281 | 2015.130.1000.281 | CTP | CTP | Microsoft SQL Server 2016 Community Technology Preview 3.3 (CTP3.3) | 2016-02-03 | 2016-01-28 | | | | -| 13.0.900.73 | 2015.130.900.73 | CTP | CTP | Microsoft SQL Server 2016 Community Technology Preview 3.2 (CTP3.2) | 2015-12-17 | 2015-12-10 | | | | -| 13.0.801.12 | 2015.130.801.12 | CTP | CTP | Microsoft SQL Server 2016 Community Technology Preview 3.1 (CTP3.1 refresh) | 2015-12-05 | 2015-12-01 | | | | -| 13.0.801.111 | 2015.130.801.111 | CTP | CTP | Microsoft SQL Server 2016 Community Technology Preview 3.1 (CTP3.1) | 2015-11-30 | 2015-11-21 | | | | -| 13.0.700.242 | 2015.130.700.242 | CTP | CTP | Microsoft SQL Server 2016 Community Technology Preview 3.0 (CTP3.0) | 2015-10-29 | 2015-10-26 | | | | -| 13.0.600.65 | 2015.130.600.65 | CTP | CTP | Microsoft SQL Server 2016 Community Technology Preview 2.4 (CTP2.4) | 2015-09-30 | 2015-09-20 | | | | -| 13.0.500.53 | 2015.130.500.53 | CTP | CTP | Microsoft SQL Server 2016 Community Technology Preview 2.3 (CTP2.3) | 2015-08-28 | 2015-08-24 | | | | -| 13.0.407.1 | 2015.130.407.1 | CTP | CTP | Microsoft SQL Server 2016 Community Technology Preview 2.2 (CTP2.2) | 2015-07-29 | 2015-07-22 | | | | -| 13.0.400.91 | 2015.130.400.91 | CTP | CTP | Microsoft SQL Server 2016 Community Technology Preview 2.2 (CTP2.2) (withdrawn) | 2015-07-22 | 2015-07-16 | | | | -| 13.0.300.44 | 2015.130.300.444 | CTP | CTP | Microsoft SQL Server 2016 Community Technology Preview 2.1 (CTP2.1) | 2015-06-14 | 2015-06-12 | | | | -| 13.0.200.172 | 2015.130.200.172 | CTP | CTP | Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2) | 2015-05-26 | 2015-05-21 | | | | - -[4510807 On-demand hotfix update package 2 for SQL Server 2016 Service Pack 2 (SP2) Cumulative update 7 (CU7)]:https://support.microsoft.com/help/4510807 -[4505222 Security update for SQL Server 2016 SP2 CU7 GDR: July 9, 2019]:https://support.microsoft.com/help/4505222 -[4508636 On-demand hotfix update package for SQL Server 2016 Service Pack 2 (SP2) Cumulative update 7 (CU7)]:https://support.microsoft.com/help/4508636 -[4495256 Cumulative Update 7 for SQL Server 2016 SP2]:https://support.microsoft.com/help/4495256 -[4488536 Cumulative Update 6 for SQL Server 2016 SP2]:https://support.microsoft.com/help/4488536 -[4490133 On-demand hotfix update package for SQL Server 2016 SP2 CU5]:https://support.microsoft.com/help/4490133 -[4475776 Cumulative Update 5 for SQL Server 2016 SP2]:https://support.microsoft.com/help/4475776 -[4482972 On-demand hotfix update package 2 for SQL Server 2016 SP2 CU4]:https://support.microsoft.com/help/4482972 -[4464106 Cumulative Update 4 for SQL Server 2016 SP2]:https://support.microsoft.com/help/4464106 -[4458871 Cumulative Update 3 for SQL Server 2016 SP2]:https://support.microsoft.com/help/4458871 -[4458621 Security update for SQL Server 2016 SP2 CU: August 19, 2018]:https://support.microsoft.com/help/4458621 -[4293807 Security update for SQL Server 2016 SP2 (CU): August 14, 2018]:https://support.microsoft.com/help/4293807/ -[4340355 Cumulative Update 2 for SQL Server 2016 SP2]:https://support.microsoft.com/help/4340355 -[4135048 Cumulative Update 1 for SQL Server 2016 SP2]:https://support.microsoft.com/help/4135048 -[4505220 Security update for SQL Server 2016 SP2 GDR: July 9, 2019]:https://support.microsoft.com/help/4505220 -[4293802 Security update for SQL Server 2016 SP2 GDR: August 14, 2018]:https://support.microsoft.com/help/4293802 -[4464343 Cumulative Update 12 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4464343 -[4465443 FIX: The "modification_counter" in DMV sys.dm_db_stats_properties shows incorrect value when partitions are merged]:https://support.microsoft.com/help/4465443/ -[4052908 SQL Server 2016 Service Pack 2 release information]:https://support.microsoft.com/help/4052908 -[4505221 Security update for SQL Server 2016 SP1 CU15 GDR: July 9, 2019]:https://support.microsoft.com/help/4505221 -[4508471 On-demand hotfix update package for SQL Server 2016 Service Pack 1 (SP1) Cumulative update 15 (CU15)]:https://support.microsoft.com/help/4508471 -[4495257 Cumulative Update 15 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4495257 -[4488535 Cumulative Update 14 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4488535 -[4475775 Cumulative Update 13 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4475775 -[4459676 Cumulative Update 11 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4459676 -[4293808 Security update for SQL Server 2016 SP1 (CU): August 14, 2018]:https://support.microsoft.com/help/4293808 -[4341569 Cumulative Update 10 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4341569 -[4100997 Cumulative Update 9 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4100997 -[4077064 Cumulative Update 8 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4077064 -[4057119 Cumulative Update 7 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4057119 -[4037354 Cumulative Update 6 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4037354 -[4040714 Cumulative Update 5 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4040714 -[4024305 Cumulative Update 4 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4024305 -[4019916 Cumulative Update 3 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4019916 -[4013106 Cumulative Update 2 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4013106 -[3208177 Cumulative update 1 for SQL Server 2016 Service Pack 1]:https://support.microsoft.com/help/3208177 -[4505219 Security update for SQL Server 2016 SP1 GDR: July 9, 2019]:https://support.microsoft.com/help/4505219 -[4458842 Security update for SQL Server 2016 SP1 GDR: August 22, 2018]:https://support.microsoft.com/help/4458842 -[4293801 Security update for SQL Server 2016 SP1 GDR: August 14, 2018]:https://support.microsoft.com/help/4293801 -[4057118 Description of the security update for SQL Server 2016 SP1 GDR: January 3, 2018]:https://support.microsoft.com/help/4057118 -[4019089 Description of the security update for SQL Server 2016 Service Pack 1 GDR: August 8, 2017]:https://support.microsoft.com/help/4019089 -[3210089 GDR update package for SQL Server 2016 SP1]:https://support.microsoft.com/help/3210089 -[3207512 Important update for SQL Server 2016 SP1 Reporting Services]:https://support.microsoft.com/help/3207512 -[3182545 SQL Server 2016 Service Pack 1 release information]:https://support.microsoft.com/help/3182545 -[4058559 Security update for SQL Server 2016 CU: January 6, 2018]:https://support.microsoft.com/help/4058559 -[4037357 Cumulative Update 9 for SQL Server 2016]:https://support.microsoft.com/help/4037357 -[4040713 Cumulative Update 8 for SQL Server 2016]:https://support.microsoft.com/help/4040713 -[4024304 Cumulative Update 7 for SQL Server 2016]:https://support.microsoft.com/help/4024304 -[4019914 Cumulative Update 6 for SQL Server 2016]:https://support.microsoft.com/help/4019914 -[4013105 Cumulative Update 5 for SQL Server 2016]:https://support.microsoft.com/help/4013105 -[3205052 Cumulative update 4 for SQL Server 2016]:https://support.microsoft.com/help/3205052 -[4058560 Description of the security update for SQL Server 2016 GDR: January 6, 2018]:https://support.microsoft.com/help/4058560 -[4019088 Security update for SQL Server 2016 RTM GDR: August 8, 2017]:https://support.microsoft.com/help/4019088 -[3210111 GDR update package for SQL Server 2016 RTM]:https://support.microsoft.com/help/3210111 -[3210110 On-demand hotfix update package for SQL Server 2016 CU3]:https://support.microsoft.com/help/3210110 -[3194717 MS16-136: Description of the security update for SQL Server 2016 CU]:https://support.microsoft.com/help/3194717 -[3205413 Cumulative update 3 for SQL Server 2016]:https://support.microsoft.com/help/3205413 -[3199171 On-demand hotfix update package for SQL Server 2016 CU2]:https://support.microsoft.com/help/3199171 -[3195813 On-demand hotfix update package for SQL Server 2016 CU2]:https://support.microsoft.com/help/3195813 -[3182270 Cumulative Update 2 for SQL Server 2016]:https://support.microsoft.com/help/3182270 -[3164674 Cumulative Update 1 for SQL Server 2016]:https://support.microsoft.com/help/3164674 -[3194716 MS16-136: Description of the security update for SQL Server 2016 GDR]:https://support.microsoft.com/help/3194716 -[3179258 Processing a partition causes data loss on other partitions after the database is restored in SQL Server 2016 (1200)]:http://support.microsoft.com/help/3179258 -[3164398 Critical update for SQL Server 2016 MSVCRT prerequisites]:https://support.microsoft.com/help/3164398 +| Build | File version |Branch | Type | Info | KB | Description/Link | Release Date | Build Date | Fixes | Public | Size, Mb | +|---------------|-------------------|-------|------|-----------------------------------|---------|------------------------------------------------------------------------------------------------------------------------|--------------|------------|------:|-------:|---------:| +| 13.0.6300.2 | 2015.131.5300.2 | SP3 | SP | **Latest SP** | 5003279 | [Microsoft SQL Server 2016 Service Pack 3 (SP3)] | 2021-09-15 | 2021-08-07 | 43 | 43 | 821 | +| 13.0.5888.11 | 2015.131.5888.11 | SP2 | CU | **Latest CU SP2** | 5001092 | [Cumulative Update 17 for SQL Server 2016 SP2] | 2021-03-29 | 2021-03-20 | 20 | 17 | 753 | +| 13.0.5882.1 | 2015.131.5882.1 | SP2 | CU | | 5000645 | [Cumulative Update 16 for SQL Server 2016 SP2] | 2021-02-11 | ? | 22 | 21 | 753 | +| 13.0.5865.1 | 2015.131.5865.1 | SP2 | CU | CVE-2021-1636 | 4583461 | [Description of the security update for SQL Server 2016 SP2 CU15: January 12, 2021] | 2021-01-12 | 2020-10-31 | 1 | 1 | 753 | +| 13.0.5850.14 | 2015.131.5850.14 | SP2 | CU | | 4577775 | [Cumulative Update 15 for SQL Server 2016 SP2] | 2020-09-28 | 2020-09-18 | 21 | 20 | 753 | +| 13.0.5830.85 | 2015.131.5830.85 | SP2 | CU | | 4564903 | [Cumulative Update 14 for SQL Server 2016 SP2] | 2020-08-06 | 2020-08-01 | 18 | 16 | 753 | +| 13.0.5820.21 | 2015.131.5820.21 | SP2 | CU | | 4549825 | [Cumulative Update 13 for SQL Server 2016 SP2] | 2020-05-28 | 2020-05-23 | 29 | 26 | 748 | +| 13.0.5698.0 | 2015.131.5698.0 | SP2 | CU | | 4536648 | [Cumulative Update 12 for SQL Server 2016 SP2] | 2020-02-25 | 2020-02-16 | 39 | 33 | 746 | +| 13.0.5622.0 | 2015.131.5622.0 | SP2 | GDR | CVE-2020-0618 | 4535706 | [Description of the security update for SQL Server 2016 SP2 CU11: February 11, 2020] | 2020-02-11 | 2019-11-28 | 1 | 1 | 752 | +| 13.0.5598.27 | 2015.131.5598.27 | SP2 | CU | | 4527378 | [Cumulative Update 11 for SQL Server 2016 SP2] | 2019-12-09 | 2019-11-28 | 29 | 26 | 752 | +| 13.0.5492.2 | 2015.131.5492.2 | SP2 | CU | | 4524334 | [Cumulative Update 10 for SQL Server 2016 SP2] | 2019-10-08 | 2019-10-05 | 21 | 21 | 752 | +| 13.0.5479.0 | 2015.131.5479.0 | SP2 | CU | **Withdrawn** | 4515435 | Cumulative Update 9 for SQL Server 2016 SP2 | 2019-09-30 | 2019-09-13 | 21 | 21 | 752 | +| 13.0.5426.0 | 2015.131.5426.0 | SP2 | CU | | 4505830 | [Cumulative Update 8 for SQL Server 2016 SP2] | 2019-07-31 | 2019-06-15 | 33 | 28 | 752 | +| 13.0.5382.0 | 2015.131.5382.0 | SP2 | COD | | 4510807 | [On-demand hotfix update package 2 for SQL Server 2016 Service Pack 2 (SP2) Cumulative update 7 (CU7)] | 2019-07-09 | 2019-06-15 | 2 | 2 | 714 | +| 13.0.5366.0 | 2015.131.5366.0 | SP2 | GDR | CVE-2019-1068 | 4505222 | [Security update for SQL Server 2016 SP2 CU7 GDR: July 9, 2019] | 2019-07-09 | 2019-06-15 | 2 | 2 | 714 | +| 13.0.5343.1 | 2015.131.5343.1 | SP2 | COD | | 4508636 | [On-demand hotfix update package for SQL Server 2016 Service Pack 2 (SP2) Cumulative update 7 (CU7)] | 2019-06-24 | 2019-06-15 | 2 | 2 | 714 | +| 13.0.5337.0 | 2015.131.5337.0 | SP2 | CU | | 4495256 | [Cumulative Update 7 for SQL Server 2016 SP2] | 2019-05-22 | 2019-05-16 | 28 | 27 | 714 | +| 13.0.5292.0 | 2015.131.5292.0 | SP2 | CU | | 4488536 | [Cumulative Update 6 for SQL Server 2016 SP2] | 2019-03-19 | 2019-03-12 | 29 | 24 | 714 | +| 13.0.5270.0 | 2015.131.5270.0 | SP2 | COD | | 4490133 | [On-demand hotfix update package for SQL Server 2016 SP2 CU5] | 2019-02-14 | 2019-02-08 | 1 | 1 | 712 | +| 13.0.5264.1 | 2015.131.5264.1 | SP2 | CU | | 4475776 | [Cumulative Update 5 for SQL Server 2016 SP2] | 2019-01-23 | 2019-01-11 | 52 | 43 | 712 | +| 13.0.5239.0 | 2015.131.5239.0 | SP2 | COD | | 4482972 | [On-demand hotfix update package 2 for SQL Server 2016 SP2 CU4] | 2018-12-20 | 2018-12-03 | 3 | 3 | 690 | +| 13.0.5233.0 | 2015.131.5233.0 | SP2 | CU | | 4464106 | [Cumulative Update 4 for SQL Server 2016 SP2] | 2018-11-13 | 2018-11-03 | 42 | 36 | 690 | +| 13.0.5216.0 | 2015.131.5216.0 | SP2 | CU | | 4458871 | [Cumulative Update 3 for SQL Server 2016 SP2] | 2018-09-21 | 2018-09-14 | 41 | 27 | 688 | +| 13.0.5201.2 | 2015.131.5201.2 | SP2 | CU | CVE-2018-8273 | 4458621 | [Security update for SQL Server 2016 SP2 CU: August 19, 2018] | 2018-08-19 | 2018-08-18 | 1 | 0 | 672 | +| 13.0.5161.0 | 2015.131.5161.0 | SP2 | CU | **Withdrawn**,CVE-2018-8273 | 4293807 | [Security update for SQL Server 2016 SP2 (CU): August 14, 2018] | 2018-08-14 | 2018-07-18 | 1 | 0 | 672 | +| 13.0.5153.0 | 2015.131.5153.0 | SP2 | CU | | 4340355 | [Cumulative Update 2 for SQL Server 2016 SP2] | 2018-07-16 | 2018-06-29 | 29 | 21 | 671 | +| 13.0.5149.0 | 2015.131.5149.0 | SP2 | CU | | 4135048 | [Cumulative Update 1 for SQL Server 2016 SP2] | 2018-05-30 | 2018-05-19 | 45 | 28 | 549 | +| 13.0.5102.14 | 2015.131.5102.14 | SP2 | GDR | CVE-2019-1332,2020-0618 | 4532097 | [Security update for SQL Server 2016 SP2 GDR: February 11, 2020] | 2020-02-11 | 2019-06-15 | 1 | 1 | 495 | +| 13.0.5101.9 | 2015.131.5101.9 | SP2 | GDR | CVE-2019-1068 | 4505220 | [Security update for SQL Server 2016 SP2 GDR: July 9, 2019] | 2019-07-09 | 2019-06-15 | 2 | 2 | 491 | +| 13.0.5081.1 | 2015.131.5081.1 | SP2 | COD | CVE-2018-8273 | 4293802 | [Security update for SQL Server 2016 SP2 GDR: August 14, 2018] | 2018-05-30 | 2018-05-19 | 1 | 0 | 492 | +| 13.0.5026.0 | 2015.131.5026.0 | SP2 | SP | | 4052908 | [SQL Server 2016 Service Pack 2 release information] | 2018-04-24 | 2018-03-18 | 50 | 50 | 774 | +| 13.0.4604.0 | 2015.130.4604.0 | SP1 | GDR | **Latest CU SP1**,CVE-2019-1068 | 4505221 | [Security update for SQL Server 2016 SP1 CU15 GDR: July 9, 2019] | 2019-07-09 | 2019-06-15 | 2 | 2 | 761 | +| 13.0.4577.0 | 2015.130.4577.0 | SP1 | COD | | 4508471 | [On-demand hotfix update package for SQL Server 2016 Service Pack 1 (SP1) Cumulative update 15 (CU15)] | 2019-06-20 | 2019-06-15 | 2 | 2 | 761 | +| 13.0.4574.0 | 2015.130.4574.0 | SP1 | CU | | 4495257 | [Cumulative Update 15 for SQL Server 2016 SP1] | 2019-05-16 | 2019-04-28 | 7 | 7 | 761 | +| 13.0.4560.0 | 2015.130.4560.0 | SP1 | CU | | 4488535 | [Cumulative update 14 (CU14) for SQL Server 2016 Service Pack 1] | 2019-03-19 | 2019-03-12 | 7 | 7 | 761 | +| 13.0.4550.1 | 2015.130.4550.1 | SP1 | CU | | 4475775 | [Cumulative Update 13 for SQL Server 2016 SP1] | 2019-01-23 | 2019-01-11 | 12 | 9 | 761 | +| 13.0.4541.0 | 2015.130.4541.0 | SP1 | CU | | 4464343 | [Cumulative Update 12 for SQL Server 2016 SP1] | 2018-11-13 | 2018-10-27 | 21 | 16 | 761 | +| 13.0.4531.0 | 2015.130.4531.0 | SP1 | COD | | 4465443 | [FIX: The "modification_counter" in DMV sys.dm_db_stats_properties shows incorrect value when partitions are merged] | 2018-09-27 | 2018-09-22 | 1 | 1 | 759 | +| 13.0.4528.0 | 2015.130.4528.0 | SP1 | CU | | 4459676 | [Cumulative Update 11 for SQL Server 2016 SP1] | 2018-09-18 | 2018-08-31 | 14 | 8 | 762 | +| 13.0.4522.0 | 2015.130.4522.0 | SP1 | CU | **Withdrawn**,CVE-2018-8273 | 4293808 | [Security update for SQL Server 2016 SP1 (CU): August 14, 2018] | 2018-08-14 | 2018-07-18 | 1 | 0 | 774 | +| 13.0.4514.0 | 2015.130.4514.0 | SP1 | CU | | 4341569 | [Cumulative Update 10 for SQL Server 2016 SP1] | 2018-07-16 | 2018-06-23 | 26 | 21 | 761 | +| 13.0.4502.0 | 2015.130.4502.0 | SP1 | CU | | 4100997 | [Cumulative Update 9 for SQL Server 2016 SP1] | 2018-05-30 | 2018-05-15 | 39 | 25 | 761 | +| 13.0.4474.0 | 2015.130.4474.0 | SP1 | CU | | 4077064 | [Cumulative Update 8 for SQL Server 2016 SP1] | 2018-03-19 | 2018-02-24 | 57 | 37 | 760 | +| 13.0.4466.4 | 2015.130.4466.4 | SP1 | CU | | 4057119 | [Cumulative Update 7 for SQL Server 2016 SP1] | 2018-01-03 | 2017-11-09 | 15 | 14 | 758 | +| 13.0.4457.0 | 2015.130.4457.0 | SP1 | CU | | 4037354 | [Cumulative Update 6 for SQL Server 2016 SP1] | 2017-11-21 | 2017-11-09 | 55 | 41 | 689 | +| 13.0.4451.0 | 2015.130.4451.0 | SP1 | CU | | 4040714 | [Cumulative Update 5 for SQL Server 2016 SP1] | 2017-09-18 | 2017-09-06 | 49 | 44 | 689 | +| 13.0.4446.0 | 2015.130.4446.0 | SP1 | CU | | 4024305 | [Cumulative Update 4 for SQL Server 2016 SP1] | 2017-08-08 | 2017-07-16 | 63 | 49 | 534 | +| 13.0.4435.0 | 2015.130.4435.0 | SP1 | CU | | 4019916 | [Cumulative Update 3 for SQL Server 2016 SP1] | 2017-05-15 | 2017-04-27 | 70 | 57 | 534 | +| 13.0.4422.0 | 2015.130.4422.0 | SP1 | CU | | 4013106 | [Cumulative Update 2 for SQL Server 2016 SP1] | 2017-03-20 | 2017-03-06 | 117 | 100 | 415 | +| 13.0.4411.0 | 2015.130.4411.0 | SP1 | CU | | 3208177 | [Cumulative update 1 for SQL Server 2016 Service Pack 1] | 2017-01-18 | 2017-01-06 | 63 | 55 | 439 | +| 13.0.4259.0 | 2015.130.4223.10 | SP1 | GDR | CVE-2019-1068 | 4505219 | [Security update for SQL Server 2016 SP1 GDR: July 9, 2019] | 2019-07-09 | 2019-06-15 | 2 | 2 | 699 | +| 13.0.4224.16 | 2015.130.4224.16 | SP1 | CU | CVE-2018-8273 | 4458842 | [Security update for SQL Server 2016 SP1 GDR: August 22, 2018] | 2018-08-22 | | 1 | 0 | 700 | +| 13.0.4223.10 | 2015.130.4223.10 | SP1 | CU | **Withdrawn**,CVE-2018-8273 | 4293801 | [Security update for SQL Server 2016 SP1 GDR: August 14, 2018] | 2018-08-14 | | 1 | 0 | | +| 13.0.4210.6 | 2015.130.4210.6 | SP1 | CU | CVE-2017-5715,2017-5753,2017-5754 | 4057118 | [Description of the security update for SQL Server 2016 SP1 GDR: January 3, 2018] | 2018-01-03 | | 1 | 0 | 696 | +| 13.0.4206.0 | 2015.130.4206.0 | SP1 | COD | | 4019089 | [Description of the security update for SQL Server 2016 Service Pack 1 GDR: August 8, 2017] | 2017-07-16 | | 1 | 1 | 364 | +| 13.0.4202.0 | 2015.130.4202.0 | SP1 | COD | | 3210089 | [GDR update package for SQL Server 2016 SP1] | 2016-12-16 | 2016-12-13 | 3 | 3 | 378 | +| 13.0.4199.0 | 2015.130.4199.0 | SP1 | COD | | 3207512 | [Important update for SQL Server 2016 SP1 Reporting Services] | 2016-11-23 | 2016-11-18 | 2 | 2 | 521 | +| 13.0.4001.0 | 2015.130.4001.0 | SP1 | SP | | 3182545 | [SQL Server 2016 Service Pack 1 release information] | 2016-11-16 | 2016-10-29 | 33 | 33 | 552 | +| 13.0.2218.0 | 2015.130.2218.0 | RTM | COD | CVE-2017-5715,2017-5753,2017-5754 | 4058559 | [Security update for SQL Server 2016 CU: January 6, 2018] | 2018-01-06 | | | | 918 | +| 13.0.2216.0 | 2015.130.2216.0 | RTM | CU | **Latest CU RTM** | 4037357 | [Cumulative Update 9 for SQL Server 2016] | 2017-11-21 | 2017-11-09 | 26 | 21 | 865 | +| 13.0.2213.0 | 2015.130.2213.0 | RTM | CU | | 4040713 | [Cumulative Update 8 for SQL Server 2016] | 2017-09-18 | 2017-09-06 | 19 | 17 | 864 | +| 13.0.2210.0 | 2015.130.2210.0 | RTM | CU | | 4024304 | [Cumulative Update 7 for SQL Server 2016] | 2017-08-08 | 2017-07-16 | 33 | 30 | 815 | +| 13.0.2204.0 | 2015.130.2204.0 | RTM | CU | | 4019914 | [Cumulative Update 6 for SQL Server 2016] | 2017-05-15 | 2017-04-20 | 28 | 22 | 814 | +| 13.0.2197.0 | 2015.130.2197.0 | RTM | CU | | 4013105 | [Cumulative Update 5 for SQL Server 2016] | 2017-03-20 | 2017-02-25 | 56 | 47 | 700 | +| 13.0.2193.0 | 2015.130.2193.0 | RTM | CU | | 3205052 | [Cumulative update 4 for SQL Server 2016] | 2017-01-18 | 2017-01-06 | 65 | 57 | 699 | +| 13.0.2190.2 | 2015.130.2190.2 | RTM | COD | | 3210110 | [On-demand hotfix update package for SQL Server 2016 CU3] | 2016-12-16 | 2016-12-13 | 3 | 3 | 691 | +| 13.0.2186.6 | 2015.130.2186.6 | RTM | CU | | 3194717 | [MS16-136: Description of the security update for SQL Server 2016 CU] | 2016-11-08 | 2016-10-31 | 31 | 31 | 691 | +| 13.0.2186.6 | 2015.130.2186.6 | RTM | CU | | 3205413 | [Cumulative update 3 for SQL Server 2016] **Duplicate KB3194717** | 2016-11-08 | 2016-10-31 | | | 691 | +| 13.0.2170.0 | 2015.130.2170.0 | RTM | COD | | 3199171 | [On-demand hotfix update package for SQL Server 2016 CU2] | 2016-11-01 | 2016-10-11 | 4 | 4 | 689 | +| 13.0.2169.0 | 2015.130.2169.0 | RTM | COD | | 3195813 | [On-demand hotfix update package for SQL Server 2016 CU2] | 2016-10-26 | 2016-10-05 | 4 | 4 | 689 | +| 13.0.2164.0 | 2015.130.2164.0 | RTM | CU | | 3182270 | [Cumulative Update 2 for SQL Server 2016] | 2016-09-22 | 2016-09-09 | 68 | 64 | 689 | +| 13.0.2149.0 | 2015.130.2149.0 | RTM | CU | | 3164674 | [Cumulative Update 1 for SQL Server 2016] | 2016-07-25 | 2016-07-11 | 192 | 146 | 665 | +| 13.0.1745.2 | 2015.130.1745.2 | RTM | COD | CVE-2017-5715,2017-5753,2017-5754 | 4058560 | [Description of the security update for SQL Server 2016 GDR: January 6, 2018] | 2018-01-06 | | | | 687 | +| 13.0.1742.0 | 2015.130.1742.0 | RTM | COD | CVE-2017-8516 | 4019088 | [Security update for SQL Server 2016 RTM GDR: August 8, 2017] | 2017-08-08 | | | | 451 | +| 13.0.1728.2 | 2015.130.1728.2 | RTM | COD | | 3210111 | [GDR update package for SQL Server 2016 RTM] | 2016-12-16 | | | | 339 | +| 13.0.1722.0 | 2015.130.1722.0 | RTM | COD | | 3194716 | [MS16-136: Description of the security update for SQL Server 2016 GDR] | 2016-11-08 | 2016-10-31 | 3 | 3 | 342 | +| 13.0.1711.0 | 2015.130.1711.0 | RTM | COD | | 3179258 | [Processing a partition causes data loss on other partitions after the database is restored in SQL Server 2016 (1200)] | 2016-08-17 | 2016-07-30 | | | 282 | +| 13.0.1708.0 | 2015.130.1708.0 | RTM | COD | | 3164398 | [Critical update for SQL Server 2016 MSVCRT prerequisites] | 2016-06-04 | 2016-06-02 | | | 265 | +| 13.0.1601.5 | 2015.130.1601.5 | RTM | RTM | | | [Microsoft SQL Server 2016 RTM] | 2016-06-01 | 2016-04-29 | | | 2050 | +| 13.0.1400.361 | 2015.130.1400.361 | RC | RC | | | Microsoft SQL Server 2016 Community Technology Release Candidate 3 (RC3) | 2016-04-15 | 2016-04-09 | | | 2114 | +| 13.0.1300.275 | 2015.130.1300.275 | RC | RC | | | Microsoft SQL Server 2016 Community Technology Release Candidate 2 (RC2) | 2016-04-01 | 2016-03-26 | | | 2101 | +| 13.0.1200.242 | 2015.130.1200.242 | RC | RC | | | Microsoft SQL Server 2016 Community Technology Release Candidate 1 (RC1) | 2016-03-18 | 2016-03-10 | | | 2083 | +| 13.0.1100.288 | 2015.130.1100.288 | RC | RC | | | Microsoft SQL Server 2016 Community Technology Release Candidate 0 (RC0) | 2016-03-07 | 2016-02-29 | | | | +| 13.0.1000.281 | 2015.130.1000.281 | CTP | CTP | | | Microsoft SQL Server 2016 Community Technology Preview 3.3 (CTP3.3) | 2016-02-03 | 2016-01-28 | | | | +| 13.0.900.73 | 2015.130.900.73 | CTP | CTP | | | Microsoft SQL Server 2016 Community Technology Preview 3.2 (CTP3.2) | 2015-12-17 | 2015-12-10 | | | | +| 13.0.801.12 | 2015.130.801.12 | CTP | CTP | | | Microsoft SQL Server 2016 Community Technology Preview 3.1 (CTP3.1 refresh) | 2015-12-05 | 2015-12-01 | | | | +| 13.0.801.111 | 2015.130.801.111 | CTP | CTP | | | Microsoft SQL Server 2016 Community Technology Preview 3.1 (CTP3.1) | 2015-11-30 | 2015-11-21 | | | | +| 13.0.700.242 | 2015.130.700.242 | CTP | CTP | | | Microsoft SQL Server 2016 Community Technology Preview 3.0 (CTP3.0) | 2015-10-29 | 2015-10-26 | | | | +| 13.0.600.65 | 2015.130.600.65 | CTP | CTP | | | Microsoft SQL Server 2016 Community Technology Preview 2.4 (CTP2.4) | 2015-09-30 | 2015-09-20 | | | | +| 13.0.500.53 | 2015.130.500.53 | CTP | CTP | | | Microsoft SQL Server 2016 Community Technology Preview 2.3 (CTP2.3) | 2015-08-28 | 2015-08-24 | | | | +| 13.0.407.1 | 2015.130.407.1 | CTP | CTP | | | Microsoft SQL Server 2016 Community Technology Preview 2.2 (CTP2.2) | 2015-07-29 | 2015-07-22 | | | | +| 13.0.400.91 | 2015.130.400.91 | CTP | CTP | **Withdrawn** | | Microsoft SQL Server 2016 Community Technology Preview 2.2 (CTP2.2) (withdrawn) | 2015-07-22 | 2015-07-16 | | | | +| 13.0.300.44 | 2015.130.300.444 | CTP | CTP | | | Microsoft SQL Server 2016 Community Technology Preview 2.1 (CTP2.1) | 2015-06-14 | 2015-06-12 | | | | +| 13.0.200.172 | 2015.130.200.172 | CTP | CTP | | | Microsoft SQL Server 2016 Community Technology Preview 2 (CTP2) | 2015-05-26 | 2015-05-21 | | | | + +[Microsoft SQL Server 2016 Service Pack 3 (SP3)]:https://support.microsoft.com/help/5003279 +[Cumulative Update 17 for SQL Server 2016 SP2]:https://support.microsoft.com/help/5001092 +[Cumulative Update 16 for SQL Server 2016 SP2]:https://support.microsoft.com/help/5000645 +[Description of the security update for SQL Server 2016 SP2 CU15: January 12, 2021]:https://support.microsoft.com/4583461 +[Cumulative Update 15 for SQL Server 2016 SP2]:https://support.microsoft.com/help/4577775 +[Cumulative Update 14 for SQL Server 2016 SP2]:https://support.microsoft.com/help/4564903 +[Cumulative Update 13 for SQL Server 2016 SP2]:https://support.microsoft.com/help/4549825 +[Cumulative Update 12 for SQL Server 2016 SP2]:https://support.microsoft.com/help/4536648 +[Description of the security update for SQL Server 2016 SP2 CU11: February 11, 2020]:https://support.microsoft.com/help/4535706 +[Cumulative Update 11 for SQL Server 2016 SP2]:https://support.microsoft.com/help/4527378 +[Cumulative Update 10 for SQL Server 2016 SP2]:https://support.microsoft.com/help/4524334 +[Cumulative Update 8 for SQL Server 2016 SP2]:https://support.microsoft.com/help/4505830 +[On-demand hotfix update package 2 for SQL Server 2016 Service Pack 2 (SP2) Cumulative update 7 (CU7)]:https://support.microsoft.com/help/4510807 +[Security update for SQL Server 2016 SP2 CU7 GDR: July 9, 2019]:https://support.microsoft.com/help/4505222 +[On-demand hotfix update package for SQL Server 2016 Service Pack 2 (SP2) Cumulative update 7 (CU7)]:https://support.microsoft.com/help/4508636 +[Cumulative Update 7 for SQL Server 2016 SP2]:https://support.microsoft.com/help/4495256 +[Cumulative Update 6 for SQL Server 2016 SP2]:https://support.microsoft.com/help/4488536 +[On-demand hotfix update package for SQL Server 2016 SP2 CU5]:https://support.microsoft.com/help/4490133 +[Cumulative Update 5 for SQL Server 2016 SP2]:https://support.microsoft.com/help/4475776 +[On-demand hotfix update package 2 for SQL Server 2016 SP2 CU4]:https://support.microsoft.com/help/4482972 +[Cumulative Update 4 for SQL Server 2016 SP2]:https://support.microsoft.com/help/4464106 +[Cumulative Update 3 for SQL Server 2016 SP2]:https://support.microsoft.com/help/4458871 +[Security update for SQL Server 2016 SP2 CU: August 19, 2018]:https://support.microsoft.com/help/4458621 +[Security update for SQL Server 2016 SP2 (CU): August 14, 2018]:https://support.microsoft.com/help/4293807/ +[Cumulative Update 2 for SQL Server 2016 SP2]:https://support.microsoft.com/help/4340355 +[Cumulative Update 1 for SQL Server 2016 SP2]:https://support.microsoft.com/help/4135048 +[Security update for SQL Server 2016 SP2 GDR: February 11, 2020]:https://support.microsoft.com/help/4532097 +[Security update for SQL Server 2016 SP2 GDR: July 9, 2019]:https://support.microsoft.com/help/4505220 +[Security update for SQL Server 2016 SP2 GDR: August 14, 2018]:https://support.microsoft.com/help/4293802 +[Cumulative Update 12 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4464343 +[FIX: The "modification_counter" in DMV sys.dm_db_stats_properties shows incorrect value when partitions are merged]:https://support.microsoft.com/help/4465443/ +[SQL Server 2016 Service Pack 2 release information]:https://support.microsoft.com/help/4052908 +[Security update for SQL Server 2016 SP1 CU15 GDR: July 9, 2019]:https://support.microsoft.com/help/4505221 +[On-demand hotfix update package for SQL Server 2016 Service Pack 1 (SP1) Cumulative update 15 (CU15)]:https://support.microsoft.com/help/4508471 +[Cumulative Update 15 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4495257 +[Cumulative Update 14 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4488535 +[Cumulative Update 13 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4475775 +[Cumulative Update 11 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4459676 +[Security update for SQL Server 2016 SP1 (CU): August 14, 2018]:https://support.microsoft.com/help/4293808 +[Cumulative Update 10 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4341569 +[Cumulative Update 9 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4100997 +[Cumulative Update 8 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4077064 +[Cumulative Update 7 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4057119 +[Cumulative Update 6 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4037354 +[Cumulative Update 5 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4040714 +[Cumulative Update 4 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4024305 +[Cumulative Update 3 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4019916 +[Cumulative Update 2 for SQL Server 2016 SP1]:https://support.microsoft.com/help/4013106 +[Cumulative update 1 for SQL Server 2016 Service Pack 1]:https://support.microsoft.com/help/3208177 +[Security update for SQL Server 2016 SP1 GDR: July 9, 2019]:https://support.microsoft.com/help/4505219 +[Security update for SQL Server 2016 SP1 GDR: August 22, 2018]:https://support.microsoft.com/help/4458842 +[Security update for SQL Server 2016 SP1 GDR: August 14, 2018]:https://support.microsoft.com/help/4293801 +[Description of the security update for SQL Server 2016 SP1 GDR: January 3, 2018]:https://support.microsoft.com/help/4057118 +[Description of the security update for SQL Server 2016 Service Pack 1 GDR: August 8, 2017]:https://support.microsoft.com/help/4019089 +[GDR update package for SQL Server 2016 SP1]:https://support.microsoft.com/help/3210089 +[Important update for SQL Server 2016 SP1 Reporting Services]:https://support.microsoft.com/help/3207512 +[SQL Server 2016 Service Pack 1 release information]:https://support.microsoft.com/help/3182545 +[Security update for SQL Server 2016 CU: January 6, 2018]:https://support.microsoft.com/help/4058559 +[Cumulative Update 9 for SQL Server 2016]:https://support.microsoft.com/help/4037357 +[Cumulative Update 8 for SQL Server 2016]:https://support.microsoft.com/help/4040713 +[Cumulative Update 7 for SQL Server 2016]:https://support.microsoft.com/help/4024304 +[Cumulative Update 6 for SQL Server 2016]:https://support.microsoft.com/help/4019914 +[Cumulative Update 5 for SQL Server 2016]:https://support.microsoft.com/help/4013105 +[Cumulative update 4 for SQL Server 2016]:https://support.microsoft.com/help/3205052 +[Description of the security update for SQL Server 2016 GDR: January 6, 2018]:https://support.microsoft.com/help/4058560 +[Security update for SQL Server 2016 RTM GDR: August 8, 2017]:https://support.microsoft.com/help/4019088 +[GDR update package for SQL Server 2016 RTM]:https://support.microsoft.com/help/3210111 +[On-demand hotfix update package for SQL Server 2016 CU3]:https://support.microsoft.com/help/3210110 +[MS16-136: Description of the security update for SQL Server 2016 CU]:https://support.microsoft.com/help/3194717 +[Cumulative update 3 for SQL Server 2016]:https://support.microsoft.com/help/3205413 +[On-demand hotfix update package for SQL Server 2016 CU2]:https://support.microsoft.com/help/3199171 +[On-demand hotfix update package for SQL Server 2016 CU2]:https://support.microsoft.com/help/3195813 +[Cumulative Update 2 for SQL Server 2016]:https://support.microsoft.com/help/3182270 +[Cumulative Update 1 for SQL Server 2016]:https://support.microsoft.com/help/3164674 +[MS16-136: Description of the security update for SQL Server 2016 GDR]:https://support.microsoft.com/help/3194716 +[Processing a partition causes data loss on other partitions after the database is restored in SQL Server 2016 (1200)]:http://support.microsoft.com/help/3179258 +[Critical update for SQL Server 2016 MSVCRT prerequisites]:https://support.microsoft.com/help/3164398 [Microsoft SQL Server 2016 RTM]:https://www.microsoft.com/evalcenter/evaluate-sql-server-2016 ## Microsoft SQL Server 2014 Builds +⚠ End-of-Life: SQL Server 2014 reached [end of mainstream support on July 9th, 2019](https://support.microsoft.com/en-us/lifecycle/search?alpha=SQL%20Server%202014%20Service%20Pack%203). + All SQL Server 2014 CU downloads: [Catalog Update Microsoft SQL Server 2014](http://www.catalog.update.microsoft.com/Search.aspx?q=sql%20server%202014) Here is the latest output from `SELECT @@VERSION` for SQL Server 2014 Developer Edition on Windows: ``` -Microsoft SQL Server 2014 (SP3-CU3-GDR) (KB4505422) - 12.0.6293.0 (X64) - May 25 2019 22:45:08 +Microsoft SQL Server 2014 (SP3-CU4) (KB4583462) - 12.0.6433.1 (X64) + Dec 20 2020 21:42:29 Copyright (c) Microsoft Corporation Developer Edition (64-bit) on … ``` -| Build | File version | Branch | Type | KB / Description | Release Date | Fixes | Public | Size, Mb | -|--------------|------------------|--------|------|------------------------------------------------------------------------------------------------------------------------------------|--------------|------:|-------:|---------:| -| 12.0.6293.0 | 2014.120.6293.0 | SP3 | GDR | [4505422 Security update for SQL Server 2014 SP3 CU3 GDR: July 9, 2019] **CVE-2019-1068** | 2019-07-09 | 1 | 1 | 656 | -| 12.0.6259.0 | 2014.120.6259.0 | SP3 | CU | [4491539 Cumulative Update 3 for SQL Server 2014 SP3] | 2019-04-16 | 4 | 4 | 656 | -| 12.0.6214.1 | 2014.120.6214.1 | SP3 | CU | [4482960 Cumulative Update 2 for SQL Server 2014 SP3] | 2019-02-19 | 5 | 5 | 602 | -| 12.0.6205.1 | 2014.120.6205.1 | SP3 | CU | [4470220 Cumulative Update 1 for SQL Server 2014 SP3] | 2018-12-12 | 16 | 13 | 601 | -| 12.0.6108.1 | 2014.120.6108.1 | SP3 | GDR | [4505218 Security update for SQL Server 2014 SP3 GDR: July 9, 2019] **CVE-2019-1068** | 2019-07-09 | 1 | 1 | 654 | -| 12.0.6024.0 | 2014.120.6024.0 | SP3 | SP | [4022619 SQL Server 2014 Service Pack 3 release information] | 2018-10-30 | 31 | 6 | 791 | -| 12.0.5659.1 | 2014.120.5659.1 | SP2 | GDR | [4505419 Security update for SQL Server 2014 SP2 CU17 GDR: July 9, 2019] **CVE-2019-1068** | 2019-07-09 | 1 | 1 | 679 | -| 12.0.5632.1 | 2014.120.5632.1 | SP2 | CU | [4491540 Cumulative Update 17 for SQL Server 2014 SP2] | 2019-04-16 | 3 | 3 | 678 | -| 12.0.5626.1 | 2014.120.5626.1 | SP2 | CU | [4482967 Cumulative Update 16 for SQL Server 2014 SP2] | 2019-02-19 | 3 | 3 | 678 | -| 12.0.5605.1 | 2014.120.5605.1 | SP2 | SP | [4469137 Cumulative Update 15 for SQL Server 2014 SP2] | 2018-12-12 | 8 | 7 | 679 | -| 12.0.5600.1 | 2014.120.5600.1 | SP2 | CU | [4459860 Cumulative Update 14 for SQL Server 2014 SP2] | 2018-10-15 | 8 | 6 | 678 | -| 12.0.5590.1 | 2014.120.5590.1 | SP2 | CU | [4456287 Cumulative Update 13 for SQL Server 2014 SP2] | 2018-08-27 | 4 | 4 | 679 | -| 12.0.5589.7 | 2014.120.5589.7 | SP2 | CU | [4130489 Cumulative Update 12 for SQL Server 2014 SP2] | 2018-06-18 | 27 | 16 | 678 | -| 12.0.5579.0 | 2014.120.5579.0 | SP2 | CU | [4077063 Cumulative Update 11 for SQL Server 2014 SP2] | 2018-03-19 | 12 | 10 | 677 | -| 12.0.5571.0 | 2014.120.5571.0 | SP2 | CU | [4052725 Cumulative Update 10 for SQL Server 2014 SP2] | 2018-01-16 | 5 | 4 | 676 | -| 12.0.5563.0 | 2014.120.5563.0 | SP2 | CU | [4055557 Cumulative Update 9 for SQL Server 2014 SP2] | 2017-12-18 | 8 | 7 | 540 | -| 12.0.5557.0 | 2014.120.5557.0 | SP2 | CU | [4037356 Cumulative Update 8 for SQL Server 2014 SP2] | 2017-10-17 | 15 | 8 | 539 | -| 12.0.5556.0 | 2014.120.5556.0 | SP2 | CU | [4032541 Cumulative Update 7 for SQL Server 2014 SP2] | 2017-08-28 | 15 | 8 | 539 | -| 12.0.5553.0 | 2014.120.5553.0 | SP2 | CU | [4019094 Cumulative Update 6 for SQL Server 2014 SP2] | 2017-08-08 | 29 | 29 | 539 | -| 12.0.5546.0 | 2014.120.5546.0 | SP2 | CU | [4013098 Cumulative Update 5 for SQL Server 2014 SP2] | 2017-04-18 | 24 | 21 | 557 | -| 12.0.5540.0 | 2014.120.5540.0 | SP2 | CU | [4010394 Cumulative Update 4 for SQL Server 2014 SP2] | 2017-02-21 | 30 | 27 | 555 | -| 12.0.5538.0 | 2014.120.5538.0 | SP2 | CU | [3204388 Cumulative update 3 for SQL Server 2014 SP2] | 2016-12-28 | 44 | 39 | 555 | -| 12.0.5532.0 | 2014.120.5532.0 | SP2 | CU | [3194718 MS16-136: Description of the security update for SQL Server 2014 Service Pack 2 CU: November 8, 2016] | 2016-11-08 | 1 | 1 | 551 | -| 12.0.5522.0 | 2014.120.5522.0 | SP2 | CU | [3188778 Cumulative update 2 for SQL Server 2014 SP2] | 2016-10-18 | 18 | 18 | 550 | -| 12.0.5511.0 | 2014.120.5511.0 | SP2 | CU | [3178925 Cumulative update 1 for SQL Server 2014 SP2] | 2016-08-24 | 45 | 36 | 556 | -| 12.0.5223.6 | 2014.120.5223.6 | SP2 | GDR | [4505217 Security update for SQL Server 2014 SP2 GDR: July 9, 2019] **CVE-2019-1068 | 2019-07-09 | 1 | 1 | 588 | -| 12.0.5214.6 | 2014.120.5214.6 | SP2 | GDR | [4057120 Security update for SQL Server 2014 Service Pack 2 GDR: January 16, 2018] **CVE-2017-5715,2017-5753,2017-5754** | 2018-01-16 | | | 960 | -| 12.0.5207.0 | 2014.120.5207.0 | SP2 | GDR | [4019093 Description of the security update for SQL Server 2014 Service Pack 2 GDR: August 8, 2017] | 2017-08-08 | 1 | 1 | 413 | -| 12.0.5203.0 | 2014.120.5203.0 | SP2 | GDR | [3194714 MS16-136: Description of the security update for SQL Server 2014 Service Pack 2 GDR: November 8, 2016] | 2016-11-08 | 1 | 1 | 463 | -| 12.0.5000.0 | 2014.120.5000.0 | SP2 | SP | [3171021 SQL Server 2014 Service Pack 2 release information] | 2016-07-11 | 133 | 55 | 681 | -| 12.0.5626.1 | 2014.120.5626.1 | SP1 | CU | [4482967 Cumulative Update 13 for SQL Server 2014 SP1] **Last CU for 2014 SP1** | 2017-08-08 | 11 | 11 | 577 | -| 12.0.4511.0 | 2014.120.4511.0 | SP1 | CU | [4017793 Cumulative Update 12 for SQL Server 2014 SP1] | 2017-04-17 | 12 | 11 | 573 | -| 12.0.4502.0 | 2014.120.4502.0 | SP1 | CU | [4010392 Cumulative Update 11 for SQL Server 2014 SP1] | 2017-02-21 | 15 | 15 | 571 | -| 12.0.4491.0 | 2014.120.4491.0 | SP1 | CU | [3204399 Cumulative update package 10 for SQL Server 2014 Service Pack 1] | 2016-12-28 | 33 | 27 | 571 | -| 12.0.4487.0 | 2014.120.4487.0 | SP1 | CU | [3194722 MS16-136: Description of the security update for SQL Server 2014 Service Pack 1 CU: November 8, 2016] | 2016-11-08 | 1 | 1 | 569 | -| 12.0.4474.0 | 2014.120.4474.0 | SP1 | CU | [3186964 Cumulative update 9 for SQL Server 2014 SP1] | 2016-10-18 | 14 | 14 | 912 | -| 12.0.4468.0 | 2014.120.4468.0 | SP1 | CU | [3174038 Cumulative update 8 for SQL Server 2014 SP1] | 2016-08-16 | 38 | 38 | 929 | -| 12.0.4463.0 | 2014.120.4463.0 | SP1 | COD | [3174370 COD Hotfix A memory leak occurs when you use Azure Storage in SQL Server 2014] | 2016-08-04 | 1 | 1 | | -| 12.0.4459.0 | 2014.120.4459.0 | SP1 | CU | [3162659 Cumulative Update 7 for SQL Server 2014 SP1] | 2016-06-20 | 35 | 33 | 928 | -| 12.0.4457.0 | 2014.120.4457.0 | SP1 | CU | [3167392 Cumulative Update 6 for SQL Server 2014 Service Pack 1] **Refresh** | 2016-05-31 | 44 | 43 | 927 | -| 12.0.4452.0 | 2014.120.4452.0 | SP1 | COD | 3147825 COD Hotfix **Deprecated** | 2016-04-05 | 1 | 1 | | -| 12.0.4449.0 | 2014.120.4449.0 | SP1 | CU | [3144524 Cumulative update 6 for SQL Server 2014 SP1 (deprecated)] **Deprecated** | 2016-04-18 | N/A | N/A | | -| 12.0.4439.1 | 2014.120.4439.1 | SP1 | CU | [3130926 Cumulative Update 5 (CU5) for SQL Server 2014 Service Pack 1] | 2016-02-22 | 20 | 20 | 924 | -| 12.0.4437.0 | 2014.120.4437.0 | SP1 | COD | [3130999 On-demand hotfix update package for SQL Server 2014 Service Pack 1 Cumulative Update 4] | 2016-02-05 | 2 | 2 | | -| 12.0.4436.0 | 2014.120.4436.0 | SP1 | CU | [3106660 Cumulative update package 4 (CU4) for SQL Server 2014 Service Pack 1] | 2015-12-21 | 34 | 34 | | -| 12.0.4433.0 | 2014.120.4433.0 | SP1 | COD | [3119148 FIX: Error 3203 occurs and a SQL Server 2014 backup job can't restart after a network failure] | 2015-12-09 | 1 | 1 | | -| 12.0.4432.0 | 2014.120.4432.0 | SP1 | COD | [3097972 FIX: Error when your stored procedure calls another stored procedure on a linked server in SQL Server 2014] | 2015-11-19 | 3 | 3 | | -| 12.0.4427.24 | 2014.120.4427.24 | SP1 | CU | [3094221 Cumulative update package 3 (CU3) for SQL Server 2014 Service Pack 1] | 2015-10-21 | 40 | 36 | | -| 12.0.4422.0 | 2014.120.4422.0 | SP1 | CU | [3075950 Cumulative update package 2 (CU2) for SQL Server 2014 Service Pack 1] | 2015-08-17 | 51 | 46 | | -| 12.0.4419.0 | 2014.120.4419.0 | SP1 | COD | [3078973 An on-demand hotfix update package is available for SQL Server 2014 SP1] | 2015-07-24 | 13 | 13 | | -| 12.0.4416.0 | 2014.120.4416.0 | SP1 | CU | [3067839 Cumulative update package 1 (CU1) for SQL Server 2014 Service Pack 1] | 2015-06-22 | 141 | 121 | | -| 12.0.4237.0 | 2014.120.4237.0 | SP1 | GDR | [4019091 Security update for SQL Server 2014 Service Pack 1 GDR: August 8, 2017] | 2017-08-08 | 1 | 1 | 391 | -| 12.0.4232.0 | 2014.120.4232.0 | SP1 | CU | [3194720 MS16-136: Description of the security update for SQL Server 2014 Service Pack 1 GDR: November 8, 2016] | 2016-11-08 | 1 | 1 | 371 | -| 12.0.4219.0 | 2014.120.4219.0 | SP1 | GDR | [3098852 SP1 GDR TLS 1.2 Update] | 2016-01-29 | | | | -| 12.0.4213.0 | 2014.120.4213.0 | SP1 | GDR | [3070446 MS15-058: Description of the nonsecurity update for SQL Server 2014 Service Pack 1 GDR: July 14, 2015] | 2015-07-14 | | | 381 | -| 12.0.4100.1 | 2014.120.4100.1 | SP1 | SP | [3058865 SQL Server 2014 Service Pack 1 release information] | 2015-05-14 | 29 | 29 | 1025 | -| 12.0.4050.0 | 2014.120.4050.0 | SP1 | SP | SQL Server 2014 Service Pack 1 (SP1) (initial) | 2015-04-15 | | | | -| 12.0.2569.0 | 2014.120.2569.0 | RTM | CU | [3158271 Cumulative update package 14 (CU14) for SQL Server 2014] **Last CU for 2014 RTM** | 2016-06-20 | 21 | 20 | 1049 | -| 12.0.2568.0 | 2014.120.2568.0 | RTM | CU | [3144517 Cumulative update package 13 (CU13) for SQL Server 2014] | 2016-04-18 | 30 | 30 | 1047 | -| 12.0.2564.0 | 2014.120.2564.0 | RTM | CU | [3130923 Cumulative update package 12 (CU12) for SQL Server 2014] | 2016-02-22 | 7 | 7 | 1045 | -| 12.0.2560.0 | 2014.120.2550.0 | RTM | CU | [3106659 Cumulative update package 11 (CU11) for SQL Server 2014] | 2015-12-21 | 19 | 19 | | -| 12.0.2556.4 | 2014.120.2556.4 | RTM | CU | [3094220 Cumulative update package 10 (CU10) for SQL Server 2014] | 2015-10-20 | 33 | 30 | | -| 12.0.2553.0 | 2014.120.2553.0 | RTM | CU | [3075949 Cumulative update package 9 (CU9) for SQL Server 2014] | 2015-08-17 | 31 | 30 | | -| 12.0.2548.0 | 2014.120.2548.0 | RTM | CU | [3045323 MS15-058: Description of the security update for SQL Server 2014 QFE: July 14, 2015] | 2015-07-14 | 1 | 1 | 1038 | -| 12.0.2546.0 | 2014.120.2546.0 | RTM | CU | [3067836 Cumulative update package 8 (CU8) for SQL Server 2014] | 2015-06-22 | 40 | 38 | | -| 12.0.2506.0 | 2014.120.2506.0 | RTM | COD | [3063054 Update enables Premium Storage support for Data files on Azure Storage and resolves backup failures] | 2015-05-19 | 1 | 1 | | -| 12.0.2505.0 | 2014.120.2505.0 | RTM | COD | [3052167 FIX: Error 1205 when you execute parallel query that contains outer join operators in SQL Server 2014] | 2015-05-19 | 1 | 1 | | -| 12.0.2504.0 | 2014.120.2504.0 | RTM | COD | [2999809 FIX: Poor performance when a query contains table joins in SQL Server 2014] | 2015-05-05 | 2 | 2 | | -| 12.0.2504.0 | 2014.120.2504.0 | RTM | COD | [3058512 FIX: Unpivot Transformation task changes null to zero or empty strings in SSIS 2014] | 2015-05-05 | | | | -| 12.0.2495.0 | 2014.120.2495.0 | RTM | CU | [3046038 Cumulative update package 7 (CU7) for SQL Server 2014] | 2015-04-23 | 47 | 41 | | -| 12.0.2488.0 | 2014.120.2488.0 | RTM | COD | [3048751 FIX: Deadlock cannot be resolved automatically when you run a SELECT query that can result in a parallel batch-mode scan] | 2015-04-01 | 1 | 1 | | -| 12.0.2485.0 | 2014.120.2485.0 | RTM | COD | [3043788 An on-demand hotfix update package is available for SQL Server 2014] | 2015-03-16 | 1 | 1 | | -| 12.0.2480.0 | 2014.120.2480.0 | RTM | CU | [3031047 Cumulative update package 6 (CU6) for SQL Server 2014] | 2015-02-16 | 64 | 55 | | -| 12.0.2474.0 | 2014.120.2474.0 | RTM | COD | [3034679 FIX: AlwaysOn availability groups are reported as NOT SYNCHRONIZING] | 2015-02-04 | 1 | 1 | | -| 12.0.2472.0 | 2014.120.2472.0 | RTM | COD | [3032087 FIX: Cannot show requested dialog after you connect to the latest SQL Database Update V12 (preview) with SQL Server 2014] | 2015-01-28 | 1 | 1 | | -| 12.0.2464.0 | 2014.120.2464.0 | RTM | COD | [3024815 Large query compilation waits on RESOURCE_SEMAPHORE_QUERY_COMPILE in SQL Server 2014] | 2015-01-05 | 1 | 1 | | -| 12.0.2456.0 | 2014.120.2456.0 | RTM | CU | [3011055 Cumulative update package 5 (CU5) for SQL Server 2014] | 2014-12-18 | 54 | 48 | | -| 12.0.2436.0 | 2014.120.2436.0 | RTM | COD | [3014867 FIX: "Remote hardening failure" exception cannot be caught and a potential data loss when you use SQL Server 2014] | 2014-11-27 | 1 | 1 | | -| 12.0.2430.0 | 2014.120.2430.0 | RTM | CU | [2999197 Cumulative update package 4 (CU4) for SQL Server 2014] | 2014-10-21 | 66 | 54 | | -| 12.0.2423.0 | 2014.120.2423.0 | RTM | COD | [3007050 FIX: RTDATA_LIST waits when you run natively stored procedures that encounter expected failures in SQL Server 2014] | 2014-10-22 | | | | -| 12.0.2405.0 | 2014.120.2405.0 | RTM | COD | [2999809 FIX: Poor performance when a query contains table joins in SQL Server 2014] | 2014-09-25 | | | | -| 12.0.2402.0 | 2014.120.2402.0 | RTM | CU | [2984923 Cumulative update package 3 (CU3) for SQL Server 2014] | 2014-08-18 | 40 | 32 | | -| 12.0.2381.0 | 2014.120.2381.0 | RTM | QFE | [2977316 MS14-044: Description of the security update for SQL Server 2014 (QFE)] | 2014-08-12 | 1 | 1 | 602 | -| 12.0.2370.0 | 2014.120.2370.0 | RTM | CU | [2967546 Cumulative update package 2 (CU2) for SQL Server 2014] | 2014-06-27 | 52 | 48 | | -| 12.0.2342.0 | 2014.120.2342.0 | RTM | CU | [2931693 Cumulative update package 1 (CU1) for SQL Server 2014] | 2014-04-21 | 121 | 114 | | -| 12.0.2271.0 | 2014.120.2271.0 | RTM | GDR | [TLS 1.2 support for SQL Server 2014 RTM] | 2016-01-29 | 3 | 3 | | -| 12.0.2269.0 | 2014.120.2269.0 | RTM | GDR | [3045324 MS15-058: Description of the security update for SQL Server 2014 GDR: July 14, 2015] | 2015-07-14 | 2 | 2 | 388 | -| 12.0.2254.0 | 2014.120.2254.0 | RTM | GDR | [2977315 MS14-044: Description of the security update for SQL Server 2014 (GDR)] | 2014-08-12 | 1 | 1 | 183 | -| 12.0.2000.8 | 2014.120.2000.8 | RTM | RTM | SQL Server 2014 RTM | 2014-04-01 | - | - | | -| 12.0.1524.0 | 2014.120.1524.0 | CTP | CTP | Microsoft SQL Server 2014 Community Technology Preview 2 (CTP2) | 2013-10-15 | | | | -| 11.0.9120.0 | 2013.110.9120.0 | CTP | CTP | Microsoft SQL Server 2014 Community Technology Preview 1 (CTP1) | 2013-06-25 | | | | - -[4505422 Security update for SQL Server 2014 SP3 CU3 GDR: July 9, 2019]:https://support.microsoft.com/help/4505422 -[4491539 Cumulative Update 3 for SQL Server 2014 SP3]:https://support.microsoft.com/help/4491539 -[4482960 Cumulative Update 2 for SQL Server 2014 SP3]:https://support.microsoft.com/help/4482960 -[4470220 Cumulative Update 1 for SQL Server 2014 SP3]:https://support.microsoft.com/help/4470220 -[4505218 Security update for SQL Server 2014 SP3 GDR: July 9, 2019]:https://support.microsoft.com/help/4505218 -[4022619 SQL Server 2014 Service Pack 3 release information]:https://support.microsoft.com/help/4022619 -[4505419 Security update for SQL Server 2014 SP2 CU17 GDR: July 9, 2019]:https://support.microsoft.com/help/4505419 -[4491540 Cumulative Update 17 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4491540 -[4482967 Cumulative Update 16 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4482967 -[4469137 Cumulative Update 15 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4469137 -[4459860 Cumulative Update 14 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4459860 -[4456287 Cumulative Update 13 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4456287 -[4130489 Cumulative Update 12 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4130489 -[4077063 Cumulative Update 11 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4077063 -[4052725 Cumulative Update 10 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4052725/cumulative-update-10-for-sql-server-2014-sp2 -[4055557 Cumulative Update 9 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4055557/cumulative-update-9-for-sql-server-2014-sp2 -[4037356 Cumulative Update 8 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4037356/cumulative-update-8-for-sql-server-2014-sp2 -[4032541 Cumulative Update 7 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4032541/cumulative-update-7-for-sql-server-2014-sp2 -[4019094 Cumulative Update 6 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4019094/cumulative-update-6-for-sql-server-2014-sp2 -[4013098 Cumulative Update 5 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4013098/cumulative-update-5-for-sql-server-2014-sp2 -[4010394 Cumulative Update 4 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4010394/cumulative-update-4-for-sql-server-2014-sp2 -[3204388 Cumulative update 3 for SQL Server 2014 SP2]:https://support.microsoft.com/help/3204388 -[3194718 MS16-136: Description of the security update for SQL Server 2014 Service Pack 2 CU: November 8, 2016]:https://support.microsoft.com/help/3194718 -[3188778 Cumulative update 2 for SQL Server 2014 SP2]:https://support.microsoft.com/help/3188778 -[3178925 Cumulative update 1 for SQL Server 2014 SP2]:https://support.microsoft.com/help/3178925 -[4505217 Security update for SQL Server 2014 SP2 GDR: July 9, 2019]:https://support.microsoft.com/help/4505217 -[3194714 MS16-136: Description of the security update for SQL Server 2014 Service Pack 2 GDR: November 8, 2016]:https://support.microsoft.com/en-us/help/3194714/ -[3171021 SQL Server 2014 Service Pack 2 release information]:https://support.microsoft.com/help/3171021 -[4019099 Cumulative Update 13 for SQL Server 2014 SP1]:https://support.microsoft.com/help/4019099/cumulative-update-13-for-sql-server-2014-sp1 -[4017793 Cumulative Update 12 for SQL Server 2014 SP1]:https://support.microsoft.com/help/4017793/cumulative-update-12-for-sql-server-2014-sp1 -[4010392 Cumulative Update 11 for SQL Server 2014 SP1]:https://support.microsoft.com/help/4010392/cumulative-update-11-for-sql-server-2014-sp1 -[3204399 Cumulative update package 10 for SQL Server 2014 Service Pack 1]:https://support.microsoft.com/help/3204399 -[3194722 MS16-136: Description of the security update for SQL Server 2014 Service Pack 1 CU: November 8, 2016]:https://support.microsoft.com/en-us/kb/3194722 -[3186964 Cumulative update 9 for SQL Server 2014 SP1]:https://support.microsoft.com/help/3186964 -[4057120 Security update for SQL Server 2014 Service Pack 2 GDR: January 16, 2018]:https://support.microsoft.com/help/4057120 -[4019093 Description of the security update for SQL Server 2014 Service Pack 2 GDR: August 8, 2017]:https://support.microsoft.com/help/4019093/ -[3174038 Cumulative update 8 for SQL Server 2014 SP1]:https://support.microsoft.com/en-us/kb/3174038 -[3174370 COD Hotfix A memory leak occurs when you use Azure Storage in SQL Server 2014]:https://support.microsoft.com/en-us/kb/3174370 -[3162659 Cumulative Update 7 for SQL Server 2014 SP1]:https://support.microsoft.com/en-us/kb/3162659 -[3167392 Cumulative Update 6 for SQL Server 2014 Service Pack 1]:https://support.microsoft.com/en-us/kb/3167392 -[3144524 Cumulative update 6 for SQL Server 2014 SP1 (deprecated)]:https://support.microsoft.com/en-us/kb/3144524 -[3130926 Cumulative Update 5 (CU5) for SQL Server 2014 Service Pack 1]:https://support.microsoft.com/en-us/kb/3130926 -[3130999 On-demand hotfix update package for SQL Server 2014 Service Pack 1 Cumulative Update 4]:https://support.microsoft.com/en-us/kb/3130999 -[3106660 Cumulative update package 4 (CU4) for SQL Server 2014 Service Pack 1]:https://support.microsoft.com/en-us/kb/3106660 -[3119148 FIX: Error 3203 occurs and a SQL Server 2014 backup job can't restart after a network failure]:http://support.microsoft.com/kb/3119148 -[3097972 FIX: Error when your stored procedure calls another stored procedure on a linked server in SQL Server 2014]:http://support.microsoft.com/kb/3097972 -[3094221 Cumulative update package 3 (CU3) for SQL Server 2014 Service Pack 1]:http://support.microsoft.com/kb/3094221 -[3075950 Cumulative update package 2 (CU2) for SQL Server 2014 Service Pack 1]:http://support.microsoft.com/kb/3075950 -[3078973 An on-demand hotfix update package is available for SQL Server 2014 SP1]:http://support.microsoft.com/kb/3078973 -[3067839 Cumulative update package 1 (CU1) for SQL Server 2014 Service Pack 1]:http://support.microsoft.com/kb/3067839 -[4019091 Security update for SQL Server 2014 Service Pack 1 GDR: August 8, 2017]:http://support.microsoft.com/help/4019091 -[3194720 MS16-136: Description of the security update for SQL Server 2014 Service Pack 1 GDR: November 8, 2016]:https://support.microsoft.com/en-us/kb/3194720 -[3098852 SP1 GDR TLS 1.2 Update]:https://support.microsoft.com/en-us/hotfix/kbhotfix?kbnum=3098852&kbln=en-us -[3070446 MS15-058: Description of the nonsecurity update for SQL Server 2014 Service Pack 1 GDR: July 14, 2015]:https://support.microsoft.com/en-us/kb/3070446 -[3058865 SQL Server 2014 Service Pack 1 release information]:https://support.microsoft.com/en-us/kb/3058865 -[3158271 Cumulative update package 14 (CU14) for SQL Server 2014]:https://support.microsoft.com/en-us/kb/3158271 -[3144517 Cumulative update package 13 (CU13) for SQL Server 2014]:https://support.microsoft.com/en-us/kb/3144517 -[3130923 Cumulative update package 12 (CU12) for SQL Server 2014]:https://support.microsoft.com/en-us/kb/3130923 -[3106659 Cumulative update package 11 (CU11) for SQL Server 2014]:http://support.microsoft.com/kb/3106659 -[3094220 Cumulative update package 10 (CU10) for SQL Server 2014]:http://support.microsoft.com/kb/3094220 -[3075949 Cumulative update package 9 (CU9) for SQL Server 2014]:http://support.microsoft.com/kb/3075949 -[3045323 MS15-058: Description of the security update for SQL Server 2014 QFE: July 14, 2015]:https://support.microsoft.com/en-us/kb/3045323 -[3067836 Cumulative update package 8 (CU8) for SQL Server 2014]:http://support.microsoft.com/kb/3067836 -[3063054 Update enables Premium Storage support for Data files on Azure Storage and resolves backup failures]:http://support.microsoft.com/kb/3063054 -[3052167 FIX: Error 1205 when you execute parallel query that contains outer join operators in SQL Server 2014]:http://support.microsoft.com/kb/3052167 -[2999809 FIX: Poor performance when a query contains table joins in SQL Server 2014]:http://support.microsoft.com/kb/2999809 -[3058512 FIX: Unpivot Transformation task changes null to zero or empty strings in SSIS 2014]:http://support.microsoft.com/kb/3058512 -[3046038 Cumulative update package 7 (CU7) for SQL Server 2014]:http://support.microsoft.com/kb/3046038 -[3048751 FIX: Deadlock cannot be resolved automatically when you run a SELECT query that can result in a parallel batch-mode scan]:http://support.microsoft.com/kb/3048751 -[3043788 An on-demand hotfix update package is available for SQL Server 2014]:http://support.microsoft.com/kb/3043788 -[3031047 Cumulative update package 6 (CU6) for SQL Server 2014]:http://support.microsoft.com/kb/3031047 -[3034679 FIX: AlwaysOn availability groups are reported as NOT SYNCHRONIZING]:http://support.microsoft.com/kb/3034679 -[3032087 FIX: Cannot show requested dialog after you connect to the latest SQL Database Update V12 (preview) with SQL Server 2014]:http://support.microsoft.com/kb/3032087 -[3024815 Large query compilation waits on RESOURCE_SEMAPHORE_QUERY_COMPILE in SQL Server 2014]:http://support.microsoft.com/kb/3024815 -[3011055 Cumulative update package 5 (CU5) for SQL Server 2014]:http://support.microsoft.com/kb/3011055 -[3014867 FIX: "Remote hardening failure" exception cannot be caught and a potential data loss when you use SQL Server 2014]:http://support.microsoft.com/kb/3014867 -[2999197 Cumulative update package 4 (CU4) for SQL Server 2014]:http://support.microsoft.com/kb/2999197 -[3007050 FIX: RTDATA_LIST waits when you run natively stored procedures that encounter expected failures in SQL Server 2014]:http://support.microsoft.com/kb/3007050 -[2999809 FIX: Poor performance when a query contains table joins in SQL Server 2014]:http://support.microsoft.com/kb/2999809 -[2984923 Cumulative update package 3 (CU3) for SQL Server 2014]:http://support.microsoft.com/kb/2984923 -[2977316 MS14-044: Description of the security update for SQL Server 2014 (QFE)]:http://support.microsoft.com/kb/2977316 -[2967546 Cumulative update package 2 (CU2) for SQL Server 2014]:http://support.microsoft.com/kb/2967546 -[2931693 Cumulative update package 1 (CU1) for SQL Server 2014]:http://support.microsoft.com/kb/2931693 -[TLS 1.2 support for SQL Server 2014 RTM]:https://support.microsoft.com/en-us/hotfix/kbhotfix?kbnum=3098856&kbln=en-us -[3045324 MS15-058: Description of the security update for SQL Server 2014 GDR: July 14, 2015]:https://support.microsoft.com/en-us/kb/3045324 -[2977315 MS14-044: Description of the security update for SQL Server 2014 (GDR)]:http://support.microsoft.com/kb/2977315 +| Build | File version | Branch | Type | Info | KB | Description/Link | Release Date | Fixes | Public | Size, Mb | +|--------------|------------------|--------|------|-----------------------------------|---------|----------------------------------------------------------------------------------------------------------------------------|--------------|------:|-------:|---------:| +| 12.0.6433.1 | 2014.120.6433.1 | SP3 | GDR | CVE-2021-1636 | 4583462 | [Description of the security update for SQL Server 2014 SP3 CU4: January 12, 2021] | 2021-01-12 | 1 | 1 | 596 | +| 12.0.6372.1 | 2014.120.6372.1 | SP3 | GDR | CVE-2020-0618 | 4535288 | [Security update for SQL Server 2014 SP3 CU4: February 11, 2020] | 2020-02-11 | 1 | 1 | 604 | +| 12.0.6329.1 | 2014.120.6329.1 | SP3 | CU | **Latest CU SP3** | 4500181 | [Cumulative Update 4 for SQL Server 2014 SP3] | 2019-07-29 | 25 | 19 | 658 | +| 12.0.6293.0 | 2014.120.6293.0 | SP3 | GDR | CVE-2019-1068 | 4505422 | [Security update for SQL Server 2014 SP3 CU3 GDR: July 9, 2019] | 2019-07-09 | 1 | 1 | 656 | +| 12.0.6259.0 | 2014.120.6259.0 | SP3 | CU | | 4491539 | [Cumulative Update 3 for SQL Server 2014 SP3] | 2019-04-16 | 4 | 4 | 656 | +| 12.0.6214.1 | 2014.120.6214.1 | SP3 | CU | | 4482960 | [Cumulative Update 2 for SQL Server 2014 SP3] | 2019-02-19 | 5 | 5 | 602 | +| 12.0.6205.1 | 2014.120.6205.1 | SP3 | CU | | 4470220 | [Cumulative Update 1 for SQL Server 2014 SP3] | 2018-12-12 | 16 | 13 | 601 | +| 12.0.6118.4 | 2014.120.6118.4 | SP3 | GDR | CVE-2020-0618 | 4532095 | [Security update for SQL Server 2014 SP3 GDR: February 11, 2020] | 2020-02-11 | 1 | 1 | 656 | +| 12.0.6108.1 | 2014.120.6108.1 | SP3 | GDR | CVE-2019-1068 | 4505218 | [Security update for SQL Server 2014 SP3 GDR: July 9, 2019] | 2019-07-09 | 1 | 1 | 654 | +| 12.0.6024.0 | 2014.120.6024.0 | SP3 | SP | | 4022619 | [SQL Server 2014 Service Pack 3 release information] | 2018-10-30 | 31 | 6 | 791 | +| 12.0.5687.1 | 2014.120.5687.1 | SP2 | CU | **Latest CU SP2** | 4500180 | [Cumulative Update 18 for SQL Server 2014 SP2] | 2019-07-29 | 7 | 4 | 681 | +| 12.0.5659.1 | 2014.120.5659.1 | SP2 | GDR | CVE-2019-1068 | 4505419 | [Security update for SQL Server 2014 SP2 CU17 GDR: July 9, 2019] | 2019-07-09 | 1 | 1 | 679 | +| 12.0.5632.1 | 2014.120.5632.1 | SP2 | CU | | 4491540 | [Cumulative Update 17 for SQL Server 2014 SP2] | 2019-04-16 | 3 | 3 | 678 | +| 12.0.5626.1 | 2014.120.5626.1 | SP2 | CU | | 4482967 | [Cumulative Update 16 for SQL Server 2014 SP2] | 2019-02-19 | 3 | 3 | 678 | +| 12.0.5605.1 | 2014.120.5605.1 | SP2 | SP | | 4469137 | [Cumulative Update 15 for SQL Server 2014 SP2] | 2018-12-12 | 8 | 7 | 679 | +| 12.0.5600.1 | 2014.120.5600.1 | SP2 | CU | | 4459860 | [Cumulative Update 14 for SQL Server 2014 SP2] | 2018-10-15 | 8 | 6 | 678 | +| 12.0.5590.1 | 2014.120.5590.1 | SP2 | CU | | 4456287 | [Cumulative Update 13 for SQL Server 2014 SP2] | 2018-08-27 | 4 | 4 | 679 | +| 12.0.5589.7 | 2014.120.5589.7 | SP2 | CU | | 4130489 | [Cumulative Update 12 for SQL Server 2014 SP2] | 2018-06-18 | 27 | 16 | 678 | +| 12.0.5579.0 | 2014.120.5579.0 | SP2 | CU | | 4077063 | [Cumulative Update 11 for SQL Server 2014 SP2] | 2018-03-19 | 12 | 10 | 677 | +| 12.0.5571.0 | 2014.120.5571.0 | SP2 | CU | | 4052725 | [Cumulative Update 10 for SQL Server 2014 SP2] | 2018-01-16 | 5 | 4 | 676 | +| 12.0.5563.0 | 2014.120.5563.0 | SP2 | CU | | 4055557 | [Cumulative Update 9 for SQL Server 2014 SP2] | 2017-12-18 | 8 | 7 | 540 | +| 12.0.5557.0 | 2014.120.5557.0 | SP2 | CU | | 4037356 | [Cumulative Update 8 for SQL Server 2014 SP2] | 2017-10-17 | 15 | 8 | 539 | +| 12.0.5556.0 | 2014.120.5556.0 | SP2 | CU | | 4032541 | [Cumulative Update 7 for SQL Server 2014 SP2] | 2017-08-28 | 15 | 8 | 539 | +| 12.0.5553.0 | 2014.120.5553.0 | SP2 | CU | | 4019094 | [Cumulative Update 6 for SQL Server 2014 SP2] | 2017-08-08 | 29 | 29 | 539 | +| 12.0.5546.0 | 2014.120.5546.0 | SP2 | CU | | 4013098 | [Cumulative Update 5 for SQL Server 2014 SP2] | 2017-04-18 | 24 | 21 | 557 | +| 12.0.5540.0 | 2014.120.5540.0 | SP2 | CU | | 4010394 | [Cumulative Update 4 for SQL Server 2014 SP2] | 2017-02-21 | 30 | 27 | 555 | +| 12.0.5538.0 | 2014.120.5538.0 | SP2 | CU | | 3204388 | [Cumulative update 3 for SQL Server 2014 SP2] | 2016-12-28 | 44 | 39 | 555 | +| 12.0.5532.0 | 2014.120.5532.0 | SP2 | CU | | 3194718 | [MS16-136: Description of the security update for SQL Server 2014 Service Pack 2 CU: November 8, 2016] | 2016-11-08 | 1 | 1 | 551 | +| 12.0.5522.0 | 2014.120.5522.0 | SP2 | CU | | 3188778 | [Cumulative update 2 for SQL Server 2014 SP2] | 2016-10-18 | 18 | 18 | 550 | +| 12.0.5511.0 | 2014.120.5511.0 | SP2 | CU | | 3178925 | [Cumulative update 1 for SQL Server 2014 SP2] | 2016-08-24 | 45 | 36 | 556 | +| 12.0.5223.6 | 2014.120.5223.6 | SP2 | GDR | CVE-2019-1068 | 4505217 | [Security update for SQL Server 2014 SP2 GDR: July 9, 2019] | 2019-07-09 | 1 | 1 | 588 | +| 12.0.5214.6 | 2014.120.5214.6 | SP2 | GDR | CVE-2017-5715,2017-5753,2017-5754 | 4057120 | [Security update for SQL Server 2014 Service Pack 2 GDR: January 16, 2018] | 2018-01-16 | | | 960 | +| 12.0.5207.0 | 2014.120.5207.0 | SP2 | GDR | | 4019093 | [Description of the security update for SQL Server 2014 Service Pack 2 GDR: August 8, 2017] | 2017-08-08 | 1 | 1 | 413 | +| 12.0.5203.0 | 2014.120.5203.0 | SP2 | GDR | | 3194714 | [MS16-136: Description of the security update for SQL Server 2014 Service Pack 2 GDR: November 8, 2016] | 2016-11-08 | 1 | 1 | 463 | +| 12.0.5000.0 | 2014.120.5000.0 | SP2 | SP | | 3171021 | [SQL Server 2014 Service Pack 2 release information] | 2016-07-11 | 133 | 55 | 681 | +| 12.0.5626.1 | 2014.120.5626.1 | SP1 | CU | **Latest CU SP1** | 4482967 | [Cumulative Update 13 for SQL Server 2014 SP1] | 2017-08-08 | 11 | 11 | 577 | +| 12.0.4511.0 | 2014.120.4511.0 | SP1 | CU | | 4017793 | [Cumulative Update 12 for SQL Server 2014 SP1] | 2017-04-17 | 12 | 11 | 573 | +| 12.0.4502.0 | 2014.120.4502.0 | SP1 | CU | | 4010392 | [Cumulative Update 11 for SQL Server 2014 SP1] | 2017-02-21 | 15 | 15 | 571 | +| 12.0.4491.0 | 2014.120.4491.0 | SP1 | CU | | 3204399 | [Cumulative update package 10 for SQL Server 2014 Service Pack 1] | 2016-12-28 | 33 | 27 | 571 | +| 12.0.4487.0 | 2014.120.4487.0 | SP1 | CU | | 3194722 | [MS16-136: Description of the security update for SQL Server 2014 Service Pack 1 CU: November 8, 2016] | 2016-11-08 | 1 | 1 | 569 | +| 12.0.4474.0 | 2014.120.4474.0 | SP1 | CU | | 3186964 | [Cumulative update 9 for SQL Server 2014 SP1] | 2016-10-18 | 14 | 14 | 912 | +| 12.0.4468.0 | 2014.120.4468.0 | SP1 | CU | | 3174038 | [Cumulative update 8 for SQL Server 2014 SP1] | 2016-08-16 | 38 | 38 | 929 | +| 12.0.4463.0 | 2014.120.4463.0 | SP1 | COD | | 3174370 | [COD Hotfix A memory leak occurs when you use Azure Storage in SQL Server 2014] | 2016-08-04 | 1 | 1 | | +| 12.0.4459.0 | 2014.120.4459.0 | SP1 | CU | | 3162659 | [Cumulative Update 7 for SQL Server 2014 SP1] | 2016-06-20 | 35 | 33 | 928 | +| 12.0.4457.0 | 2014.120.4457.0 | SP1 | CU | **Refresh** | 3167392 | [Cumulative Update 6 for SQL Server 2014 Service Pack 1] | 2016-05-31 | 44 | 43 | 927 | +| 12.0.4452.0 | 2014.120.4452.0 | SP1 | COD | **Withdrawn** | 3147825 | 3147825 COD Hotfix | 2016-04-05 | 1 | 1 | | +| 12.0.4449.0 | 2014.120.4449.0 | SP1 | CU | **Withdrawn** | 3144524 | [Cumulative update 6 for SQL Server 2014 SP1 (deprecated)] | 2016-04-18 | | | | +| 12.0.4439.1 | 2014.120.4439.1 | SP1 | CU | | 3130926 | [Cumulative Update 5 (CU5) for SQL Server 2014 Service Pack 1] | 2016-02-22 | 20 | 20 | 924 | +| 12.0.4437.0 | 2014.120.4437.0 | SP1 | COD | | 3130999 | [On-demand hotfix update package for SQL Server 2014 Service Pack 1 Cumulative Update 4] | 2016-02-05 | 2 | 2 | | +| 12.0.4436.0 | 2014.120.4436.0 | SP1 | CU | | 3106660 | [Cumulative update package 4 (CU4) for SQL Server 2014 Service Pack 1] | 2015-12-21 | 34 | 34 | | +| 12.0.4433.0 | 2014.120.4433.0 | SP1 | COD | | 3119148 | [FIX: Error 3203 occurs and a SQL Server 2014 backup job can't restart after a network failure] | 2015-12-09 | 1 | 1 | | +| 12.0.4432.0 | 2014.120.4432.0 | SP1 | COD | | 3097972 | [FIX: Error when your stored procedure calls another stored procedure on a linked server in SQL Server 2014] | 2015-11-19 | 3 | 3 | | +| 12.0.4427.24 | 2014.120.4427.24 | SP1 | CU | | 3094221 | [Cumulative update package 3 (CU3) for SQL Server 2014 Service Pack 1] | 2015-10-21 | 40 | 36 | | +| 12.0.4422.0 | 2014.120.4422.0 | SP1 | CU | | 3075950 | [Cumulative update package 2 (CU2) for SQL Server 2014 Service Pack 1] | 2015-08-17 | 51 | 46 | | +| 12.0.4419.0 | 2014.120.4419.0 | SP1 | COD | | 3078973 | [An on-demand hotfix update package is available for SQL Server 2014 SP1] | 2015-07-24 | 13 | 13 | | +| 12.0.4416.0 | 2014.120.4416.0 | SP1 | CU | | 3067839 | [Cumulative update package 1 (CU1) for SQL Server 2014 Service Pack 1] | 2015-06-22 | 141 | 121 | | +| 12.0.4237.0 | 2014.120.4237.0 | SP1 | GDR | | 4019091 | [Security update for SQL Server 2014 Service Pack 1 GDR: August 8, 2017] | 2017-08-08 | 1 | 1 | 391 | +| 12.0.4232.0 | 2014.120.4232.0 | SP1 | CU | | 3194720 | [MS16-136: Description of the security update for SQL Server 2014 Service Pack 1 GDR: November 8, 2016] | 2016-11-08 | 1 | 1 | 371 | +| 12.0.4219.0 | 2014.120.4219.0 | SP1 | GDR | | 3098852 | [SP1 GDR TLS 1.2 Update] | 2016-01-29 | | | | +| 12.0.4213.0 | 2014.120.4213.0 | SP1 | GDR | | 3070446 | [MS15-058: Description of the nonsecurity update for SQL Server 2014 Service Pack 1 GDR: July 14, 2015] | 2015-07-14 | | | 381 | +| 12.0.4100.1 | 2014.120.4100.1 | SP1 | SP | | 3058865 | [SQL Server 2014 Service Pack 1 release information] | 2015-05-14 | 29 | 29 | 1025 | +| 12.0.4050.0 | 2014.120.4050.0 | SP1 | SP | | | SQL Server 2014 Service Pack 1 (SP1) (initial) | 2015-04-15 | | | | +| 12.0.2569.0 | 2014.120.2569.0 | RTM | CU | **Latest CU RTM** | 3158271 | [Cumulative update package 14 (CU14) for SQL Server 2014] | 2016-06-20 | 21 | 20 | 1049 | +| 12.0.2568.0 | 2014.120.2568.0 | RTM | CU | | 3144517 | [Cumulative update package 13 (CU13) for SQL Server 2014] | 2016-04-18 | 30 | 30 | 1047 | +| 12.0.2564.0 | 2014.120.2564.0 | RTM | CU | | 3130923 | [Cumulative update package 12 (CU12) for SQL Server 2014] | 2016-02-22 | 7 | 7 | 1045 | +| 12.0.2560.0 | 2014.120.2550.0 | RTM | CU | | 3106659 | [Cumulative update package 11 (CU11) for SQL Server 2014] | 2015-12-21 | 19 | 19 | | +| 12.0.2556.4 | 2014.120.2556.4 | RTM | CU | | 3094220 | [Cumulative update package 10 (CU10) for SQL Server 2014] | 2015-10-20 | 33 | 30 | | +| 12.0.2553.0 | 2014.120.2553.0 | RTM | CU | | 3075949 | [Cumulative update package 9 (CU9) for SQL Server 2014] | 2015-08-17 | 31 | 30 | | +| 12.0.2548.0 | 2014.120.2548.0 | RTM | CU | | 3045323 | [MS15-058: Description of the security update for SQL Server 2014 QFE: July 14, 2015] | 2015-07-14 | 1 | 1 | 1038 | +| 12.0.2546.0 | 2014.120.2546.0 | RTM | CU | | 3067836 | [Cumulative update package 8 (CU8) for SQL Server 2014] | 2015-06-22 | 40 | 38 | | +| 12.0.2506.0 | 2014.120.2506.0 | RTM | COD | | 3063054 | [Update enables Premium Storage support for Data files on Azure Storage and resolves backup failures] | 2015-05-19 | 1 | 1 | | +| 12.0.2505.0 | 2014.120.2505.0 | RTM | COD | | 3052167 | [FIX: Error 1205 when you execute parallel query that contains outer join operators in SQL Server 2014] | 2015-05-19 | 1 | 1 | | +| 12.0.2504.0 | 2014.120.2504.0 | RTM | COD | | 2999809 | [FIX: Poor performance when a query contains table joins in SQL Server 2014] | 2015-05-05 | 2 | 2 | | +| 12.0.2504.0 | 2014.120.2504.0 | RTM | COD | | 3058512 | [FIX: Unpivot Transformation task changes null to zero or empty strings in SSIS 2014] | 2015-05-05 | | | | +| 12.0.2495.0 | 2014.120.2495.0 | RTM | CU | | 3046038 | [Cumulative update package 7 (CU7) for SQL Server 2014] | 2015-04-23 | 47 | 41 | | +| 12.0.2488.0 | 2014.120.2488.0 | RTM | COD | | 3048751 | [FIX: Deadlock cannot be resolved automatically when you run a SELECT query that can result in a parallel batch-mode scan] | 2015-04-01 | 1 | 1 | | +| 12.0.2485.0 | 2014.120.2485.0 | RTM | COD | | 3043788 | [An on-demand hotfix update package is available for SQL Server 2014] | 2015-03-16 | 1 | 1 | | +| 12.0.2480.0 | 2014.120.2480.0 | RTM | CU | | 3031047 | [Cumulative update package 6 (CU6) for SQL Server 2014] | 2015-02-16 | 64 | 55 | | +| 12.0.2474.0 | 2014.120.2474.0 | RTM | COD | | 3034679 | [FIX: AlwaysOn availability groups are reported as NOT SYNCHRONIZING] | 2015-02-04 | 1 | 1 | | +| 12.0.2472.0 | 2014.120.2472.0 | RTM | COD | | 3032087 | [FIX: Cannot show requested dialog after you connect to the latest SQL Database Update V12 (preview) with SQL Server 2014] | 2015-01-28 | 1 | 1 | | +| 12.0.2464.0 | 2014.120.2464.0 | RTM | COD | | 3024815 | [Large query compilation waits on RESOURCE_SEMAPHORE_QUERY_COMPILE in SQL Server 2014] | 2015-01-05 | 1 | 1 | | +| 12.0.2456.0 | 2014.120.2456.0 | RTM | CU | | 3011055 | [Cumulative update package 5 (CU5) for SQL Server 2014] | 2014-12-18 | 54 | 48 | | +| 12.0.2436.0 | 2014.120.2436.0 | RTM | COD | | 3014867 | [FIX: "Remote hardening failure" exception cannot be caught and a potential data loss when you use SQL Server 2014] | 2014-11-27 | 1 | 1 | | +| 12.0.2430.0 | 2014.120.2430.0 | RTM | CU | | 2999197 | [Cumulative update package 4 (CU4) for SQL Server 2014] | 2014-10-21 | 66 | 54 | | +| 12.0.2423.0 | 2014.120.2423.0 | RTM | COD | | 3007050 | [FIX: RTDATA_LIST waits when you run natively stored procedures that encounter expected failures in SQL Server 2014] | 2014-10-22 | | | | +| 12.0.2405.0 | 2014.120.2405.0 | RTM | COD | | 2999809 | [FIX: Poor performance when a query contains table joins in SQL Server 2014] | 2014-09-25 | | | | +| 12.0.2402.0 | 2014.120.2402.0 | RTM | CU | | 2984923 | [Cumulative update package 3 (CU3) for SQL Server 2014] | 2014-08-18 | 40 | 32 | | +| 12.0.2381.0 | 2014.120.2381.0 | RTM | QFE | | 2977316 | [MS14-044: Description of the security update for SQL Server 2014 (QFE)] | 2014-08-12 | 1 | 1 | 602 | +| 12.0.2370.0 | 2014.120.2370.0 | RTM | CU | | 2967546 | [Cumulative update package 2 (CU2) for SQL Server 2014] | 2014-06-27 | 52 | 48 | | +| 12.0.2342.0 | 2014.120.2342.0 | RTM | CU | | 2931693 | [Cumulative update package 1 (CU1) for SQL Server 2014] | 2014-04-21 | 121 | 114 | | +| 12.0.2271.0 | 2014.120.2271.0 | RTM | GDR | | | [TLS 1.2 support for SQL Server 2014 RTM] | 2016-01-29 | 3 | 3 | | +| 12.0.2269.0 | 2014.120.2269.0 | RTM | GDR | | 3045324 | [MS15-058: Description of the security update for SQL Server 2014 GDR: July 14, 2015] | 2015-07-14 | 2 | 2 | 388 | +| 12.0.2254.0 | 2014.120.2254.0 | RTM | GDR | | 2977315 | [MS14-044: Description of the security update for SQL Server 2014 (GDR)] | 2014-08-12 | 1 | 1 | 183 | +| 12.0.2000.8 | 2014.120.2000.8 | RTM | RTM | | | SQL Server 2014 RTM | 2014-04-01 | | | | +| 12.0.1524.0 | 2014.120.1524.0 | CTP | CTP | | | Microsoft SQL Server 2014 Community Technology Preview 2 (CTP2) | 2013-10-15 | | | | +| 11.0.9120.0 | 2013.110.9120.0 | CTP | CTP | | | Microsoft SQL Server 2014 Community Technology Preview 1 (CTP1) | 2013-06-25 | | | | + +[Description of the security update for SQL Server 2014 SP3 CU4: January 12, 2021]:https://support.microsoft.com/help/4583462 +[Security update for SQL Server 2014 SP3 CU4: February 11, 2020]:https://support.microsoft.com/help/4535288 +[Cumulative Update 4 for SQL Server 2014 SP3]:https://support.microsoft.com/help/4500181 +[Security update for SQL Server 2014 SP3 CU3 GDR: July 9, 2019]:https://support.microsoft.com/help/4505422 +[Cumulative Update 3 for SQL Server 2014 SP3]:https://support.microsoft.com/help/4491539 +[Cumulative Update 2 for SQL Server 2014 SP3]:https://support.microsoft.com/help/4482960 +[Cumulative Update 1 for SQL Server 2014 SP3]:https://support.microsoft.com/help/4470220 +[Security update for SQL Server 2014 SP3 GDR: February 11, 2020]:https://support.microsoft.com/help/4532095 +[Security update for SQL Server 2014 SP3 GDR: July 9, 2019]:https://support.microsoft.com/help/4505218 +[SQL Server 2014 Service Pack 3 release information]:https://support.microsoft.com/help/4022619 +[Cumulative Update 18 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4500180 +[Security update for SQL Server 2014 SP2 CU17 GDR: July 9, 2019]:https://support.microsoft.com/help/4505419 +[Cumulative Update 17 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4491540 +[Cumulative Update 16 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4482967 +[Cumulative Update 15 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4469137 +[Cumulative Update 14 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4459860 +[Cumulative Update 13 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4456287 +[Cumulative Update 12 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4130489 +[Cumulative Update 11 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4077063 +[Cumulative Update 10 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4052725/cumulative-update-10-for-sql-server-2014-sp2 +[Cumulative Update 9 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4055557/cumulative-update-9-for-sql-server-2014-sp2 +[Cumulative Update 8 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4037356/cumulative-update-8-for-sql-server-2014-sp2 +[Cumulative Update 7 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4032541/cumulative-update-7-for-sql-server-2014-sp2 +[Cumulative Update 6 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4019094/cumulative-update-6-for-sql-server-2014-sp2 +[Cumulative Update 5 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4013098/cumulative-update-5-for-sql-server-2014-sp2 +[Cumulative Update 4 for SQL Server 2014 SP2]:https://support.microsoft.com/help/4010394/cumulative-update-4-for-sql-server-2014-sp2 +[Cumulative update 3 for SQL Server 2014 SP2]:https://support.microsoft.com/help/3204388 +[MS16-136: Description of the security update for SQL Server 2014 Service Pack 2 CU: November 8, 2016]:https://support.microsoft.com/help/3194718 +[Cumulative update 2 for SQL Server 2014 SP2]:https://support.microsoft.com/help/3188778 +[Cumulative update 1 for SQL Server 2014 SP2]:https://support.microsoft.com/help/3178925 +[Security update for SQL Server 2014 SP2 GDR: July 9, 2019]:https://support.microsoft.com/help/4505217 +[MS16-136: Description of the security update for SQL Server 2014 Service Pack 2 GDR: November 8, 2016]:https://support.microsoft.com/help/3194714/ +[SQL Server 2014 Service Pack 2 release information]:https://support.microsoft.com/help/3171021 +[Cumulative Update 13 for SQL Server 2014 SP1]:https://support.microsoft.com/help/4019099/cumulative-update-13-for-sql-server-2014-sp1 +[Cumulative Update 12 for SQL Server 2014 SP1]:https://support.microsoft.com/help/4017793/cumulative-update-12-for-sql-server-2014-sp1 +[Cumulative Update 11 for SQL Server 2014 SP1]:https://support.microsoft.com/help/4010392/cumulative-update-11-for-sql-server-2014-sp1 +[Cumulative update package 10 for SQL Server 2014 Service Pack 1]:https://support.microsoft.com/help/3204399 +[MS16-136: Description of the security update for SQL Server 2014 Service Pack 1 CU: November 8, 2016]:https://support.microsoft.com/kb/3194722 +[Cumulative update 9 for SQL Server 2014 SP1]:https://support.microsoft.com/help/3186964 +[Security update for SQL Server 2014 Service Pack 2 GDR: January 16, 2018]:https://support.microsoft.com/help/4057120 +[Description of the security update for SQL Server 2014 Service Pack 2 GDR: August 8, 2017]:https://support.microsoft.com/help/4019093/ +[Cumulative update 8 for SQL Server 2014 SP1]:https://support.microsoft.com/kb/3174038 +[COD Hotfix A memory leak occurs when you use Azure Storage in SQL Server 2014]:https://support.microsoft.com/kb/3174370 +[Cumulative Update 7 for SQL Server 2014 SP1]:https://support.microsoft.com/kb/3162659 +[Cumulative Update 6 for SQL Server 2014 Service Pack 1]:https://support.microsoft.com/kb/3167392 +[Cumulative update 6 for SQL Server 2014 SP1 (deprecated)]:https://support.microsoft.com/kb/3144524 +[Cumulative Update 5 (CU5) for SQL Server 2014 Service Pack 1]:https://support.microsoft.com/kb/3130926 +[On-demand hotfix update package for SQL Server 2014 Service Pack 1 Cumulative Update 4]:https://support.microsoft.com/kb/3130999 +[Cumulative update package 4 (CU4) for SQL Server 2014 Service Pack 1]:https://support.microsoft.com/kb/3106660 +[FIX: Error 3203 occurs and a SQL Server 2014 backup job can't restart after a network failure]:http://support.microsoft.com/kb/3119148 +[FIX: Error when your stored procedure calls another stored procedure on a linked server in SQL Server 2014]:http://support.microsoft.com/kb/3097972 +[Cumulative update package 3 (CU3) for SQL Server 2014 Service Pack 1]:http://support.microsoft.com/kb/3094221 +[Cumulative update package 2 (CU2) for SQL Server 2014 Service Pack 1]:http://support.microsoft.com/kb/3075950 +[An on-demand hotfix update package is available for SQL Server 2014 SP1]:http://support.microsoft.com/kb/3078973 +[Cumulative update package 1 (CU1) for SQL Server 2014 Service Pack 1]:http://support.microsoft.com/kb/3067839 +[Security update for SQL Server 2014 Service Pack 1 GDR: August 8, 2017]:http://support.microsoft.com/help/4019091 +[MS16-136: Description of the security update for SQL Server 2014 Service Pack 1 GDR: November 8, 2016]:https://support.microsoft.com/kb/3194720 +[SP1 GDR TLS 1.2 Update]:https://support.microsoft.com/hotfix/kbhotfix?kbnum=3098852&kbln=en-us +[MS15-058: Description of the nonsecurity update for SQL Server 2014 Service Pack 1 GDR: July 14, 2015]:https://support.microsoft.com/kb/3070446 +[SQL Server 2014 Service Pack 1 release information]:https://support.microsoft.com/kb/3058865 +[Cumulative update package 14 (CU14) for SQL Server 2014]:https://support.microsoft.com/kb/3158271 +[Cumulative update package 13 (CU13) for SQL Server 2014]:https://support.microsoft.com/kb/3144517 +[Cumulative update package 12 (CU12) for SQL Server 2014]:https://support.microsoft.com/kb/3130923 +[Cumulative update package 11 (CU11) for SQL Server 2014]:http://support.microsoft.com/kb/3106659 +[Cumulative update package 10 (CU10) for SQL Server 2014]:http://support.microsoft.com/kb/3094220 +[Cumulative update package 9 (CU9) for SQL Server 2014]:http://support.microsoft.com/kb/3075949 +[MS15-058: Description of the security update for SQL Server 2014 QFE: July 14, 2015]:https://support.microsoft.com/kb/3045323 +[Cumulative update package 8 (CU8) for SQL Server 2014]:http://support.microsoft.com/kb/3067836 +[Update enables Premium Storage support for Data files on Azure Storage and resolves backup failures]:http://support.microsoft.com/kb/3063054 +[FIX: Error 1205 when you execute parallel query that contains outer join operators in SQL Server 2014]:http://support.microsoft.com/kb/3052167 +[FIX: Poor performance when a query contains table joins in SQL Server 2014]:http://support.microsoft.com/kb/2999809 +[FIX: Unpivot Transformation task changes null to zero or empty strings in SSIS 2014]:http://support.microsoft.com/kb/3058512 +[Cumulative update package 7 (CU7) for SQL Server 2014]:http://support.microsoft.com/kb/3046038 +[FIX: Deadlock cannot be resolved automatically when you run a SELECT query that can result in a parallel batch-mode scan]:http://support.microsoft.com/kb/3048751 +[An on-demand hotfix update package is available for SQL Server 2014]:http://support.microsoft.com/kb/3043788 +[Cumulative update package 6 (CU6) for SQL Server 2014]:http://support.microsoft.com/kb/3031047 +[FIX: AlwaysOn availability groups are reported as NOT SYNCHRONIZING]:http://support.microsoft.com/kb/3034679 +[FIX: Cannot show requested dialog after you connect to the latest SQL Database Update V12 (preview) with SQL Server 2014]:http://support.microsoft.com/kb/3032087 +[Large query compilation waits on RESOURCE_SEMAPHORE_QUERY_COMPILE in SQL Server 2014]:http://support.microsoft.com/kb/3024815 +[Cumulative update package 5 (CU5) for SQL Server 2014]:http://support.microsoft.com/kb/3011055 +[FIX: "Remote hardening failure" exception cannot be caught and a potential data loss when you use SQL Server 2014]:http://support.microsoft.com/kb/3014867 +[Cumulative update package 4 (CU4) for SQL Server 2014]:http://support.microsoft.com/kb/2999197 +[FIX: RTDATA_LIST waits when you run natively stored procedures that encounter expected failures in SQL Server 2014]:http://support.microsoft.com/kb/3007050 +[FIX: Poor performance when a query contains table joins in SQL Server 2014]:http://support.microsoft.com/kb/2999809 +[Cumulative update package 3 (CU3) for SQL Server 2014]:http://support.microsoft.com/kb/2984923 +[MS14-044: Description of the security update for SQL Server 2014 (QFE)]:http://support.microsoft.com/kb/2977316 +[Cumulative update package 2 (CU2) for SQL Server 2014]:http://support.microsoft.com/kb/2967546 +[Cumulative update package 1 (CU1) for SQL Server 2014]:http://support.microsoft.com/kb/2931693 +[TLS 1.2 support for SQL Server 2014 RTM]:https://support.microsoft.com/hotfix/kbhotfix?kbnum=3098856&kbln=en-us +[MS15-058: Description of the security update for SQL Server 2014 GDR: July 14, 2015]:https://support.microsoft.com/kb/3045324 +[MS14-044: Description of the security update for SQL Server 2014 (GDR)]:http://support.microsoft.com/kb/2977315 ## Microsoft SQL Server 2012 Builds -All SQL Server 2014 CU downloads: [Catalog Update Microsoft SQL Server 2012](http://www.catalog.update.microsoft.com/Search.aspx?q=sql%20server%202012) - -| Build | File version | Branch | Type | KB / Description | Release Date | -|---------------|------------------|--------|------|----------------------------------------------------------------------------------------------------------------------------------------|--------------| -| 11.0.77462.6 | 2011.110.7462.6 | SP4 | GDR | [4057116 Security Advisory ADV180002 (GDR)] | 2018-01-12 | -| 11.0.7001.0 | 2011.110.7001.0 | SP4 | SP | [4018073 SQL Server 2012 Service Pack 4 release information] | 2017-10-05 | -| 11.0.6607.3 | 2011.110.6607.3 | SP3 | CU | [4016762 Cumulative Update 10 for SQL Server 2012 SP3] | 2017-08-08 | -| 11.0.6598.0 | 2011.110.6598.0 | SP3 | CU | [4016762 Cumulative Update 9 for SQL Server 2012 SP3] | 2017-05-15 | -| 11.0.6594.0 | 2011.110.6594.0 | SP3 | CU | [4013104 Cumulative Update 8 for SQL Server 2012 SP3] | 2017-03-21 | -| 11.0.6579.0 | 2011.110.6579.0 | SP3 | CU | [3205051 Cumulative Update Package 7 for SQL Server 2012 SP3] | 2017-01-18 | -| 11.0.6567.0 | 2011.110.6567.0 | SP3 | COD | [3194724 MS16-136: Description of the security update for SQL Server 2012 Service Pack 3 CU: November 8, 2016] | 2016-11-17 | -| 11.0.6544.0 | 2011.110.6544.0 | SP3 | CU | [3180915 Cumulative update 5 for SQL Server 2012 Service Pack 3] | 2016-09-20 | -| 11.0.6540.0 | 2011.110.6540.0 | SP3 | CU | [3165264 Cumulative Update 4 for SQL Server 2012 SP3] | 2016-07-18 | -| 11.0.6537.0 | 2011.110.6537.0 | SP3 | CU | [3152635 Cumulative update package 3 for SQL Server 2012 SP3] | 2016-05-16 | -| 11.0.6523.0 | 2011.110.6523.0 | SP3 | CU | [3137746 Cumulative update package 2 for SQL Server 2012 SP3] | 2016-03-21 | -| 11.0.6518.0 | 2011.110.6518.0 | SP3 | CU | [3123299 Cumulative update package 1 for SQL Server 2012 SP3] | 2016-01-19 | -| 11.0.6248.0 | 2011.110.6248.0 | SP3 | GDR | [3194721 MS16-136: Description of the security update for SQL Server 2012 Service Pack 3 GDR: November 8, 2016] | 2016-11-08 | -| 11.0.6216.27 | 2011.110.6216.27 | SP3 | GDR | [3135244 TLS 1.2 support for SQL Server 2012 SP3 GDR] | 2016-01-27 | -| 11.3.6020.0 | 2011.110.6020.0 | SP3 | SP | [3072779 Microsoft SQL Server 2012 Service Pack 3 (SP3)] | 2015-11-21 | -| 11.0.5678.0 | 2011.110.5678.0 | SP2 | CU | [3205054 Cumulative Update 16 for SQL Server 2012 SP2] | 2017-01-18 | -| 11.0.5676.0 | 2011.110.5676.0 | SP2 | CU | [3205416 Cumulative update package 15 (CU15) for SQL Server 2012 Service Pack 2] | 2016-11-17 | -| 11.0.5676.0 | 2011.110.5676.0 | SP2 | COD | [3194725 MS16-136: Description of the security update for SQL Server 2012 Service Pack 2 CU: November 8, 2016] | 2016-11-17 | -| 11.0.5657.0 | 2011.110.5657.0 | SP2 | CU | [3180914 Cumulative Update 14 for SQL Server 2012 SP2] | 2016-09-20 | -| 11.0.5655.0 | 2011.110.5655.0 | SP2 | CU | [3165266 Cumulative Update 13 for SQL Server 2012 SP2] | 2016-07-18 | -| 11.0.5649.0 | 2011.110.5649.0 | SP2 | CU | [3152637 Cumulative update package 12 for SQL Server 2012 SP2] | 2016-05-16 | -| 11.0.5646.2 | 2011.110.5646.2 | SP2 | CU | [3137745 Cumulative update package 11 for SQL Server 2012 SP2] | 2016-03-21 | -| 11.0.5644.2 | 2011.110.5644.2 | SP2 | CU | [3120313 Cumulative update package 10 for SQL Server 2012 SP2] | 2016-01-19 | -| 11.0.5641.0 | 2011.110.5641.0 | SP2 | CU | [3098512 Cumulative update package 9 for SQL Server 2012 SP2] | 2015-11-16 | -| 11.0.5636 | 2011.110.5636.3 | SP2 | COD | [3097636 FIX: Performance decrease when application with connection pooling frequently connects or disconnects in SQL Server] | 2015-09-22 | -| 11.0.5634 | 2011.110.5634.0 | SP2 | CU | [3082561 Cumulative update package 8 (CU8) for SQL Server 2012 Service Pack 2] | 2015-09-21 | -| 11.0.5629 | 2011.110.5629.0 | SP2 | COD | [3087872 FIX: Access violations when you use the FileTable feature in SQL Server 2012] | 2015-08-31 | -| 11.0.5623 | 2011.110.5623.0 | SP2 | CU | [3072100 Cumulative update package 7 (CU7) for SQL Server 2012 Service Pack 2] | 2015-07-20 | -| 11.0.5613 | 2011.110.5613.0 | SP2 | COD | [3045319 MS15-058: Description of the security update for SQL Server 2012 Service Pack 2 QFE: July 14, 2015] | 2015-07-14 | -| 11.0.5592 | 2011.110.5592.0 | SP2 | CU | [3052468 Cumulative update package 6 (CU6) for SQL Server 2012 Service Pack 2] | 2015-05-19 | -| 11.0.5582 | 2011.110.5582.0 | SP2 | CU | [3037255 Cumulative update package 5 (CU5) for SQL Server 2012 Service Pack 2] | 2015-03-16 | -| 11.0.5571 | 2011.110.5571.0 | SP2 | COD | [3034679 FIX: AlwaysOn availability groups are reported as NOT SYNCHRONIZING] | 2015-05-15 | -| 11.0.5569 | 2011.110.5569.0 | SP2 | CU | [3007556 Cumulative update package 4 (CU4) for SQL Server 2012 Service Pack 2] | 2015-01-20 | -| 11.0.5556 | 2011.110.5556.0 | SP2 | CU | [3002049 Cumulative update package 3 (CU3) for SQL Server 2012 Service Pack 2] | 2014-11-17 | -| 11.0.5548 | 2011.110.5548.0 | SP2 | CU | [2983175 Cumulative update package 2 (CU2) for SQL Server 2012 Service Pack 2] | 2014-09-15 | -| 11.0.5532 | 2011.110.5532.0 | SP2 | CU | [2976982 Cumulative update package 1 (CU1) for SQL Server 2012 Service Pack 2] | 2014-07-24 | -| 11.0.5522 | 2011.110.5522.0 | SP2 | COD | [2969896 FIX: Data loss in clustered index occurs when you run online build index in SQL Server 2012 (Hotfix for SQL2012 SP2)] | 2014-06-20 | -| 11.0.5388 | 2012.110.5388.0 | SP2 | GDR | [3194719 MS16-136: Description of the security update for SQL Server 2012 Service Pack 2 GDR: November 8, 2016] | 2016-11-08 | -| 11.0.5352 | 2012.110.5352.0 | SP2 | GDR | [3135244 TLS 1.2 support for SQL Server 2012 SP2 GDR] | 2016-01-27 | -| 11.0.5343 | 2011.110.5343.0 | SP2 | GDR | [3045321 MS15-058: Description of the security update for SQL Server 2012 Service Pack 2 GDR: July 14, 2015] | 2015-07-14 | -| 11.0.5058 | 2011.110.5058.0 | SP2 | SP | [SQL Server 2012 Service Pack 2 (SP2)] | 2014-06-10 | -| 11.0.3513 | 2011.110.3513.0 | SP1 | QFE | [3045317 MS15-058: Description of the security update for SQL Server 2012 SP1 QFE: July 14, 2015] | 2015-07-14 | -| 11.0.3492 | 2011.110.3492.0 | SP1 | CU | [3052476 Cumulative update package 16 (CU16) for SQL Server 2012 Service Pack 1] | 2015-05-18 | -| 11.0.3487 | 2011.110.3487.0 | SP1 | CU | [3038001 Cumulative update package 15 (CU15) for SQL Server 2012 Service Pack 1] | 2015-03-16 | -| 11.0.3486 | 2011.110.3486.0 | SP1 | QFE | [3023636 Cumulative update package 14 (CU14) for SQL Server 2012 Service Pack 1] | 2015-01-19 | -| 11.0.3460 | 2011.110.3460.0 | SP1 | COD | [2977325 MS14-044: Description of the security update for SQL Server 2012 Service Pack 1 (QFE)] | 2014-08-12 | -| 11.0.3482 | 2011.110.3482.0 | SP1 | CU | [3002044 Cumulative update package 13 (CU13) for SQL Server 2012 Service Pack 1] | 2014-11-17 | -| 11.0.3470 | 2011.110.3470.0 | SP1 | CU | [2991533 Cumulative update package 12 (CU12) for SQL Server 2012 Service Pack 1] | 2014-09-15 | -| 11.0.3449 | 2011.110.3449.0 | SP1 | CU | [2975396 Cumulative update package 11 (CU11) for SQL Server 2012 Service Pack 1] | 2014-07-21 | -| 11.0.3437 | 2011.110.3437.0 | SP1 | COD | [2969896 FIX: Data loss in clustered index occurs when you run online build index in SQL Server 2012 (Hotfix for SQL2012 SP1)] | 2014-06-10 | -| 11.0.3431 | 2011.110.3431.0 | SP1 | CU | [2954099 Cumulative update package 10 (CU10) for SQL Server 2012 Service Pack 1] | 2014-05-19 | -| 11.0.3412 | 2011.110.3412.0 | SP1 | CU | [2931078 Cumulative update package 9 (CU9) for SQL Server 2012 Service Pack 1] | 2014-03-18 | -| 11.0.3401 | 2011.110.3401.0 | SP1 | CU | [2917531 Cumulative update package 8 (CU8) for SQL Server 2012 Service Pack 1] | 2014-01-20 | -| 11.0.3393 | 2011.110.3393.0 | SP1 | CU | [2894115 Cumulative update package 7 (CU7) for SQL Server 2012 Service Pack 1] | 2013-11-18 | -| 11.0.3381 | 2011.110.3381.0 | SP1 | CU | [2874879 Cumulative update package 6 (CU6) for SQL Server 2012 Service Pack 1] | 2013-09-16 | -| 11.0.3373 | 2011.110.3373.0 | SP1 | CU | [2861107 Cumulative update package 5 (CU5) for SQL Server 2012 Service Pack 1] | 2013-07-16 | -| 11.0.3368 | 2011.110.3368.0 | SP1 | CU | [2833645 Cumulative update package 4 (CU4) for SQL Server 2012 Service Pack 1] | 2013-05-31 | -| 11.0.3350 | 2011.110.3350.0 | SP1 | COD | [2832017 FIX: You can’t create or open SSIS projects or maintenance plans after you apply Cumulative Update 3 for SQL Server 2012 SP1] | 2013-04-17 | -| 11.0.3349 | 2011.110.3349.0 | SP1 | CU | [2812412 Cumulative update package 3 (CU3) for SQL Server 2012 Service Pack 1] | 2013-03-18 | -| 11.0.3339 | 2011.110.3339.0 | SP1 | CU | [2790947 Cumulative update package 2 (CU2) for SQL Server 2012 Service Pack 1] | 2013-01-25 | -| 11.0.3335 | 2011.110.3335.0 | SP1 | COD | [2800050 FIX: Component installation process fails after you install SQL Server 2012 SP1] | 2013-01-14 | -| 11.0.3321 | 2011.110.3321.0 | SP1 | CU | [2765331 Cumulative update package 1 (CU1) for SQL Server 2012 Service Pack 1] | 2012-11-20 | -| 11.0.3156 | 2011.110.3156.0 | SP1 | COD | [3045318 MS15-058: Description of the security update for SQL Server 2012 SP1 GDR: July 14, 2015] | 2015-07-14 | -| 11.0.3153 | 2011.110.3153.0 | SP1 | GDR | [2977326 MS14-044: Description of the security update for SQL Server 2012 Service Pack 1 (GDR)] | 2014-08-12 | -| 11.0.3128 | 2011.110.3128.0 | SP1 | COD | [2793634 Windows Installer starts repeatedly after you install SQL Server 2012 SP1] | 2013-01-03 | -| 11.0.3000 | 2011.110.3000.0 | SP1 | SP | [SQL Server 2012 Service Pack 1 (SP1)] | 2012-11-06 | -| 11.0.2845 | 2011.110.2845.0 | SP1 | CTP | SQL Server 2012 Service Pack 1 Customer Technology Preview 4 (CTP4) | 2012-09-20 | -| 11.0.2809 | 2011.110.2809.24 | SP1 | CTP | SQL Server 2012 Service Pack 1 Customer Technology Preview 3 (CTP3) | 2012-07-05 | -| 11.0.2424 | 2011.110.2424.0 | RTM | CU | [2908007 Cumulative update package 11 (CU11) for SQL Server 2012] | 2013-12-17 | -| 11.0.2420 | 2011.110.2420.0 | RTM | CU | [2891666 Cumulative update package 10 (CU10) for SQL Server 2012] | 2013-10-21 | -| 11.0.2419 | 2011.110.2419.0 | RTM | CU | [2867319 Cumulative update package 9 (CU9) for SQL Server 2012] | 2013-08-21 | -| 11.0.2410 | 2011.110.2410.0 | RTM | CU | [2844205 Cumulative update package 8 (CU8) for SQL Server 2012] | 2013-06-18 | -| 11.0.2405 | 2011.110.2405.0 | RTM | CU | [2823247 Cumulative update package 7 (CU7) for SQL Server 2012] | 2013-04-15 | -| 11.0.2401 | 2011.110.2401.0 | RTM | CU | [2728897 Cumulative update package 6 (CU6) for SQL Server 2012] | 2013-02-18 | -| 11.0.2395 | 2011.110.2395.0 | RTM | CU | [2777772 Cumulative update package 5 (CU5) for SQL Server 2012] | 2012-12-18 | -| 11.0.9000 | 2011.110.9000.5 | RTM | CTP | Microsoft SQL Server 2012 With Power View For Multidimensional Models Customer Technology Preview (CTP3) | 2012-11-27 | -| 11.0.2383 | 2011.110.2383.0 | RTM | CU | [2758687 Cumulative update package 4 (CU4) for SQL Server 2012] | 2012-10-18 | -| 11.0.2376 | 2011.110.2376.0 | RTM | COD | [Microsoft Security Bulletin MS12-070] | 2012-10-09 | -| 11.0.2332 | 2011.110.2332.0 | RTM | CU | [2723749 Cumulative update package 3 (CU3) for SQL Server 2012] | 2012-08-29 | -| 11.0.2325 | 2011.110.2325.0 | RTM | CU | [2703275 Cumulative update package 2 (CU2) for SQL Server 2012] | 2012-06-18 | -| 11.0.2316 | 2011.110.2316.0 | RTM | CU | [2679368 Cumulative update package 1 (CU1) for SQL Server 2012] | 2012-04-12 | -| 11.0.2218 | 2011.110.2218.0 | RTM | COD | [Microsoft Security Bulletin MS12-070] | 2012-10-09 | -| 11.0.2214 | 2011.110.2214.0 | RTM | COD | 2685308 FIX: SSAS uses only 20 cores in SQL Server 2012 Business Intelligence | 2012-04-06 | -| 11.0.2100 | 2011.110.2100.60 | RTM | RTM | SQL Server 2012 RTM | 2012-03-06 | -| 11.0.1913 | 2011.110.1913.37 | RC | RC | Microsoft SQL Server 2012 Release Candidate 1 (RC1) | 2011-12-16 | -| 11.0.1750 | 2011.110.1750.32 | RC | RC | Microsoft SQL Server 2012 Release Candidate 0 (RC0) | 2011-11-17 | -| 11.0.1440 | 2010.110.1440.19 | CTP | CTP | Microsoft SQL Server 2012 (codename Denali) Community Technology Preview 3 (CTP3) | 2011-07-11 | -| 11.0.1103 | 2010.110.1103.9 | CTP | CTP | Microsoft SQL Server 2012 (codename Denali) Community Technology Preview 1 (CTP1) | 2010-11-08 | - -[4057116 Security Advisory ADV180002 (GDR)]:https://support.microsoft.com/en-us/help/4057116/security-update-for-vulnerabilities-in-sql-server -[4018073 SQL Server 2012 Service Pack 4 release information]:https://support.microsoft.com/en-us/help/4018073/sql-server-2012-service-pack-4-release-information -[4016762 Cumulative Update 10 for SQL Server 2012 SP3]:https://support.microsoft.com/en-us/help/4025925/cumulative-update-10-for-sql-server-2012-sp3 -[4016762 Cumulative Update 9 for SQL Server 2012 SP3]:https://support.microsoft.com/en-us/help/4016762/cumulative-update-9-for-sql-server-2012-sp3 -[4013104 Cumulative Update 8 for SQL Server 2012 SP3]:https://support.microsoft.com/en-us/help/4013104/cumulative-update-8-for-sql-server-2012-sp3 -[3205051 Cumulative Update Package 7 for SQL Server 2012 SP3]:https://support.microsoft.com/en-us/help/3205051/cumulative-update-7-for-sql-server-2012-sp3 -[3194724 MS16-136: Description of the security update for SQL Server 2012 Service Pack 3 CU: November 8, 2016]:https://support.microsoft.com/en-us/kb/3194724 -[3194725 MS16-136: Description of the security update for SQL Server 2012 Service Pack 2 CU: November 8, 2016]:https://support.microsoft.com/en-us/kb/3194725 -[3180914 Cumulative Update 14 for SQL Server 2012 SP2]:https://support.microsoft.com/en-us/kb/3180914 -[3180915 Cumulative update 5 for SQL Server 2012 Service Pack 3]:https://support.microsoft.com/en-us/kb/3180915 -[3165264 Cumulative Update 4 for SQL Server 2012 SP3]:https://support.microsoft.com/en-us/kb/3165264 -[3165266 Cumulative Update 13 for SQL Server 2012 SP2]:https://support.microsoft.com/en-us/kb/3165266 -[3152635 Cumulative update package 3 for SQL Server 2012 SP3]:https://support.microsoft.com/en-us/kb/3152635 -[3152637 Cumulative update package 12 for SQL Server 2012 SP2]:https://support.microsoft.com/en-us/kb/3152637 -[3137746 Cumulative update package 2 for SQL Server 2012 SP3]:https://support.microsoft.com/en-us/kb/3137746 -[3137745 Cumulative update package 11 for SQL Server 2012 SP2]:https://support.microsoft.com/en-us/kb/3137745 -[3123299 Cumulative update package 1 for SQL Server 2012 SP3]:https://support.microsoft.com/en-us/kb/3123299 -[3205416 Cumulative update package 15 (CU15) for SQL Server 2012 Service Pack 2]:https://support.microsoft.com/en-us/kb/3205416 -[3194721 MS16-136: Description of the security update for SQL Server 2012 Service Pack 3 GDR: November 8, 2016]:https://support.microsoft.com/en-us/kb/3194721 -[3135244 TLS 1.2 support for SQL Server 2012 SP3 GDR]:https://support.microsoft.com/en-us/kb/3135244 -[3120313 Cumulative update package 10 for SQL Server 2012 SP2]:https://support.microsoft.com/en-us/kb/3120313 -[3072779 Microsoft SQL Server 2012 Service Pack 3 (SP3)]:https://support.microsoft.com/en-us/kb/3072779 -[3205054 Cumulative Update 16 for SQL Server 2012 SP2]:https://support.microsoft.com/en-us/help/3205054/cumulative-update-16-for-sql-server-2012-sp2 -[3098512 Cumulative update package 9 for SQL Server 2012 SP2]:https://support.microsoft.com/en-us/kb/3098512 -[3097636 FIX: Performance decrease when application with connection pooling frequently connects or disconnects in SQL Server]:https://support.microsoft.com/en-us/kb/3097636 -[3082561 Cumulative update package 8 (CU8) for SQL Server 2012 Service Pack 2]:http://support.microsoft.com/kb/3082561 -[3087872 FIX: Access violations when you use the FileTable feature in SQL Server 2012]:https://support.microsoft.com/en-us/kb/3087872 -[3072100 Cumulative update package 7 (CU7) for SQL Server 2012 Service Pack 2]:http://support.microsoft.com/kb/3072100 -[3045319 MS15-058: Description of the security update for SQL Server 2012 Service Pack 2 QFE: July 14, 2015]:https://support.microsoft.com/en-us/kb/3045319 -[3052468 Cumulative update package 6 (CU6) for SQL Server 2012 Service Pack 2]:http://support.microsoft.com/kb/3052468 -[3037255 Cumulative update package 5 (CU5) for SQL Server 2012 Service Pack 2]:http://support.microsoft.com/kb/3037255 -[3034679 FIX: AlwaysOn availability groups are reported as NOT SYNCHRONIZING]:http://support.microsoft.com/kb/3034679 -[3007556 Cumulative update package 4 (CU4) for SQL Server 2012 Service Pack 2]:http://support.microsoft.com/kb/3007556 -[3002049 Cumulative update package 3 (CU3) for SQL Server 2012 Service Pack 2]:http://support.microsoft.com/kb/3002049 -[2983175 Cumulative update package 2 (CU2) for SQL Server 2012 Service Pack 2]:http://support.microsoft.com/kb/2983175 -[2976982 Cumulative update package 1 (CU1) for SQL Server 2012 Service Pack 2]:http://support.microsoft.com/kb/2976982 -[2969896 FIX: Data loss in clustered index occurs when you run online build index in SQL Server 2012 (Hotfix for SQL2012 SP2)]:http://support.microsoft.com/kb/2969896 -[3194719 MS16-136: Description of the security update for SQL Server 2012 Service Pack 2 GDR: November 8, 2016]:https://support.microsoft.com/en-us/kb/3194719 -[3135244 TLS 1.2 support for SQL Server 2012 SP2 GDR]:https://support.microsoft.com/en-us/kb/3135244 -[3045321 MS15-058: Description of the security update for SQL Server 2012 Service Pack 2 GDR: July 14, 2015]:https://support.microsoft.com/en-us/kb/3045321 -[SQL Server 2012 Service Pack 2 (SP2)]:http://www.microsoft.com/en-us/download/details.aspx?id=43340 -[3045317 MS15-058: Description of the security update for SQL Server 2012 SP1 QFE: July 14, 2015]:https://support.microsoft.com/en-us/kb/3045317 -[3052476 Cumulative update package 16 (CU16) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/3052476 -[3038001 Cumulative update package 15 (CU15) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/3038001 -[3023636 Cumulative update package 14 (CU14) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/3023636 -[2977325 MS14-044: Description of the security update for SQL Server 2012 Service Pack 1 (QFE)]:http://support.microsoft.com/kb/2977325 -[3002044 Cumulative update package 13 (CU13) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/3002044 -[2991533 Cumulative update package 12 (CU12) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2991533 -[2975396 Cumulative update package 11 (CU11) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2975396 -[2969896 FIX: Data loss in clustered index occurs when you run online build index in SQL Server 2012 (Hotfix for SQL2012 SP1)]:http://support.microsoft.com/kb/2969896 -[2954099 Cumulative update package 10 (CU10) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2954099 -[2931078 Cumulative update package 9 (CU9) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2931078 -[2917531 Cumulative update package 8 (CU8) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2917531 -[2894115 Cumulative update package 7 (CU7) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2894115 -[2874879 Cumulative update package 6 (CU6) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2874879 -[2861107 Cumulative update package 5 (CU5) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2861107 -[2833645 Cumulative update package 4 (CU4) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2833645 -[2832017 FIX: You can’t create or open SSIS projects or maintenance plans after you apply Cumulative Update 3 for SQL Server 2012 SP1]:http://support.microsoft.com/kb/2832017 -[2812412 Cumulative update package 3 (CU3) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2812412 -[2790947 Cumulative update package 2 (CU2) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2790947 -[2800050 FIX: Component installation process fails after you install SQL Server 2012 SP1]:http://support.microsoft.com/kb/2800050 -[2765331 Cumulative update package 1 (CU1) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2765331 -[3045318 MS15-058: Description of the security update for SQL Server 2012 SP1 GDR: July 14, 2015]:https://support.microsoft.com/en-us/kb/3045318 -[2977326 MS14-044: Description of the security update for SQL Server 2012 Service Pack 1 (GDR)]:http://support.microsoft.com/kb/2977326 -[2793634 Windows Installer starts repeatedly after you install SQL Server 2012 SP1]:http://support.microsoft.com/kb/2793634 -[SQL Server 2012 Service Pack 1 (SP1)]:http://www.microsoft.com/en-us/download/details.aspx?id=35575 -[2908007 Cumulative update package 11 (CU11) for SQL Server 2012]:http://support.microsoft.com/kb/2908007 -[2891666 Cumulative update package 10 (CU10) for SQL Server 2012]:http://support.microsoft.com/kb/2891666 -[2867319 Cumulative update package 9 (CU9) for SQL Server 2012]:http://support.microsoft.com/kb/2867319 -[2844205 Cumulative update package 8 (CU8) for SQL Server 2012]:http://support.microsoft.com/kb/2844205 -[2823247 Cumulative update package 7 (CU7) for SQL Server 2012]:http://support.microsoft.com/kb/2823247 -[2728897 Cumulative update package 6 (CU6) for SQL Server 2012]:http://support.microsoft.com/kb/2728897 -[2777772 Cumulative update package 5 (CU5) for SQL Server 2012]:http://support.microsoft.com/kb/2777772 -[2758687 Cumulative update package 4 (CU4) for SQL Server 2012]:http://support.microsoft.com/kb/2758687 -[Microsoft Security Bulletin MS12-070]:http://technet.microsoft.com/en-us/security/bulletin/ms12-070 -[2723749 Cumulative update package 3 (CU3) for SQL Server 2012]:http://support.microsoft.com/kb/2723749 -[2703275 Cumulative update package 2 (CU2) for SQL Server 2012]:http://support.microsoft.com/kb/2703275 -[2679368 Cumulative update package 1 (CU1) for SQL Server 2012]:http://support.microsoft.com/kb/2679368 -[2685308 FIX: SSAS uses only 20 cores in SQL Server 2012 Business Intelligence]:http://support.microsoft.com/kb/2685308 +⚠ End-of-Life: SQL Server 2012 reached [end of mainstream support on July 11th, 2017](https://support.microsoft.com/en-us/lifecycle/search?alpha=sql%20server%202012%20Service%20Pack%204). + +All SQL Server 2012 CU downloads: [Catalog Update Microsoft SQL Server 2012](http://www.catalog.update.microsoft.com/Search.aspx?q=sql%20server%202012) + +| Build | File version | Branch | Type | Info | KB | Description/Link | Release Date | Fixes | Public | +|---------------|------------------|--------|------|-----------------------------------|---------|--------------------------------------------------------------------------------------------------------------------------------|--------------|-------|--------| +| 11.0.7507.2 | 2011.110.7507.2 | SP4 | GDR | CVE-2021-1636 | 4583465 | [Description of the security update for SQL Server 2012 SP4 GDR: January 12, 2021] | 2021-01-12 | 1 | 1 | +| 11.0.7493.4 | 2011.110.7462.6 | SP4 | GDR | CVE-2020-0618 | 4532098 | [Security update for SQL Server 2012 SP4 GDR: February 11, 2020] | 2020-02-11 | 1 | 1 | +| 11.0.7469.6 | 2011.110.7469.6 | SP4 | CU | **Latest CU SP4** | 4091266 | [On-demand hotfix update package for SQL Server 2012 SP4] | 2018-03-28 | 2 | 2 | +| 11.0.7462.6 | 2011.110.7462.6 | SP4 | GDR | CVE-2017-5715,2017-5753,2017-5754 | 4057116 | [Security Advisory ADV180002 (GDR)] | 2018-01-12 | 1 | 1 | +| 11.0.7001.0 | 2011.110.7001.0 | SP4 | SP | | 4018073 | [SQL Server 2012 Service Pack 4 release information] | 2017-10-05 | 23 | 23 | +| 11.0.6615.2 | 2012.110.6615.2 | SP3 | CU | CVE-2017-5715,2017-5753,2017-5754 | 4057121 | [Description of the security update for SQL Server 2012 SP3 CU: January 16, 2018] | 2018-01-16 | 1 | 1 | +| 11.0.6607.3 | 2011.110.6607.3 | SP3 | CU | **Latest CU SP3** | 4016762 | [Cumulative Update 10 for SQL Server 2012 SP3] | 2017-08-08 | 5 | 15 | +| 11.0.6598.0 | 2011.110.6598.0 | SP3 | CU | | 4016762 | [Cumulative Update 9 for SQL Server 2012 SP3] | 2017-05-15 | 12 | 10 | +| 11.0.6594.0 | 2011.110.6594.0 | SP3 | CU | | 4013104 | [Cumulative Update 8 for SQL Server 2012 SP3] | 2017-03-21 | 17 | 17 | +| 11.0.6579.0 | 2011.110.6579.0 | SP3 | CU | | 3205051 | [Cumulative Update Package 7 for SQL Server 2012 SP3] | 2017-01-18 | 12 | 12 | +| 11.0.6567.0 | 2011.110.6567.0 | SP3 | COD | | 3194724 | [MS16-136: Description of the security update for SQL Server 2012 Service Pack 3 CU: November 8, 2016] | 2016-11-17 | 16 | 11 | +| 11.0.6544.0 | 2011.110.6544.0 | SP3 | CU | | 3180915 | [Cumulative update 5 for SQL Server 2012 Service Pack 3] | 2016-09-20 | 21 | 18 | +| 11.0.6540.0 | 2011.110.6540.0 | SP3 | CU | | 3165264 | [Cumulative Update 4 for SQL Server 2012 SP3] | 2016-07-18 | 23 | 22 | +| 11.0.6537.0 | 2011.110.6537.0 | SP3 | CU | | 3152635 | [Cumulative update package 3 for SQL Server 2012 SP3] | 2016-05-17 | 21 | 21 | +| 11.0.6523.0 | 2011.110.6523.0 | SP3 | CU | | 3137746 | [Cumulative update package 2 for SQL Server 2012 SP3] | 2016-03-22 | 21 | 19 | +| 11.0.6518.0 | 2011.110.6518.0 | SP3 | CU | | 3123299 | [Cumulative update package 1 for SQL Server 2012 SP3] | 2016-01-19 | 8 | 8 | +| 11.0.6260.1 | 2011.110.6260.1 | SP3 | GDR | CVE-2017-5715,2017-5753,2017-5754 | 4057115 | [Description of the security update for SQL Server 2012 SP3 GDR: January 16, 2018 – Security Advisory ADV180002] | 2018-01-16 | 1 | 1 | +| 11.0.6248.0 | 2011.110.6248.0 | SP3 | GDR | | 3194721 | [MS16-136: Description of the security update for SQL Server 2012 Service Pack 3 GDR: November 8, 2016] | 2016-11-08 | 1 | 1 | +| 11.0.6216.27 | 2011.110.6216.27 | SP3 | GDR | | 3135244 | [TLS 1.2 support for SQL Server 2012 SP3 GDR] | 2016-01-27 | 1 | 1 | +| 11.3.6020.0 | 2011.110.6020.0 | SP3 | SP | | 3072779 | [Microsoft SQL Server 2012 Service Pack 3 (SP3)] | 2015-11-21 | 37 | 37 | +| 11.0.5678.0 | 2011.110.5678.0 | SP2 | CU | **Latest CU SP2** | 3205054 | [Cumulative Update 16 for SQL Server 2012 SP2] | 2017-01-18 | 5 | 4 | +| 11.0.5676.0 | 2011.110.5676.0 | SP2 | CU | | 3205416 | [Cumulative update package 15 (CU15) for SQL Server 2012 Service Pack 2] | 2016-11-17 | 2 | 1 | +| 11.0.5676.0 | 2011.110.5676.0 | SP2 | COD | | 3194725 | [MS16-136: Description of the security update for SQL Server 2012 Service Pack 2 CU: November 8, 2016] | 2016-11-08 | 2 | 1 | +| 11.0.5657.0 | 2011.110.5657.0 | SP2 | CU | | 3180914 | [Cumulative Update 14 for SQL Server 2012 SP2] | 2016-09-20 | 1 | 1 | +| 11.0.5655.0 | 2011.110.5655.0 | SP2 | CU | | 3165266 | [Cumulative Update 13 for SQL Server 2012 SP2] | 2016-07-18 | 7 | 6 | +| 11.0.5649.0 | 2011.110.5649.0 | SP2 | CU | | 3152637 | [Cumulative update package 12 for SQL Server 2012 SP2] | 2016-05-16 | 7 | 7 | +| 11.0.5646.2 | 2011.110.5646.2 | SP2 | CU | | 3137745 | [Cumulative update package 11 for SQL Server 2012 SP2] | 2016-03-22 | 14 | 13 | +| 11.0.5644.2 | 2011.110.5644.2 | SP2 | CU | | 3120313 | [Cumulative update package 10 for SQL Server 2012 SP2] | 2016-01-19 | 14 | 12 | +| 11.0.5641.0 | 2011.110.5641.0 | SP2 | CU | | 3098512 | [Cumulative update package 9 for SQL Server 2012 SP2] | 2015-11-18 | 14 | 13 | +| 11.0.5636 | 2011.110.5636.3 | SP2 | COD | | 3097636 | [FIX: Performance decrease when application with connection pooling frequently connects or disconnects in SQL Server] | 2015-09-22 | 1 | 1 | +| 11.0.5634 | 2011.110.5634.0 | SP2 | CU | | 3082561 | [Cumulative update package 8 (CU8) for SQL Server 2012 Service Pack 2] | 2015-09-21 | 24 | 23 | +| 11.0.5629 | 2011.110.5629.0 | SP2 | COD | | 3087872 | [FIX: Access violations when you use the FileTable feature in SQL Server 2012] | 2015-08-31 | 1 | 1 | +| 11.0.5623 | 2011.110.5623.0 | SP2 | CU | | 3072100 | [Cumulative update package 7 (CU7) for SQL Server 2012 Service Pack 2] | 2015-07-20 | 38 | 33 | +| 11.0.5613 | 2011.110.5613.0 | SP2 | COD | | 3045319 | [MS15-058: Description of the security update for SQL Server 2012 Service Pack 2 QFE: July 14, 2015] | 2015-07-14 | 1 | 1 | +| 11.0.5592 | 2011.110.5592.0 | SP2 | CU | | 3052468 | [Cumulative update package 6 (CU6) for SQL Server 2012 Service Pack 2] | 2015-05-19 | 23 | 23 | +| 11.0.5582 | 2011.110.5582.0 | SP2 | CU | | 3037255 | [Cumulative update package 5 (CU5) for SQL Server 2012 Service Pack 2] | 2015-03-16 | 27 | 27 | +| 11.0.5571 | 2011.110.5571.0 | SP2 | COD | | 3034679 | [FIX: AlwaysOn availability groups are reported as NOT SYNCHRONIZING] | 2015-02-04 | 1 | 1 | +| 11.0.5569 | 2011.110.5569.0 | SP2 | CU | | 3007556 | [Cumulative update package 4 (CU4) for SQL Server 2012 Service Pack 2] | 2015-01-20 | 42 | 36 | +| 11.0.5556 | 2011.110.5556.0 | SP2 | CU | | 3002049 | [Cumulative update package 3 (CU3) for SQL Server 2012 Service Pack 2] | 2014-11-17 | 40 | 33 | +| 11.0.5548 | 2011.110.5548.0 | SP2 | CU | | 2983175 | [Cumulative update package 2 (CU2) for SQL Server 2012 Service Pack 2] | 2014-09-15 | 52 | 50 | +| 11.0.5532 | 2011.110.5532.0 | SP2 | CU | | 2976982 | [Cumulative update package 1 (CU1) for SQL Server 2012 Service Pack 2] | 2014-07-24 | 46 | 45 | +| 11.0.5522 | 2011.110.5522.0 | SP2 | COD | | 2969896 | [FIX: Data loss in clustered index occurs when you run online build index in SQL Server 2012 (Hotfix for SQL2012 SP2)] | 2014-06-20 | 1 | 1 | +| 11.0.5388 | 2012.110.5388.0 | SP2 | GDR | | 3194719 | [MS16-136: Description of the security update for SQL Server 2012 Service Pack 2 GDR: November 8, 2016] | 2016-11-08 | 1 | 1 | +| 11.0.5352 | 2012.110.5352.0 | SP2 | GDR | | 3135244 | [TLS 1.2 support for SQL Server 2012 SP2 GDR] | 2016-01-27 | 2 | 2 | +| 11.0.5343 | 2011.110.5343.0 | SP2 | GDR | | 3045321 | [MS15-058: Description of the security update for SQL Server 2012 Service Pack 2 GDR: July 14, 2015] | 2015-07-14 | 1 | 1 | +| 11.0.5058 | 2011.110.5058.0 | SP2 | SP | | | [SQL Server 2012 Service Pack 2 (SP2)] | 2014-06-10 | 37 | 37 | +| 11.0.3513 | 2011.110.3513.0 | SP1 | QFE | **Latest CU SP1** | 3045317 | [MS15-058: Description of the security update for SQL Server 2012 SP1 QFE: July 14, 2015] | 2015-07-14 | 1 | 1 | +| 11.0.3492 | 2011.110.3492.0 | SP1 | CU | | 3052476 | [Cumulative update package 16 (CU16) for SQL Server 2012 Service Pack 1] | 2015-05-18 | 4 | 4 | +| 11.0.3487 | 2011.110.3487.0 | SP1 | CU | | 3038001 | [Cumulative update package 15 (CU15) for SQL Server 2012 Service Pack 1] | 2015-03-16 | 1 | 1 | +| 11.0.3486 | 2011.110.3486.0 | SP1 | QFE | | 3023636 | [Cumulative update package 14 (CU14) for SQL Server 2012 Service Pack 1] | 2015-01-19 | 9 | 8 | +| 11.0.3482 | 2011.110.3482.0 | SP1 | CU | | 3002044 | [Cumulative update package 13 (CU13) for SQL Server 2012 Service Pack 1] | 2014-11-17 | 13 | 10 | +| 11.0.3470 | 2011.110.3470.0 | SP1 | CU | | 2991533 | [Cumulative update package 12 (CU12) for SQL Server 2012 Service Pack 1] | 2014-09-15 | 16 | 14 | +| 11.0.3467 | 2011.110.3467.0 | SP1 | COD | | 2975402 | [COD Hotfix 2975402] | 2014-08-28 | 1 | 1 | +| 11.0.3460 | 2011.110.3460.0 | SP1 | COD | | 2977325 | [MS14-044: Description of the security update for SQL Server 2012 Service Pack 1 (QFE)] | 2014-08-12 | 1 | 1 | +| 11.0.3449 | 2011.110.3449.0 | SP1 | CU | | 2975396 | [Cumulative update package 11 (CU11) for SQL Server 2012 Service Pack 1] | 2014-07-21 | 32 | 32 | +| 11.0.3437 | 2011.110.3437.0 | SP1 | COD | | 2969896 | [FIX: Data loss in clustered index occurs when you run online build index in SQL Server 2012 (Hotfix for SQL2012 SP1)] | 2014-06-10 | 1 | 1 | +| 11.0.3431 | 2011.110.3431.0 | SP1 | CU | | 2954099 | [Cumulative update package 10 (CU10) for SQL Server 2012 Service Pack 1] | 2014-05-19 | 38 | 36 | +| 11.0.3412 | 2011.110.3412.0 | SP1 | CU | | 2931078 | [Cumulative update package 9 (CU9) for SQL Server 2012 Service Pack 1] | 2014-03-18 | | | +| 11.0.3401 | 2011.110.3401.0 | SP1 | CU | | 2917531 | [Cumulative update package 8 (CU8) for SQL Server 2012 Service Pack 1] | 2014-01-20 | | | +| 11.0.3393 | 2011.110.3393.0 | SP1 | CU | | 2894115 | [Cumulative update package 7 (CU7) for SQL Server 2012 Service Pack 1] | 2013-11-18 | | | +| 11.0.3381 | 2011.110.3381.0 | SP1 | CU | | 2874879 | [Cumulative update package 6 (CU6) for SQL Server 2012 Service Pack 1] | 2013-09-16 | | | +| 11.0.3373 | 2011.110.3373.0 | SP1 | CU | | 2861107 | [Cumulative update package 5 (CU5) for SQL Server 2012 Service Pack 1] | 2013-07-16 | | | +| 11.0.3368 | 2011.110.3368.0 | SP1 | CU | | 2833645 | [Cumulative update package 4 (CU4) for SQL Server 2012 Service Pack 1] | 2013-05-31 | | | +| 11.0.3350 | 2011.110.3350.0 | SP1 | COD | | 2832017 | [FIX: You can’t create or open SSIS projects or maintenance plans after you apply Cumulative Update 3 for SQL Server 2012 SP1] | 2013-04-17 | | | +| 11.0.3349 | 2011.110.3349.0 | SP1 | CU | | 2812412 | [Cumulative update package 3 (CU3) for SQL Server 2012 Service Pack 1] | 2013-03-18 | | | +| 11.0.3339 | 2011.110.3339.0 | SP1 | CU | | 2790947 | [Cumulative update package 2 (CU2) for SQL Server 2012 Service Pack 1] | 2013-01-25 | | | +| 11.0.3335 | 2011.110.3335.0 | SP1 | COD | | 2800050 | [FIX: Component installation process fails after you install SQL Server 2012 SP1] | 2013-01-14 | | | +| 11.0.3321 | 2011.110.3321.0 | SP1 | CU | | 2765331 | [Cumulative update package 1 (CU1) for SQL Server 2012 Service Pack 1] | 2012-11-20 | | | +| 11.0.3156 | 2011.110.3156.0 | SP1 | COD | | 3045318 | [MS15-058: Description of the security update for SQL Server 2012 SP1 GDR: July 14, 2015] | 2015-07-14 | 1 | 1 | +| 11.0.3153 | 2011.110.3153.0 | SP1 | GDR | | 2977326 | [MS14-044: Description of the security update for SQL Server 2012 Service Pack 1 (GDR)] | 2014-08-12 | 1 | 1 | +| 11.0.3128 | 2011.110.3128.0 | SP1 | COD | | 2793634 | [Windows Installer starts repeatedly after you install SQL Server 2012 SP1] | 2013-01-03 | | | +| 11.0.3000 | 2011.110.3000.0 | SP1 | SP | | | [SQL Server 2012 Service Pack 1 (SP1)] | 2012-11-06 | 92 | 92 | +| 11.0.2845 | 2011.110.2845.0 | SP1 | CTP | | | SQL Server 2012 Service Pack 1 Customer Technology Preview 4 (CTP4) | 2012-09-20 | | | +| 11.0.2809 | 2011.110.2809.24 | SP1 | CTP | | | SQL Server 2012 Service Pack 1 Customer Technology Preview 3 (CTP3) | 2012-07-05 | | | +| 11.0.2424 | 2011.110.2424.0 | RTM | CU | **Latest CU RTM** | 2908007 | [Cumulative update package 11 (CU11) for SQL Server 2012] | 2013-12-17 | 16 | 15 | +| 11.0.2420 | 2011.110.2420.0 | RTM | CU | | 2891666 | [Cumulative update package 10 (CU10) for SQL Server 2012] | 2013-10-21 | 4 | 4 | +| 11.0.2419 | 2011.110.2419.0 | RTM | CU | | 2867319 | [Cumulative update package 9 (CU9) for SQL Server 2012] | 2013-08-21 | | | +| 11.0.2410 | 2011.110.2410.0 | RTM | CU | | 2844205 | [Cumulative update package 8 (CU8) for SQL Server 2012] | 2013-06-18 | | | +| 11.0.2405 | 2011.110.2405.0 | RTM | CU | | 2823247 | [Cumulative update package 7 (CU7) for SQL Server 2012] | 2013-04-15 | | | +| 11.0.2401 | 2011.110.2401.0 | RTM | CU | | 2728897 | [Cumulative update package 6 (CU6) for SQL Server 2012] | 2013-02-18 | | | +| 11.0.2395 | 2011.110.2395.0 | RTM | CU | | 2777772 | [Cumulative update package 5 (CU5) for SQL Server 2012] | 2012-12-18 | | | +| 11.0.9000 | 2011.110.9000.5 | RTM | CTP | | | Microsoft SQL Server 2012 With Power View For Multidimensional Models Customer Technology Preview (CTP3) | 2012-11-27 | | | +| 11.0.2383 | 2011.110.2383.0 | RTM | CU | | 2758687 | [Cumulative update package 4 (CU4) for SQL Server 2012] | 2012-10-18 | | | +| 11.0.2376 | 2011.110.2376.0 | RTM | COD | [MS12-070] | 2716441 | [Security Update for SQL Server 2012 RTM (KB2716441)] | 2012-10-09 | | | +| 11.0.2332 | 2011.110.2332.0 | RTM | CU | | 2723749 | [Cumulative update package 3 (CU3) for SQL Server 2012] | 2012-08-29 | | | +| 11.0.2325 | 2011.110.2325.0 | RTM | CU | | 2703275 | [Cumulative update package 2 (CU2) for SQL Server 2012] | 2012-06-18 | | | +| 11.0.2316 | 2011.110.2316.0 | RTM | CU | | 2679368 | [Cumulative update package 1 (CU1) for SQL Server 2012] | 2012-04-12 | | | +| 11.0.2218 | 2011.110.2218.0 | RTM | COD | [MS12-070] | 2716442 | [Security Update for SQL Server 2012 RTM (KB2716442)] | 2012-10-09 | | | +| 11.0.2214 | 2011.110.2214.0 | RTM | COD | | 2685308 | [FIX: SSAS uses only 20 cores in SQL Server 2012 Business Intelligence | 2012-04-06 | | | +| 11.0.2100 | 2011.110.2100.60 | RTM | RTM | | | SQL Server 2012 RTM | 2012-03-06 | | | +| 11.0.1913 | 2011.110.1913.37 | RC | RC | | | Microsoft SQL Server 2012 Release Candidate 1 (RC1) | 2011-12-16 | | | +| 11.0.1750 | 2011.110.1750.32 | RC | RC | | | Microsoft SQL Server 2012 Release Candidate 0 (RC0) | 2011-11-17 | | | +| 11.0.1440 | 2010.110.1440.19 | CTP | CTP | | | Microsoft SQL Server 2012 (codename Denali) Community Technology Preview 3 (CTP3) | 2011-07-11 | | | +| 11.0.1103 | 2010.110.1103.9 | CTP | CTP | | | Microsoft SQL Server 2012 (codename Denali) Community Technology Preview 1 (CTP1) | 2010-11-08 | | | + +[Description of the security update for SQL Server 2012 SP4 GDR: January 12, 2021]:https://support.microsoft.com/help/4583465 +[Security update for SQL Server 2012 SP4 GDR: February 11, 2020]:https://support.microsoft.com/help/4532098 +[On-demand hotfix update package for SQL Server 2012 SP4]:https://support.microsoft.com/help/4091266 +[Security Advisory ADV180002 (GDR)]:https://support.microsoft.com/help/4057116/security-update-for-vulnerabilities-in-sql-server +[SQL Server 2012 Service Pack 4 release information]:https://support.microsoft.com/help/4018073/sql-server-2012-service-pack-4-release-information +[Description of the security update for SQL Server 2012 SP3 CU: January 16, 2018]:https://support.microsoft.com/help/4057121 +[Cumulative Update 10 for SQL Server 2012 SP3]:https://support.microsoft.com/help/4025925/cumulative-update-10-for-sql-server-2012-sp3 +[Cumulative Update 9 for SQL Server 2012 SP3]:https://support.microsoft.com/help/4016762/cumulative-update-9-for-sql-server-2012-sp3 +[Cumulative Update 8 for SQL Server 2012 SP3]:https://support.microsoft.com/help/4013104/cumulative-update-8-for-sql-server-2012-sp3 +[Cumulative Update Package 7 for SQL Server 2012 SP3]:https://support.microsoft.com/help/3205051/cumulative-update-7-for-sql-server-2012-sp3 +[MS16-136: Description of the security update for SQL Server 2012 Service Pack 3 CU: November 8, 2016]:https://support.microsoft.com/kb/3194724 +[MS16-136: Description of the security update for SQL Server 2012 Service Pack 2 CU: November 8, 2016]:https://support.microsoft.com/kb/3194725 +[Cumulative Update 14 for SQL Server 2012 SP2]:https://support.microsoft.com/kb/3180914 +[Cumulative update 5 for SQL Server 2012 Service Pack 3]:https://support.microsoft.com/kb/3180915 +[Cumulative Update 4 for SQL Server 2012 SP3]:https://support.microsoft.com/kb/3165264 +[Cumulative Update 13 for SQL Server 2012 SP2]:https://support.microsoft.com/kb/3165266 +[Cumulative update package 3 for SQL Server 2012 SP3]:https://support.microsoft.com/kb/3152635 +[Cumulative update package 12 for SQL Server 2012 SP2]:https://support.microsoft.com/kb/3152637 +[Cumulative update package 2 for SQL Server 2012 SP3]:https://support.microsoft.com/kb/3137746 +[Cumulative update package 11 for SQL Server 2012 SP2]:https://support.microsoft.com/kb/3137745 +[Cumulative update package 1 for SQL Server 2012 SP3]:https://support.microsoft.com/kb/3123299 +[Cumulative update package 15 (CU15) for SQL Server 2012 Service Pack 2]:https://support.microsoft.com/kb/3205416 +[MS16-136: Description of the security update for SQL Server 2012 Service Pack 3 GDR: November 8, 2016]:https://support.microsoft.com/kb/3194721 +[TLS 1.2 support for SQL Server 2012 SP3 GDR]:https://support.microsoft.com/kb/3135244 +[Cumulative update package 10 for SQL Server 2012 SP2]:https://support.microsoft.com/kb/3120313 +[Microsoft SQL Server 2012 Service Pack 3 (SP3)]:https://support.microsoft.com/kb/3072779 +[Cumulative Update 16 for SQL Server 2012 SP2]:https://support.microsoft.com/help/3205054/cumulative-update-16-for-sql-server-2012-sp2 +[Cumulative update package 9 for SQL Server 2012 SP2]:https://support.microsoft.com/kb/3098512 +[FIX: Performance decrease when application with connection pooling frequently connects or disconnects in SQL Server]:https://support.microsoft.com/kb/3097636 +[Cumulative update package 8 (CU8) for SQL Server 2012 Service Pack 2]:http://support.microsoft.com/kb/3082561 +[FIX: Access violations when you use the FileTable feature in SQL Server 2012]:https://support.microsoft.com/kb/3087872 +[Cumulative update package 7 (CU7) for SQL Server 2012 Service Pack 2]:http://support.microsoft.com/kb/3072100 +[MS15-058: Description of the security update for SQL Server 2012 Service Pack 2 QFE: July 14, 2015]:https://support.microsoft.com/kb/3045319 +[Cumulative update package 6 (CU6) for SQL Server 2012 Service Pack 2]:http://support.microsoft.com/kb/3052468 +[Cumulative update package 5 (CU5) for SQL Server 2012 Service Pack 2]:http://support.microsoft.com/kb/3037255 +[FIX: AlwaysOn availability groups are reported as NOT SYNCHRONIZING]:http://support.microsoft.com/kb/3034679 +[Cumulative update package 4 (CU4) for SQL Server 2012 Service Pack 2]:http://support.microsoft.com/kb/3007556 +[Cumulative update package 3 (CU3) for SQL Server 2012 Service Pack 2]:http://support.microsoft.com/kb/3002049 +[Cumulative update package 2 (CU2) for SQL Server 2012 Service Pack 2]:http://support.microsoft.com/kb/2983175 +[Cumulative update package 1 (CU1) for SQL Server 2012 Service Pack 2]:http://support.microsoft.com/kb/2976982 +[FIX: Data loss in clustered index occurs when you run online build index in SQL Server 2012 (Hotfix for SQL2012 SP2)]:http://support.microsoft.com/kb/2969896 +[MS16-136: Description of the security update for SQL Server 2012 Service Pack 2 GDR: November 8, 2016]:https://support.microsoft.com/kb/3194719 +[TLS 1.2 support for SQL Server 2012 SP2 GDR]:https://support.microsoft.com/kb/3135244 +[MS15-058: Description of the security update for SQL Server 2012 Service Pack 2 GDR: July 14, 2015]:https://support.microsoft.com/kb/3045321 +[SQL Server 2012 Service Pack 2 (SP2)]:http://www.microsoft.com/download/details.aspx?id=43340 +[MS15-058: Description of the security update for SQL Server 2012 SP1 QFE: July 14, 2015]:https://support.microsoft.com/kb/3045317 +[Cumulative update package 16 (CU16) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/3052476 +[Cumulative update package 15 (CU15) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/3038001 +[Cumulative update package 14 (CU14) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/3023636 +[Cumulative update package 13 (CU13) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/3002044 +[Cumulative update package 12 (CU12) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2991533 +[COD Hotfix 2975402]:http://support.microsoft.com/kb/2975402 +[MS14-044: Description of the security update for SQL Server 2012 Service Pack 1 (QFE)]:http://support.microsoft.com/kb/2977325 +[Cumulative update package 11 (CU11) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2975396 +[FIX: Data loss in clustered index occurs when you run online build index in SQL Server 2012 (Hotfix for SQL2012 SP1)]:http://support.microsoft.com/kb/2969896 +[Cumulative update package 10 (CU10) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2954099 +[Cumulative update package 9 (CU9) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2931078 +[Cumulative update package 8 (CU8) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2917531 +[Cumulative update package 7 (CU7) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2894115 +[Cumulative update package 6 (CU6) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2874879 +[Cumulative update package 5 (CU5) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2861107 +[Cumulative update package 4 (CU4) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2833645 +[FIX: You can’t create or open SSIS projects or maintenance plans after you apply Cumulative Update 3 for SQL Server 2012 SP1]:http://support.microsoft.com/kb/2832017 +[Cumulative update package 3 (CU3) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2812412 +[Cumulative update package 2 (CU2) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2790947 +[FIX: Component installation process fails after you install SQL Server 2012 SP1]:http://support.microsoft.com/kb/2800050 +[Cumulative update package 1 (CU1) for SQL Server 2012 Service Pack 1]:http://support.microsoft.com/kb/2765331 +[MS15-058: Description of the security update for SQL Server 2012 SP1 GDR: July 14, 2015]:https://support.microsoft.com/kb/3045318 +[MS14-044: Description of the security update for SQL Server 2012 Service Pack 1 (GDR)]:http://support.microsoft.com/kb/2977326 +[Windows Installer starts repeatedly after you install SQL Server 2012 SP1]:http://support.microsoft.com/kb/2793634 +[SQL Server 2012 Service Pack 1 (SP1)]:http://www.microsoft.com/download/details.aspx?id=35575 +[Cumulative update package 11 (CU11) for SQL Server 2012]:http://support.microsoft.com/kb/2908007 +[Cumulative update package 10 (CU10) for SQL Server 2012]:http://support.microsoft.com/kb/2891666 +[Cumulative update package 9 (CU9) for SQL Server 2012]:http://support.microsoft.com/kb/2867319 +[Cumulative update package 8 (CU8) for SQL Server 2012]:http://support.microsoft.com/kb/2844205 +[Cumulative update package 7 (CU7) for SQL Server 2012]:http://support.microsoft.com/kb/2823247 +[Cumulative update package 6 (CU6) for SQL Server 2012]:http://support.microsoft.com/kb/2728897 +[Cumulative update package 5 (CU5) for SQL Server 2012]:http://support.microsoft.com/kb/2777772 +[Cumulative update package 4 (CU4) for SQL Server 2012]:http://support.microsoft.com/kb/2758687 +[Security Update for SQL Server 2012 RTM (KB2716441)]:https://www.microsoft.com/en-us/download/details.aspx?id=34917 +[Cumulative update package 3 (CU3) for SQL Server 2012]:http://support.microsoft.com/kb/2723749 +[Cumulative update package 2 (CU2) for SQL Server 2012]:http://support.microsoft.com/kb/2703275 +[Cumulative update package 1 (CU1) for SQL Server 2012]:http://support.microsoft.com/kb/2679368 +[Security Update for SQL Server 2012 RTM (KB2716442)]:https://www.microsoft.com/en-us/download/details.aspx?id=34884 +[FIX: SSAS uses only 20 cores in SQL Server 2012 Business Intelligence]:http://support.microsoft.com/kb/2685308 +[MS12-070]:http://technet.microsoft.com/security/bulletin/ms12-070 @@ -1104,143 +1170,143 @@ All SQL Server 2014 CU downloads: [Catalog Update Microsoft SQL Server 2012](htt ### All SQL Server 2008 R2 CU downloads [Catalog Update Microsoft SQL Server 2008 R2]:http://www.catalog.update.microsoft.com/Search.aspx?q=sql%20server%202008%20R2 -| Build | File version | KB / Description | Release Date | -|---------------|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------| -| 10.50.6542 | 2009.100.6542.0 | [3146034 Intermittent service terminations occur after you install any SQL Server 2008 or SQL Server 2008 R2 versions from KB3135244] | 2016-03-03 | -| 10.50.6537 | 2009.100.6537.0 | [3135244 TLS 1.2 support for SQL Server 2008 R2 SP3] | 2016-01-27 | -| 10.50.6529 | 2009.100.6529.0 | [3045314 MS15-058: Description of the security update for SQL Server 2008 R2 Service Pack 3 QFE: July 14, 2015] | 2015-07-14 | -| 10.50.6525 | 2009.100.6525.0 | [3033860 An on-demand hotfix update package is available for SQL Server 2008 R2 Service Pack 3 (SP3)] | 2015-02-09 | -| 10.50.6220 | 2009.100.6220.0 | [3045316 MS15-058: Description of the security update for SQL Server 2008 R2 Service Pack 3 GDR: July 14, 2015] | 2015-07-14 | -| 10.50.6000.34 | 2009.100.6000.34 | [SQL Server 2008 R2 Service Pack 3 (SP3)] | 2014-09-26 | -| 10.50.4343 | 2009.100.4343.0 | [3135244 TLS 1.2 support for SQL Server 2008 R2 SP2 (IA-64 only)] | 2016-01-27 | -| 10.50.4339 | 2009.100.4339.0 | [3045312 MS15-058: Description of the security update for SQL Server 2008 R2 Service Pack 2 QFE: July 14, 2015] | 2015-07-14 | -| 10.50.4331 | 2009.100.4331.0 | [2987585 Restore Log with Standby Mode on an Advanced Format disk may cause a 9004 error in SQL Server 2008 R2 or SQL Server 2012] | 2014-08-27 | -| 10.50.4321 | 2009.100.4321.0 | [2977319 MS14-044: Description of the security update for SQL Server 2008 R2 Service Pack 2 (QFE)] | 2014-08-12 | -| 10.50.4319 | 2009.100.4319.0 | [2967540 Cumulative update package 13 (CU13) for SQL Server 2008 R2 Service Pack 2] | 2014-06-30 | -| 10.50.4305 | 2009.100.4305.0 | [2938478 Cumulative update package 12 (CU12) for SQL Server 2008 R2 Service Pack 2] | 2014-04-21 | -| 10.50.4302 | 2009.100.4302.0 | [2926028 Cumulative update package 11 (CU11) for SQL Server 2008 R2 Service Pack 2] | 2014-02-18 | -| 10.50.4297 | 2009.100.4297.0 | [2908087 Cumulative update package 10 (CU10) for SQL Server 2008 R2 Service Pack 2] | 2013-12-16 | -| 10.50.4295 | 2009.100.4295.0 | [2887606 Cumulative update package 9 (CU9) for SQL Server 2008 R2 Service Pack 2] | 2013-10-29 | -| 10.50.4290 | 2009.100.4290.0 | [2871401 Cumulative update package 8 (CU8) for SQL Server 2008 R2 Service Pack 2] | 2013-08-30 | -| 10.50.4286 | 2009.100.4286.0 | [2844090 Cumulative update package 7 (CU7) for SQL Server 2008 R2 Service Pack 2] | 2013-06-17 | -| 10.50.4285 | 2009.100.4285.0 | [2830140 Cumulative update package 6 (CU6) for SQL Server 2008 R2 Service Pack 2 (updated)] | 2013-06-13 | -| 10.50.4279 | 2009.100.4279.0 | 2830140 Cumulative update package 6 (CU6) for SQL Server 2008 R2 Service Pack 2 (replaced) | 2013-04-15 | -| 10.50.4276 | 2009.100.4276.0 | [2797460 Cumulative update package 5 (CU5) for SQL Server 2008 R2 Service Pack 2] | 2013-02-18 | -| 10.50.4270 | 2009.100.4270.0 | [2777358 Cumulative update package 4 (CU4) for SQL Server 2008 R2 Service Pack 2] | 2012-12-17 | -| 10.50.4266 | 2009.100.4266.0 | [2754552 Cumulative update package 3 (CU3) for SQL Server 2008 R2 Service Pack 2] | 2012-10-15 | -| 10.50.4263 | 2009.100.4263.0 | [2740411 Cumulative update package 2 (CU2) for SQL Server 2008 R2 Service Pack 2] | 2012-08-29 | -| 10.50.4260 | 2009.100.4260.0 | [2720425 Cumulative update package 1 (CU1) for SQL Server 2008 R2 Service Pack 2] | 2012-08-01 | -| 10.50.4042 | 2009.100.4042.0 | [3045313 MS15-058: MS15-058: Description of the security update for SQL Server 2008 R2 Service Pack 2 GDR: July 14, 2015] | 2015-07-14 | -| 10.50.4033 | 2009.100.4033.0 | [2977320 MS14-044: Description of the security update for SQL Server 2008 R2 Service Pack 2 (GDR)] | 2014-08-12 | -| 10.50.4000 | 2009.100.4000.0 | [SQL Server 2008 R2 Service Pack 2 (SP2)] | 2012-06-26 | -| 10.50.3720 | 2009.100.3720.0 | SQL Server 2008 R2 Service Pack 2 Community Technology Preview (CTP) | 2012-05-13 | -| 10.50.2881 | 2009.100.2881.0 | [2868244 An on-demand hotfix update package for SQL Server 2008 R2 Service Pack 1] | 2013-08-12 | -| 10.50.2876 | 2009.100.2876.0 | [2855792 Cumulative update package 13 (CU13) for SQL Server 2008 R2 Service Pack 1] | 2013-06-17 | -| 10.50.2875 | 2009.100.2875.0 | [2828727 Cumulative update package 12 (CU12) for SQL Server 2008 R2 Service Pack 1 (updated)] | 2013-06-13 | -| 10.50.2874 | 2009.100.2874.0 | 2828727 Cumulative update package 12 (CU12) for SQL Server 2008 R2 Service Pack 1 (replaced) | 2013-04-15 | -| 10.50.2861 | 2009.100.2861.0 | [Microsoft Security Bulletin MS12-070] | 2012-10-09 | -| 10.50.2869 | 2009.100.2869.0 | [2812683 Cumulative update package 11 (CU11) for SQL Server 2008 R2 Service Pack 1] | 2013-02-18 | -| 10.50.2868 | 2009.100.2868.0 | [2783135 Cumulative update package 10 (CU10) for SQL Server 2008 R2 Service Pack 1] | 2012-12-17 | -| 10.50.2866 | 2009.100.2866.0 | [2756574 Cumulative update package 9 (CU9) for SQL Server 2008 R2 Service Pack 1] | 2012-11-06 | -| 10.50.2861 | 2009.100.2861.0 | [2716439 MS12-070: Description of the security update for SQL Server 2008 R2 Service Pack 1 QFE: October 9, 2012] | 2012-10-09 | -| 10.50.2822 | 2009.100.2822.0 | [2723743 Cumulative update package 8 (CU8) for SQL Server 2008 R2 Service Pack 1] | 2012-08-29 | -| 10.50.2817 | 2009.100.2817.0 | [2703282 Cumulative update package 7 (CU7) for SQL Server 2008 R2 Service Pack 1] | 2012-06-18 | -| 10.50.2811 | 2009.100.2811.0 | [2679367 Cumulative update package 6 (CU6) for SQL Server 2008 R2 Service Pack 1] | 2012-04-16 | -| 10.50.2807 | 2009.100.2807.0 | [2675522 FIX: Access violation when you run DML statements against a table that has partitioned indexes in SQL Server 2008 R2] | 2012-03-12 | -| 10.50.2806 | 2009.100.2806.0 | [2659694 Cumulative update package 5 (CU5) for SQL Server 2008 R2 Service Pack 1] | 2012-02-22 | -| 10.50.2799 | 2009.100.2799.0 | [2633357 FIX: "Non-yielding Scheduler" error might occur when you run a query that uses the CHARINDEX function in SQL Server 2008 R2] | 2012-02-22 | -| 10.50.2796 | 2009.100.2796.0 | [2633146 Cumulative update package 4 (CU4) for SQL Server 2008 R2 Service Pack 1] | 2011-12-20 | -| 10.50.2789 | 2009.100.2789.0 | [2591748 Cumulative update package 3 (CU3) for SQL Server 2008 R2 Service Pack 1] | 2011-10-17 | -| 10.50.2776 | 2009.100.2776.0 | [2606883 FIX: Slow performance when an AFTER trigger runs on a partitioned table in SQL Server 2008 R2] | 2011-10-18 | -| 10.50.2772 | 2009.100.2772.0 | [2567714 Cumulative update package 2 (CU2) for SQL Server 2008 R2 Service Pack 1] | 2011-08-15 | -| 10.50.2769 | 2009.100.2769.0 | [2544793 Cumulative update package 1 (CU1) for SQL Server 2008 R2 Service Pack 1] | 2011-07-18 | -| 10.50.2550 | 2009.100.2550.0 | [Microsoft Security Bulletin MS12-070] | 2012-10-09 | -| 10.50.2500 | 2009.100.2500.0 | [SQL Server 2008 R2 Service Pack 1 (SP1)] | 2011-07-11 | -| 10.50.1817 | 2009.100.1817.0 | [2703280 Cumulative update package 14 (CU14) for SQL Server 2008 R2] | 2012-06-18 | -| 10.50.1815 | 2009.100.1815.0 | [2679366 Cumulative update package 13 (CU13) for SQL Server 2008 R2] | 2012-04-17 | -| 10.50.1810 | 2009.100.1810.0 | [2659692 Cumulative update package 12 (CU12) for SQL Server 2008 R2] | 2012-02-21 | -| 10.50.1809 | 2009.100.1809.0 | [2633145 Cumulative update package 11 (CU11) for SQL Server 2008 R2] | 2012-01-09 | -| 10.50.1807 | 2009.100.1807.0 | [2591746 Cumulative update package 10 (CU10) for SQL Server 2008 R2] | 2011-10-19 | -| 10.50.1804 | 2009.100.1804.0 | [2567713 Cumulative update package 9 (CU9) for SQL Server 2008 R2] | 2011-08-16 | -| 10.50.1800 | 2009.100.1800.0 | [2574699 FIX: Database data files might be incorrectly marked as sparse in SQL Server 2008 R2 or in SQL Server 2008 even when the physical files are marked as not sparse in the file system] | 2011-10-18 | -| 10.50.1797 | 2009.100.1797.0 | [2534352 Cumulative update package 8 (CU8) for SQL Server 2008 R2] | 2011-06-20 | -| 10.50.1790 | 2009.100.1790.0 | [2494086 MS11-049: Description of the security update for SQL Server 2008 R2 QFE: June 14, 2011] | 2011-06-17 | -| 10.50.1777 | 2009.100.1777.0 | [2507770 Cumulative update package 7 (CU7) for SQL Server 2008 R2] | 2011-06-16 | -| 10.50.1769 | 2009.100.1769.0 | [2520808 FIX: Non-yielding scheduler error when you run a query that uses a TVP in SQL Server 2008 or in SQL Server 2008 R2 if SQL Profiler or SQL Server Extended Events is used] | 2011-04-18 | -| 10.50.1765 | 2009.100.1765.0 | [2489376 Cumulative update package 6 (CU6) for SQL Server 2008 R2] | 2011-02-21 | -| 10.50.1753 | 2009.100.1753.0 | [2438347 Cumulative update package 5 (CU5) for SQL Server 2008 R2] | 2010-12-23 | -| 10.50.1746 | 2009.100.1746.0 | [2345451 Cumulative update package 4 (CU4) for SQL Server 2008 R2] | 2010-10-18 | -| 10.50.1734 | 2009.100.1734.0 | [2261464 Cumulative update package 3 (CU3) for SQL Server 2008 R2] | 2010-08-20 | -| 10.50.1720 | 2009.100.1720.0 | [2072493 Cumulative update package 2 (CU2) for SQL Server 2008 R2] | 2010-06-25 | -| 10.50.1702 | 2009.100.1702.0 | [981355 Cumulative update package 1 (CU1) for SQL Server 2008 R2] | 2010-05-18 | -| 10.50.1617 | 2009.100.1617.0 | [2494088 MS11-049: Description of the security update for SQL Server 2008 R2 GDR: June 14, 2011] | 2011-06-14 | -| 10.50.1600.1 | 2009.100.1600.1 | SQL Server 2008 R2 RTM | 2010-04-21 | -| 10.50.1352 | 2009.100.1352.12 | Microsoft SQL Server 2008 R2 November Community Technology Preview (CTP) | 2009-11-12 | -| 10.50.1092 | 2009.100.1092.20 | Microsoft SQL Server 2008 R2 August Community Technology Preview (CTP) | 2009-06-30 | - -[3146034 Intermittent service terminations occur after you install any SQL Server 2008 or SQL Server 2008 R2 versions from KB3135244]:http://support.microsoft.com/en-us/kb/3146034 -[3135244 TLS 1.2 support for SQL Server 2008 R2 SP3]:http://support.microsoft.com/en-us/kb/3135244 -[3045314 MS15-058: Description of the security update for SQL Server 2008 R2 Service Pack 3 QFE: July 14, 2015]:http://support.microsoft.com/kb/3045314 -[3033860 An on-demand hotfix update package is available for SQL Server 2008 R2 Service Pack 3 (SP3)]:http://support.microsoft.com/kb/3033860 -[3045316 MS15-058: Description of the security update for SQL Server 2008 R2 Service Pack 3 GDR: July 14, 2015]:http://support.microsoft.com/kb/3045316 -[SQL Server 2008 R2 Service Pack 3 (SP3)]:http://www.microsoft.com/en-us/download/details.aspx?id=44271 -[3135244 TLS 1.2 support for SQL Server 2008 R2 SP2 (IA-64 only)]:http://support.microsoft.com/en-us/kb/3135244 -[3045312 MS15-058: Description of the security update for SQL Server 2008 R2 Service Pack 2 QFE: July 14, 2015]:http://support.microsoft.com/kb/3045312 -[2987585 Restore Log with Standby Mode on an Advanced Format disk may cause a 9004 error in SQL Server 2008 R2 or SQL Server 2012]:http://support.microsoft.com/kb/2987585 -[2977319 MS14-044: Description of the security update for SQL Server 2008 R2 Service Pack 2 (QFE)]:http://support.microsoft.com/kb/2977319 -[2967540 Cumulative update package 13 (CU13) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2967540 -[2938478 Cumulative update package 12 (CU12) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2938478 -[2926028 Cumulative update package 11 (CU11) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2926028 -[2908087 Cumulative update package 10 (CU10) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2908087 -[2887606 Cumulative update package 9 (CU9) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2887606 -[2871401 Cumulative update package 8 (CU8) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2871401 -[2844090 Cumulative update package 7 (CU7) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2844090 -[2830140 Cumulative update package 6 (CU6) for SQL Server 2008 R2 Service Pack 2 (updated)]:http://support.microsoft.com/kb/2830140 -[2797460 Cumulative update package 5 (CU5) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2797460 -[2777358 Cumulative update package 4 (CU4) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2777358 -[2754552 Cumulative update package 3 (CU3) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2754552 -[2740411 Cumulative update package 2 (CU2) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2740411 -[2720425 Cumulative update package 1 (CU1) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2720425 -[3045313 MS15-058: MS15-058: Description of the security update for SQL Server 2008 R2 Service Pack 2 GDR: July 14, 2015]:http://support.microsoft.com/kb/3045313 -[2977320 MS14-044: Description of the security update for SQL Server 2008 R2 Service Pack 2 (GDR)]:http://support.microsoft.com/kb/2977320 -[SQL Server 2008 R2 Service Pack 2 (SP2)]:http://www.microsoft.com/en-us/download/details.aspx?id=30437 -[2868244 An on-demand hotfix update package for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2868244 -[2855792 Cumulative update package 13 (CU13) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2855792 -[2828727 Cumulative update package 12 (CU12) for SQL Server 2008 R2 Service Pack 1 (updated)]:http://support.microsoft.com/kb/2828727 -[2812683 Cumulative update package 11 (CU11) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2812683 -[2783135 Cumulative update package 10 (CU10) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2783135 -[2756574 Cumulative update package 9 (CU9) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2756574 -[2716439 MS12-070: Description of the security update for SQL Server 2008 R2 Service Pack 1 QFE: October 9, 2012]:http://support.microsoft.com/kb/2716439 -[2723743 Cumulative update package 8 (CU8) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2723743 -[2703282 Cumulative update package 7 (CU7) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2703282 -[2679367 Cumulative update package 6 (CU6) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2679367 -[2675522 FIX: Access violation when you run DML statements against a table that has partitioned indexes in SQL Server 2008 R2]:http://support.microsoft.com/kb/2675522 -[2659694 Cumulative update package 5 (CU5) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2659694 -[2633357 FIX: "Non-yielding Scheduler" error might occur when you run a query that uses the CHARINDEX function in SQL Server 2008 R2]:http://support.microsoft.com/kb/2633357 -[2633146 Cumulative update package 4 (CU4) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2633146 -[2591748 Cumulative update package 3 (CU3) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2591748 -[2606883 FIX: Slow performance when an AFTER trigger runs on a partitioned table in SQL Server 2008 R2]:http://support.microsoft.com/kb/2606883 -[2567714 Cumulative update package 2 (CU2) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2567714 -[2544793 Cumulative update package 1 (CU1) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2544793 +| Build | File version | Branch | Type | Info | KB | Description/Link | Release Date | +|---------------|------------------|--------|------|------------------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------| +| 10.50.6542 | 2009.100.6542.0 | SP3 | CU |**Latest CU SP3** | 3146034 | [Intermittent service terminations occur after you install any SQL Server 2008 or SQL Server 2008 R2 versions from KB3135244] | 2016-03-03 | +| 10.50.6537 | 2009.100.6537.0 | SP3 | CU | | 3135244 | [TLS 1.2 support for SQL Server 2008 R2 SP3] | 2016-01-27 | +| 10.50.6529 | 2009.100.6529.0 | SP3 | QFE | | 3045314 | [MS15-058: Description of the security update for SQL Server 2008 R2 Service Pack 3 QFE: July 14, 2015] | 2015-07-14 | +| 10.50.6525 | 2009.100.6525.0 | SP3 | COD | | 3033860 | [An on-demand hotfix update package is available for SQL Server 2008 R2 Service Pack 3 (SP3)] | 2015-02-09 | +| 10.50.6220 | 2009.100.6220.0 | SP3 | COD | | 3045316 | [MS15-058: Description of the security update for SQL Server 2008 R2 Service Pack 3 GDR: July 14, 2015] | 2015-07-14 | +| 10.50.6000.34 | 2009.100.6000.34 | SP3 | SP |**Latest SP** | | [SQL Server 2008 R2 Service Pack 3 (SP3)] | 2014-09-26 | +| 10.50.4343 | 2009.100.4343.0 | SP2 | CU | | 3135244 | [TLS 1.2 support for SQL Server 2008 R2 SP2 (IA-64 only)] | 2016-01-27 | +| 10.50.4339 | 2009.100.4339.0 | SP2 | QFE | | 3045312 | [MS15-058: Description of the security update for SQL Server 2008 R2 Service Pack 2 QFE: July 14, 2015] | 2015-07-14 | +| 10.50.4331 | 2009.100.4331.0 | SP2 | | | 2987585 | [Restore Log with Standby Mode on an Advanced Format disk may cause a 9004 error in SQL Server 2008 R2 or SQL Server 2012] | 2014-08-27 | +| 10.50.4321 | 2009.100.4321.0 | SP2 | QFE | | 2977319 | [MS14-044: Description of the security update for SQL Server 2008 R2 Service Pack 2 (QFE)] | 2014-08-12 | +| 10.50.4319 | 2009.100.4319.0 | SP2 | CU | | 2967540 | [Cumulative update package 13 (CU13) for SQL Server 2008 R2 Service Pack 2] | 2014-06-30 | +| 10.50.4305 | 2009.100.4305.0 | SP2 | CU | | 2938478 | [Cumulative update package 12 (CU12) for SQL Server 2008 R2 Service Pack 2] | 2014-04-21 | +| 10.50.4302 | 2009.100.4302.0 | SP2 | CU | | 2926028 | [Cumulative update package 11 (CU11) for SQL Server 2008 R2 Service Pack 2] | 2014-02-18 | +| 10.50.4297 | 2009.100.4297.0 | SP2 | CU | | 2908087 | [Cumulative update package 10 (CU10) for SQL Server 2008 R2 Service Pack 2] | 2013-12-16 | +| 10.50.4295 | 2009.100.4295.0 | SP2 | CU | | 2887606 | [Cumulative update package 9 (CU9) for SQL Server 2008 R2 Service Pack 2] | 2013-10-29 | +| 10.50.4290 | 2009.100.4290.0 | SP2 | CU | | 2871401 | [Cumulative update package 8 (CU8) for SQL Server 2008 R2 Service Pack 2] | 2013-08-30 | +| 10.50.4286 | 2009.100.4286.0 | SP2 | CU | | 2844090 | [Cumulative update package 7 (CU7) for SQL Server 2008 R2 Service Pack 2] | 2013-06-17 | +| 10.50.4285 | 2009.100.4285.0 | SP2 | CU | | 2830140 | [Cumulative update package 6 (CU6) for SQL Server 2008 R2 Service Pack 2 (updated)] | 2013-06-13 | +| 10.50.4279 | 2009.100.4279.0 | SP2 | CU |**Withdrawn** | 2830140 | Cumulative update package 6 (CU6) for SQL Server 2008 R2 Service Pack 2 (replaced) | 2013-04-15 | +| 10.50.4276 | 2009.100.4276.0 | SP2 | CU | | 2797460 | [Cumulative update package 5 (CU5) for SQL Server 2008 R2 Service Pack 2] | 2013-02-18 | +| 10.50.4270 | 2009.100.4270.0 | SP2 | CU | | 2777358 | [Cumulative update package 4 (CU4) for SQL Server 2008 R2 Service Pack 2] | 2012-12-17 | +| 10.50.4266 | 2009.100.4266.0 | SP2 | CU | | 2754552 | [Cumulative update package 3 (CU3) for SQL Server 2008 R2 Service Pack 2] | 2012-10-15 | +| 10.50.4263 | 2009.100.4263.0 | SP2 | CU | | 2740411 | [Cumulative update package 2 (CU2) for SQL Server 2008 R2 Service Pack 2] | 2012-08-29 | +| 10.50.4260 | 2009.100.4260.0 | SP2 | CU | | 2720425 | [Cumulative update package 1 (CU1) for SQL Server 2008 R2 Service Pack 2] | 2012-08-01 | +| 10.50.4042 | 2009.100.4042.0 | SP2 | GDR | | 3045313 | [MS15-058: MS15-058: Description of the security update for SQL Server 2008 R2 Service Pack 2 GDR: July 14, 2015] | 2015-07-14 | +| 10.50.4033 | 2009.100.4033.0 | SP2 | GDR | | 2977320 | [MS14-044: Description of the security update for SQL Server 2008 R2 Service Pack 2 (GDR)] | 2014-08-12 | +| 10.50.4000 | 2009.100.4000.0 | SP2 | SP | | | [SQL Server 2008 R2 Service Pack 2 (SP2)] | 2012-06-26 | +| 10.50.3720 | 2009.100.3720.0 | SP2 | CTP | | | SQL Server 2008 R2 Service Pack 2 Community Technology Preview (CTP) | 2012-05-13 | +| 10.50.2881 | 2009.100.2881.0 | SP1 | | | 2868244 | [An on-demand hotfix update package for SQL Server 2008 R2 Service Pack 1] | 2013-08-12 | +| 10.50.2876 | 2009.100.2876.0 | SP1 | CU | | 2855792 | [Cumulative update package 13 (CU13) for SQL Server 2008 R2 Service Pack 1] | 2013-06-17 | +| 10.50.2875 | 2009.100.2875.0 | SP1 | CU | | 2828727 | [Cumulative update package 12 (CU12) for SQL Server 2008 R2 Service Pack 1 (updated)] | 2013-06-13 | +| 10.50.2874 | 2009.100.2874.0 | SP1 | CU |**Withdrawn** | 2828727 | Cumulative update package 12 (CU12) for SQL Server 2008 R2 Service Pack 1 (replaced) | 2013-04-15 | +| 10.50.2861 | 2009.100.2861.0 | SP1 | | | | [Microsoft Security Bulletin MS12-070] | 2012-10-09 | +| 10.50.2869 | 2009.100.2869.0 | SP1 | CU | | 2812683 | [Cumulative update package 11 (CU11) for SQL Server 2008 R2 Service Pack 1] | 2013-02-18 | +| 10.50.2868 | 2009.100.2868.0 | SP1 | CU | | 2783135 | [Cumulative update package 10 (CU10) for SQL Server 2008 R2 Service Pack 1] | 2012-12-17 | +| 10.50.2866 | 2009.100.2866.0 | SP1 | CU | | 2756574 | [Cumulative update package 9 (CU9) for SQL Server 2008 R2 Service Pack 1] | 2012-11-06 | +| 10.50.2861 | 2009.100.2861.0 | SP1 | QFE | | 2716439 | [MS12-070: Description of the security update for SQL Server 2008 R2 Service Pack 1 QFE: October 9, 2012] | 2012-10-09 | +| 10.50.2822 | 2009.100.2822.0 | SP1 | CU | | 2723743 | [Cumulative update package 8 (CU8) for SQL Server 2008 R2 Service Pack 1] | 2012-08-29 | +| 10.50.2817 | 2009.100.2817.0 | SP1 | CU | | 2703282 | [Cumulative update package 7 (CU7) for SQL Server 2008 R2 Service Pack 1] | 2012-06-18 | +| 10.50.2811 | 2009.100.2811.0 | SP1 | CU | | 2679367 | [Cumulative update package 6 (CU6) for SQL Server 2008 R2 Service Pack 1] | 2012-04-16 | +| 10.50.2807 | 2009.100.2807.0 | SP1 | | | 2675522 | [FIX: Access violation when you run DML statements against a table that has partitioned indexes in SQL Server 2008 R2] | 2012-03-12 | +| 10.50.2806 | 2009.100.2806.0 | SP1 | CU | | 2659694 | [Cumulative update package 5 (CU5) for SQL Server 2008 R2 Service Pack 1] | 2012-02-22 | +| 10.50.2799 | 2009.100.2799.0 | SP1 | | | 2633357 | [FIX: "Non-yielding Scheduler" error might occur when you run a query that uses the CHARINDEX function in SQL Server 2008 R2] | 2012-02-22 | +| 10.50.2796 | 2009.100.2796.0 | SP1 | CU | | 2633146 | [Cumulative update package 4 (CU4) for SQL Server 2008 R2 Service Pack 1] | 2011-12-20 | +| 10.50.2789 | 2009.100.2789.0 | SP1 | CU | | 2591748 | [Cumulative update package 3 (CU3) for SQL Server 2008 R2 Service Pack 1] | 2011-10-17 | +| 10.50.2776 | 2009.100.2776.0 | SP1 | | | 2606883 | [FIX: Slow performance when an AFTER trigger runs on a partitioned table in SQL Server 2008 R2] | 2011-10-18 | +| 10.50.2772 | 2009.100.2772.0 | SP1 | CU | | 2567714 | [Cumulative update package 2 (CU2) for SQL Server 2008 R2 Service Pack 1] | 2011-08-15 | +| 10.50.2769 | 2009.100.2769.0 | SP1 | CU | | 2544793 | [Cumulative update package 1 (CU1) for SQL Server 2008 R2 Service Pack 1] | 2011-07-18 | +| 10.50.2550 | 2009.100.2550.0 | SP1 | | [MS12-070] | | [Microsoft Security Bulletin MS12-070] | 2012-10-09 | +| 10.50.2500 | 2009.100.2500.0 | SP1 | SP | | | [SQL Server 2008 R2 Service Pack 1 (SP1)] | 2011-07-11 | +| 10.50.1817 | 2009.100.1817.0 | RTM | CU | | 2703280 | [Cumulative update package 14 (CU14) for SQL Server 2008 R2] | 2012-06-18 | +| 10.50.1815 | 2009.100.1815.0 | RTM | CU | | 2679366 | [Cumulative update package 13 (CU13) for SQL Server 2008 R2] | 2012-04-17 | +| 10.50.1810 | 2009.100.1810.0 | RTM | CU | | 2659692 | [Cumulative update package 12 (CU12) for SQL Server 2008 R2] | 2012-02-21 | +| 10.50.1809 | 2009.100.1809.0 | RTM | CU | | 2633145 | [Cumulative update package 11 (CU11) for SQL Server 2008 R2] | 2012-01-09 | +| 10.50.1807 | 2009.100.1807.0 | RTM | CU | | 2591746 | [Cumulative update package 10 (CU10) for SQL Server 2008 R2] | 2011-10-19 | +| 10.50.1804 | 2009.100.1804.0 | RTM | CU | | 2567713 | [Cumulative update package 9 (CU9) for SQL Server 2008 R2] | 2011-08-16 | +| 10.50.1800 | 2009.100.1800.0 | RTM | | | 2574699 | [FIX: Database data files might be incorrectly marked as sparse in SQL Server 2008 R2 or in SQL Server 2008 even when the physical files are marked as not sparse in the file system] | 2011-10-18 | +| 10.50.1797 | 2009.100.1797.0 | RTM | CU | | 2534352 | [Cumulative update package 8 (CU8) for SQL Server 2008 R2] | 2011-06-20 | +| 10.50.1790 | 2009.100.1790.0 | RTM | QFE | | 2494086 | [MS11-049: Description of the security update for SQL Server 2008 R2 QFE: June 14, 2011] | 2011-06-17 | +| 10.50.1777 | 2009.100.1777.0 | RTM | CU | | 2507770 | [Cumulative update package 7 (CU7) for SQL Server 2008 R2] | 2011-06-16 | +| 10.50.1769 | 2009.100.1769.0 | RTM | | | 2520808 | [FIX: Non-yielding scheduler error when you run a query that uses a TVP in SQL Server 2008 or in SQL Server 2008 R2 if SQL Profiler or SQL Server Extended Events is used] | 2011-04-18 | +| 10.50.1765 | 2009.100.1765.0 | RTM | CU | | 2489376 | [Cumulative update package 6 (CU6) for SQL Server 2008 R2] | 2011-02-21 | +| 10.50.1753 | 2009.100.1753.0 | RTM | CU | | 2438347 | [Cumulative update package 5 (CU5) for SQL Server 2008 R2] | 2010-12-23 | +| 10.50.1746 | 2009.100.1746.0 | RTM | CU | | 2345451 | [Cumulative update package 4 (CU4) for SQL Server 2008 R2] | 2010-10-18 | +| 10.50.1734 | 2009.100.1734.0 | RTM | CU | | 2261464 | [Cumulative update package 3 (CU3) for SQL Server 2008 R2] | 2010-08-20 | +| 10.50.1720 | 2009.100.1720.0 | RTM | CU | | 2072493 | [Cumulative update package 2 (CU2) for SQL Server 2008 R2] | 2010-06-25 | +| 10.50.1702 | 2009.100.1702.0 | RTM | CU | | 981355 | [Cumulative update package 1 (CU1) for SQL Server 2008 R2] | 2010-05-18 | +| 10.50.1617 | 2009.100.1617.0 | RTM | GDR | | 2494088 | [MS11-049: Description of the security update for SQL Server 2008 R2 GDR: June 14, 2011] | 2011-06-14 | +| 10.50.1600.1 | 2009.100.1600.1 | RTM | RTM |**RTM** | | SQL Server 2008 R2 RTM | 2010-04-21 | +| 10.50.1352 | 2009.100.1352.12 | CTP | CTP | | | Microsoft SQL Server 2008 R2 November Community Technology Preview (CTP) | 2009-11-12 | +| 10.50.1092 | 2009.100.1092.20 | CTP | CTP | | | Microsoft SQL Server 2008 R2 August Community Technology Preview (CTP) | 2009-06-30 | + +[Intermittent service terminations occur after you install any SQL Server 2008 or SQL Server 2008 R2 versions from KB3135244]:http://support.microsoft.com/kb/3146034 +[TLS 1.2 support for SQL Server 2008 R2 SP3]:http://support.microsoft.com/kb/3135244 +[MS15-058: Description of the security update for SQL Server 2008 R2 Service Pack 3 QFE: July 14, 2015]:http://support.microsoft.com/kb/3045314 +[An on-demand hotfix update package is available for SQL Server 2008 R2 Service Pack 3 (SP3)]:http://support.microsoft.com/kb/3033860 +[MS15-058: Description of the security update for SQL Server 2008 R2 Service Pack 3 GDR: July 14, 2015]:http://support.microsoft.com/kb/3045316 +[SQL Server 2008 R2 Service Pack 3 (SP3)]:http://www.microsoft.com/download/details.aspx?id=44271 +[TLS 1.2 support for SQL Server 2008 R2 SP2 (IA-64 only)]:http://support.microsoft.com/kb/3135244 +[MS15-058: Description of the security update for SQL Server 2008 R2 Service Pack 2 QFE: July 14, 2015]:http://support.microsoft.com/kb/3045312 +[Restore Log with Standby Mode on an Advanced Format disk may cause a 9004 error in SQL Server 2008 R2 or SQL Server 2012]:http://support.microsoft.com/kb/2987585 +[MS14-044: Description of the security update for SQL Server 2008 R2 Service Pack 2 (QFE)]:http://support.microsoft.com/kb/2977319 +[Cumulative update package 13 (CU13) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2967540 +[Cumulative update package 12 (CU12) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2938478 +[Cumulative update package 11 (CU11) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2926028 +[Cumulative update package 10 (CU10) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2908087 +[Cumulative update package 9 (CU9) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2887606 +[Cumulative update package 8 (CU8) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2871401 +[Cumulative update package 7 (CU7) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2844090 +[Cumulative update package 6 (CU6) for SQL Server 2008 R2 Service Pack 2 (updated)]:http://support.microsoft.com/kb/2830140 +[Cumulative update package 5 (CU5) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2797460 +[Cumulative update package 4 (CU4) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2777358 +[Cumulative update package 3 (CU3) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2754552 +[Cumulative update package 2 (CU2) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2740411 +[Cumulative update package 1 (CU1) for SQL Server 2008 R2 Service Pack 2]:http://support.microsoft.com/kb/2720425 +[MS15-058: MS15-058: Description of the security update for SQL Server 2008 R2 Service Pack 2 GDR: July 14, 2015]:http://support.microsoft.com/kb/3045313 +[MS14-044: Description of the security update for SQL Server 2008 R2 Service Pack 2 (GDR)]:http://support.microsoft.com/kb/2977320 +[SQL Server 2008 R2 Service Pack 2 (SP2)]:http://www.microsoft.com/download/details.aspx?id=30437 +[An on-demand hotfix update package for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2868244 +[Cumulative update package 13 (CU13) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2855792 +[Cumulative update package 12 (CU12) for SQL Server 2008 R2 Service Pack 1 (updated)]:http://support.microsoft.com/kb/2828727 +[Cumulative update package 11 (CU11) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2812683 +[Cumulative update package 10 (CU10) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2783135 +[Cumulative update package 9 (CU9) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2756574 +[MS12-070: Description of the security update for SQL Server 2008 R2 Service Pack 1 QFE: October 9, 2012]:http://support.microsoft.com/kb/2716439 +[Cumulative update package 8 (CU8) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2723743 +[Cumulative update package 7 (CU7) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2703282 +[Cumulative update package 6 (CU6) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2679367 +[FIX: Access violation when you run DML statements against a table that has partitioned indexes in SQL Server 2008 R2]:http://support.microsoft.com/kb/2675522 +[Cumulative update package 5 (CU5) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2659694 +[FIX: "Non-yielding Scheduler" error might occur when you run a query that uses the CHARINDEX function in SQL Server 2008 R2]:http://support.microsoft.com/kb/2633357 +[Cumulative update package 4 (CU4) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2633146 +[Cumulative update package 3 (CU3) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2591748 +[FIX: Slow performance when an AFTER trigger runs on a partitioned table in SQL Server 2008 R2]:http://support.microsoft.com/kb/2606883 +[Cumulative update package 2 (CU2) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2567714 +[Cumulative update package 1 (CU1) for SQL Server 2008 R2 Service Pack 1]:http://support.microsoft.com/kb/2544793 [SQL Server 2008 R2 Service Pack 1 (SP1)]:http://www.microsoft.com/download/en/details.aspx?id=26727 -[2703280 Cumulative update package 14 (CU14) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2703280 -[2679366 Cumulative update package 13 (CU13) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2679366 -[2659692 Cumulative update package 12 (CU12) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2659692 -[2633145 Cumulative update package 11 (CU11) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2633145 -[2591746 Cumulative update package 10 (CU10) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2591746 -[2567713 Cumulative update package 9 (CU9) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2567713 -[2574699 FIX: Database data files might be incorrectly marked as sparse in SQL Server 2008 R2 or in SQL Server 2008 even when the physical files are marked as not sparse in the file system]:http://support.microsoft.com/kb/2574699 -[2534352 Cumulative update package 8 (CU8) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2534352 -[2494086 MS11-049: Description of the security update for SQL Server 2008 R2 QFE: June 14, 2011]:http://support.microsoft.com/kb/2494086 -[2507770 Cumulative update package 7 (CU7) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2507770 -[2520808 FIX: Non-yielding scheduler error when you run a query that uses a TVP in SQL Server 2008 or in SQL Server 2008 R2 if SQL Profiler or SQL Server Extended Events is used]:http://support.microsoft.com/kb/2520808 -[2489376 Cumulative update package 6 (CU6) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2489376 -[2438347 Cumulative update package 5 (CU5) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2438347 -[2345451 Cumulative update package 4 (CU4) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2345451 -[2261464 Cumulative update package 3 (CU3) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2261464 -[2072493 Cumulative update package 2 (CU2) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2072493 -[981355 Cumulative update package 1 (CU1) for SQL Server 2008 R2]:http://support.microsoft.com/kb/981355 -[2494088 MS11-049: Description of the security update for SQL Server 2008 R2 GDR: June 14, 2011]:http://support.microsoft.com/kb/2494088 +[Cumulative update package 14 (CU14) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2703280 +[Cumulative update package 13 (CU13) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2679366 +[Cumulative update package 12 (CU12) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2659692 +[Cumulative update package 11 (CU11) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2633145 +[Cumulative update package 10 (CU10) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2591746 +[Cumulative update package 9 (CU9) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2567713 +[FIX: Database data files might be incorrectly marked as sparse in SQL Server 2008 R2 or in SQL Server 2008 even when the physical files are marked as not sparse in the file system]:http://support.microsoft.com/kb/2574699 +[Cumulative update package 8 (CU8) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2534352 +[MS11-049: Description of the security update for SQL Server 2008 R2 QFE: June 14, 2011]:http://support.microsoft.com/kb/2494086 +[Cumulative update package 7 (CU7) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2507770 +[FIX: Non-yielding scheduler error when you run a query that uses a TVP in SQL Server 2008 or in SQL Server 2008 R2 if SQL Profiler or SQL Server Extended Events is used]:http://support.microsoft.com/kb/2520808 +[Cumulative update package 6 (CU6) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2489376 +[Cumulative update package 5 (CU5) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2438347 +[Cumulative update package 4 (CU4) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2345451 +[Cumulative update package 3 (CU3) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2261464 +[Cumulative update package 2 (CU2) for SQL Server 2008 R2]:http://support.microsoft.com/kb/2072493 +[Cumulative update package 1 (CU1) for SQL Server 2008 R2]:http://support.microsoft.com/kb/981355 +[MS11-049: Description of the security update for SQL Server 2008 R2 GDR: June 14, 2011]:http://support.microsoft.com/kb/2494088 ## Microsoft SQL Server 2008 Builds @@ -1339,14 +1405,14 @@ All SQL Server 2014 CU downloads: [Catalog Update Microsoft SQL Server 2012](htt | 10.0.1049 | 2007.100.1049.14 | SQL Server 2008 CTP, July 2007 | 2007-07-31 | | 10.0.1019 | 2007.100.1019.17 | SQL Server 2008 CTP, June 2007 | 2007-05-21 | -[3146034 Intermittent service terminations occur after you install any SQL Server 2008 or SQL Server 2008 R2 versions from KB3135244]:http://support.microsoft.com/en-us/kb/3146034 -[3135244 TLS 1.2 support for SQL Server 2008 SP4]:http://support.microsoft.com/en-us/kb/3135244 +[3146034 Intermittent service terminations occur after you install any SQL Server 2008 or SQL Server 2008 R2 versions from KB3135244]:http://support.microsoft.com/kb/3146034 +[3135244 TLS 1.2 support for SQL Server 2008 SP4]:http://support.microsoft.com/kb/3135244 [3045308 MS15-058: Description of the security update for SQL Server 2008 Service Pack 4 QFE: July 14, 2015]:http://support.microsoft.com/kb/3045308 [3034373 An on-demand hotfix update package is available for SQL Server 2008 Service Pack 4 (SP4)]:http://support.microsoft.com/kb/3034373 -[3045311 MS15-058: Description of the security update for SQL Server 2008 Service Pack 4 GDR: July 14, 2015]:https://support.microsoft.com/en-us/kb/3045311 -[2979596 SQL Server 2008 Service Pack 4 release information]:https://support.microsoft.com/en-us/kb/2979596 -[3135244 TLS 1.2 support for SQL Server 2008 SP3 (IA-64 only)]:http://support.microsoft.com/en-us/kb/3135244 -[3045303 MS15-058: Description of the security update for SQL Server 2008 Service Pack 3 QFE: July 14, 2015]:https://support.microsoft.com/en-us/kb/3045303 +[3045311 MS15-058: Description of the security update for SQL Server 2008 Service Pack 4 GDR: July 14, 2015]:https://support.microsoft.com/kb/3045311 +[2979596 SQL Server 2008 Service Pack 4 release information]:https://support.microsoft.com/kb/2979596 +[3135244 TLS 1.2 support for SQL Server 2008 SP3 (IA-64 only)]:http://support.microsoft.com/kb/3135244 +[3045303 MS15-058: Description of the security update for SQL Server 2008 Service Pack 3 QFE: July 14, 2015]:https://support.microsoft.com/kb/3045303 [2977322 MS14-044: Description of the security update for SQL Server 2008 SP3 (QFE)]:http://support.microsoft.com/kb/2977322 [2877204 FIX: Error 8985 when you run the "dbcc shrinkfile" statement by using the logical name of a file in SQL Server 2008 R2 or SQL Server 2008]:http://support.microsoft.com/kb/2877204 [2958696 Cumulative update package 17 (CU17) for SQL Server 2008 Service Pack 3]:http://support.microsoft.com/kb/2958696 @@ -1367,11 +1433,11 @@ All SQL Server 2014 CU downloads: [Catalog Update Microsoft SQL Server 2012](htt [2648098 Cumulative update package 3 (CU3) for SQL Server 2008 Service Pack 3]:http://support.microsoft.com/kb/2648098 [2633143 Cumulative update package 2 (CU2) for SQL Server 2008 Service Pack 3]:http://support.microsoft.com/kb/2633143 [2617146 Cumulative update package 1 (CU1) for SQL Server 2008 Service Pack 3]:http://support.microsoft.com/kb/2617146 -[3045305 MS15-058: Description of the security update for SQL Server 2008 Service Pack 3 GDR: July 14, 2015]:https://support.microsoft.com/en-us/kb/3045305 +[3045305 MS15-058: Description of the security update for SQL Server 2008 Service Pack 3 GDR: July 14, 2015]:https://support.microsoft.com/kb/3045305 [2977321 MS14-044: Description of the security update for SQL Server 2008 SP3 (GDR)]:http://support.microsoft.com/kb/2977321 -[Microsoft Security Bulletin MS12-070]:http://technet.microsoft.com/en-us/security/bulletin/ms12-070 +[Microsoft Security Bulletin MS12-070]:http://technet.microsoft.com/security/bulletin/ms12-070 [SQL Server 2008 Service Pack 3 (SP3)]:http://www.microsoft.com/download/en/details.aspx?id=27594 -[Microsoft Security Bulletin MS12-070]:http://technet.microsoft.com/en-us/security/bulletin/ms12-070 +[Microsoft Security Bulletin MS12-070]:http://technet.microsoft.com/security/bulletin/ms12-070 [2715951 Cumulative update package 11 (CU11) for SQL Server 2008 Service Pack 2]:http://support.microsoft.com/kb/2715951 [2696625 Cumulative update package 10 (CU10) for SQL Server 2008 Service Pack 2]:http://support.microsoft.com/kb/2696625 [2673382 Cumulative update package 9 (CU9) for SQL Server 2008 Service Pack 2]:http://support.microsoft.com/kb/2673382 @@ -1383,7 +1449,7 @@ All SQL Server 2014 CU downloads: [Catalog Update Microsoft SQL Server 2012](htt [2498535 Cumulative update package 3 (CU3) for SQL Server 2008 Service Pack 2]:http://support.microsoft.com/kb/2498535 [2467239 Cumulative update package 2 (CU2) for SQL Server 2008 Service Pack 2]:http://support.microsoft.com/kb/2467239 [2289254 Cumulative update package 1 (CU1) for SQL Server 2008 Service Pack 2]:http://support.microsoft.com/kb/2289254 -[Microsoft Security Bulletin MS12-070]:http://technet.microsoft.com/en-us/security/bulletin/ms12-070 +[Microsoft Security Bulletin MS12-070]:http://technet.microsoft.com/security/bulletin/ms12-070 [2494089 MS11-049: Description of the security update for SQL Server 2008 Service Pack 2 GDR: June 14, 2011]:http://support.microsoft.com/kb/2494089 [SQL Server 2008 Service Pack 2 (SP2)]:http://www.microsoft.com/downloads/en/details.aspx?FamilyID=8FBFC1DE-D25E-4790-88B5-7DDA1F1D4E17 [2582282 Cumulative update package 16 (CU16) for SQL Server 2008 Service Pack 1]:http://support.microsoft.com/kb/2582282 @@ -1406,7 +1472,7 @@ All SQL Server 2014 CU downloads: [Catalog Update Microsoft SQL Server 2012](htt [970507 FIX: Error message in SQL Server 2008 when you run an INSERT SELECT statement on a table: "Violation of PRIMARY KEY constraint ''. Cannot insert duplicate key in object ''"]:http://support.microsoft.com/kb/970507 [969099 Cumulative update package 1 (CU1) for SQL Server 2008 Service Pack 1]:http://support.microsoft.com/kb/969099 [2494096 MS11-049: Description of the security update for SQL Server 2008 Service Pack 1 GDR: June 14, 2011]:http://support.microsoft.com/kb/2494096 -[SQL Server 2008 Service Pack 1 (SP1)]:http://www.microsoft.com/en-us/download/details.aspx?id=20302 +[SQL Server 2008 Service Pack 1 (SP1)]:http://www.microsoft.com/download/details.aspx?id=20302 [979064 Cumulative update package 10 (CU10) for SQL Server 2008]:http://support.microsoft.com/kb/979064 [977444 Cumulative update package 9 (CU9) for SQL Server 2008]:http://support.microsoft.com/kb/977444 [975976 Cumulative update package 8 (CU8) for SQL Server 2008]:http://support.microsoft.com/kb/975976 @@ -1419,7 +1485,7 @@ All SQL Server 2014 CU downloads: [Catalog Update Microsoft SQL Server 2012](htt [958611 FIX: You may receive incorrect results when you run a query that references three or more tables in the FROM clause in SQL Server 2008]:http://support.microsoft.com/kb/958611 [956717 Cumulative update package 1 (CU1) for SQL Server 2008]:http://support.microsoft.com/kb/956717 [956718 FIX: A MERGE statement may not enforce a foreign key constraint when the statement updates a unique key column that is not part of a clustering key that has a single row as the update source in SQL Server 2008]:http://support.microsoft.com/kb/956718 -[SQL Server 2008 RTM]:http://msdn.microsoft.com/en-us/subscriptions/downloads/details/default.aspx?pm=pid%3a334 +[SQL Server 2008 RTM]:http://msdn.microsoft.com/subscriptions/downloads/details/default.aspx?pm=pid%3a334 ## Microsoft SQL Server 2005 Builds @@ -1664,14 +1730,14 @@ All SQL Server 2014 CU downloads: [Catalog Update Microsoft SQL Server 2012](htt | 9.00.1528 | 2005.90.1528.0 | [915306 FIX: The merge agent fails and a "permission denied" error message is logged when you synchronize a SQL Server 2005-based merge publication] | 2007-01-08 | | 9.00.1528 | 2005.90.1528.0 | [915112 FIX: Error message when an ADO.NET-connected application tries to reuse a connection from the connection pool in SQL Server 2005: "The request failed to run because the batch is aborted"] | 2006-07-26 | | 9.00.1519 | 2005.90.1519.0 | [913494 FIX: The merge agent does not use a specified custom user update to handle conflicting UPDATE statements in SQL Server 2005] | 2007-01-20 | -| 9.00.1518 | 2005.90.1518.0 | [913941 FIX: A SQL Server login may have more permissions when you log on to an instance of SQL Server 2005] | 2006-09-22 | -| 9.00.1518 | 2005.90.1518.0 | [912472 FIX: An incorrect result may appear in the subscribing database when you set database mirroring for a database and database failover occurs in SQL Server 2005] | 2006-07-26 | -| 9.00.1518 | 2005.90.1518.0 | [913371 FIX: You may receive error messages when you use the sp_cursoropen statement to open a cursor on a user-defined stored procedure in SQL Server 2005] | 2006-07-26 | -| 9.00.1514 | 2005.90.1514.0 | [912471 FIX: The replication on the server does not work any longer when you manually fail over databases in SQL Server 2005] | 2006-07-26 | -| 9.00.1503 | 2005.90.1503.0 | [911662 FIX: You may receive an access violation error message when you run a SELECT query in SQL Server 2005] | 2006-07-26 | -| 9.00.1502 | 2005.90.1502.0 | [915793 FIX: You cannot restore the log backups on the mirror server after you remove database mirroring for the mirror database in SQL Server 2005] | 2006-07-26 | -| 9.00.1500 | 2005.90.1500.0 | [910416 FIX: Error message when you run certain queries or certain stored procedures in SQL Server 2005: "A severe error occurred on the current command"] | 2006-06-01 | -| 9.00.1406 | 2005.90.1406.0 | [932557 FIX: A script task or a script component may not run correctly when you run an SSIS package in SQL Server 2005 build 1399] | 2007-07-11 | +| 9.00.1518 | 2005.90.1518.0 | 913941 FIX: A SQL Server login may have more permissions when you log on to an instance of SQL Server 2005 | 2006-09-22 | +| 9.00.1518 | 2005.90.1518.0 | 912472 FIX: An incorrect result may appear in the subscribing database when you set database mirroring for a database and database failover occurs in SQL Server 2005 | 2006-07-26 | +| 9.00.1518 | 2005.90.1518.0 | 913371 FIX: You may receive error messages when you use the sp_cursoropen statement to open a cursor on a user-defined stored procedure in SQL Server 2005 | 2006-07-26 | +| 9.00.1514 | 2005.90.1514.0 | 912471 FIX: The replication on the server does not work any longer when you manually fail over databases in SQL Server 2005 | 2006-07-26 | +| 9.00.1503 | 2005.90.1503.0 | 911662 FIX: You may receive an access violation error message when you run a SELECT query in SQL Server 2005 | 2006-07-26 | +| 9.00.1502 | 2005.90.1502.0 | 915793 FIX: You cannot restore the log backups on the mirror server after you remove database mirroring for the mirror database in SQL Server 2005 | 2006-07-26 | +| 9.00.1500 | 2005.90.1500.0 | 910416 FIX: Error message when you run certain queries or certain stored procedures in SQL Server 2005: "A severe error occurred on the current command" | 2006-06-01 | +| 9.00.1406 | 2005.90.1406.0 | 932557 FIX: A script task or a script component may not run correctly when you run an SSIS package in SQL Server 2005 build 1399 | 2007-07-11 | | 9.00.1399 | 2005.90.1399.0 | SQL Server 2005 RTM | 2005-11-07 | [2716427 MS12-070: Description of the security update for SQL Server 2005 Service Pack 4 QFE]:http://support.microsoft.com/kb/2716427 @@ -1682,7 +1748,7 @@ All SQL Server 2014 CU downloads: [Catalog Update Microsoft SQL Server 2012](htt [2507769 Cumulative update package 3 (CU3) for SQL Server 2005 Service Pack 4]:http://support.microsoft.com/kb/2507769 [2489409 Cumulative update package 2 (CU2) for SQL Server 2005 Service Pack 4]:http://support.microsoft.com/kb/2489409 [2464079 Cumulative update package 1 (CU1) for SQL Server 2005 Service Pack 4]:http://support.microsoft.com/kb/2464079 -[Microsoft Security Bulletin MS12-070]:http://technet.microsoft.com/en-us/security/bulletin/ms12-070 +[Microsoft Security Bulletin MS12-070]:http://technet.microsoft.com/security/bulletin/ms12-070 [2494120 MS11-049: Description of the security update for SQL Server 2005 Service Pack 4 GDR: June 14, 2011]:http://support.microsoft.com/kb/2494120 [SQL Server 2005 Service Pack 4 (SP4)]:http://www.microsoft.com/downloads/en/details.aspx?FamilyID=b953e84f-9307-405e-bceb-47bd345baece [2598903 FIX: SQL Server Agent job randomly stops when you schedule the job to run past midnight on specific days in SQL Server 2005, in SQL Server 2008 or in SQL Server 2008 R2]:http://support.microsoft.com/kb/2598903 @@ -1808,7 +1874,7 @@ All SQL Server 2014 CU downloads: [Catalog Update Microsoft SQL Server 2012](htt [940286 FIX: A Service Broker endpoint stops passing messages in a database mirroring session of SQL Server 2005]:http://support.microsoft.com/kb/940286 [937343 FIX: SQL Server 2005 stops and then restarts unexpectedly and errors occur in the tempdb database]:http://support.microsoft.com/kb/937343 [937545 FIX: Error message when you use the BULK INSERT statement to import a data file into a table in SQL Server 2005 with SP1: "The OLE DB provider "BULK" for linked server "(null)" reported an error"]:http://support.microsoft.com/kb/937545 -[933499 FIX: Error message when you use transactional replication to replicate the execution of stored procedures to subscribers in SQL Server 2005: "Insufficient memory to run query"]:https://support.microsoft.com/en-us/kb/933499 +[933499 FIX: Error message when you use transactional replication to replicate the execution of stored procedures to subscribers in SQL Server 2005: "Insufficient memory to run query"]:https://support.microsoft.com/kb/933499 [937544 FIX: You may receive error 3456 when you try to restore a transaction log for a SQL Server 2005 database]:http://support.microsoft.com/kb/937544 [937277 FIX: A memory leak occurs when you use the sp_OAMethod stored procedure to call a method of a COM object in SQL Server 2005]:http://support.microsoft.com/kb/937277 [934812 FIX: You cannot bring the SQL Server group online in a cluster environment after you rename the virtual server name of the default instance of SQL Server 2005]:http://support.microsoft.com/kb/934812 @@ -1882,7 +1948,7 @@ All SQL Server 2014 CU downloads: [Catalog Update Microsoft SQL Server 2012](htt [932555 FIX: A script task or a script component may not run correctly when you run an SSIS package in SQL Server 2005 build 2047]:http://support.microsoft.com/kb/932555 [SQL Server 2005 Service Pack 1 (SP1)]:http://www.microsoft.com/downloads/details.aspx?FamilyID=CB6C71EA-D649-47FF-9176-E7CAC58FD4BC [932556 FIX: A script task or a script component may not run correctly when you run an SSIS package in SQL Server 2005 build 1500 and later builds]:http://support.microsoft.com/kb/932556 -[926493 FIX: Error message when you restore a transaction-log backup that is generated in SQL Server 2000 SP4 to an instance of SQL Server 2005: "Msg 3456, Level 16, State 1, Line 1. Could not redo log record"]:https://support.microsoft.com/en-us/kb/926493 +[926493 FIX: Error message when you restore a transaction-log backup that is generated in SQL Server 2000 SP4 to an instance of SQL Server 2005: "Msg 3456, Level 16, State 1, Line 1. Could not redo log record"]:https://support.microsoft.com/kb/926493 [926292 FIX: When you query through a view that uses the ORDER BY clause in SQL Server 2005, the result is still returned in random order]:http://support.microsoft.com/kb/926292 [922527 FIX: Error message when you schedule some SQL Server 2005 Integration Services packages to run as jobs: "Package has been cancelled"]:http://support.microsoft.com/kb/922527 [922804 FIX: After you detach a Microsoft SQL Server 2005 database that resides on network-attached storage, you cannot reattach the SQL Server database]:http://support.microsoft.com/kb/922804 @@ -1905,14 +1971,7 @@ All SQL Server 2014 CU downloads: [Catalog Update Microsoft SQL Server 2012](htt [915306 FIX: The merge agent fails and a "permission denied" error message is logged when you synchronize a SQL Server 2005-based merge publication]:http://support.microsoft.com/kb/915306 [915112 FIX: Error message when an ADO.NET-connected application tries to reuse a connection from the connection pool in SQL Server 2005: "The request failed to run because the batch is aborted"]:http://support.microsoft.com/kb/915112 [913494 FIX: The merge agent does not use a specified custom user update to handle conflicting UPDATE statements in SQL Server 2005]:http://support.microsoft.com/kb/913494 -[913941 FIX: A SQL Server login may have more permissions when you log on to an instance of SQL Server 2005]:http://support.microsoft.com/kb/913941 -[912472 FIX: An incorrect result may appear in the subscribing database when you set database mirroring for a database and database failover occurs in SQL Server 2005]:http://support.microsoft.com/kb/912472 -[913371 FIX: You may receive error messages when you use the sp_cursoropen statement to open a cursor on a user-defined stored procedure in SQL Server 2005]:http://support.microsoft.com/kb/913371 -[912471 FIX: The replication on the server does not work any longer when you manually fail over databases in SQL Server 2005]:http://support.microsoft.com/kb/912471 -[911662 FIX: You may receive an access violation error message when you run a SELECT query in SQL Server 2005]:http://support.microsoft.com/kb/911662 -[915793 FIX: You cannot restore the log backups on the mirror server after you remove database mirroring for the mirror database in SQL Server 2005]:http://support.microsoft.com/kb/915793 -[910416 FIX: Error message when you run certain queries or certain stored procedures in SQL Server 2005: "A severe error occurred on the current command"]:http://support.microsoft.com/kb/910416 -[932557 FIX: A script task or a script component may not run correctly when you run an SSIS package in SQL Server 2005 build 1399]:https://support.microsoft.com/help/932557 +[913941 FIX: A SQL Server login may have more permissions when you log on to an instance of SQL Server 2005]:https://web.archive.org/web/20170712163528/https://support.microsoft.com/en-us/help/913494 ## Microsoft SQL Server 2000 Builds @@ -2316,7 +2375,7 @@ All SQL Server 2014 CU downloads: [Catalog Update Microsoft SQL Server 2012](htt | 7.00.517 | SQL Server 7.0 Beta 3 | | [948113 MS08-040: Description of the security update for SQL Server 7.0: July 8, 2008]:https://support.microsoft.com/help/941203 -[SQL Server 7.0 Service Pack 4 (SP4)]:https://www.microsoft.com/en-us/download/details.aspx?id=7959 +[SQL Server 7.0 Service Pack 4 (SP4)]:https://www.microsoft.com/download/details.aspx?id=7959 ## Microsoft SQL Server 6.5 Builds diff --git a/SSMS/README.md b/SSMS/README.md index 659bc931..54a9b822 100644 --- a/SSMS/README.md +++ b/SSMS/README.md @@ -5,17 +5,20 @@ It also provides tools to deploy, monitor, and upgrade the data-tier components, ## SSMS Guides -- [40 SSMS Tips](SSMS_Tips.md) -- [36 SSMS Addins](SSMS_Addins.md) +- [40 SSMS Tips](SSMS_Tips.md) (by Konstantin Taranov) +- [36 SSMS Addins](SSMS_Addins.md) (by Konstantin Taranov) - [SSMS Snippets](SSMS_Snippets) -- [SSMS Shortcuts](SSMS_Shortcuts.md) +- [SSMS Shortcuts](SSMS_Shortcuts.md) (by Konstantin Taranov) +- [A month of SSMS tips and tricks](https://blog.waynesheffield.com/wayne/archive/2018/02/ssms-tips-tricks/) (by Wayne Sheffield) +- [SSMS Tricks & Shortcuts](http://www.e-squillace.com/ssms-tricks-shortcuts/) (by George Squillace) +- [SSMS Tricks and Tips Ebook](https://sql-down-under.newzenler.com/f/ssms-tips-tricks-book) (by Greg Low) ### Useful Resources - [Download SQL Server Management Studio (SSMS)](https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms) - [SQL Server Management Studio - Changelog (SSMS)](https://docs.microsoft.com/en-us/sql/ssms/sql-server-management-studio-changelog-ssms) - [SQL Server Management Studio (SSMS) - Release Candidate](https://docs.microsoft.com/en-us/sql/ssms/sql-server-management-studio-ssms-release-candidate) - [Previous SQL Server Management Studio Releases](https://docs.microsoft.com/en-us/sql/ssms/previous-sql-server-management-studio-releases) -- [SQLSentry Latest Builds of Management Studio](http://blogs.sqlsentry.com/team-posts/latest-builds-management-studio/) +- [SQLSentry Latest Builds of Management Studio](https://www.sentryone.com/blog/team-posts/latest-builds-management-studio/) - [SQL Server Tools](https://docs.microsoft.com/en-us/sql/ssdt/sql-server-tools) - [SQL Server Management Studio (SSMS)](https://docs.microsoft.com/en-us/sql/ssms/sql-server-management-studio-ssms) - [Microsoft Download Center SSMS](https://www.microsoft.com/en-us/download/search.aspx?q=sql%20server%20management%20studio&p=0&r=10&t=&s=Relevancy~Descending) @@ -46,18 +49,18 @@ SSMS 18.x is based on the new Visual Studio 2017 Isolated Shell: The new shell u ## Available Languages -**SQL Server Management Studio 18.1 GA**: - [Chinese (People's Republic of China)](https://go.microsoft.com/fwlink/?linkid=2094583&clcid=0x804) | - [Chinese (Taiwan)](https://go.microsoft.com/fwlink/?linkid=2094583&clcid=0x404) | - [English (United States)](https://go.microsoft.com/fwlink/?linkid=2094583&clcid=0x409) | - [French](https://go.microsoft.com/fwlink/?linkid=2094583&clcid=0x40c) | - [German](https://go.microsoft.com/fwlink/?linkid=2094583&clcid=0x407) | - [Italian](https://go.microsoft.com/fwlink/?linkid=2094583&clcid=0x410) | - [Japanese](https://go.microsoft.com/fwlink/?linkid=2094583&clcid=0x411) | - [Korean](https://go.microsoft.com/fwlink/?linkid=2094583&clcid=0x412) | - [Portuguese (Brazil)](https://go.microsoft.com/fwlink/?linkid=2094583&clcid=0x416) | - [Russian](https://go.microsoft.com/fwlink/?linkid=2094583&clcid=0x419) | - [Spanish](https://go.microsoft.com/fwlink/?linkid=2094583&clcid=0x40a) +**SQL Server Management Studio 18.9.2 GA**: + [Chinese (People's Republic of China)](https://go.microsoft.com/fwlink/?linkid=2168063&clcid=0x804) | + [Chinese (Taiwan)](https://go.microsoft.com/fwlink/?linkid=2168063&clcid=0x404) | + [English (United States)](https://go.microsoft.com/fwlink/?linkid=2168063&clcid=0x409) | + [French](https://go.microsoft.com/fwlink/?linkid=2168063&clcid=0x40c) | + [German](https://go.microsoft.com/fwlink/?linkid=2168063&clcid=0x407) | + [Italian](https://go.microsoft.com/fwlink/?linkid=2168063&clcid=0x410) | + [Japanese](https://go.microsoft.com/fwlink/?linkid=2168063&clcid=0x411) | + [Korean](https://go.microsoft.com/fwlink/?linkid=2168063&clcid=0x412) | + [Portuguese (Brazil)](https://go.microsoft.com/fwlink/?linkid=2168063&clcid=0x416) | + [Russian](https://go.microsoft.com/fwlink/?linkid=2168063&clcid=0x419) | + [Spanish](https://go.microsoft.com/fwlink/?linkid=2168063&clcid=0x40a) ## SQL Server Management Studio Download Links and Release Info @@ -65,45 +68,72 @@ SSMS 18.x is based on the new Visual Studio 2017 Isolated Shell: The new shell u - **PP** - Public Preview - Size in Megabytes for English version -| Version/Download Link | Build | Release Date | Size, Mb | -| -------------------------------- | ------------- | ------------ | -------: | -| [18.1 GA Release] **Latest GA** | 15.0.18131.0 | 2019-06-11 | 527 | -| [18.0 GA Release] | 15.0.18118.0 | 2019-04-24 | 524 | -| [18.0 RC1 Release] | 15.0.18098.0 | 2019-03-28 | 484 | -| [18.0 Preview 7 Release] | 15.0.18092.0 | 2019-03-01 | 478 | -| [18.0 Preview 6 Release] | 15.0.18075.0 | 2018-12-18 | 457 | -| [18.0 Preview 5 Release] | 15.0.18068.0 | 2018-11-15 | 457 | -| [18.0 Preview 4 Release] | 15.0.18040.0 | 2018-09-24 | 456 | -| [17.9.1 Release] | 14.0.17289.0 | 2018-11-21 | 807 | -| [17.9 Release] | 14.0.17285.0 | 2018-09-04 | 807 | -| [17.8.1 Release] | 14.0.17277.0 | 2018-06-26 | 806 | -| [17.8 Release] **Deprecated** | 14.0.17276.0 | 2018-06-21 | 806 | -| [17.7 Release] | 14.0.17254.0 | 2018-05-09 | 803 | -| [17.6 Release] | 14.0.17230.0 | 2018-03-20 | 802 | -| [17.5 Release] | 14.0.17224.0 | 2018-02-15 | 802 | -| [17.4 Release] | 14.0.17213.0 | 2017-12-07 | 802 | -| [17.3 Release] | 14.0.17199.0 | 2017-10-09 | 801 | -| [17.2 Release] | 14.0.17177.0 | 2017-08-07 | 819 | -| [17.1 Release] | 14.0.17119.0 | 2017-05-24 | 784 | -| [17.0 Release] | 14.0.17099.0 | 2017-04-25 | 729 | -| [17.0 RC3 Release] | 14.0.17028.0 | 2017-03-09 | 677 | -| [17.0 RC2 Release] | 14.0.16150.0 | 2017-02-01 | 682 | -| [17.0 RC1 Release] | 14.0.16000.64 | 2016-11-16 | 687 | -| [16.5.3 Release] | 13.0.16106.4 | 2017-01-26 | 898 | -| 16.5.2 Release **Deprecated** | 13.0.16105.4 | 2017-01-18 | 898 | -| [16.5.1 Release] | 13.0.16100.1 | 2016-12-05 | 894 | -| [16.5 Release] | 13.0.16000.28 | 2016-10-26 | 894 | -| [16.4.1 Release] | 13.0.15900.1 | 2016-09-23 | 894 | -| 16.4 Release **Deprecated** | 13.0.15800.18 | 2016-09-20 | | -| [16.3 Release] | 13.0.15700.28 | 2016-08-15 | 806 | -| [July 2016 Hotfix Update] | 13.0.15600.2 | 2016-07-13 | 825 | -| July 2016 Release **Deprecated** | 13.0.15500.91 | 2016-07-01 | | -| [June 2016 Release] | 13.0.15000.23 | 2016-06-01 | 825 | -| [SQL Server 2014 SP1] | 12.0.4100.1 | 2015-05-14 | 815 | -| [SQL Server 2012 SP3] | 11.0.6020.0 | 2015-11-21 | 964 | -| [SQL Server 2008 R2] | 10.50.4000 | 2012-07-02 | 161 | - -[18.0 GA Release]:https://go.microsoft.com/fwlink/?linkid=2094583 +| Version/Download Link | Info | Build | Release Date | Size, Mb | +| --------------------------|----------------|---------------|--------------|---------:| +| [18.9.2 GA Release] | **Latest GA** | 15.0.18386.0 | 2021-07-15 | 642 | +| [18.9.1 GA Release] | | 15.0.18384.0 | 2021-04-20 | 635 | +| [18.9 GA Release] | | 15.0.18382.0 | 2021-04-15 | 635 | +| [18.8 GA Release] | | 15.0.18369.0 | 2020-12-17 | 640 | +| [18.7.1 GA Release] | | 15.0.18358.0 | 2020-10-27 | 635 | +| [18.7 GA Release] | | 15.0.18357.0 | 2020-10-20 | 635 | +| [18.6 GA Release] | | 15.0.18338.0 | 2020-07-22 | 534 | +| [18.5.1 GA Release] | | 15.0.18333.0 | 2020-06-09 | 535 | +| [18.5 GA Release] | | 15.0.18183.0 | 2020-04-07 | 535 | +| [18.4 GA Release] | | 15.0.18206.0 | 2019-11-04 | 539 | +| [18.3.1 GA Release] | | 15.0.18183.0 | 2019-10-02 | 534 | +| [18.3 GA Release] | | 15.0.18178.0 | 2019-09-23 | 534 | +| [18.2 GA Release] | | 15.0.18142.0 | 2019-07-25 | 528 | +| [18.1 GA Release] | | 15.0.18131.0 | 2019-06-11 | 527 | +| [18.0 GA Release] | | 15.0.18118.0 | 2019-04-24 | 524 | +| [18.0 RC1 Release] | | 15.0.18098.0 | 2019-03-28 | 484 | +| [18.0 Preview 7 Release] | | 15.0.18092.0 | 2019-03-01 | 478 | +| [18.0 Preview 6 Release] | | 15.0.18075.0 | 2018-12-18 | 457 | +| [18.0 Preview 5 Release] | | 15.0.18068.0 | 2018-11-15 | 457 | +| [18.0 Preview 4 Release] | | 15.0.18040.0 | 2018-09-24 | 456 | +| [17.9.1 Release] | **Latest 17** | 14.0.17289.0 | 2018-11-21 | 807 | +| [17.9 Release] | | 14.0.17285.0 | 2018-09-04 | 807 | +| [17.8.1 Release] | | 14.0.17277.0 | 2018-06-26 | 806 | +| [17.8 Release] | **Deprecated** | 14.0.17276.0 | 2018-06-21 | 806 | +| [17.7 Release] | | 14.0.17254.0 | 2018-05-09 | 803 | +| [17.6 Release] | | 14.0.17230.0 | 2018-03-20 | 802 | +| [17.5 Release] | | 14.0.17224.0 | 2018-02-15 | 802 | +| [17.4 Release] | | 14.0.17213.0 | 2017-12-07 | 802 | +| [17.3 Release] | | 14.0.17199.0 | 2017-10-09 | 801 | +| [17.2 Release] | | 14.0.17177.0 | 2017-08-07 | 819 | +| [17.1 Release] | | 14.0.17119.0 | 2017-05-24 | 784 | +| [17.0 Release] | | 14.0.17099.0 | 2017-04-25 | 729 | +| [17.0 RC3 Release] | | 14.0.17028.0 | 2017-03-09 | 677 | +| [17.0 RC2 Release] | | 14.0.16150.0 | 2017-02-01 | 682 | +| [17.0 RC1 Release] | | 14.0.16000.64 | 2016-11-16 | 687 | +| [16.5.3 Release] | **Latest 16** | 13.0.16106.4 | 2017-01-26 | 898 | +| 16.5.2 Release | **Deprecated** | 13.0.16105.4 | 2017-01-18 | 898 | +| [16.5.1 Release] | | 13.0.16100.1 | 2016-12-05 | 894 | +| [16.5 Release] | | 13.0.16000.28 | 2016-10-26 | 894 | +| [16.4.1 Release] | | 13.0.15900.1 | 2016-09-23 | 894 | +| 16.4 Release | **Deprecated** | 13.0.15800.18 | 2016-09-20 | | +| [16.3 Release] | | 13.0.15700.28 | 2016-08-15 | 806 | +| [July 2016 Hotfix Update] | | 13.0.15600.2 | 2016-07-13 | 825 | +| July 2016 Release | **Deprecated** | 13.0.15500.91 | 2016-07-01 | | +| [June 2016 Release] | | 13.0.15000.23 | 2016-06-01 | 825 | +| [SQL Server 2014 SP1] | | 12.0.4100.1 | 2015-05-14 | 815 | +| [SQL Server 2012 SP3] | | 11.0.6020.0 | 2015-11-21 | 964 | +| [SQL Server 2008 R2] | | 10.50.4000 | 2012-07-02 | 161 | + +[18.9.2 GA Release]:https://go.microsoft.com/fwlink/?linkid=2168063 +[18.9.1 GA Release]:https://go.microsoft.com/fwlink/?linkid=2161193 +[18.9 GA Release]:https://go.microsoft.com/fwlink/?linkid=2160964 +[18.8 GA Release]:https://go.microsoft.com/fwlink/?linkid=2151644 +[18.7.1 GA Release]:https://go.microsoft.com/fwlink/?linkid=2147207 +[18.7 GA Release]:https://go.microsoft.com/fwlink/?linkid=2146265 +[18.6 GA Release]:https://go.microsoft.com/fwlink/?linkid=2135491 +[18.5.1 GA Release]:https://go.microsoft.com/fwlink/?linkid=2132606 +[18.5 GA Release]:https://go.microsoft.com/fwlink/?linkid=2125901 +[18.4 GA Release]:https://go.microsoft.com/fwlink/?linkid=2108895 +[18.3.1 GA Release]:https://go.microsoft.com/fwlink/?linkid=2105412 +[18.3 GA Release]:https://go.microsoft.com/fwlink/?linkid=2104251 +[18.2 GA Release]:https://go.microsoft.com/fwlink/?linkid=2099720 +[18.1 GA Release]:https://go.microsoft.com/fwlink/?linkid=2094583 +[18.0 GA Release]:https://go.microsoft.com/fwlink/?linkid=2088649 [18.0 RC1 Release]:https://go.microsoft.com/fwlink/?linkid=2085742 [18.0 Preview 7 Release]:https://go.microsoft.com/fwlink/?linkid=2078638 [18.0 Preview 6 Release]:https://go.microsoft.com/fwlink/?linkid=2052501 diff --git a/SSMS/SSMS_Addins.md b/SSMS/SSMS_Addins.md index f970e1c4..985fc505 100644 --- a/SSMS/SSMS_Addins.md +++ b/SSMS/SSMS_Addins.md @@ -1,11 +1,11 @@ # SQL Server Management Studio add-ins -Complete list of useful and must have add-ins for SQL Server Management Studio - **37** SSMS add-ins +Complete list of useful and must have add-ins for SQL Server Management Studio - **38** SSMS add-ins | Name | Download page | Release Date | Support SSMS Version | Developer | Free version | Price | |-------------------------------------------------------|-------------------------------|--------------|:---------------------|----------------------|--------------|------:| -| [SSMSBoost](#ssmsboost) | [SSMSBoost] | 2019-01-09 | 2008-2018 | Solutions Crew GmbH | Yes | $150 | +| [SSMSBoost](#ssmsboost) | [SSMSBoost] | 2019-08-19 | 2008-2018 | Solutions Crew GmbH | Yes | $150 | +| [SQL Refactor Studio](#sql-refactor-studio) | [SQL Refactor Studio] | 2013-09-01 | 2013-2016 | SQL Refactor Studio Team | Yes | $17-25 | | [SqlSmash](#sqlsmash) | [SqlSmash] | 2017-06-10 | 2008-2017 | Smashing Jedis LLC | Yes | $99 | -| [SQL Code Guard](#sql-code-guard) | [Red Gate SQL Code Guard] | 2017-07-03 | 2016 | Red Gate | Yes | No | | [SQL Search](#sql-search) | [SQL Search] | 2017-02-27 | 2008-2017 | Red Gate | Yes | No | | [Red Gate SQL Test](#red-gate-sql-test) | [Red Gate SQL Test] | 2017-03-21 | 2008-2017 | Red Gate | No | $369 | | [Red Gate SQL Source Control](#red-gate-control) | [Red Gate SQL Source Control] | 2017-06-30 | 2012-2017 | Red Gate | No | $495 | @@ -15,19 +15,19 @@ Complete list of useful and must have add-ins for SQL Server Management Studio - | [SQL Sentry Plan Explorer](#sql-sentry-plan-explorer) | [SQL Sentry Plan Explorer] | 2017-05-25 | 2008-2017 | SQL Sentry | Yes | No | | [TSQL Code Smells Finder](#tsql-code-smells-finder) | [TSQL Code Smells Finder] | 2013-02-15 | 2008-2014 | Dave ballantyne | Yes | No | | [SQLTreeo](#sqltreeo) | [SQLTreeo] | 2017-06-06 | 2012-2017 | SQLTreeo | No | €50 | -| [ApexSQL Complete](#apexsql-complete) | [ApexSQL Complete] | 2017-10-26 | 2012-2017 | ApexSQL tools | Yes | No | -| [ApexSQL Refactor](#apexsql-refactor) | [ApexSQL Refactor] | 2017-07-13 | 2008-2017 | ApexSQL tools | Yes | No | -| [ApexSQL Search](#apexsql-search) | [ApexSQL Search] | 2017-06-19 | 2008-2017 | ApexSQL tools | Yes | No | -| [ApexSQL Source Control](#apexsql-source-control) | [ApexSQL Source Control] | 2017-10-12 | 2008-2017 | ApexSQL tools | No | $299 | -| [ApexSQL Unit Test](#apexsql-unit-test) | [ApexSQL Unit Test] | 2017-08-16 | 2008-2017 | ApexSQL tools | Yes | $499 | +| [ApexSQL Complete](#apexsql-complete) | [ApexSQL Complete] | 2021-01-20 | 2012-2019 | ApexSQL tools | No | $514 | +| [ApexSQL Refactor](#apexsql-refactor) | [ApexSQL Refactor] | 2021-01-20 | 2008-2019 | ApexSQL tools | No | $514 | +| [ApexSQL Search](#apexsql-search) | [ApexSQL Search] | 2021-01-20 | 2008-2019 | ApexSQL tools | No | $514 | +| [ApexSQL Source Control](#apexsql-source-control) | [ApexSQL Source Control] | 2021-01-20 | 2008-2019 | ApexSQL tools | No | $257 | +| [ApexSQL Unit Test](#apexsql-unit-test) | [ApexSQL Unit Test] | 2021-01-20 | 2008-2019 | ApexSQL tools | No | $514 | | [Spotlight Developer](#spotlight-developer) | [Spotlight Developer] | 2016-02-04 | 2008-2014 | Spotlight Essentials | Yes | No | -| [dbForge Source Control](#dbforge-source-control) | [dbForge Source Control] | 2018-12-21 | 2005-2018 | Devart | No | $249 | -| [dbForge Unit Test](#dbforge-unit-test) | [dbForge Unit Test] | 2018-12-21 | 2005-2018 | Devart | No | $199 | -| [dbForge Data Pump](#dbforge-data-pump) | [dbForge Data Pump] | 2018-12-21 | 2008-2018 | Devart | No | $149 | -| [dbForge Index Manager](#dbforge-index-manager) | [dbForge Index Manager] | 2018-12-21 | 2008-2018 | Devart | No | $99 | -| [dbForge Search](#dbforge-search) | [dbForge Search] | 2018-12-21 | 2008-2018 | Devart | Yes | No | -| [dbForge Monitor](#dbforge-monitor) | [dbForge Monitor] | 2018-12-21 | 2008-2018 | Devart | Yes | No | -| [dbForge SQL Complete](#dbforge-sql-complete) | [dbForge SQL Complete] | 2018-12-21 | 2000-2018 | Devart | Yes | $149 | +| [dbForge Source Control](#dbforge-source-control) | [dbForge Source Control] | 2019-10-10 | 2005-2018 | Devart | No | $249 | +| [dbForge Unit Test](#dbforge-unit-test) | [dbForge Unit Test] | 2019-10-10 | 2005-2018 | Devart | No | $199 | +| [dbForge Data Pump](#dbforge-data-pump) | [dbForge Data Pump] | 2019-10-10 | 2008-2018 | Devart | No | $149 | +| [dbForge Index Manager](#dbforge-index-manager) | [dbForge Index Manager] | 2021-09-10 | 2008-2018 | Devart | No | $119 | +| [dbForge Search](#dbforge-search) | [dbForge Search] | 2019-10-10 | 2008-2018 | Devart | Yes | No | +| [dbForge Monitor](#dbforge-monitor) | [dbForge Monitor] | 2019-10-10 | 2012-2018 | Devart | Yes | No | +| [dbForge SQL Complete](#dbforge-sql-complete) | [dbForge SQL Complete] | 2021-10-05 | 2000-2018 | Devart | Yes | $199 | | [SoftTree SQL Assistant](#softtree-sql-assistant) | [SoftTree SQL Assistant] | 2016-03-18 | 2008-2014 | SoftTree | No | $179 | | [SQL Enlight For SSMS](#sql-enlight-for-ssms) | [SQL Enlight For SSMS] | 2016-04-25 | 2008-2014 | UbitSoft | No | $195 | | [SQL Hunting Dog](#sql-hunting-dog) | [SQL Hunting Dog] | 2016-03-03 | 2008-2014 | Alex Maslyukov | Yes | No | @@ -35,11 +35,15 @@ Complete list of useful and must have add-ins for SQL Server Management Studio - | [Tabs Studio](#tabs-studio) | [Tabs Studio] | 2017-08-24 | 2012-2017 | Vlasov Studio | No | $49 | | [Workload Addin](#workload-addin) | [Workload Addin] | 2017-02-07 | 2008-2012 | Tomáš Bauer | Yes | No | | [SQL Server Diagnostics](#sql-server-diagnostics) | [SQL Server Diagnostics] | 2017-06-22 | 2016-2017 | Microsoft | Yes | No | -| [VersionSQL](#versionsql) | [VersionSQL] | 2017-02-16 | 2012-2017 | VersionSQL | Yes | $149 | +| [VersionSQL](#versionsql) | [VersionSQL] | 2017-02-16 | 2012-2017 | Wrism Innovations | Yes | $199 | | [Spotlight Tuning Pack](#spotlight-tuning-pack) | [Spotlight Tuning Pack] | 2018-06-01 | 2012-2017 | Quest Software Inc | Yes | $180 | | [Michel Max - SSMS Tools](#michel-max) | [Michel Max - SSMS Tools] | 2018-11-16 | 2012-2018 | Michel Max | Yes | No | | [SSMS Schema Folders](#ssms-schema-folders) | [SSMS Schema Folders] | 2018-10-06 | 2012-2018 | Nicholas Ross | Yes | No | | [Statistics Reporter](#statistics-reporter) | [Statistics Reporter] | 2019-04-17 | 2014-2018 | Analytics Bar | Yes | No | +| [SSMS Lizard](#ssms-lizard) | [SSMS Lizard] | 2020-06-15 | 2018-2018 | Lizard Labs Software | Yes | No | +| [SSMS Object Explorer Menu](#ssms-menu) | [SSMS Object Explorer Menu] | 2023-07-10 | 2018-2022 | Daniel Brink | Yes | No | +| [SQL Shades dark mode](#sql-shades) | [SQL Shades] | 2022-08-03 | 2018-2022 | Wrism Innovations | Yes | No | +| [Axial SQL Tools](#axial-sql-tools) | [Axial SQL Tools] | 2025-01-26 | 2022-2025 | Alex Bochkov | Yes | No | @@ -52,14 +56,57 @@ Free version: Yes
Price: $150 SSMSBoost add-in adds missing features and improves your productivity when working with Microsoft SQL Server in SQL Server Management Studio. - -The main goal of the project is to speed-up daily tasks of SQL DBA and SQL developers and to help you avoid destructive DML executions in production environments. + - SQL Code formatting + - GoTo Definition + - Run current statement + - Restore last session + - Export data to Excel + - Prohibit execution of UPDATE/DELETE without WHERE + - Connections manager + - Save/Visualize files stored in BLOB/TEXT fields + - Regions + - Code highlighting within INSERT/VALUES statement + - Connection coloring + - and even more... Licensing options: after 30 day trial period register and get free community license or buy the professional version. [Features list / SSMSBoost version comparison](http://www.ssmsboost.com/VersionCompare) + +## SQL Refactor Studio +Download page: [SQL Refactor Studio]
+Release date: 2013-09-01
+Support Version: 2013-2016
+Developer: SQL Refactor Studio Team
+Free version: Yes
+Price: $17-25 + +SQL Refactor Studio is a SQL Server Management Studio addin. It contains a lot of useful tools that help SQL Server developers to perform their daily routines. + +Key features of SQL Refactor Studio: +- Group Databases and Database Objects +- SQL Query History +- Generate C# classes +- Refactoring «Rename» +- View Dependencies +- Find Code +- Displaying calculations on the SSMS status bar +- Refactoring «Add CRUD Methods» +- Refactoring «Introduce Trigger for History» +- Refactoring «Add Lookup Table» +- Refactoring «Move Columns» +- Find Data +- Generate Select Statement +- Script Table Data +- Change collation of table columns +- Highlight all occurrences of selected word +- Scripting an object as ALTER +- Get row count +- Get Top(N) rows + + ## SqlSmash Download page: [SqlSmash]
@@ -86,25 +133,6 @@ Write maintainable SQL scripts, Understand code better and Navigate faster with - Go To Definition - -## SQL Code Guard -Download link: [Red Gate SQL Code Guard]
-Release date: 2017-02-17
-Support Version: 2016
-Developer: Red Gate
-Free version: Yes
-Price: No - -SQL Code Guard is a free solution for SQL Server that provides fast and comprehensive static analysis for T-Sql code, shows code complexity and objects dependencies. - - - Integration with SSMS 2016 - - Integration with Visual Studio 2012/2013 - - Checkin Policy for TFS (how to install & use) - - Support of msbuild (how to use msbuild) - - Command line utility (how to use command line utility). - - API for custom tool development (demo projects can be found in SQL Code Guard folder) - - ## SQL Search Download page: [SQL Search]
@@ -251,11 +279,11 @@ Price: €50 ## ApexSQL Complete Download page: [ApexSQL Complete]
-Release date: 2017-10-26
-Support Version: 2008-2017
+Release date: 2021-01-20
+Support Version: 2008-2019
Developer: ApexSQL tools
-Free version: Yes
-Price: No +Free version: No
+Price: $514 - Automatically complete SQL statements - Review an objects script and description @@ -270,11 +298,11 @@ Price: No ## ApexSQL Refactor Download page: [ApexSQL Refactor]
-Release date: 2017-05-08
-Support Version: 2008-2017
+Release date: 2021-01-20
+Support Version: 2008-2019
Developer: ApexSQL tools
-Free version: Yes
-Price: No +Free version: No
+Price: $514 With ApexSQL Refactor you can: - Format SQL with over 160 options @@ -290,11 +318,11 @@ With ApexSQL Refactor you can: ## ApexSQL Search Download page: [ApexSQL Search]
-Release date: 2017-06-19
-Support Version: 2008-2017
+Release date: 2021-01-20
+Support Version: 2008-2019
Developer: ApexSQL tools
-Free version: Yes
-Price: No +Free version: No
+Price: $514 With ApexSQL Search you can: - Search for SQL objects @@ -308,11 +336,11 @@ With ApexSQL Search you can: ## ApexSQL Source Control Download page: [ApexSQL Source Control]
-Release date: 2017-10-12
-Support Version: 2008-2017
+Release date: 2021-01-20
+Support Version: 2008-2019
Developer: ApexSQL tools
Free version: No
-Price: $299 +Price: $257 - Integrate SQL source control directly into SSMS - Use dedicated or shared development models @@ -327,8 +355,8 @@ Price: $299 ## ApexSQL Unit Test Download page: [ApexSQL Unit Test]
-Release date: 2017-08-22
-Support Version: 2008-2017
+Release date: 2021-01-20
+Support Version: 2008-2019
Developer: ApexSQL tools
Free version: No
Price: $499 @@ -364,7 +392,7 @@ You also get a FREE System health Check, Performance Health Analysis and compreh ## dbForge Source Control Download page: [dbForge Source Control]
-Release date: 2018-12-21
+Release date: 2019-10-10
Support Version: 2005-2018
Developer: Devart
Free version: No
@@ -377,7 +405,7 @@ The tool can link your databases to all popular source control systems, and deli ## dbForge Unit Test Download page: [dbForge Unit Test]
-Release date: 2018-12-21
+Release date: 2019-10-10
Support Version: 2005-2018
Developer: Devart
Free version: No
@@ -391,7 +419,7 @@ dbForge Unit Test for SQL Server functionality allows you to develop stable and ## dbForge Data Pump Download page: [dbForge Data Pump]
-Release date: 2018-12-21
+Release date: 2019-10-10
Support Version: 2008-2018
Developer: Devart
Free version: No
@@ -404,11 +432,11 @@ The tool supports import and export from 10+ widely used data formats (Text, MS ## dbForge Index Manager Download page: [dbForge Index Manager]
-Release date: 2018-12-21
+Release date: 2021-09-10
Support Version: 2008-2018
Developer: Devart
Free version: No
-Price: $99 +Price: $119 dbForge Index Manager for SQL Server is a handy SSMS add-in for analyzing the status of SQL indexes and fixing issues with index fragmentation. The tool allows you to quickly collect index fragmentation statistics and detect databases that require maintenance. @@ -419,7 +447,7 @@ dbForge Index Manager for SQL Server will significantly boost SQL Server perform ## dbForge Search Download page: [dbForge Search]
-Release date: 2018-12-21
+Release date: 2019-10-10
Support Version: 2008-2018
Developer: Devart
Free version: Yes
@@ -433,8 +461,8 @@ With dbForge Object Search for SQL Server you no longer need to look through the ## dbForge Monitor Download page: [dbForge Monitor]
-Release date: 2018-12-21
-Support Version: 2008-2018
+Release date: 2019-10-10
+Support Version: 2012-2018
Developer: Devart
Free version: Yes
Price: No @@ -448,11 +476,11 @@ Price: No ## dbForge SQL Complete Download page: [dbForge SQL Complete]
-Release date: 2018-12-21
+Release date: 2021-10-05
Support Version: 2000-2018
Developer: Devart
Free version: Yes
-Price: $149 +Price: $199 dbForge SQL Complete provides a wide range of code completion features that relieve users from remembering long and complex object names, column names, SQL operators, etc., but instead allows concentrating on writing high-quality SQL code with proper formatting that is easy to understand and interpret. @@ -648,8 +676,73 @@ Price: No Statistics Reporter SSMS Extension is a SQL Server Management Studio Add-in for parsing SET STATISTICS IO, TIME ON into a beautiful report. + +## SSMS Lizard +Download page: [SSMS Lizard]
+Release date: 2020-06-15
+Support Version: 2018-2018
+Developer: Lizard Labs Software
+Free version: Yes
+Price: No + +SSMS Lizard extends SQL Server Management Studio with a number of new features not previously seen on its user interfaces: + +- Show query results in advanced data grid (sorting, grouping, searching, filtering, tabs, conditional formatting, formula fields, column chooser, bookmarks, split view, etc...) +- Extend SQL quires with in-line Visual Basic (VB.Net) code. +- Print or export data to Excel, Word, PDF, HTML, TSV, CSV, RTF or TXT documents. +- Quickly attach the query results to an e-mail, FTP or even Google Drive with a single click of a button; and more. + + + +## SSMS Object Explorer Menu +Download page: [SSMS Object Explorer Menu]
+Release date: 2023-07-10
+Support Version: 2018-2023
+Developer: Daniel Brink
+Free version: Yes
+Price: No + +SSMS extension for adding custom menu items to the Object Explorer's right-click context menu. + + +## SQL Shades +Download page: [SQL Shades]
+Release date: 2022-08-03
+Support Version: 18+
+Developer: Wrism Innovations
+Free version: Yes
+Price: No + +Adds a true dark theme to SSMS. + + +## Axial SQL Tools +Download page: [Axial SQL Tools]
+Release date: 2025-01-26
+Support Version: 20+
+Developer: Alex Bochkov
+Free version: Yes
+Price: No + +Axial SQL Tools is a productivity add-in for SQL Server Management Studio 20/21, designed to streamline your workflow and address common limitations in SSMS. Built from the personal experience of a seasoned SQL Server engineer, this tool incorporates community feedback to continuously improve and simplify routine tasks. + +Main Features: +- Transaction Warning: Instantly see if you’ve left any transactions open. +- Precise Execution Time: Monitor query execution times down to the millisecond on the status bar. +- Format Any TSQL Code: Validate and format your TSQL code using the Microsoft TSQL parser for improved readability. +- Query Templates and Snippets: Access a library of query templates for common tasks, saving time on routine queries. +- Export Grid to Excel: Quickly export grid results directly into an Excel file. +- Export Grid to Email: Export grid results and send the file via email directly from SSMS. +- Export Grid as Temp Table: Convert grid results into temporary tables using generated INSERT statements. +- Script Selected Object Definition: Easily generate scripts for the definitions of selected objects from your query. +- Server Health Dashboard: Get a quick overview of the server’s key metrics. +- Right Alignment for Numeric Values in Grid: Automatically align numeric values to the right in the grid for better readability. +- BULK Data Transfer Between Two Open Connections: Seamlessly transfer bulk data between two open connections with a single click. +- Query History: Maintain a detailed log of executed queries for auditing and easy retrieval. + [SSMSBoost]:http://www.ssmsboost.com/ +[SQL Refactor Studio]: https://sqlrefactorstudio.com/ [SqlSmash]:http://www.sqlsmash.com/ [Red Gate SQL Code Guard]:https://www.red-gate.com/products/sql-development/sql-code-guard/ [SQL Search]:http://www.red-gate.com/products/sql-development/sql-search/ @@ -659,7 +752,7 @@ Statistics Reporter SSMS Extension is a SQL Server Management Studio Add-in for [dbForge SQL Complete]:https://www.devart.com/dbforge/sql/sqlcomplete/ordering.html [SSMS Tools Pack]:http://www.ssmstoolspack.com/Features [SQL Pretty Printer]:http://www.excel-sql-server.com/excel-sql-server-import-export-using-excel-add-ins.htm -[SQL Sentry Plan Explorer]:https://www.sqlsentry.com/products/plan-explorer/sql-server-query-view +[SQL Sentry Plan Explorer]:https://www.sentryone.com/plan-explorer [TSQL Code Smells Finder]:https://tsqlsmells.codeplex.com/releases/view/101979 [SQLTreeo]:http://www.sqltreeo.com/ [ApexSQL Complete]:http://www.apexsql.com/sql_tools_complete.aspx @@ -687,7 +780,11 @@ Statistics Reporter SSMS Extension is a SQL Server Management Studio Add-in for [Michel Max - SSMS Tools]:https://sourceforge.net/projects/michelmaxssmstools2017/ [SSMS Schema Folders]:https://github.com/nicholas-ross/SSMS-Schema-Folders [Statistics Reporter]:https://analyticsbar.com/blog/statistics-reporter-ssms-extension/ +[SSMS Object Explorer Menu]:https://github.com/brink-daniel/ssms-object-explorer-menu [SQL_Search Download]:https://download.red-gate.com/SQL_Search.exe [Apex SQL Search Download]:https://www.apexsql.com/zips/ApexSQLSearch.exe [DbForge Search Download]:https://www.devart.com/dbforge/sql/search/searchsql22std.exe +[SSMS Lizard]:https://www.lizard-labs.com/sql_server_management_studio_ssms_extesnsion_lizard.aspx +[SQL Shades]:https://www.sqlshades.com/ +[Axial SQL Tools]:(https://github.com/Axial-SQL/AxialSqlTools) diff --git a/SSMS/SSMS_Errors.md b/SSMS/SSMS_Errors.md index 5a2bb310..9aa198e8 100644 --- a/SSMS/SSMS_Errors.md +++ b/SSMS/SSMS_Errors.md @@ -1,12 +1,14 @@ # SSMS known errors and bugs - - [What to Do When You Get a "Cache is Out of Date" Error Message](https://www.databasejournal.com/features/mssql/what-to-do-when-you-get-a-cache-is-out-of-date-error-message.html) - - [CTRL+R does not hide the Query Result window in SSMS](https://stackoverflow.com/questions/17068661/ctrlr-does-not-hide-the-query-result-window-in-ssms) - - [SQL SERVER – Unable to Launch SSMS Error – Cannot Find One or More Components. Please Reinstall the Application](https://blog.sqlauthority.com/2017/12/06/sql-server-unable-launch-ssms-error-cannot-find-one-components-please-reinstall-application/) - - [Object Reference Not Set to an Instance of an Object’ When Failing Over an Availability Group Using SSMS <= 17.5](https://sqlundercover.com/2018/03/29/object-reference-not-set-to-an-instance-of-an-object-when-failing-over-an-availability-group-using-ssms-17-5/) - - [File Growth Rate – The GUI Lies](https://sqlrus.com/2018/06/file-growth-rate-the-gui-lies/) - - [SSMS: Allow forcing case-insensitive matching in Object Explorer filters](https://feedback.azure.com/forums/908035-sql-server/suggestions/36679522-ssms-allow-forcing-case-insensitive-matching-in-o) - - [SSMS: Object Explorer Filtering allows for SQL Injection (oops)](https://feedback.azure.com/forums/908035-sql-server/suggestions/36678803-ssms-object-explorer-filtering-allows-for-sql-inj) - - [SSMS won't open scripts on double-click](https://stackoverflow.com/q/1726577/2298061) - - [SSMS Crash While Using Backup to URL or Connecting to Storage](https://blog.sqlauthority.com/2018/10/09/sql-server-sql-server-management-studio-crash-while-using-backup-to-url-or-connecting-to-storage/) - - [Error in SSMS: Attempted to read or write protected memory.](https://sqlstudies.com/2019/02/18/error-in-ssms-attempted-to-read-or-write-protected-memory/) +- [What to Do When You Get a "Cache is Out of Date" Error Message](https://www.databasejournal.com/features/mssql/what-to-do-when-you-get-a-cache-is-out-of-date-error-message.html) +- [CTRL+R does not hide the Query Result window in SSMS](https://stackoverflow.com/questions/17068661/ctrlr-does-not-hide-the-query-result-window-in-ssms) +- [SQL SERVER – Unable to Launch SSMS Error – Cannot Find One or More Components. Please Reinstall the Application](https://blog.sqlauthority.com/2017/12/06/sql-server-unable-launch-ssms-error-cannot-find-one-components-please-reinstall-application/) +- [Object Reference Not Set to an Instance of an Object’ When Failing Over an Availability Group Using SSMS <= 17.5](https://sqlundercover.com/2018/03/29/object-reference-not-set-to-an-instance-of-an-object-when-failing-over-an-availability-group-using-ssms-17-5/) +- [File Growth Rate – The GUI Lies](https://sqlrus.com/2018/06/file-growth-rate-the-gui-lies/) +- [SSMS: Allow forcing case-insensitive matching in Object Explorer filters](https://feedback.azure.com/forums/908035-sql-server/suggestions/36679522-ssms-allow-forcing-case-insensitive-matching-in-o) +- [SSMS: Object Explorer Filtering allows for SQL Injection (oops)](https://feedback.azure.com/forums/908035-sql-server/suggestions/36678803-ssms-object-explorer-filtering-allows-for-sql-inj) +- [SSMS won't open scripts on double-click](https://stackoverflow.com/q/1726577/2298061) +- [SSMS Crash While Using Backup to URL or Connecting to Storage](https://blog.sqlauthority.com/2018/10/09/sql-server-sql-server-management-studio-crash-while-using-backup-to-url-or-connecting-to-storage/) +- [Error in SSMS: Attempted to read or write protected memory.](https://sqlstudies.com/2019/02/18/error-in-ssms-attempted-to-read-or-write-protected-memory/) +- [SSMS Sequence Contains No Elements](https://thomaslarock.com/2020/01/sequence-contains-no-elements/) +- [SQL Server Management Studio Connection to Integration Services Error Class Not Registered](https://www.mssqltips.com/sqlservertip/6479/sql-server-management-studio-connection-to-integration-services-error-class-not-registered/) diff --git a/SSMS/SSMS_Tips.md b/SSMS/SSMS_Tips.md index f955149a..01f6acaa 100644 --- a/SSMS/SSMS_Tips.md +++ b/SSMS/SSMS_Tips.md @@ -57,47 +57,49 @@ Most tips works for SSMS higher 2008 but some of them only works for SSMS 2016 a 37. [AutoRecover in SSMS](#37) 38. [View and query Power BI .pbix files in SSMS](#38) 39. [Using SSMS to analyze Power BI with XMLA](#39) -40. [Reference](#reference) +40. [SSMS shortcut to comment/uncomment a specific part of the query](#40) +41. [Reference](#reference) **Great thanks to**: - - Kendra Little ([b](http://www.littlekendra.com/) | [t](https://twitter.com/Kendra_Little)) - - Slava Murygin ([b](http://slavasql.blogspot.ru/)) - - Mike Milligan ([b](http://www.bidn.com/Blogs/userid/43/author/mike-milligan)) - - Kenneth Fisher ([b](https://twitter.com/sqlstudent144) | [t](https://twitter.com/sqlstudent144)) - - William Durkin ([b](http://www.williamdurkin.com/) | [t](https://twitter.com/sql_williamd)) - - John Morehouse ([b](http://sqlrus.com/) | [t](http://twitter.com/sqlrus)) - - Phil Factor ([b](https://www.red-gate.com/simple-talk/author/phil-factor/) | [t](https://twitter.com/phil_factor)) - - Klaus Aschenbrenner ([b](https://www.sqlpassion.at/) | [t](https://twitter.com/Aschenbrenner)) - - Latish Sehgal ([b](http://www.dotnetsurfers.com/)) - - Arvind Shyamsundar ([b](https://blogs.msdn.microsoft.com/arvindsh/)) - - [SQLMatters](http://www.sqlmatters.com/) - - [MSSQLTips](https://www.mssqltips.com/) - - Anthony Zanevsky, Andrew Zanevsky and Katrin Zanevsky - - Andy Mallon ([b](http://www.am2.co/) | [t](https://twitter.com/AMtwo)) - - Aaron Bertrand ([b](http://sqlperformance.com/author/abertrand) | [t](https://twitter.com/AaronBertrand)) - - Daniel Calbimonte ([b](https://www.sqlshack.com/author/daniel-calbimonte/) | [t](https://twitter.com/dcalbimonte)) - - Ahmad Yaseen ([b](https://www.sqlshack.com/author/ahmad-yaseen/) | [t](https://twitter.com/AhmadZYaseen)) - - Solomon Rutzky ([b](https://sqlquantumleap.com/) | [t](https://twitter.com/SqlQuantumLeap)) - - Bert Wagner ([b](https://blogs.sentryone.com) | [t](https://twitter.com/bertwagner)) - - Thomas LaRock ([b](https://thomaslarock.com/) | [t](https://twitter.com/SQLRockstar)) - - Jen Mccown ([b](http://www.midnightdba.com/Jen/author/jen/)) - - Louis Davidson ([b](https://www.red-gate.com/simple-talk/author/louis-davidson/) | [t](https://twitter.com/drsql)) - - Solomon Rutzky ([b](https://sqlquantumleap.com) | [t](https://twitter.com/srutzky)) - - Michelle Haarhues ([b](https://witsociety.wordpress.com/) | [t](https://twitter.com/mhaarhues)) - - Christian Wade ([b](https://witsociety.wordpress.com/) | [t](https://twitter.com/_christianWade)) - - Kellyn Pot’Vin-Gorman ([b](https://dbakevlar.com/) | [t](https://twitter.com/DBAKevlar)) - - Kevin Feasel ([b](https://36chambers.wordpress.com) | [t](https://twitter.com/feaselkl)) +- Kendra Little ([b](http://www.littlekendra.com/) | [t](https://twitter.com/Kendra_Little)) +- Slava Murygin ([b](http://slavasql.blogspot.ru/)) +- Mike Milligan ([b](http://www.bidn.com/Blogs/userid/43/author/mike-milligan)) +- Kenneth Fisher ([b](https://twitter.com/sqlstudent144) | [t](https://twitter.com/sqlstudent144)) +- William Durkin ([b](http://www.williamdurkin.com/) | [t](https://twitter.com/sql_williamd)) +- John Morehouse ([b](http://sqlrus.com/) | [t](http://twitter.com/sqlrus)) +- Phil Factor ([b](https://www.red-gate.com/simple-talk/author/phil-factor/) | [t](https://twitter.com/phil_factor)) +- Klaus Aschenbrenner ([b](https://www.sqlpassion.at/) | [t](https://twitter.com/Aschenbrenner)) +- Latish Sehgal ([b](http://www.dotnetsurfers.com/)) +- Arvind Shyamsundar ([b](https://blogs.msdn.microsoft.com/arvindsh/)) +- [SQLMatters](http://www.sqlmatters.com/) +- [MSSQLTips](https://www.mssqltips.com/) +- Anthony Zanevsky, Andrew Zanevsky and Katrin Zanevsky +- Andy Mallon ([b](http://www.am2.co/) | [t](https://twitter.com/AMtwo)) +- Aaron Bertrand ([b](http://sqlperformance.com/author/abertrand) | [t](https://twitter.com/AaronBertrand)) +- Daniel Calbimonte ([b](https://www.sqlshack.com/author/daniel-calbimonte/) | [t](https://twitter.com/dcalbimonte)) +- Ahmad Yaseen ([b](https://www.sqlshack.com/author/ahmad-yaseen/) | [t](https://twitter.com/AhmadZYaseen)) +- Solomon Rutzky ([b](https://sqlquantumleap.com/) | [t](https://twitter.com/SqlQuantumLeap)) +- Bert Wagner ([b](https://bertwagner.com/category/sql.html) | [t](https://twitter.com/bertwagner)) +- Thomas LaRock ([b](https://thomaslarock.com/) | [t](https://twitter.com/SQLRockstar)) +- Jen Mccown ([b](http://www.midnightdba.com/Jen/author/jen/)) +- Louis Davidson ([b](https://www.red-gate.com/simple-talk/author/louis-davidson/) | [t](https://twitter.com/drsql)) +- Solomon Rutzky ([b](https://sqlquantumleap.com) | [t](https://twitter.com/srutzky)) +- Michelle Haarhues ([b](https://witsociety.wordpress.com/) | [t](https://twitter.com/mhaarhues)) +- Christian Wade ([b](https://witsociety.wordpress.com/) | [t](https://twitter.com/_christianWade)) +- Kellyn Pot’Vin-Gorman ([b](https://dbakevlar.com/) | [t](https://twitter.com/DBAKevlar)) +- Kevin Feasel ([b](https://36chambers.wordpress.com) | [t](https://twitter.com/feaselkl)) +- Brent Ozar ([b](https://www.brentozar.com/) | [@BrentO](https://twitter.com/BrentO)) -## Import and Export Settings +## 1. Import and Export Settings `Tools > Options > Environment > Import and Export Settings` Default settings (if you need to compare with yours) you can find here: [SSMS settings files](https://github.com/ktaranov/sqlserver-kit/tree/master/SSMS/SSMS_vssettings) You can configure so many settings in SSMS and then export it and use on all your computers. -Below link provide detailed instruction and awesome Dark theme configuration: [Making SSMS Pretty: My Dark Theme](https://blogs.sentryone.com/aaronbertrand/making-ssms-pretty-my-dark-theme/) +Below link provide detailed instruction and awesome Dark theme configuration: [Making SSMS Pretty: My Dark Theme](https://www.sentryone.com/blog/aaronbertrand/making-ssms-pretty-my-dark-theme/) Also you can create shared team settings file and use it from network location. Detailed information you can find in this article [Symbolic Links for Sharing Template Files or "How I Broke Management Studio with Symbolic Links"](http://sqlmag.com/sql-server/symbolic-links-sharing-template-files-or-how-i-broke-management-studio-symbolic-links) @@ -106,8 +108,8 @@ Detailed information you can find in this article [Symbolic Links for Sharing Te -## SSMS Shortcuts -All shortcuts you can find [here](https://github.com/ktaranov/sqlserver-kit/blob/master/SSMS/SSMS_Shortcuts.md) +## 2. SSMS Shortcuts +All shortcuts you can find [here](https://github.com/ktaranov/sqlserver-kit/blob/master/SSMS/SSMS_Shortcuts.md). Known problem for SSMS 2012 and 2014: [CTRL+R does not hide the Query Result window in SSMS] Create custom shortcut as simple as possible: @@ -146,7 +148,7 @@ Most useful are: -## Keyboard Shortcuts for Favorite Stored Procedures and Scripts +## 3. Keyboard Shortcuts for Favorite Stored Procedures and Scripts A query shortcut allows you to execute code simply by hitting Ctrl and a number key. Cool. But first, there are a few things to know about query shortcuts: 1. The window in SSMS where you configure the query shortcuts has the text field for the shortcut labeled as **Stored Procedure**, which is misleading because you can specify a query. You can even specify multiple queries. @@ -163,7 +165,7 @@ For another 9 shortcuts my recommendation awesome open source Brent Ozar teams p | Query Shortcut | Stored Procedure | |-------------------------|----------------------| | Alt + F1 | [sp_help] | -| Ctrl + F1 | [sp_WhoIsActive] | +| Ctrl + F1 | [`sp_WhoIsActive`] | | Ctrl + 1 | [sp_who] | | Ctrl + 2 | [sp_lock] | | Ctrl + 3 | [sp_Blitz] | @@ -182,7 +184,7 @@ Also recommended: [sp_help]:https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-help-transact-sql [sp_who]:https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-who-transact-sql [sp_lock]:https://docs.microsoft.com/en-us/sql/relational-databases/system-stored-procedures/sp-lock-transact-sql -[sp_WhoIsActive]:http://whoisactive.com +[`sp_WhoIsActive`]:http://whoisactive.com [sp_Blitz]:https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/blob/dev/sp_Blitz.sql [sp_BlitzBackups]:https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/blob/dev/sp_BlitzBackups.sql [sp_BlitzCache]:https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/blob/dev/sp_BlitzCache.sql @@ -196,43 +198,50 @@ Also recommended: [sp_foreachdb]:https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/blob/dev/sp_foreachdb.sql [usp_BulkUpload]:https://github.com/ktaranov/sqlserver-kit/blob/master/Stored_Procedure/usp_BulkUpload.sql -### Some useful shortcuts for `sp_WhoIsActive from Kevin Feasel -More details [here](https://36chambers.wordpress.com/2019/04/02/whoisactive-in-ssms/) +### Some useful shortcuts for `sp_WhoIsActive` from Kevin Feasel +More details [here](https://36chambers.wordpress.com/2019/04/02/whoisactive-in-ssms/). What’s Going On shortcut? -`EXEC sp_whoisactive @get_full_inner_text = 1, @get_outer_command = 1, @find_block_leaders = 1, @get_task_info = 2, @get_transaction_info = 1, @get_plans = 0, @output_column_list = '[session_id][login_name][dd%][CPU][reads][writes][wait_info][blocking_session_id][blocked_session_count][sql_text][sql_command][status][tempdb_%][%]', @sort_order = '[session_id]';` +```tsql +EXEC sp_whoisactive + @get_full_inner_text = 1 + , @get_outer_command = 1 + , @find_block_leaders = 1 + , @get_task_info = 2 + , @get_transaction_info = 1 + , @get_plans = 0 + , @output_column_list = '[session_id][login_name][dd%][CPU][reads][writes][wait_info][blocking_session_id][blocked_session_count][sql_text][sql_command][status][tempdb_%][%]' + , @sort_order = '[session_id]'; +``` And here it is in a little bit nicer of a format so we can cover it: -```sql +```tsql EXEC sp_whoisactive - @get_full_inner_text = 1, - @get_outer_command = 1, - @find_block_leaders = 1, - @get_task_info = 2, - @get_transaction_info = 1, - @get_plans = 0, - @output_column_list = '[session_id][login_name][dd%][CPU][reads][writes][wait_info][blocking_session_id][blocked_session_count][sql_text][sql_command][status][tempdb_%][%]', - @sort_order = '[session_id]'; + @get_full_inner_text = 1 + , @get_outer_command = 1 + , @find_block_leaders = 1 + , @get_task_info = 2 + , @get_transaction_info = 1 + , @get_plans = 0 + , @output_column_list = '[session_id][login_name][dd%][CPU][reads][writes][wait_info][blocking_session_id][blocked_session_count][sql_text][sql_command][status][tempdb_%][%]' + , @sort_order = '[session_id]'; ``` When you need to get execution plans, that’s when I break out Ctrl+4. Here is the one-liner: -`EXEC sp_whoisactive @get_full_inner_text = 1, @get_outer_command = 1, @find_block_leaders = 1, @get_task_info = 2, @get_transaction_info = 1, @get_plans = 1, @output_column_list = '[session_id][login_name][dd%][CPU][reads][writes][wait_info][blocking_session_id][blocked_session_count][sql_text][sql_command][status][tempdb_%][%]', @sort_order = '[session_id]';` - -Formatted: -``` +```tsql EXEC sp_whoisactive - @get_full_inner_text = 1, - @get_outer_command = 1, - @find_block_leaders = 1, - @get_task_info = 2, - @get_transaction_info = 1, - @get_plans = 1, - @output_column_list = '[session_id][login_name][dd%][CPU][reads][writes][wait_info][blocking_session_id][blocked_session_count][sql_text][sql_command][status][tempdb_%][%]', - @sort_order = '[session_id]'; + @get_full_inner_text = 1 + , @get_outer_command = 1 + , @find_block_leaders = 1 + , @get_task_info = 2 + , @get_transaction_info = 1 + , @get_plans = 1 + , @output_column_list = '[session_id][login_name][dd%][CPU][reads][writes][wait_info][blocking_session_id][blocked_session_count][sql_text][sql_command][status][tempdb_%][%]' + , @sort_order = '[session_id]'; ``` -## SSMS Scripting Option +## 4. SSMS Scripting Option ### Script any object with data `Right click on database name > Tasks > Generate Scripts …` @@ -252,7 +261,7 @@ More details here: [What’s new in SQL Server Management Studio 17.2; Authentic -## Selecting a block of text using the ALT Key +## 5. Selecting a block of text using the ALT Key By holding down the ALT key as you select a block of text you can control the width of the selection region as well as the number of rows. Also you can activate multi line mode with `Shift + Alt` keys and using keyboard arrows to format multi line code. @@ -264,7 +273,7 @@ More info and video about this awesome feature in this article: [My Favorite SSM -## Script Table and Column Names by Dragging from Object Explorer +## 6. Script Table and Column Names by Dragging from Object Explorer Save keystrokes by dragging Drag the `Columns` folder for a table in to auto-type all column names in the table in a single line. - Warning: this doesn’t include square [brackets] around the column names for SSMS below 17 version, so if your columns contain spaces or special characters at the beginning, this shortcut isn’t for you @@ -272,7 +281,7 @@ Drag the `Columns` folder for a table in to auto-type all column names in the ta -## Disable Copy of Empty Text +## 7. Disable Copy of Empty Text - Select a block of text to copy; - Move the cursor the place where you want to paste the code; @@ -285,7 +294,7 @@ This behavior can be disabled in SSMS: go to `Tools > Options > Text Editor > Al -## Client Statistics +## 8. Client Statistics When you enable that option for your session (`Ctrl + Alt + S`), SQL Server Management Studio will give you more information about the client side processing of your query. The Network Statistics shows you the following information: @@ -302,7 +311,7 @@ The Time Statistics additionally shows you the following information: -## Configure Object Explorer to Script Compression and Partition Schemes for Indexes +## 9. Configure Object Explorer to Script Compression and Partition Schemes for Indexes Is this index compressed or partitioned? By default, you wouldn’t know just by scripting out the index from Object Explorer. If you script out indexes this way to check them into source code, or to tweak the definition slightly, this can lead you to make mistakes. @@ -316,7 +325,7 @@ You can make sure you’re aware when indexes have compression or are partitione -## Using GO X to Execute a Batch or Statement Multiple Times +## 10. Using GO X to Execute a Batch or Statement Multiple Times The `GO` command marks the end of a batch of statements that should be sent to SQL Server for processing, and then compiled into a single execution plan. By specifying a number after the `GO` the batch can be run specified number of times. This can be useful if, for instance, you want to create test data by running an insert statement a number of times. Note that this is not a Transact SQL statement and will only work in Management Studio (and also SQLCMD or OSQL). For instance the following SQL can be run in SSMS : @@ -340,7 +349,7 @@ In this case this is a simpler alternative than creating a cursor or while loop. -## SSMS Template Replacement +## 11. SSMS Template Replacement One under-used feature of Management Studio is the template replacement feature. SSMS comes with a library of templates, but you can also make your own templates for reusable scripts. In your saved .sql script, just use the magic incantation to denote the parameters for replacement. The format is simple: `` @@ -349,7 +358,7 @@ Then, when you open the `.sql` script, you hit `CTRL + Shift + M`, and SSMS will -## Color coding of connections +## 12. Color coding of connections SQL Server Management Studio has the capability of coloring the bar at the bottom of each query window, with the color dependent on which server is connected. This can be useful in order to provide a visual check of the server that a query is to be run against, for instance to color code production instances as red, development as green and amber as test. This can also be used in conjunction with Registered Servers and CMS (Central Management Server). @@ -358,7 +367,7 @@ Select the check box towards the bottom of the window and use the ‘Select… -## SQLCMD mode +## 13. SQLCMD mode Switching on SQLCMD mode enables a number of useful extra scripting style commands in SSMS. In particular you can use it to change to the connection credentials within the query window, so that you can run a query against multiple servers from the same query window. There are more details of how to do this here: [Changing the SQL Server connection within an SSMS Query Windows using SQLCMD Mode](http://www.sqlmatters.com/Articles/Changing%20the%20SQL%20Server%20connection%20within%20an%20SSMS%20Query%20Windows%20using%20SQLCMD%20Mode.aspx) @@ -371,18 +380,18 @@ Also some great tips from Louis Davidson article: [Using SQLCMD, End Execution o -## Script multiple objects using the Object Explorer Details Windows +## 14. Script multiple objects using the Object Explorer Details Windows Individual database objects, such as a table or stored procedure, can be scripted within SSMS by right clicking on the object within Object Explorer and selecting the appropriate item in the drop down menu. However if you have a lot of objects to script that can quickly become time consuming. Fortunately it’s possible to select multiple objects and script them up all together in a single query window. To do this just open the Object Explorer Details window from the View menu (or press the F7 key). If you want to script up multiple (or all) tables, select the Tables item under the relevant database in Object Explorer. A list of all tables appears in the Object Explorer Details window. -Select the tables you want to script (using the Control key if necessary) and then right click and select which script option you want – e.g. to create a table create script for all tables +Select the tables you want to script (using the Control key if necessary) and then right click and select which script option you want – e.g. to create a table create script for all tables. -## Registered Servers / Central Management Server +## 15. Registered Servers / Central Management Server If you have a lot of servers then re-entering the details in Object Explorer every time you start SSMS can be frustrating and time consuming. Fortunately there are two facilities within SSMS that enable these details to be entered just once and "remembered" each time you open up SSMS. These two facilities are **Registered Servers** and **Central Management Servers**. @@ -400,7 +409,7 @@ A significant limitation with CMS is that the CMS server itself can’t be inclu -## Splitting the Query Window and Annotations and Map Mode for Vertical Scroll Bar +## 16. Splitting the Query Window and Annotations and Map Mode for Vertical Scroll Bar The query window in SSMS can be split into two so that you can look at two parts of the same query simultaneously. Both parts of the split window can be scrolled independently. This is especially useful if you have a large query and want to compare different areas of the same query. To split the window simply drag the bar to the top right hand side of the window as shown below. @@ -423,14 +432,14 @@ There are four types of annotations, the first three of which are shown in their -## Moving columns in the results pane +## 17. Moving columns in the results pane It may not be immediately obvious but you can switch columns around in the results pane when using the grid view, by dragging the column headers and dropping them next to another column header. This can be useful if you want to rearrange how the results are displayed without amending the query, especially if you have a lot of columns in your result set. This works only for one column. -## Generating Charts and Drawings in SQL Server Management Studio +## 18. Generating Charts and Drawings in SQL Server Management Studio You don't have to settle for T-SQL's monochrome text output. These stored procedures let you quickly and easily turn your SELECT queries' output into colorized charts and even computer-generated art. To turn your own data into a line, column, area, or bar chart using the Chart stored procedure, you need to design a SELECT query that serves as the first parameter in the stored procedure call. @@ -440,7 +449,7 @@ Also you can generate amazing chart using awesome R libraries, detailed article: -## Additional Connection Parameters +## 19. Additional Connection Parameters One such change SSMS got for free is the connection resiliency logic within the `SqlConnection.Open()` method. To improve the default experience for clients which connect to Azure SQL Database, the above method will (in the case of initial connection errors / timeouts) now retry 1 time after sleeping for 10 seconds. These numbers are configurable by properties called ConnectRetryCount (default value 1) and ConnectRetryInterval (default value 10 seconds.) The previous versions of the SqlConnection class would not automatically retry in cases of connection failure. @@ -454,14 +463,14 @@ ConnectRetryCount=0 -## Working with tabs headers +## 20. Working with tabs headers You can view [SPID](https://docs.microsoft.com/en-us/sql/t-sql/functions/spid-transact-sql) in tabs header, quickly open script containing folder or copy script file path. ![Working with tabs headers](/SSMS/SSMS_Tips/working_with_tabs_headers.png) -## Hiding tables in SSMS Object Explorer +## 21. Hiding tables in SSMS Object Explorer 1. You can actually hide an object from object explorer by assigning a specific extended property: ``` EXEC sp_addextendedproperty @@ -494,14 +503,14 @@ In the case of SPs the code, same with Views and in the case of Tables it’s th -## UnDock Tabs and Windows for Multi Monitor Support +## 22. UnDock Tabs and Windows for Multi Monitor Support From SSMS 2012 and onwards, you can easily dock/undock the query tabs as well as different object windows inside SSMS to make better use of the screen real estate and multiple monitors you have. ![UnDock Tabs and Windows for Multi Monitor Support](/SSMS/SSMS_Tips/undock_tabs_and_windows_for_multi_monitor_support.gif) -## RegEx-Based Finding and Replacing of Text in SSMS +## 23. RegEx-Based Finding and Replacing of Text in SSMS So often, one sees developers doing repetitive coding in SSMS or Visual Studio that would be much quicker and easier by using the built-in Regular-Expression-based Find/Replace functionality. It is understandable, since the syntax is odd and some features are missing, but it is still well-worth knowing about. @@ -511,7 +520,7 @@ My favorite regex: replace `\t` on `\n, `. It useful in many cases when you have -## Changing what SSMS opens on startup +## 24. Changing what SSMS opens on startup The more interesting way to look at this shortcut is to check the various options available with SSMS command line parameters. To check them, use the following command: ``` @@ -548,7 +557,7 @@ This is the complete text of shortcut properties: -## Modifying New Query Template +## 25. Modifying New Query Template You can modified New Query template for any instance SQL Server: ``` C:\Program Files (x86)\Microsoft SQL Server\[140|130|120|110]\Tools\Binn\ ManagementStudio\SqlWorkbenchProjectItems\Sql\SQLFile.sql @@ -567,7 +576,7 @@ Thanks for this tip Aaron Bertrand: [T-SQL Tuesday #92: Lessons Learned the Hard -## Query Execution Options +## 26. Query Execution Options More detailed article here: [Knowing the Options] The options represent the SET values of the current session. @@ -653,7 +662,7 @@ SELECT 'XACT_ABORT' AS 'Option', CASE @@options & 16384 WHEN 0 THEN -## SQL Server Diagnostics Extension +## 27. SQL Server Diagnostics Extension Analyze Dumps – Customers using this extension will be able to debug and self-resolve memory dump issues from their SQL Server instances and receive recommended Knowledge Base (KB) article(s) from Microsoft, which may be applicable for the fix. The memory dumps are stored in a secured and compliant manner as governed by the [Microsoft Privacy Policy](https://privacy.microsoft.com/en-us/privacystatement). @@ -667,7 +676,7 @@ More details here: [SQL Server Diagnostics Extension for SSMS] and [SQL Server D -## Connect to SQL Servers in another domain using Windows Authentication +## 28. Connect to SQL Servers in another domain using Windows Authentication You may find that you need to connect remotely to a SQL Server that is in another domain. This is a problem when SQL authentication is not an option, because Windows machine is in its own domain; Management Studio cannot directly override the local Windows credentials and pass the credentials for a remote domain user. @@ -703,7 +712,7 @@ More details here: [Connect to SQL Servers in another domain using Windows Authe -## SSMS Default Reports +## 29. SSMS Default Reports By right-clicking on the SQL Server instance and navigating to `Reports > Standard Reports`, you can see the predefined SSMS reports: ![SSMS_Server_Default_Reports](/SSMS/SSMS_Tips/29_SSMS_Server_Default_Reports.png) @@ -717,7 +726,7 @@ Useful another reports information: -## Live Query Statistics +## 30. Live Query Statistics SQL Server Management Studio provides the ability to view the live execution plan of an active query. This live query plan provides real-time insights into the query execution process as the controls flow from one query plan operator to another. The live query plan displays the overall query progress and operator-level run-time execution statistics such as the number of rows produced, elapsed time, operator progress, etc. @@ -732,14 +741,14 @@ This feature can be used with the [Transact-SQL Debugger](https://docs.microsoft -## Searching in Showplan +## 31. Searching in Showplan In SSMS 17.2, appear the ability to search table name, index name or column name and more in graphical showplan. just use `CTRL+F` to start a search in graphical showplan (or right-click on a blank area of the plan, and in the context menu click on Find Node option), and you can quickly see exactly where node id 30 is. More details here: [New in SSMS: Searching in Showplan] -## Object Explore Details +## 32. Object Explore Details To bring up the Object Explorer Details pane, use the `F7` shortcut or it can be accessed from `Toolbar -> View -> Object -> Explorer Details`. ![SSMS_Database_Default_Reports](/SSMS/SSMS_Tips/32_object_explore_details_01.png) @@ -754,19 +763,19 @@ This tells SQL Server Management Studio to display all the objects that have the -## Working with Azure SQL +## 33. Working with Azure SQL For SSMS 17.2 and above you can enable Multi-Factor Authentication in Azure SQL Database, more details here: [Configure Multi-Factor Authentication in Azure SQL Database] -## Using Extended Events and Profiler in SSMS +## 34. Using Extended Events and Profiler in SSMS Full instruction here: [EXTENDED EVENTS AND PROFILER: XE PROFILER] -## Vulnerability Assessment in SSMS +## 35. Vulnerability Assessment in SSMS You will need version 17.4 for the Vulnerability Assessment feature. Right-click to any database to start a scan. ![SSMS_Database_Default_Reports](/SSMS/SSMS_Tips/SQL_Vulnerability_Assessment.gif) @@ -783,7 +792,7 @@ More info here: [SQL Vulnerability Assessment Available in SSMS] and [Vulnerabil -## Import Flat File to SQL Wizard +## 36. Import Flat File to SQL Wizard You will need version 17.3 or later. Detailed article here: [Import Flat File to SQL Wizard] @@ -796,7 +805,7 @@ PROSE analyzes data patterns in your input file to infer column names, types, de -## AutoRecover in SSMS +## 37. AutoRecover in SSMS With the default settings, you can lose up to 5 minutes of work on a sudden reboot. The recovered information will be kept for 7 days so there is some time to get your files. These settings can be modified, changing how often auto recover happens and how long the information is retained. @@ -805,13 +814,13 @@ This feature can be turned off but it is not recommended. To change the settings, go to: `Tools -> Options -> Environment -> AutoRecover`. -More details [here](https://witsociety.wordpress.com/2019/04/11/autorecover-in-ssms/) +More details [here](https://witsociety.wordpress.com/2019/04/11/autorecover-in-ssms/). ![AutoRecover in SSMS](/SSMS/SSMS_Tips/AutoRecover_in_SSMS.png) -## View and query Power BI .pbix files in SSMS +## 38. View and query Power BI .pbix files in SSMS All Power BI files end with `.pbix`. You can make a copy of the file, (because DBA always like to work from copies vs. the originals) then rename the file from `.pbix` to `.zip`. You can then unzip the file and see the base components that make up a Power BI report and visuals: @@ -831,21 +840,74 @@ You will connect to the trimmed down Analysis Server behind the PBI Desktop repo ![Using SSMS with PowerBI](/SSMS/SSMS_Tips/38_using_ssms_with_powerbi_02.jpg) -More details [here](https://dbakevlar.com/2019/03/using-ssms-with-power-bi/) +More details [here](https://dbakevlar.com/2019/03/using-ssms-with-power-bi/). -## Using SSMS and Profiler to analyze PowerBI with XMLA +## 39. Using SSMS and Profiler to analyze PowerBI with XMLA SSMS can be used to, for example, view partitions generated by [incremental refresh](https://docs.microsoft.com/power-bi/service-premium-incremental-refresh). Version 18.0 RC1 or above is required. SQL Server Profiler can be used for tracing and debugging. SSMS 18.0 RC1 or above is required. -More details [here](https://powerbi.microsoft.com/en-us/blog/power-bi-open-platform-connectivity-with-xmla-endpoints-public-preview/) +More details [here](https://powerbi.microsoft.com/en-us/blog/power-bi-open-platform-connectivity-with-xmla-endpoints-public-preview/). + + + +## 40. SSMS shortcut to comment/uncomment a specific part of the query? +You can easily do this with [Code Snippets](https://docs.microsoft.com/en-us/sql/ssms/scripting/add-transact-sql-snippets): + +```xml + + + <_locDefinition xmlns="urn:locstudio"> + <_locDefault _loc="locNone" /> + <_locTag _loc="locData">Title + <_locTag _loc="locData">Description + <_locTag _loc="locData">Author + <_locTag _loc="locData">ToolTip + <_locTag _loc="locData">Default + + +
+ SLASH STAR COMMENT (surrounds) + + Surround selected text with slash star comment block /**/ + wBob + + SurroundsWith + +
+ + + + + + + + + + +
+
+``` + +Save the file with a `.snippet` extension and follow the instructions from [here](https://docs.microsoft.com/en-us/sql/ssms/scripting/add-transact-sql-snippets) to add the snippet to SSMS. + +Instructions for use: + +1. Highlight the text you want to surround with the comment block in the query editor +1. Press `Ctrl+K, Ctrl+S` to summon the 'Surround With' snippets. Note the comma between the two sequences, it means "press Ctrl+K, then press Ctrl+S in quick succession" +1. Select your snippet from the list +1. Your highlighted text is surrounded with the comment block +1. press `Ctrl+Z` to Undo - this is the normal windows undo command. It will remove the comment block as long as you haven't made any other edits. + +More details [here](https://dba.stackexchange.com/a/147182/107045) + -Reference: +## 40. Reference: - [Free Course: SQL Server Management Studio Shortcuts & Secrets](https://sqlworkbooks.com/course/sql-server-management-studio-shortcuts-secrets/) (by Kendra Little) - - [SSMS Tips: Templates and Control+Shift+M] (by Kendra Little) + - [SSMS Tips: Templates and Control+Shift+M](http://littlekendra.com/2016/08/09/ssms-tips-templates-and-controlshiftm/) (by Kendra Little) - [Fixing Hot-Key issue in SSMS in five steps](http://slavasql.blogspot.ru/2017/02/fixing-hot-key-issue-in-ssms-in-five.html) (by Slava Murygin) - [SSMS Tips and Tricks](http://www.ssmstipsandtricks.com/) (by Latish Sehgal) - [Do you need more than STATISTICS IO for Query Tuning?](https://www.sqlpassion.at/archive/2017/03/27/do-you-need-more-than-statistics-io-for-query-tuning/) (by Klaus Aschenbrenner) @@ -875,14 +937,13 @@ Reference: - [SSMS Tips and Tricks free ebook](http://ssmsbook.sqldownunder.com) (by SDU Insiders) [Cycle through clipboard ring]:http://www.ssmstipsandtricks.com/blog/2014/05/05/cycle-through-clipboard-ring/ -[SSMS Tips: Templates and Control+Shift+M]:http://littlekendra.com/2016/08/09/ssms-tips-templates-and-controlshiftm/ [Generating Charts and Drawings in SQL Server Management Studio]:http://sqlmag.com/t-sql/generating-charts-and-drawings-sql-server-management-studio [View R Plots from within SQL Server Management Studio]:http://www.sqlservercentral.com/articles/R+Services/156107/ [RegEx-Based Finding and Replacing of Text in SSMS]:https://www.simple-talk.com/sql/sql-training/regex-based-finding-and-replacing-of-text-in-ssms/ [SQL Server Management Studio (SSMS) Tips and Tricks]:http://www.bidn.com/blogs/MMilligan/bidn-blog/3326/sql-server-management-studio-ssms-tips-and-tricks [Knowing the Options]:http://sqlrus.com/2017/05/knowing-the-options/ [SQL Server Diagnostics Extension for SSMS]:https://blogs.msdn.microsoft.com/sql_server_team/sql-server-diagnostics-preview/ -[T-SQL Tuesday #92: Lessons Learned the Hard Way]:https://blogs.sentryone.com/aaronbertrand/t-sql-tuesday-92-lessons-learned-hard-way/ +[T-SQL Tuesday #92: Lessons Learned the Hard Way]:https://www.sentryone.com/blog/aaronbertrand/t-sql-tuesday-92-lessons-learned-hard-way/ [SQL Server Diagnostics: New "Analyze Dumps" feature]:https://sqlworkbooks.com/2017/07/sql-server-diagnostics-new-analyze-dumps-feature/ [Connect to SQL Servers in another domain using Windows Authentication]:https://www.mssqltips.com/sqlservertip/3250/connect-to-sql-servers-in-another-domain-using-windows-authentication/ [New in SSMS: Searching in Showplan]:https://blogs.msdn.microsoft.com/sql_server_team/new-in-ssms-searching-in-showplan/ diff --git a/SSMS/SSMS_vssettings/NewSettings_Default_18.7.1(15.0.18358).vssettings b/SSMS/SSMS_vssettings/NewSettings_Default_18.7.1(15.0.18358).vssettings new file mode 100644 index 00000000..89953e17 --- /dev/null +++ b/SSMS/SSMS_vssettings/NewSettings_Default_18.7.1(15.0.18358).vssettings @@ -0,0 +1,995 @@ + + true + false + true + false + true + false + true + true + true + 0 + 0 + + true + true + true + false + + 5 + 0 + 10 + true + true + true + false + false + true + 10 + + false + + %vsspv_settings_directory%\NewSettings.vssettings + + %vsspv_user_appdata%\Documents\SQL Server Management Studio + true + true + true + 4 + 4 + true + %vsspv_visualstudio_dir%\Templates\ItemTemplates + false + true + 1 + 0 + 1 + %vsspv_visualstudio_dir%\Templates\ProjectTemplates + true + 4 + true + + false + + HACK:2 + TODO:2 + UNDONE:2 + UnresolvedMergeConflict:3 + + false + false + + https://docs.microsoft.com/sql/ssms/tutorials/tutorial-sql-server-management-studio + 1 + C:\Windows\system32\notepad.exe + https://www.bing.com + + true + true + 0 + true + true + false + true + false + true + true + + 4 + true + true + true + true + 2 + true + true + true + false + false + true + true + false + false + true + true + 58 + false + false + 4 + true + true + true + true + + 4 + true + true + true + true + 1 + true + true + false + false + false + true + true + true + true + true + true + 58 + false + false + 4 + true + true + true + true + + 4 + true + true + true + true + 1 + true + true + false + false + false + true + true + true + true + true + true + 58 + false + false + 4 + false + true + true + true + + 4 + true + true + true + true + 2 + true + true + false + false + false + true + true + true + true + true + true + 58 + false + false + 4 + false + true + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + false + true + + true + true + true + false + false + false + true + false + false + false + false + true + true + true + true + false + false + true + true + false + true + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + true + false + + 0 + 0 + + + + True + <ExtensionRepositoryConfigList Capacity="0" xmlns="clr-namespace:Microsoft.VisualStudio.ExtensionManager;assembly=Microsoft.VisualStudio.ExtensionEngine" /> + True + + + + false + true + false + 2 + {B1BA9461-FC54-45B3-A484-CB6DD0B95C94} + 0 + + 2 + + + + + + + + + + + + + + + + + + 15.0.0.0 + + + + + + + + + + + + + + + + + + + + + + + + + + Ctrl+Shift+F + Ctrl+Shift+L + Ctrl+F1 + Ctrl+\, Ctrl+T + Ctrl+\, T + F7 + + Ctrl+T + Ctrl+K, Ctrl+C + Ctrl+Shift+L + Ctrl+Shift+L + Ctrl+Shift+L + Ctrl+Shift+L + Ctrl+Shift+L + Ctrl+Shift+L + Ctrl+Shift+U + Ctrl+Shift+U + Ctrl+Shift+U + Ctrl+Shift+U + Ctrl+Shift+U + Ctrl+Shift+U + Ctrl+K, Ctrl+U + Ctrl+Shift+T + Ctrl+Alt+N + Ctrl+N + Ctrl+F1 + Ctrl+L + F5 + Ctrl+E + F5 + Ctrl+E + Alt+X + F5 + Ctrl+E + F5 + Ctrl+E + F5 + Ctrl+E + Ctrl+M + Shift+Alt+S + Alt+F8 + Ctrl+Shift+F + Ctrl+Shift+F + Ctrl+D + Ctrl+D + Ctrl+T + Ctrl+T + Ctrl+Shift+M + F8 + F7 + F5 + Ctrl+Alt+K + Ctrl+Alt+T + F6 + Shift+F6 + Ctrl+R + Ctrl+R + Ctrl+R + Ctrl+R + Ctrl+R + + + + false + false + + false + false + true + false + false + false + true + false + false + false + false + true + true + true + true + false + false + true + true + false + true + false + {B1BA9461-FC54-45B3-A484-CB6DD0B95C94} + 0 + + false + + 0 + 1 + + true + false + + + + + + + + + + false + true + false + + true + true + + True + False + True + True + True + True + False + False + True + False + + false + 1 + 0 + 0 + 0 + 0 + + MatchCase=0 WholeWord=0 Hidden=0 Up=0 Selection=0 Block=0 KeepCase=0 SubFolders=1 KeepOpen=0 NameOnly=0 Append=0 Plain Files Find + MatchCase=0 WholeWord=0 Hidden=0 Up=0 Selection=0 Block=0 KeepCase=0 SubFolders=1 KeepOpen=0 NameOnly=0 Append=0 Plain Solution Find + MatchCase=0 WholeWord=0 Hidden=0 Up=0 Selection=0 Block=0 KeepCase=0 SubFolders=0 KeepOpen=0 NameOnly=0 Append=0 Plain Document Find + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + Regex + 0 + 0 + + 7 + NoToolWin|Design + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1101011110101111100010000000001001101001000000167577360473600210110111000015001500150010001000100020002000500010000100002501000500125100011001111111111000011100100110000000010120482530001001110000010100110101011132768819211011010000000115010https://referencesource.microsoft.com/symbolshttps://msdl.microsoft.com/download/symbols + True + True + 1048576 + 0 + True + + True + True + True + 8, 8 + SnapLines + True + True + True + True + + None + False + True + True + True + True + True + True + True + True + %VsInstallDir%\xml\Schemas + \ No newline at end of file diff --git a/SSMS/SSMS_vssettings/README.md b/SSMS/SSMS_vssettings/README.md index 326a63c8..dc901533 100644 --- a/SSMS/SSMS_vssettings/README.md +++ b/SSMS/SSMS_vssettings/README.md @@ -1,6 +1,13 @@ # SSMS settings files +In files with `_Default_` you can find defaults SSMS settings for different SSMS version. +For import settings files see **tip 1** in [SSMS tips](https://github.com/ktaranov/sqlserver-kit/blob/master/SSMS/SSMS_Tips.md#1) guide. - - [NewSettings_17.2(14.0.17177).vssettings](/NewSettings_17.2(14.0.17177).vssettings) - - [NewSettings_2014(12.0.5556).vssettings](/NewSettings_2014(12.0.5556).vssettings) - - [NewSettings_Default_17.2(14.0.17177).vssettings](/NewSettings_Default_17.2(14.0.17177).vssettings) - - [NewSettings_Default_2014(12.0.5556).vssettings](/NewSettings_Default_2014(12.0.5556).vssettings) +My awesome settings: [ktaranov_18.7.1.vssettings](.ktaranov_18.7.1.vssettings) + +- [AB.DarkScheme.LargeFonts.vssettings](/AB.DarkScheme.LargeFonts.vssettings) +- [AB.DarkScheme.NormalFonts.vssettings](/AB.DarkScheme.NormalFonts.vssettings) +- [NewSettings_17.2(14.0.17177).vssettings](/NewSettings_17.2(14.0.17177).vssettings) +- [NewSettings_2014(12.0.5556).vssettings](/NewSettings_2014(12.0.5556).vssettings) +- [NewSettings_Default_17.2(14.0.17177).vssettings](/NewSettings_Default_17.2(14.0.17177).vssettings) +- [NewSettings_Default_18.7.1(15.0.18358).vssettings](/NewSettings_Default_18.7.1(15.0.18358).vssettings) +- [NewSettings_Default_2014(12.0.5556).vssettings](/NewSettings_Default_2014(12.0.5556).vssettings) diff --git a/SSMS/SSMS_vssettings/ktaranov_18.7.1.vssettings b/SSMS/SSMS_vssettings/ktaranov_18.7.1.vssettings new file mode 100644 index 00000000..03301c74 --- /dev/null +++ b/SSMS/SSMS_vssettings/ktaranov_18.7.1.vssettings @@ -0,0 +1,124 @@ +truefalsetruefalsetruefalsetruetruetrue10truetruetruefalse56553510truetruetruetruefalsetrue10%vsspv_user_appdata%\Documents\SQL Server Management Studiotruetruetrue44true%vsspv_visualstudio_dir%\Templates\ItemTemplatesfalsetrue101%vsspv_visualstudio_dir%\Templates\ProjectTemplatestrue2truefalseHACK:2TODO:2UNDONE:2UnresolvedMergeConflict:3falsefalse + https://docs.microsoft.com/sql/ssms/tutorials/tutorial-sql-server-management-studio + 1 + C:\Windows\system32\notepad.exe + https://www.bing.com + truetrue0truetruefalsetruefalsetruetrue4truetruetruetrue2truetruetruefalsefalsetruetruefalsefalsetruetrue58truefalse4truetruefalsetrue4truetruetruetrue1truetruetruefalsefalsetruetruefalsetruetruetrue58truefalse4truetruefalsetrue4truetruetruetrue1truetruetruefalsefalsetruetruefalsetruetruetrue58truefalse4truetruefalsetrue4truetruetruetrue2truetruetruefalsefalsetruetruefalsetruetruetrue58truefalse4truetruefalsetrue + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + truefalsetruetruetruetruefalsefalsefalsetruefalsefalsefalsefalsetruetruetruetruefalsefalsetruetruefalsetruefalsefalsetruefalse00True<ExtensionRepositoryConfigList Capacity="0" xmlns="clr-namespace:Microsoft.VisualStudio.ExtensionManager;assembly=Microsoft.VisualStudio.ExtensionEngine" />Truefalsetruefalse2{B1BA9461-FC54-45B3-A484-CB6DD0B95C94}0215.0.0.0Ctrl+Shift+LCtrl+F1Ctrl+\, Ctrl+TCtrl+\, TCtrl+TCtrl+K, Ctrl+CCtrl+Shift+LCtrl+Shift+LCtrl+Shift+LCtrl+Shift+LCtrl+Shift+LCtrl+Shift+LCtrl+Shift+UCtrl+Shift+UCtrl+Shift+UCtrl+Shift+UCtrl+Shift+UCtrl+Shift+UCtrl+K, Ctrl+UCtrl+Shift+TCtrl+Alt+NCtrl+NCtrl+F1Ctrl+LF5Ctrl+EF5Ctrl+EAlt+XF5Ctrl+EF5Ctrl+EF5Ctrl+ECtrl+MShift+Alt+SAlt+F8Ctrl+Shift+FCtrl+Shift+FCtrl+DCtrl+DCtrl+TCtrl+TCtrl+Shift+MF8F7F5Ctrl+Alt+KCtrl+Alt+TF6Shift+F6Ctrl+RCtrl+RCtrl+RCtrl+RCtrl+Rfalsefalsefalsefalsetruefalsefalsefalsetruefalsefalsefalsefalsetruetruetruetruefalsefalsetruetruefalsetruefalse{B1BA9461-FC54-45B3-A484-CB6DD0B95C94}0false01truefalsefalsetruefalsetruetrueTrueFalseTrueTrueTrueTrueFalseFalseTrueTrueTrue + false + 1 + 0 + 0 + 0 + 0 + MatchCase=0 WholeWord=0 Hidden=0 Up=0 Selection=0 Block=0 KeepCase=0 SubFolders=1 KeepOpen=0 NameOnly=0 Append=0 Plain Files FindMatchCase=0 WholeWord=0 Hidden=0 Up=0 Selection=0 Block=0 KeepCase=0 SubFolders=1 KeepOpen=0 NameOnly=0 Append=0 Plain Solution FindMatchCase=0 WholeWord=0 Hidden=0 Up=0 Selection=0 Block=0 KeepCase=0 SubFolders=0 KeepOpen=0 NameOnly=0 Append=0 Plain Document Find1111111111111111Regex007NoToolWin|Design1101011110101111100010000000001001101001000000167577360473600210110111000015001500150010001000100020002000500010000100002501000500125100011001111111111000011100100110000000010120482530001001110000010100110101011132768819211011010000000115010https://referencesource.microsoft.com/symbolshttps://msdl.microsoft.com/download/symbolsTrueTrue10485760True + True + True + True + 8, 8 + SnapLines + True + True + True + True + NoneFalseTrueTrueTrueTrueTrueTrueTrueTrue%VsInstallDir%\xml\Schemas \ No newline at end of file diff --git a/Sample_Databases/Oracle_Employee_Database.sql b/Sample_Databases/Oracle_Employee_Database.sql new file mode 100644 index 00000000..66723c34 --- /dev/null +++ b/Sample_Databases/Oracle_Employee_Database.sql @@ -0,0 +1,64 @@ +/* +Source link: https://github.com/ktaranov/sqlserver-kit/blob/master/Sample_Databases/Oracle_Employee_Database.sql +Changed data type to more unviversal: varchar2 -> varchar, number -> int +Tested on SQL Server 2019 and Postgres 12.2 +Original link: https://livesql.oracle.com/apex/livesql/file/content_O5AEB2HE08PYEPTGCFLZU9YCV.html +Code style for PostgresSQL - python like. +*/ + +CREATE DATABASE oracle_employee; + +DROP TABLE employee; +DROP TABLE department; + +CREATE TABLE department ( + id int NOT NULL + , name varchar(100) NOT NULL + , CONSTRAINT pk_department PRIMARY KEY (id) +); + +CREATE TABLE employee ( + id int NOT NULL + , department_id INT NOT NULL + , chief_id int NULL + , name varchar(100) NOT NULL + , salary DECIMAL(19,2) NOT NULL + , CONSTRAINT pk_employee PRIMARY KEY (id) +); + +ALTER TABLE employee ADD CONSTRAINT fk_employee__department_id FOREIGN KEY (department_id) REFERENCES department(id); +ALTER TABLE employee ADD CONSTRAINT fk_employee__cheief_id FOREIGN KEY (chief_id) REFERENCES employee(id); + +INSERT INTO department (id, name) VALUES(10, 'ACCOUNTING'); +INSERT INTO department (id, name) VALUES(20, 'RESEARCH'); +INSERT INTO department (id, name) VALUES(30, 'SALES'); +INSERT INTO department (id, name) VALUES(40, 'OPERATIONS'); + +INSERT INTO employee(id, name, chief_id, salary, department_id) +VALUES(7839, 'KING', null, 5000, 10); +INSERT INTO employee(id, name, chief_id, salary, department_id) +VALUES(7698, 'BLAKE', 7839, 2850, 30); +INSERT INTO employee(id, name, chief_id, salary, department_id) +VALUES(7782, 'CLARK', 7839, 2450, 10); +INSERT INTO employee(id, name, chief_id, salary, department_id) +VALUES(7566, 'JONES',7839, 2975, 20); +INSERT INTO employee(id, name, chief_id, salary, department_id) +VALUES(7788, 'SCOTT', 7566, 3000, 20); +INSERT INTO employee(id, name, chief_id, salary, department_id) +VALUES(7902, 'FORD', 7566, 3000, 20); +INSERT INTO employee(id, name, chief_id, salary, department_id) +VALUES(7369, 'SMITH', 7902, 800, 20); +INSERT INTO employee(id, name, chief_id, salary, department_id) +VALUES(7499, 'ALLEN', 7698, 1600, 30); +INSERT INTO employee(id, name, chief_id, salary, department_id) +VALUES(7521, 'WARD', 7698, 1250, 30); +INSERT INTO employee(id, name, chief_id, salary, department_id) +VALUES(7654, 'MARTIN', 7698, 1250, 30); +INSERT INTO employee(id, name, chief_id, salary, department_id) +VALUES(7844, 'TURNER', 7698, 1500, 30); +INSERT INTO employee(id, name, chief_id, salary, department_id) +VALUES(7876, 'ADAMS', 7788, 1100, 20); +INSERT INTO employee(id, name, chief_id, salary, department_id) +VALUES(7900, 'JAMES', 7698, 950, 30 ); +INSERT INTO employee(id, name, chief_id, salary, department_id) +VALUES(7934, 'MILLER', 7782, 1300, 10); diff --git a/Sample_Databases/README.md b/Sample_Databases/README.md index e7716533..f3e9a3ea 100644 --- a/Sample_Databases/README.md +++ b/Sample_Databases/README.md @@ -8,7 +8,9 @@ Some databases you can download from this repository: https://rebrand.ly/sample- |-----------------------------------------|--------------------|----------|---------:|---------:|------------:| | [StackOverflow 2010 Database] | >=2012 | OLTP | 9360 | 9104 | 9 | | [StackOverflow Database] | >=2012 | OLTP | 137000 | | 9 | +| [StackOverflow Column Store Edition] | >=2017 | OLTP | 160000 | | 9 | | [WideWorldImporters OLTP] | ? | OLTP | 121 | 1024 | 29 | +| [WideWorldImporters OLTP Legacy] | >=2008 | OLTP | 64 | 391 | 31 | | [WideWorldImporters DWH] | ? | DWH | 47 | 2048 | 48 | | [AdventureWorks OLTP 2017] | 2017 | OLTP | 47 | 264 | 71 | | [AdventureWorks OLTP 2016] | >=2016 | OLTP | 93 | 208 | 96 | @@ -24,11 +26,15 @@ Some databases you can download from this repository: https://rebrand.ly/sample- | [AdventureWorks Tabular Model] | ? | AS | 21 | ? | ? | | [Northwind Database][1] | 2000 | OLTP | - | ? | ? | | [Pub Database][1] | 2000 | OLTP | - | ? | ? | +| [Oracle Employee Database] | 2000 | OLTP | 3 | 4 | 2 | +| [DunderMifflin] | ? | OLTP | - | - | ? | [StackOverflow 2010 Database]:https://www.brentozar.com/archive/2015/10/how-to-download-the-stack-overflow-database-via-bittorrent/ [StackOverflow Database]:https://www.brentozar.com/archive/2015/10/how-to-download-the-stack-overflow-database-via-bittorrent/ -[WideWorldImporters DWH]:https://github.com/Microsoft/sql-server-samples/releases/tag/wide-world-importers-v1.0 +[StackOverflow Column Store Edition]:https://www.erikdarlingdata.com/2019/11/stack-overflow-demo-database-column-store-edition-downloads-and-links/ +[WideWorldImporters OLTP Legacy]:https://www.sentryone.com/blog/aaronbertrand/plan-explorer-3-0-demo-kit [WideWorldImporters OLTP]:https://github.com/Microsoft/sql-server-samples/releases/tag/wide-world-importers-v1.0 +[WideWorldImporters DWH]:https://github.com/Microsoft/sql-server-samples/releases/tag/wide-world-importers-v1.0 [AdventureWorks OLTP 2017]:https://github.com/Microsoft/sql-server-samples/releases/download/adventureworks/AdventureWorks2017.bak [AdventureWorks OLTP 2016]:https://github.com/Microsoft/sql-server-samples/releases/download/adventureworks/AdventureWorks2016.bak [AdventureWorks OLTP 2016 Extended]:https://github.com/Microsoft/sql-server-samples/releases/download/adventureworks/AdventureWorks2016_EXT.bak @@ -42,6 +48,8 @@ Some databases you can download from this repository: https://rebrand.ly/sample- [AdventureWorks Multidimensional Model]:https://github.com/Microsoft/sql-server-samples/releases/download/adventureworks-analysis-services/adventure-works-multidimensional-model-full-database-backup.zip [AdventureWorks Tabular Model]:https://github.com/Microsoft/sql-server-samples/releases/download/adventureworks-analysis-services/adventure-works-tabular-model-1200-full-database-backup.zip [1]:https://github.com/Microsoft/sql-server-samples/tree/master/samples/databases/northwind-pubs +[Oracle Employee Database]:https://github.com/ktaranov/sqlserver-kit/blob/master/Sample_Databases/Oracle_Employee_Database.sql +[DunderMifflin]:https://github.com/tdmitch/DunderMifflin ## Datasets - [Data.gov](https://www.data.gov/) diff --git a/Scripts/Adding_Trace_Flags_To_Startup_Parameters.sql b/Scripts/Adding_Trace_Flags_To_Startup_Parameters.sql index b3f5af8d..9872dd1a 100644 --- a/Scripts/Adding_Trace_Flags_To_Startup_Parameters.sql +++ b/Scripts/Adding_Trace_Flags_To_Startup_Parameters.sql @@ -2,152 +2,108 @@ Source link: https://blog.waynesheffield.com/wayne/archive/2017/09/registry-sql-server-startup-parameters/ Author: Wayne Sheffield -Globally enable / disable the specified trace flags. -Use DBCC TRACEON/TRACEOFF to enable disable globally trace flags, then adjust -the SQL Server instance startup parameters for these trace flags. - +Description: Globally enable or disable the specified trace flags. +Use DBCC TRACEON/TRACEOFF to enable or disable trace flags globally, +then adjust the SQL Server instance startup parameters for these trace flags. + SQL Server startup parameters are stored in the registry at: -HKLM\Software\Microsoft\Microsoft SQL Server\MSSQL12.SQL2014\MSSQLServer\Parameters - +HKLM\Software\Microsoft\MSSQLSERVER\MSSQLServer\Parameters + To use the xp_instance_reg... XPs, use: HKLM\Software\Microsoft\MSSQLSERVER\MSSQLServer\Parameters. - -To use: + +Usage: 1. Add the Trace Flags that you want modified to the @TraceFlags table variable. 2. Set the @DebugLevel variable to 1 to see what will happen on your system first. -3. When satisified what will happen, set @DebugLevel to 0 to actually execute the statements. +3. When satisfied with the output, set @DebugLevel to 0 to actually execute the statements. ******************************************************************************** - MODIFICATION LOG +MODIFICATION LOG ******************************************************************************** 2016-08-03 WGS Initial Creation. *******************************************************************************/ SET NOCOUNT ON; --- Declare and initialize variables. --- To use with SQL 2005, cannot set the variables in the declare statement. -DECLARE @MaxValue INTEGER, - @SQLCMD VARCHAR(MAX), - @RegHive VARCHAR(50), - @RegKey VARCHAR(100), - @DebugLevel TINYINT; - -SET @RegHive = 'HKEY_LOCAL_MACHINE'; -SET @RegKey = 'Software\Microsoft\MSSQLSERVER\MSSQLServer\Parameters'; -SET @DebugLevel = 0; -- only makes changes if set to zero! - --- Add the trace flags that you want changed here. --- If enable = 1, DBCC TRACEON will be run; if enable = 0 then DBCC TRACEOFF will be run. --- If enable_on_startup = 1, then this TF will be added to start up on service restart; --- If enable_on_startup - 0, then this TF will be removed from starting up service restart + +DECLARE @MaxValue INT, + @SQLCMD VARCHAR(MAX), + @RegHive VARCHAR(50) = 'HKEY_LOCAL_MACHINE', + @RegKey VARCHAR(100) = 'Software\Microsoft\MSSQLSERVER\MSSQLServer\Parameters', + @DebugLevel TINYINT = 1; + DECLARE @TraceFlags TABLE ( - TF INTEGER, - enable BIT, - enable_on_startup BIT, - TF2 AS '-T' + CONVERT(VARCHAR(15), TF) + TF INT, + enable BIT, + enable_on_startup BIT, + TF2 AS '-T' + CONVERT(VARCHAR(15), TF) ); INSERT INTO @TraceFlags (TF, enable, enable_on_startup) --- To work with SQL 2005, cannot use a table value constructor. --- So, use SELECT statements with UNION ALL for each TF to modify. -SELECT 1117, 1, 1 UNION ALL -SELECT 1118, 1, 1 UNION ALL -SELECT 1204, 0, 0 UNION ALL -SELECT 1222, 0, 0; +VALUES (1117, 1, 1), + (1118, 1, 1), + (1204, 0, 0), + (1222, 0, 0); - --- Get all of the arguments / parameters when starting up the service. DECLARE @SQLArgs TABLE ( - Value VARCHAR(50), - Data VARCHAR(500), - ArgNum AS CONVERT(INTEGER, REPLACE(Value, 'SQLArg', ''))); + Value VARCHAR(50), + Data VARCHAR(500), + ArgNum AS CONVERT(INT, REPLACE(Value, 'SQLArg', '')) +); INSERT INTO @SQLArgs - EXECUTE master.sys.xp_instance_regenumvalues @RegHive, @RegKey; +EXEC master.sys.xp_instance_regenumvalues @RegHive, @RegKey; +SELECT @MaxValue = MAX(ArgNum) FROM @SQLArgs; +PRINT 'MaxValue: ' + CAST(@MaxValue AS VARCHAR); --- Get the highest argument number that is currently set -SELECT @MaxValue = MAX(ArgNum) -FROM @SQLArgs; -RAISERROR('MaxValue: %i', 10, 1, @MaxValue) WITH NOWAIT; - --- Disable specified trace flags -SELECT @SQLCMD = 'DBCC TRACEOFF(' + - STUFF((SELECT ',' + CONVERT(VARCHAR(15), TF) - FROM @TraceFlags - WHERE enable = 0 - ORDER BY TF - FOR XML PATH(''), TYPE).value('.','varchar(max)') - ,1,1,'') + ', -1);' +SELECT @SQLCMD = 'DBCC TRACEOFF(' + + STUFF((SELECT ',' + CONVERT(VARCHAR(15), TF) + FROM @TraceFlags + WHERE enable = 0 + ORDER BY TF + FOR XML PATH(''), TYPE).value('.','varchar(max)'), 1, 1, '') + ', -1);'; +IF @DebugLevel = 0 EXEC (@SQLCMD); +PRINT 'Disable TFs Command: "' + @SQLCMD + '"'; -IF @DebugLevel = 0 EXECUTE (@SQLCMD); -RAISERROR('Disable TFs Command: "%s"', 10, 1, @SQLCMD) WITH NOWAIT; - --- Enable specified trace flags -SELECT @SQLCMD = 'DBCC TRACEON(' + - STUFF((SELECT ',' + CONVERT(VARCHAR(15), TF) - FROM @TraceFlags - WHERE enable = 1 - ORDER BY TF - FOR XML PATH(''), TYPE).value('.','varchar(max)') - ,1,1,'') + ', -1);' - -IF @DebugLevel = 0 EXECUTE (@SQLCMD); -RAISERROR('Enable TFs Command: "%s"', 10, 1, @SQLCMD) WITH NOWAIT; +SELECT @SQLCMD = 'DBCC TRACEON(' + + STUFF((SELECT ',' + CONVERT(VARCHAR(15), TF) + FROM @TraceFlags + WHERE enable = 1 + ORDER BY TF + FOR XML PATH(''), TYPE).value('.','varchar(max)'), 1, 1, '') + ', -1);'; +IF @DebugLevel = 0 EXEC (@SQLCMD); +PRINT 'Enable TFs Command: "' + @SQLCMD + '"'; DECLARE cSQLParams CURSOR LOCAL FAST_FORWARD FOR -WITH cte AS -( - -- Current arguments, with new TFs added at the end. Get a row number to sort by. - SELECT *, - ROW_NUMBER() OVER (ORDER BY ISNULL(ArgNum, 999999999), TF) - 1 AS RN - FROM @SQLArgs arg +WITH cte AS ( + SELECT * , + ROW_NUMBER() OVER (ORDER BY ISNULL(ArgNum, 999999999), TF) - 1 AS RN + FROM @SQLArgs arg FULL OUTER JOIN @TraceFlags tf ON arg.Data = tf.TF2 -), cte2 AS -( - -- Use the row number to calc the SQLArg# for new TFs. - -- Use the original Value (SQLArg#) and Data for all rows if possible, - -- Otherwise use the calculated SQLArg# and the calculated TF2 column. - -- Only get the original non-TF-matched parameters, and the TFs set to be enabled - -- (existing startup TFs not in @TraceFlags are left alone). - SELECT ca.Value, - ca.Data - -- in case any TFs are removed, calculate new row numbers in order - -- to renumber the SQLArg values - , ROW_NUMBER() OVER (ORDER BY RN) - 1 AS RN2 - FROM cte - -- Again, for SQL 2005, use SELECT statement instead of VALUES. - CROSS APPLY (SELECT ISNULL(Value, 'SQLArg' + CONVERT(VARCHAR(15), RN)), - ISNULL(Data, TF2) ) ca(Value, Data) - WHERE ISNULL(enable_on_startup, 1) = 1 -- ISNULL handles non-TF parameters +), cte2 AS ( + SELECT ca.Value, ca.Data, + ROW_NUMBER() OVER (ORDER BY RN) - 1 AS RN2 + FROM cte + CROSS APPLY (SELECT ISNULL(Value, 'SQLArg' + CONVERT(VARCHAR(15), RN)), ISNULL(Data, TF2)) ca(Value, Data) + WHERE ISNULL(enable_on_startup, 1) = 1 ) --- The first three parameters are the location of the errorlog directory, --- and the master database file locations. Ignore these. --- This returns the remaining parameters that should be set. --- Also return the highest number of parameters, so can determine if any need to be deleted. -SELECT 'SQLArg' + CONVERT(VARCHAR(15), RN2) AS Value, - Data, - MAX(RN2) OVER () AS MaxRN2 -FROM cte2 -WHERE RN2 > 2 +SELECT 'SQLArg' + CONVERT(VARCHAR(15), RN2) AS Value, Data, MAX(RN2) OVER () AS MaxRN2 +FROM cte2 +WHERE RN2 > 2 ORDER BY RN2; - -DECLARE @Value VARCHAR(50), - @Data VARCHAR(500), - @MaxRN2 INTEGER; + +DECLARE @Value VARCHAR(50), @Data VARCHAR(500), @MaxRN2 INT; OPEN cSQLParams; FETCH NEXT FROM cSQLParams INTO @Value, @Data, @MaxRN2; WHILE @@FETCH_STATUS = 0 BEGIN - IF @DebugLevel = 0 EXECUTE master.sys.xp_instance_regwrite @RegHive, @RegKey, @Value, 'REG_SZ', @Data; - RAISERROR('EXECUTE master.sys.xp_instance_regwrite ''%s'', ''%s'', ''%s'', ''REG_SZ'', ''%s''', 10, 1, @RegHive, @RegKey, @Value, @Data) WITH NOWAIT; + IF @DebugLevel = 0 EXEC master.sys.xp_instance_regwrite @RegHive, @RegKey, @Value, 'REG_SZ', @Data; + PRINT 'EXEC master.sys.xp_instance_regwrite ''' + @RegHive + ''', ''' + @RegKey + ''', ''' + @Value + ''', ''REG_SZ'', ''' + @Data + ''''; FETCH NEXT FROM cSQLParams INTO @Value, @Data, @MaxRN2; END; CLOSE cSQLParams; DEALLOCATE cSQLParams; --- In case deleting more TFs than added, there may be extra SQLArg values left behind. --- Need to delete the extras now. WHILE @MaxValue > @MaxRN2 BEGIN - SET @Value = 'SQLArg' + CONVERT(VARCHAR(15), @MaxValue); - IF @DebugLevel = 0 EXECUTE master.sys.xp_instance_regdeletevalue @RegHive, @RegKey, @Value; - RAISERROR('EXECUTE master.sys.xp_instance_regdeletevalue ''%s'', ''%s'', ''%s''', 10, 1, @RegHive, @RegKey, @Value) WITH NOWAIT; - SET @MaxValue = @MaxValue - 1; + SET @Value = 'SQLArg' + CONVERT(VARCHAR(15), @MaxValue); + IF @DebugLevel = 0 EXEC master.sys.xp_instance_regdeletevalue @RegHive, @RegKey, @Value; + PRINT 'EXEC master.sys.xp_instance_regdeletevalue ''' + @RegHive + ''', ''' + @RegKey + ''', ''' + @Value + ''''; + SET @MaxValue = @MaxValue - 1; END; diff --git a/Scripts/Azure SQL Database Diagnostic Information Queries.sql b/Scripts/Azure SQL Database Diagnostic Information Queries.sql index 2d1c180e..c04f7cd8 100644 --- a/Scripts/Azure SQL Database Diagnostic Information Queries.sql +++ b/Scripts/Azure SQL Database Diagnostic Information Queries.sql @@ -1,24 +1,26 @@ - -- Azure SQL Database Diagnostic Information Queries -- Glenn Berry --- Last Modified: June 3, 2019 --- https://www.sqlskills.com/blogs/glenn/ --- http://sqlserverperformance.wordpress.com/ +-- Last Modified: September 1, 2020 +-- https://glennsqlperformance.com/ +-- https://sqlserverperformance.wordpress.com/ +-- YouTube: https://bit.ly/2PkoAM1 -- Twitter: GlennAlanBerry --- Please listen to my Pluralsight courses --- https://www.pluralsight.com/author/glenn-berry +-- Diagnostic Queries are available here +-- https://glennsqlperformance.com/resources/ + --- If you want to find all of our SQLskills SQL101 blog posts, check out https://www.sqlskills.com/help/sql101/ +-- If you like PowerShell, there is a very useful community solution for running these queries in an automated fashion +-- https://dbatools.io/ +-- Invoke-DbaDiagnosticQuery +-- https://dbatools.io/functions/invoke-dbadiagnosticquery/ --****************************************************************************** ---* Copyright (C) 2019 Glenn Berry, SQLskills.com +--* Copyright (C) 2020 Glenn Berry --* All rights reserved. --* ---* For more scripts and sample code, check out ---* https://www.sqlskills.com/blogs/glenn --* --* You may alter this code for your own *non-commercial* purposes. You may --* republish altered code as long as you include this copyright and give due credit. @@ -87,14 +89,19 @@ ORDER BY avg_io_stall_ms DESC OPTION (RECOMPILE); -- Get I/O utilization by database (Query 5) (IO Usage By Database) WITH Aggregate_IO_Statistics -AS -(SELECT DB_NAME(database_id) AS [Database Name], -CAST(SUM(num_of_bytes_read + num_of_bytes_written)/1048576 AS DECIMAL(12, 2)) AS io_in_mb -FROM sys.dm_io_virtual_file_stats(NULL, NULL) AS [DM_IO_STATS] -GROUP BY database_id) -SELECT ROW_NUMBER() OVER(ORDER BY io_in_mb DESC) AS [I/O Rank], [Database Name], - CAST(io_in_mb/ SUM(io_in_mb) OVER() * 100.0 AS DECIMAL(5,2)) AS [I/O Percent], - io_in_mb AS [Total I/O (MB)] +AS (SELECT DB_NAME(database_id) AS [Database Name], + CAST(SUM(num_of_bytes_read + num_of_bytes_written) / 1048576 AS DECIMAL(12, 2)) AS [ioTotalMB], + CAST(SUM(num_of_bytes_read ) / 1048576 AS DECIMAL(12, 2)) AS [ioReadMB], + CAST(SUM(num_of_bytes_written) / 1048576 AS DECIMAL(12, 2)) AS [ioWriteMB] + FROM sys.dm_io_virtual_file_stats(NULL, NULL) AS [DM_IO_STATS] + GROUP BY database_id) +SELECT ROW_NUMBER() OVER (ORDER BY ioTotalMB DESC) AS [I/O Rank], + [Database Name], ioTotalMB AS [Total I/O (MB)], + CAST(ioTotalMB / SUM(ioTotalMB) OVER () * 100.0 AS DECIMAL(5, 2)) AS [Total I/O %], + ioReadMB AS [Read I/O (MB)], + CAST(ioReadMB / SUM(ioReadMB) OVER () * 100.0 AS DECIMAL(5, 2)) AS [Read I/O %], + ioWriteMB AS [Write I/O (MB)], + CAST(ioWriteMB / SUM(ioWriteMB) OVER () * 100.0 AS DECIMAL(5, 2)) AS [Write I/O %] FROM Aggregate_IO_Statistics ORDER BY [I/O Rank] OPTION (RECOMPILE); ------ @@ -201,7 +208,7 @@ AND counter_name = N'Page life expectancy' OPTION (RECOMPILE); -- Higher PLE is better. Watch the trend over time, not the absolute value -- This will only return one row for non-NUMA systems --- Page Life Expectancy isnt what you think +-- Page Life Expectancy isn’t what you think… -- https://bit.ly/2EgynLa @@ -509,14 +516,17 @@ OPTION (RECOMPILE); -- Cumulative wait stats are not as useful on an idle instance that is not under load or performance pressure --- SQL Server Wait Types Library (Paul Randal) --- https://www.sqlskills.com/help/waits/ +-- SQL Server Wait Types Library +-- https://bit.ly/2ePzYO2 -- The SQL Server Wait Type Repository --- http://blogs.msdn.com/b/psssql/archive/2009/11/03/the-sql-server-wait-type-repository.aspx +-- https://bit.ly/1afzfjC -- Wait statistics, or please tell me where it hurts --- https://www.sqlskills.com/blogs/paul/wait-statistics-or-please-tell-me-where-it-hurts/ +-- https://bit.ly/2wsQHQE + +-- SQL Server 2005 Performance Tuning using the Waits and Queues +-- https://bit.ly/1o2NFoF -- sys.dm_db_wait_stats (Azure SQL Database) -- https://bit.ly/2HoJOoT @@ -1222,7 +1232,10 @@ SELECT DATABASEPROPERTYEX (DB_NAME(DB_ID()), 'Edition') AS [Database Edition], -- https://bit.ly/2ItexPg --- These five Pluralsight Courses go into more detail about how to run these queries and interpret the results +-- These six Pluralsight Courses go into more detail about how to run these queries and interpret the results + +-- Azure SQL Database: Diagnosing Performance Issues with DMVs +-- https://bit.ly/2meDRCN -- SQL Server 2017: Diagnosing Performance Issues with DMVs -- https://bit.ly/2FqCeti @@ -1230,26 +1243,19 @@ SELECT DATABASEPROPERTYEX (DB_NAME(DB_ID()), 'Edition') AS [Database Edition], -- SQL Server 2017: Diagnosing Configuration Issues with DMVs -- https://bit.ly/2MSUDUL --- SQL Server 2014 DMV Diagnostic Queries Part 1 +-- SQL Server 2014 DMV Diagnostic Queries – Part 1 -- https://bit.ly/2plxCer --- SQL Server 2014 DMV Diagnostic Queries Part 2 +-- SQL Server 2014 DMV Diagnostic Queries – Part 2 -- https://bit.ly/2IuJpzI --- SQL Server 2014 DMV Diagnostic Queries Part 3 +-- SQL Server 2014 DMV Diagnostic Queries – Part 3 -- https://bit.ly/2FIlCPb --- Sign up for Microsoft Visual Studio Dev Essentials and get a free three month pass to Pluralsight - -- Microsoft Visual Studio Dev Essentials --- https://bit.ly/1q6xbDL - - --- Sign up for Microsoft Azure Essentials and get lots of free Azure usage credits, MCP exam voucher, three month Pluralsight subscription - --- Microsoft Azure Essentials --- https://bit.ly/2KH91dQ - +-- https://bit.ly/2qjNRxi +-- Microsoft Azure Learn +-- https://bit.ly/2O0Hacc \ No newline at end of file diff --git "a/Scripts/Backup_Restore_What\342\200\231s_My_Status.sql" "b/Scripts/Backup_Restore_What\342\200\231s_My_Status.sql" index 9d760042..c7560aa7 100644 --- "a/Scripts/Backup_Restore_What\342\200\231s_My_Status.sql" +++ "b/Scripts/Backup_Restore_What\342\200\231s_My_Status.sql" @@ -28,4 +28,6 @@ FROM sys.dm_exec_requests r WHERE command IN ( 'RESTORE DATABASE' , 'BACKUP DATABASE' + ,'RESTORE LOG' + ,'BACKUP LOG' ); diff --git a/Scripts/Bad_Query_Example_13_JOINS.sql b/Scripts/Bad_Query_Example_13_JOINS.sql new file mode 100644 index 00000000..c12aebc0 --- /dev/null +++ b/Scripts/Bad_Query_Example_13_JOINS.sql @@ -0,0 +1,26 @@ +/* + + Generate complex query plan + Reads and writes per database. + 2020-06-23 by Brent Ozar + 2020-07-05 by Konstantin Taranov + 1.1 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Bad_Query_Example_13_JOINS.sql + https://www.brentozar.com/archive/2020/06/bad-idea-jeans-building-big-query-plans/ + +*/ + + +DECLARE @TheRootOfAllEvil TABLE + (Id int PRIMARY KEY CLUSTERED); +WITH CTE1 AS (SELECT * FROM @TheRootOfAllEvil r1), +CTE2 AS (SELECT cA.* FROM CTE1 cA INNER JOIN CTE1 cB ON cA.Id = cB.Id), +CTE3 AS (SELECT cA.* FROM CTE2 cA INNER JOIN CTE2 cB ON cA.Id = cB.Id), +CTE4 AS (SELECT cA.* FROM CTE3 cA INNER JOIN CTE3 cB ON cA.Id = cB.Id), +CTE5 AS (SELECT cA.* FROM CTE4 cA INNER JOIN CTE4 cB ON cA.Id = cB.Id), +CTE6 AS (SELECT cA.* FROM CTE5 cA INNER JOIN CTE5 cB ON cA.Id = cB.Id), +CTE7 AS (SELECT cA.* FROM CTE6 cA INNER JOIN CTE6 cB ON cA.Id = cB.Id), +CTE8 AS (SELECT cA.* FROM CTE7 cA INNER JOIN CTE7 cB ON cA.Id = cB.Id), +CTE9 AS (SELECT cA.* FROM CTE8 cA INNER JOIN CTE8 cB ON cA.Id = cB.Id), +CTE10 AS (SELECT cA.* FROM CTE9 cA INNER JOIN CTE9 cB ON cA.Id = cB.Id) +SELECT * FROM CTE10; diff --git a/Scripts/Build_CREATE_TABLE_statement_using_dm_exec_describe_first_result_set.sql b/Scripts/Build_CREATE_TABLE_statement_using_dm_exec_describe_first_result_set.sql new file mode 100644 index 00000000..4cc6aa96 --- /dev/null +++ b/Scripts/Build_CREATE_TABLE_statement_using_dm_exec_describe_first_result_set.sql @@ -0,0 +1,76 @@ +/* + Builds a CREATE TABLE statement to create a temporary table with the required columns + By: Max Vernon +*/ +SET NOCOUNT ON; + +USE tempdb; +IF OBJECT_ID(N'dbo.outputTest', N'P') IS NOT NULL +DROP PROCEDURE dbo.outputTest; +GO +CREATE PROCEDURE dbo.outputTest +( + @column_i int + , @column_j varchar(30) + , @column_k char(6) +) +AS +BEGIN + SET NOCOUNT ON; + SELECT v.i + , v.j + , v.k + FROM (VALUES (@column_i, @column_j, @column_k)) v(i, j, k); +END +GO + +DECLARE @tempTableName sysname; +DECLARE @cmd nvarchar(max) + +SET @tempTableName = N'#someTable'; +SET @cmd = N'EXEC dbo.outputTest @column_i = 1, @column_j = NULL, @column_k = NULL;'; + +DECLARE @createTableStmt nvarchar(max); +DECLARE @maxColumnNameLength int; +DECLARE @maxTypeNameLength int; +SELECT @maxColumnNameLength = MAX(LEN(rs.name)) + , @maxTypeNameLength = MAX(LEN(rs.system_type_name)) +FROM sys.dm_exec_describe_first_result_set(@cmd, NULL, NULL) rs; + +SET @createTableStmt = STUFF( + ( + SELECT N', ' + rs.name + + N' ' + REPLICATE(N' ', @maxColumnNameLength - LEN(rs.name)) + + rs.system_type_name + N' ' + REPLICATE(N' ', @maxTypeNameLength - LEN(rs.system_type_name)) + + CASE WHEN rs.collation_name IS NOT NULL AND rs.collation_name <> DATABASEPROPERTYEX(DB_NAME(), 'Collation') + THEN N'COLLATE ' + rs.collation_name + N' ' ELSE N'' END + + CASE WHEN rs.is_nullable = 1 THEN N'NULL' ELSE N'NOT NULL' END + FROM sys.dm_exec_describe_first_result_set(@cmd, NULL, NULL) rs + ORDER BY rs.column_ordinal + FOR XML PATH('') + ), 1, 2, N''); +SET @createTableStmt = 'IF OBJECT_ID(N''' + @tempTableName + N''', N''U'') IS NOT NULL +BEGIN + DROP TABLE ' + @tempTableName + N'; +END +CREATE TABLE ' + @tempTableName + N' +( + ' + REPLACE(@createTableStmt, N', ', NCHAR(13) + NCHAR(10) + N' , ') + N' +); +'; + +IF LEN(@createTableStmt) > 4000 +BEGIN + DECLARE @CurrentLen int; + SET @CurrentLen = 1; + WHILE @CurrentLen <= LEN(@createTableStmt) + BEGIN + PRINT SUBSTRING(@createTableStmt, @CurrentLen, 4000); + SET @CurrentLen = @CurrentLen + 4000; + END + RAISERROR (N'Output is chunked into 4,000 char pieces - look for errant line endings!', 14, 1); +END +ELSE +BEGIN + PRINT @createTableStmt; +END; diff --git a/Scripts/Cached_Data_Per_Object_in_Memory.sql b/Scripts/Cached_Data_Per_Object_in_Memory.sql new file mode 100644 index 00000000..e98f8d55 --- /dev/null +++ b/Scripts/Cached_Data_Per_Object_in_Memory.sql @@ -0,0 +1,39 @@ +/* + + List Cached Data Per Object in Memory + 1 data set: list Cached Data Per Object in Memory. + No + Pinal Dave + 2021-03-31 + 2021-03-31 by Konstantin Taranov + 1.0 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Cached_Data_Per_Object_in_Memory.sql + https://blog.sqlauthority.com/2021/03/31/sql-server-cached-data-per-object-in-memory/ + +*/ + +SELECT COUNT (1) * 8 / 1024 AS MBUsed, + OBJECT_SCHEMA_NAME(object_id) SchemaName, + name AS TableName, index_id +FROM sys.dm_os_buffer_descriptors AS bd + INNER JOIN + ( + SELECT object_name(object_id) AS name + ,index_id ,allocation_unit_id, object_id + FROM sys.allocation_units AS au + INNER JOIN sys.partitions AS p + ON au.container_id = p.hobt_id + AND (au.type = 1 OR au.type = 3) + UNION ALL + SELECT object_name(object_id) AS name + ,index_id, allocation_unit_id, object_id + FROM sys.allocation_units AS au + INNER JOIN sys.partitions AS p + ON au.container_id = p.partition_id + AND au.type = 2 + ) AS obj + ON bd.allocation_unit_id = obj.allocation_unit_id +WHERE database_id = DB_ID() +GROUP BY OBJECT_SCHEMA_NAME(object_id), name, index_id +ORDER BY COUNT (*) * 8 / 1024 DESC; +GO diff --git a/Scripts/CheckSpectreMeltdownStatus.sql b/Scripts/CheckSpectreMeltdownStatus.sql new file mode 100644 index 00000000..a5ac949c --- /dev/null +++ b/Scripts/CheckSpectreMeltdownStatus.sql @@ -0,0 +1,238 @@ + +-- Check Spectre/Meltdown Status for SQL Server +-- Glenn Berry +-- SQLskills.com +-- Last Modified: January 23, 2018 + +--****************************************************************************** +--* Copyright (C) 2018 Glenn Berry, SQLskills.com +--* All rights reserved. +--* +--* For more scripts and sample code, check out +--* https://www.sqlskills.com/blogs/glenn +--* +--* You may alter this code for your own *non-commercial* purposes. You may +--* republish altered code as long as you include this copyright and give due credit. +--* +--* +--* THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF +--* ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED +--* TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A +--* PARTICULAR PURPOSE. +--* +--****************************************************************************** + +-- Determine if SQL Server has been patched against Meltdown/Spectre +-- This only checks the SQL Server patch status, not the operating system or hardware +-- This works for SQL Server 2008 through SQL Server 2017 + +-- You can use a Microsoft-provided PowerShell script to check your +-- operating system and hardware patch status as decribed in this Microsoft KB + +-- Windows Client Guidance for IT Pros to protect against speculative execution side-channel vulnerabilities +-- https://support.microsoft.com/en-us/help/4073119/protect-against-speculative-execution-side-channel-vulnerabilities-in + +SET NOCOUNT ON; + +-- Declare variables +DECLARE @MachineIdentification varchar(128) = ''; +DECLARE @ProductVersion varchar(20) = ''; +DECLARE @ProductBuild int = 0; +DECLARE @PatchStatus varchar(15) = 'not patched'; +DECLARE @FinalPatchMessage varchar(256) = ''; + +SET @MachineIdentification = 'Server Name = ' + CONVERT(varchar(50), SERVERPROPERTY ('MachineName')) + ', Instance Name = ' + ISNULL(CONVERT(varchar(50), SERVERPROPERTY('InstanceName')), 'None') + ': '; + + +-- Figure out major version number and then get the build number + +-- SQL Server 2008 +IF EXISTS (SELECT * WHERE CONVERT(varchar(20), SERVERPROPERTY('ProductVersion')) LIKE '10.0%') + BEGIN + SET @ProductVersion = CONVERT(varchar(20), SERVERPROPERTY('ProductVersion')); + IF @ProductVersion = '10.0.6556.0' + BEGIN + SET @PatchStatus = 'patched'; + END + SET @FinalPatchMessage = @MachineIdentification + N'SQL Server 2008, Build Number ' + @ProductVersion + '. This SQL Server instance is ' + @PatchStatus + ' against Spectre/Meltdown.'; + PRINT @FinalPatchMessage; + SELECT @FinalPatchMessage AS [SQL Server Patch Status]; + END + +-- Description of the security update for SQL Server 2008 SP4 GDR: January 6, 2018 +-- https://support.microsoft.com/en-us/help/4057114 +-- Build 10.0.6556.0 + + +-- SQL Server 2008 R2 +IF EXISTS (SELECT * WHERE CONVERT(varchar(20), SERVERPROPERTY('ProductVersion')) LIKE '10.5%') + BEGIN + SET @ProductVersion = CONVERT(varchar(20), SERVERPROPERTY('ProductVersion')); + IF @ProductVersion = '10.50.6560.0' + BEGIN + SET @PatchStatus = 'patched'; + END + SET @FinalPatchMessage = @MachineIdentification + N'SQL Server 2008 R2, Build Number ' + @ProductVersion + '. This SQL Server instance is ' + @PatchStatus + ' against Spectre/Meltdown.'; + PRINT @FinalPatchMessage; + SELECT @FinalPatchMessage AS [SQL Server Patch Status]; + END + + +-- Description of the security update for SQL Server 2008 R2 SP3 GDR: January 6, 2018 +-- https://support.microsoft.com/en-us/help/4057113 +-- 10.50.6560.0 + + +-- SQL Server 2012 +-- We have ProductBuild in SQL Server 2012 and newer +IF EXISTS (SELECT * WHERE CONVERT(varchar(20), SERVERPROPERTY('ProductVersion')) LIKE '11%') + BEGIN + SET @ProductVersion = CONVERT(varchar(20), SERVERPROPERTY('ProductVersion')); + SET @ProductBuild = CONVERT(int, SERVERPROPERTY('ProductBuild')); + IF @ProductBuild >= 7462 + BEGIN + SET @PatchStatus = 'patched'; + END + SET @FinalPatchMessage = @MachineIdentification + N'SQL Server 2012, Build Number ' + @ProductVersion + '. This SQL Server instance is ' + @PatchStatus + + ' against Spectre/Meltdown.'; + PRINT @FinalPatchMessage; + SELECT @FinalPatchMessage AS [SQL Server Patch Status]; + END + +-- Description of the security update for SQL Server 2012 SP4 GDR: January 12, 2018 +-- https://support.microsoft.com/en-us/help/4057116 +-- Build 11.0.7462.6 + + +-- SQL Server 2014 +IF EXISTS (SELECT * WHERE CONVERT(varchar(20), SERVERPROPERTY('ProductVersion')) LIKE '12%') + BEGIN + SET @ProductVersion = CONVERT(varchar(20), SERVERPROPERTY('ProductVersion')); + SET @ProductBuild = CONVERT(int, SERVERPROPERTY('ProductBuild')); + IF @ProductBuild >= 5571 -- SP2 CU + BEGIN + SET @PatchStatus = 'patched'; + END + IF @ProductBuild = 5214 -- SP2 GDR + BEGIN + SET @PatchStatus = 'patched'; + END + SET @FinalPatchMessage = @MachineIdentification + N'SQL Server 2014, Build Number ' + @ProductVersion + '. This SQL Server instance is ' + @PatchStatus + + ' against Spectre/Meltdown.'; + PRINT @FinalPatchMessage; + SELECT @FinalPatchMessage AS [SQL Server Patch Status]; + END + +-- Description of the security update for SQL Server 2014 SP2 CU10: January 16, 2018 +-- https://support.microsoft.com/en-us/help/4057117 +-- Build 12.0.5571.0 + +-- Description of the security update for SQL Server 2014 SP2 GDR: January 16, 2018 +-- https://support.microsoft.com/en-us/help/4057120 +-- Build 12.0.5214.6 + + +-- SQL Server 2016 +IF EXISTS (SELECT * WHERE CONVERT(varchar(20), SERVERPROPERTY('ProductVersion')) LIKE '13%') + BEGIN + SET @ProductVersion = CONVERT(varchar(20), SERVERPROPERTY('ProductVersion')); + SET @ProductBuild = CONVERT(int, SERVERPROPERTY('ProductBuild')); + IF @ProductBuild >= 4466 -- SP1 CU7 + BEGIN + SET @PatchStatus = 'patched'; + END + IF @ProductBuild = 4210 -- SP1 GDR + BEGIN + SET @PatchStatus = 'patched'; + END + IF @ProductBuild = 2218 -- RTM CU + BEGIN + SET @PatchStatus = 'patched'; + END + IF @ProductBuild = 1745 -- RTM GDR + BEGIN + SET @PatchStatus = 'patched'; + END + SET @FinalPatchMessage = @MachineIdentification + N'SQL Server 2016, Build Number ' + @ProductVersion + '. This SQL Server instance is ' + @PatchStatus + + ' against Spectre/Meltdown.'; + PRINT @FinalPatchMessage; + SELECT @FinalPatchMessage AS [SQL Server Patch Status]; + END + +-- Description of the security update for SQL Server 2016 CU7 SP1: January 3, 2018 +-- https://support.microsoft.com/en-us/help/4058561 +-- Build 13.0.4466.4 + +-- Description of the security update for SQL Server 2016 GDR SP1: January 3, 2018 +-- https://support.microsoft.com/en-us/help/4057118 +-- Build 13.0.4210.6 + +-- Description of the security update for SQL Server 2016 CU: January 6, 2018 +-- https://support.microsoft.com/en-us/help/4058559 +-- Build 13.0.2218.0 + +-- Description of the security update for SQL Server 2016 GDR: January 6, 2018 +-- https://support.microsoft.com/en-us/help/4058560 +-- Build 13.0.1745.2 + + +-- SQL Server 2017 +IF EXISTS (SELECT * WHERE CONVERT(varchar(20), SERVERPROPERTY('ProductVersion')) LIKE '14%') + BEGIN + SET @ProductVersion = CONVERT(varchar(20), SERVERPROPERTY('ProductVersion')); + SET @ProductBuild = CONVERT(int, SERVERPROPERTY('ProductBuild')); + IF @ProductBuild >= 3015 -- 2017 CU3 + BEGIN + SET @PatchStatus = 'patched'; + END + IF @ProductBuild = 2000 -- 2017 GDR + BEGIN + SET @PatchStatus = 'patched'; + END + SET @FinalPatchMessage = @MachineIdentification + N'SQL Server 2017, Build Number ' + @ProductVersion + '. This SQL Server instance is ' + @PatchStatus + + ' against Spectre/Meltdown.'; + PRINT @FinalPatchMessage; + SELECT @FinalPatchMessage AS [SQL Server Patch Status]; + END + +-- Description of the security update for SQL Server 2017 GDR: January 3, 2018 +-- https://support.microsoft.com/en-us/help/4057122 +-- Build 14.0.2000.63 + +-- Description of the security update for SQL Server 2017 CU3 RTM: January 3, 2018 +-- https://support.microsoft.com/en-us/help/4058562 +-- Build 14.0.3015.40 + + +-- SQL Server Guidance to protect against speculative execution side-channel vulnerabilities +-- https://support.microsoft.com/en-us/help/4073225/guidance-for-sql-server + + + +-- ToDo: Check for clr status, check for R Server, check for linked servers,etc. + +---- Get selected instance-level configuration values that relate to SQL Server extensibility features +SELECT name AS [Configuration Name], value as [Value], + value_in_use AS [Value In Use], description +FROM sys.configurations +WHERE name IN (N'clr enabled', N'clr strict security', + N'external scripts enabled', N'Ole Automation Procedures', + N'xp_cmdshell') +ORDER BY name; + +-- If clr enabled is 1, then strongly consider setting clr strict security to 1 (on new enough builds of SQL Server 2012, 2014, 2016, and 2017) + +-- Update adds the "CLR strict security" feature to SQL Server 2016 +-- https://support.microsoft.com/en-us/help/4018930/update-adds-the-clr-strict-security-feature-to-sql-server-2016 + + +------ Check for Polybase and R Services +--SELECT SERVERPROPERTY('IsPolybaseInstalled') AS [IsPolybaseInstalled], +--SERVERPROPERTY('IsAdvancedAnalyticsInstalled') AS [IsRServicesInstalled]; + +------ Linked servers +--EXEC sp_linkedservers; + + +--SELECT j.[name], s.step_name, s.subsystem +--FROM msdb.dbo.sysjobsteps AS s +--INNER JOIN msdb.dbo.sysjobs AS j +--ON s.job_id = j.job_id +--WHERE s.subsystem = N'ActiveScripting' +--GO diff --git a/Scripts/Checkpoint_XE.sql b/Scripts/Checkpoint_XE.sql new file mode 100644 index 00000000..46a4fe4d --- /dev/null +++ b/Scripts/Checkpoint_XE.sql @@ -0,0 +1,50 @@ + + Analyze checkpoint extended events result + 1 data set: checploints info. + No + Aaron Bertrand + 2020-02-17 + 2021-09-30 by Konstantin Taranov + 1.0 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Checkpoint_XE.sql + https://www.mssqltips.com/sqlservertip/6319/sql-server-checkpoint-monitoring-with-extended-events/ + + +DROP TABLE IF EXISTS #xml; +GO +SELECT ev = SUBSTRING([object_name],12,5), ed = CONVERT(xml, event_data) + INTO #xml + FROM sys.fn_xe_file_target_read_file('L:\XE_Out\CheckPoint*.xel', NULL, NULL, NULL); +;WITH Events(ev,ts,db,id) AS +( + SELECT ev, + ed.value(N'(event/@timestamp)[1]', N'datetime'), + ed.value(N'(event/data[@name="database_id"]/value)[1]', N'int'), + ed.value(N'(event/action[@name="attach_activity_id"]/value)[1]', N'uniqueidentifier') + FROM #xml +), +EventPairs AS +( + SELECT db, ev, + checkpoint_ended = ts, + checkpoint_began = LAG(ts, 1) OVER (PARTITION BY id, db ORDER BY ts) + FROM Events +), +Timings AS +( + SELECT + dbname = DB_NAME(db), + checkpoint_began, + checkpoint_ended, + duration_milliseconds = DATEDIFF(MILLISECOND, checkpoint_began, checkpoint_ended) + FROM EventPairs WHERE ev = 'end' AND checkpoint_began IS NOT NULL +) +SELECT + dbname, + checkpoint_count = COUNT(*), + avg_seconds = CONVERT(decimal(18,2),AVG(1.0*duration_milliseconds)/1000), + max_seconds = CONVERT(decimal(18,2),MAX(1.0*duration_milliseconds)/1000), + total_seconds_spent = CONVERT(decimal(18,2),SUM(1.0*duration_milliseconds)/1000) +FROM Timings +GROUP BY dbname +ORDER BY total_seconds_spent DESC; diff --git a/Scripts/Compare_Tables_With_Matching_Columns.sql b/Scripts/Compare_Tables_With_Matching_Columns.sql new file mode 100644 index 00000000..0d04af51 --- /dev/null +++ b/Scripts/Compare_Tables_With_Matching_Columns.sql @@ -0,0 +1,129 @@ +/* + + Find all matching column names between tables. Useful for exploring databases with implied relationships but no foreign keys. + 1 data set: temp table #results. + No + Tom Barrett + 2022-08-27 + 2022-08-27 by Tom Barrett + 1.0 + +*/ + +SET NOCOUNT ON; + +/* create staging objects */ +IF object_id('tempdb..#tablesToQuery') IS NOT NULL +BEGIN + DROP TABLE #tablesToQuery +END + +CREATE TABLE #tablesToQuery ( + DatabaseName NVARCHAR(1000) + , SchemaName NVARCHAR(1000) + , TableName NVARCHAR(1000) + , IsProcessed BIT DEFAULT 0 + ) +GO + +IF object_id('tempdb..#results') IS NOT NULL +BEGIN + DROP TABLE #results +END + +CREATE TABLE #results ( + DatabaseName NVARCHAR(1000) + , ColumnName NVARCHAR(1000) + , Table1 NVARCHAR(1000) + , Table2 NVARCHAR(1000) + ) +GO + +/* get list of tables */ +INSERT INTO #tablesToQuery ( + DatabaseName + , SchemaName + , TableName + ) +SELECT TABLE_CATALOG + , TABLE_SCHEMA + , TABLE_NAME +FROM INFORMATION_SCHEMA.TABLES +ORDER BY TABLE_CATALOG + , TABLE_SCHEMA + , TABLE_NAME +GO + +/* loop through tables and get matching columns by name */ +DECLARE @x INT = 1; +DECLARE @table NVARCHAR(1000); + +WHILE @x <= ( + SELECT count('dracula') + FROM #tablesToQuery + WHERE IsProcessed = 0 + ) +BEGIN + /* get next table*/ + SELECT TOP 1 @table = TableName + FROM #tablesToQuery + WHERE IsProcessed = 0; + + /* insert into #results any tables + columns that match */ + WITH cte + AS ( + SELECT TABLE_CATALOG + , TABLE_SCHEMA + , TABLE_NAME + , COLUMN_NAME + FROM INFORMATION_SCHEMA.COLUMNS + ) + INSERT INTO #results + SELECT cte1.TABLE_CATALOG + , cte1.COLUMN_NAME + , CONCAT ( + cte1.TABLE_SCHEMA + , '.' + , cte1.TABLE_NAME + ) + , CONCAT ( + cte2.TABLE_SCHEMA + , '.' + , cte2.TABLE_NAME + ) + FROM cte AS cte1 + JOIN cte AS cte2 ON cte1.TABLE_CATALOG = cte2.TABLE_CATALOG + AND cte1.TABLE_SCHEMA collate Latin1_general_CI_AI = cte2.TABLE_SCHEMA collate Latin1_general_CI_AI /* remove this line to search different schemas*/ + AND cte1.TABLE_NAME collate Latin1_general_CI_AI <> cte2.TABLE_NAME collate Latin1_general_CI_AI + AND cte1.COLUMN_NAME collate Latin1_general_CI_AI = cte2.COLUMN_NAME collate Latin1_general_CI_AI + WHERE cte1.TABLE_NAME = @table + /* add any other irrelevant or metadata columns to exclude */ + AND cte1.COLUMN_NAME collate Latin1_general_CI_AI NOT IN ( + 'ID' + , 'ACTIVE' + , 'CREATEDBY' + , 'ETC.' + ) + + UPDATE #tablesToQuery + SET IsProcessed = 1 + WHERE TableName = @table; +END + +/* return results */ +SELECT * +FROM #results +/* uncomment this line to search results for a specific table */ +/* WHERE Table1 = 'Schema.Table' */ +ORDER BY ColumnName + , Table1 + , Table2 +GO + +/* clean up */ +DROP TABLE #results +GO + +DROP TABLE #tablesToQuery +GO + diff --git a/Scripts/Compress_Tables_And_Indexes.sql b/Scripts/Compress_Tables_And_Indexes.sql new file mode 100644 index 00000000..a6e70b56 --- /dev/null +++ b/Scripts/Compress_Tables_And_Indexes.sql @@ -0,0 +1,205 @@ +/* + + Compress tables and indexes + Temp table #estimated_results and print or exec rebuild index commands + Max Vernon + 2019-08-08 + 2019-09-12 by Konstantin Taranov + 1.1 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Compress_Tables.sql + https://www.sqlserverscience.com/performance/compress-big-tables/ + +*/ + + +/* + Compresses tables and indexes that are consuming more than the specified amount of space. + + By: Max Vernon, 2019-08-08 + + Set the following variables before running the script! + - @DebugOnly - 1 will cause the script to print out the generated commands, 0 will also execute those commands + - @OnlineOnly - 1 causes the script to use ONLINE=ON when performing the compress operation + - @CompressionType - can be "PAGE" or "ROW" + - @MinObjectSizeGB - the minimum current size of a table/index before it will be considered for compression + - @MinCompressionRatio - the minimum estimated compression ratio before a table/index will be compressed, + a lower number indicates a higher level of compression: + 0.25 - the data must compress to 1/4 its uncompressed size + 0.5 - the data must compress to half its uncompressed size + 0.1 - the data must compress to 1/10th its uncompressed size + 1.0 - no compression + Notes: + - Only Heaps, Clustered Indexes, and Non-Clustered Indexes are affected by this script. +*/ + +SET TRANSACTION ISOLATION LEVEL READ COMMITTED; +SET NOCOUNT ON; + +DECLARE @DebugOnly bit = 1; --set to zero to actually compress tables +DECLARE @MinObjectSizeGB decimal(38,2) = 0.01; +DECLARE @OnlineOnly bit = 1; +DECLARE @CompressionType nvarchar(60) = N'PAGE'; --can be PAGE or ROW +DECLARE @MinCompressionRatio decimal(38,2) = 10; + +DECLARE @SchemaName sysname; +DECLARE @ObjectName sysname; +DECLARE @IndexID int; +DECLARE @PartitionNumber int; +DECLARE @MaxDOP int; +DECLARE @msg nvarchar(1000); +DECLARE @cmd nvarchar(max); + +SET @MaxDOP = ( --set our MaxDOP to half of the configured value, or 1 if the sysadmin + --hasn't explicity configured the value + SELECT COALESCE(CONVERT(int, c.value), 2) + FROM sys.configurations c + WHERE c.name = N'max degree of parallelism' + ) / 2; + +IF OBJECT_ID(N'tempdb..#estimated_results', N'U') IS NOT NULL +DROP TABLE #estimated_results; +CREATE TABLE #estimated_results +( + [schema_name] sysname NULL + , [object_name] sysname NULL + , [index_id] int NULL + , [partition_number] int NULL + , [size_with_current_compression_setting(KB)] bigint NULL + , [size_with_requested_compression_setting(KB)] bigint NULL + , [sample_size_with_current_compression_setting(KB)] bigint NULL + , [sample_size_with_requested_compression_setting(KB)] bigint NULL +); + +DECLARE cur CURSOR LOCAL FORWARD_ONLY STATIC READ_ONLY +FOR +SELECT SchemaName = s.name + , ObjectName = o.name + , i.index_id + , p.partition_number +FROM sys.schemas s + INNER JOIN sys.objects o ON s.schema_id = o.schema_id + INNER JOIN sys.indexes i ON o.object_id = i.object_id + INNER JOIN sys.partitions p ON i.object_id = p.object_id AND i.index_id = p.index_id + INNER JOIN ( + SELECT v.index_type + FROM (VALUES + (0) --heap + , (1) --clustered index + , (2) --non-clustered index + )v(index_type) + ) index_types ON i.type = index_types.index_type +WHERE i.is_hypothetical = 0 + AND s.name <> N'sys' + AND o.is_ms_shipped = 0 + AND p.data_compression_desc <> @CompressionType + AND ( + ( + @OnlineOnly = 1 + AND NOT EXISTS ( + SELECT 1 + FROM sys.columns c + INNER JOIN sys.types ty ON c.system_type_id = ty.system_type_id + WHERE c.object_id = o.object_id + AND ( + ty.name = N'ntext' --none of these column types can be compressed online + OR ty.name = N'text' + OR ty.name = N'image' + ) + ) + AND p.filestream_filegroup_id = 0 --no filestream table can be compressed online + ) + OR @OnlineOnly = 0 + ) + AND NOT EXISTS ( + --tables with sparse columns cannot be compressed. + --https://docs.microsoft.com/en-us/sql/relational-databases/data-compression/data-compression?view=sql-server-2017#how-compression-affects-other-sql-server-components + SELECT 1 + FROM sys.columns c + WHERE c.object_id = o.object_id + AND c.is_sparse = 1 + ) +ORDER BY s.name + , o.name + , i.index_id + , p.partition_number; + +OPEN cur; +FETCH NEXT FROM cur INTO @SchemaName, @ObjectName, @IndexID, @PartitionNumber; +WHILE @@FETCH_STATUS = 0 +BEGIN + SET @msg = N'EXEC sys.sp_estimate_data_compression_savings @schema_name = N''' + @SchemaName + N''' + , @object_name = N''' + @ObjectName + N''' + , @index_id = ' + CONVERT(nvarchar(1000), @IndexID) + N' + , @partition_number = ' + CONVERT(nvarchar(1000), @PartitionNumber) + N' + , @data_compression = ' + @CompressionType + N';'; + --RAISERROR (@msg, 0, 1) WITH NOWAIT; + + INSERT INTO #estimated_results ( + object_name + , schema_name + , index_id + , partition_number + , [size_with_current_compression_setting(KB)] + , [size_with_requested_compression_setting(KB)] + , [sample_size_with_current_compression_setting(KB)] + , [sample_size_with_requested_compression_setting(KB)] + ) + EXEC sys.sp_estimate_data_compression_savings @schema_name = @SchemaName + , @object_name = @ObjectName + , @index_id = @IndexID + , @partition_number = @PartitionNumber + , @data_compression = @CompressionType; + FETCH NEXT FROM cur INTO @SchemaName, @ObjectName, @IndexID, @PartitionNumber; +END +CLOSE cur; +DEALLOCATE cur; + +DECLARE cur CURSOR LOCAL FORWARD_ONLY STATIC READ_ONLY +FOR +SELECT CASE WHEN er.index_id = 0 THEN + N'ALTER TABLE ' + QUOTENAME(er.schema_name) + N'.' + QUOTENAME(er.object_name) + N' +REBUILD WITH ( + DATA_COMPRESSION = ' + @CompressionType + N' + , ONLINE = ' + CASE WHEN @OnlineOnly = 1 THEN N'ON' ELSE N'OFF' END + N' + , SORT_IN_TEMPDB = OFF + , MAXDOP = ' + CONVERT(nvarchar(10), @MaxDOP) + N' + ); +' +ELSE + N'ALTER INDEX ' + QUOTENAME(i.name) + N' ON ' + QUOTENAME(er.schema_name) + N'.' + QUOTENAME(er.object_name) + N' +REBUILD WITH ( + DATA_COMPRESSION = ' + @CompressionType + N' + , ONLINE = ' + CASE WHEN @OnlineOnly = 1 THEN N'ON' ELSE N'OFF' END + N' + , SORT_IN_TEMPDB = OFF + , MAXDOP = ' + CONVERT(nvarchar(10), @MaxDOP) + N' + ); +' +END +FROM #estimated_results er + LEFT JOIN sys.schemas s ON er.schema_name = s.name + LEFT JOIN sys.objects o ON s.schema_id = o.schema_id AND er.object_name = o.name + LEFT JOIN sys.indexes i ON o.object_id = i.object_id AND er.index_id = i.index_id +WHERE er.[size_with_current_compression_setting(KB)] >= (@MinObjectSizeGB * 1048576) --sizes are reported in KB + AND (CONVERT(decimal(38, 2), er.[size_with_requested_compression_setting(KB)]) / er.[size_with_current_compression_setting(KB)]) <= @MinCompressionRatio +OPEN cur; +FETCH NEXT FROM cur INTO @cmd; +WHILE @@FETCH_STATUS = 0 +BEGIN + if @DebugOnly = 0 + BEGIN + BEGIN TRANSACTION + RAISERROR (@cmd, 0, 1) WITH NOWAIT; + EXEC sys.sp_executesql @cmd; + COMMIT TRANSACTION + CHECKPOINT + END + ELSE + BEGIN + RAISERROR (@cmd, 0, 1) WITH NOWAIT; + END + FETCH NEXT FROM cur INTO @cmd; +END +CLOSE cur; +DEALLOCATE cur; + +SELECT * FROM #estimated_results; diff --git a/Scripts/Count_Database_Reads_and_Writes.sql b/Scripts/Count_Database_Reads_and_Writes.sql new file mode 100644 index 00000000..b2fa821e --- /dev/null +++ b/Scripts/Count_Database_Reads_and_Writes.sql @@ -0,0 +1,30 @@ +/* + + Counts reads and writes for databases + Reads and writes per database. + 2020-04-07 by Brent Ozar + 2020-04-15 by Konstantin Taranov + 1.1 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Count_Database_Reads_and_Writes.sql + https://www.brentozar.com/archive/2020/04/how-can-i-measure-if-my-database-does-more-reads-than-writes/ + +*/ + + +WITH reads_and_writes AS ( + SELECT db.name AS database_name, + SUM(user_seeks + user_scans + user_lookups) AS reads, + SUM(user_updates) AS writes, + SUM(user_seeks + user_scans + user_lookups + user_updates) AS all_activity + FROM sys.dm_db_index_usage_stats us + INNER JOIN sys.databases db ON us.database_id = db.database_id + GROUP BY db.name +) +SELECT + database_name + , reads + , ((reads * 1.0) / all_activity) * 100 AS reads_percent + , writes + , ((writes * 1.0) / all_activity) * 100 AS writes_percent + FROM reads_and_writes AS rw + ORDER BY database_name; diff --git a/Scripts/Create_2_Million_Tables.sql b/Scripts/Create_2_Million_Tables.sql new file mode 100644 index 00000000..4863a99e --- /dev/null +++ b/Scripts/Create_2_Million_Tables.sql @@ -0,0 +1,39 @@ +/* +https://docs.microsoft.com/en-us/sql/sql-server/maximum-capacity-specifications-for-sql-server +Database objects include objects such as tables, views, stored procedures, user-defined functions, triggers, rules, defaults, and constraints. +The sum of the number of all objects in a database cannot exceed 2,147,483,647. +*/ +CREATE DATABASE [TwoMillion]; + +ALTER DATABASE [TwoMillion] SET RECOVERY SIMPLE WITH NO_WAIT; +GO + +USE [TwoMillion]; + +SET NOCOUNT ON; + +DECLARE @sql nvarchar(max) = N''; +DECLARE @i int = 1; + +SELECT @i = 2147483647 - COUNT(*) FROM [TwoMillion].sys.objects; +PRINT N'Creating ' + FORMAT(@i,'N0') + N' tables...'; + +WHILE @i > 0 +BEGIN + SET @i -= 1; + + SET @sql = N'CREATE TABLE [TwoMillion].dbo.t' + CONVERT(nvarchar(max),2147483648-@i) + N' (i int);'; + IF (@i % 10000) = 0 RAISERROR(@sql, 0, 1) WITH NOWAIT; + + EXEC sp_executesql @sql; +END; + +/* +ALTER DATABASE [TwoMillion] SET SINGLE_USER WITH ROLLBACK IMMEDIATE; +GO + +USE master; +GO + +DROP DATABASE [TwoMillion]; +*/ diff --git a/Scripts/Databases_Report.sql b/Scripts/Databases_Report.sql index 51b4e685..629890e4 100644 --- a/Scripts/Databases_Report.sql +++ b/Scripts/Databases_Report.sql @@ -1,45 +1,74 @@ --- https://stackoverflow.com/a/42508688/2298061 +/* + + Get all databases meta data using dynamic T-SQL + 1 data set: temp table #DatabaseInfo. + No + Konstantin Taranov + 2018-03-01 + 2019-11-14 by Konstantin Taranov + 1.2 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Databases_Report.sql + +*/ -IF OBJECT_ID('tempdb..#AllTables','U') IS NOT NULL DROP TABLE #AllTables; +SET NOCOUNT ON; -CREATE TABLE #AllTables( - DBName SYSNAME - , TableCount INT - , ViewCount INT - , ProcedureCount INT - , TriggerCount INT - , FullTextCatalog INT - , XmlIndexes INT - , SpatialIndexes INT - , TableColumnsCount INT -); +DECLARE @tsql nvarchar(max); +DECLARE @crlf nvarchar(10) = NCHAR(13) + NCHAR(10); +DECLARE @debug bit = 0; + +IF OBJECT_ID('tempdb..#DatabaseInfo', 'U') IS NOT NULL DROP TABLE #DatabaseInfo; -DECLARE @SQL NVARCHAR(MAX); +CREATE TABLE #DatabaseInfo( + DBName sysname NOT NULL + , TableCount int NOT NULL + , TableColumnsCount int NOT NULL + , ViewCount int NOT NULL + , ProcedureCount int NOT NULL + , TriggerCount int NOT NULL + , FullTextCatalog int NOT NULL + , XmlIndexes int NOT NULL + , SpatialIndexes int NOT NULL + , DataTotalSizeMb int NOT NULL + , DataSpaceUtilMb int NOT NULL + , LogTotalSizeMb int NOT NULL + , LogSpaceUtilMb int NOT NULL +); -SELECT @SQL = COALESCE(@SQL, N'') + N'USE ' + quotename(name) + N'; - INSERT INTO #AllTables - SELECT N' + QUOTENAME(name,'''') + N' AS DBName, - (SELECT COUNT(*) FROM ' + QUOTENAME(name) + N'.sys.tables), - (SELECT COUNT(*) FROM ' + QUOTENAME(name) + N'.sys.views), - (SELECT COUNT(*) FROM ' + QUOTENAME(name) + N'.sys.procedures), - (SELECT COUNT(*) FROM ' + QUOTENAME(name) + N'.sys.triggers), - (SELECT COUNT(*) FROM ' + QUOTENAME(name) + N'.sys.fulltext_catalogs), - (SELECT COUNT(*) FROM ' + QUOTENAME(name) + N'.sys.xml_indexes), - (SELECT COUNT(*) FROM ' + QUOTENAME(name) + N'.sys.spatial_indexes), - (SELECT SUM(max_column_id_used) FROM ' + QUOTENAME(name) + N'.sys.tables); -' +SELECT @tsql = COALESCE(@tsql, N'') + @crlf + + N'USE ' + QUOTENAME(name) + N';' + @crlf + + N'INSERT INTO #DatabaseInfo' + @crlf + + N'SELECT' + @crlf + + N' N' + QUOTENAME(name,'''') + N' AS DBName' + @crlf + + N' , (SELECT COUNT(*) AS TableCount FROM ' + QUOTENAME(name) + N'.sys.tables)' + @crlf + + N' , (SELECT ISNULL(SUM(max_column_id_used), 0) AS TableColumnsCount FROM ' + QUOTENAME(name) + N'.sys.tables)' + @crlf + + N' , (SELECT COUNT(*) AS ViewCount FROM ' + QUOTENAME(name) + N'.sys.views)' + @crlf + + N' , (SELECT COUNT(*) AS ProcedureCount FROM ' + QUOTENAME(name) + N'.sys.procedures)' + @crlf + + N' , (SELECT COUNT(*) AS TriggerCount FROM ' + QUOTENAME(name) + N'.sys.triggers)' + @crlf + + N' , (SELECT COUNT(*) AS FullTextCatalog FROM ' + QUOTENAME(name) + N'.sys.fulltext_catalogs)' + @crlf + + N' , (SELECT COUNT(*) AS XmlIndexes FROM ' + QUOTENAME(name) + N'.sys.xml_indexes)' + @crlf + + N' , (SELECT COUNT(*) AS SpatialIndexes FROM ' + QUOTENAME(name) + N'.sys.spatial_indexes)' + @crlf + + N' , (SELECT SUM(size * 8 / 1024) AS DataTotalSizeMb FROM ' + QUOTENAME(name) + N'.sys.master_files WHERE database_id = DB_ID(DB_NAME()) AND type = 0)' + @crlf + + N' , (SELECT SUM(FILEPROPERTY(name, ''SpaceUsed'') * 8 / 1024) AS DataSpaceUtilMb FROM ' + QUOTENAME(name) + N'.sys.master_files WHERE database_id = DB_ID(DB_NAME()) AND type = 0)' + @crlf + + N' , (SELECT SUM(size * 8 / 1024) AS LogTotalSizeMb FROM ' + QUOTENAME(name) + N'.sys.master_files WHERE database_id = DB_ID(DB_NAME()) AND type = 1)' + @crlf + + N' , (SELECT SUM(FILEPROPERTY(name, ''SpaceUsed'') * 8 / 1024) AS LogSpaceUtilMb FROM ' + QUOTENAME(name) + N'.sys.master_files WHERE database_id = DB_ID(DB_NAME()) AND type = 1);' + @crlf FROM sys.databases ORDER BY name; -EXECUTE sp_executesql @SQL; +IF @debug = 1 SELECT @tsql ELSE EXEC sp_executesql @tsql; -SELECT DBName +SELECT + DBName , TableCount + , TableColumnsCount , ViewCount , ProcedureCount , TriggerCount , FullTextCatalog , XmlIndexes , SpatialIndexes - , TableColumnsCount - FROM #AllTables; + , DataTotalSizeMb + , DataSpaceUtilMb + , LogTotalSizeMb + , LogSpaceUtilMb +FROM #DatabaseInfo; diff --git a/Scripts/Disable_Enable_All_Triggers_In_Database.sql b/Scripts/Disable_Enable_All_Triggers_In_Database.sql new file mode 100644 index 00000000..5801e967 --- /dev/null +++ b/Scripts/Disable_Enable_All_Triggers_In_Database.sql @@ -0,0 +1,44 @@ +/* + + Disable and enable again all triggers in database + nothing. + No + Federico Minca + 2019-08-20 + 2019-08-26 by Konstantin Taranov + 1.0 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Disable_Enable_All_Triggers_In_Database.sql + https://jesspomfret.com/disable-all-triggers/ + +*/ + +-- Select Active Triggers and prepare Disable and Enable T-SQL Statement and put into Temp Table +SELECT 'ALTER TABLE [' + sc.name + '].[' + ta.name + '] DISABLE TRIGGER [' + tr.name + '];' AS DisableTriggerStatement, +'ALTER TABLE [' + sc.name + '].[' + ta.name + '] ENABLE TRIGGER [' + tr.name + '];' AS EnableTriggerStatement +INTO #Triggers +FROM sys.triggers tr +INNER JOIN sys.tables ta ON ta.object_id = tr.parent_id +INNER JOIN sys.schemas sc ON sc.schema_id = ta.schema_id +WHERE tr.is_disabled = 0; + +-- Prepare Variable Script for Execution +DECLARE @Disable_Statement nvarchar(max) = ( + SELECT tmp.DisableTriggerStatement + CHAR(10) AS "data()" + FROM #Triggers tmp + FOR XML PATH('') + ); + +-- Execute SQL +EXEC sys.sp_executesql @Disable_Statement; + +-- Prepare Variable Script for Execution +DECLARE @Enable_Statement nvarchar(max) = ( + SELECT tmp.EnableTriggerStatement + CHAR(10) AS data + FROM #Triggers tmp + FOR XML PATH('') + ); + +-- Execute SQL +EXEC sys.sp_executesql @Enable_Statement; + +DROP TABLE #Triggers; diff --git a/Scripts/Disabling_Jobs_Schedules.sql b/Scripts/Disabling_Jobs_Schedules.sql new file mode 100644 index 00000000..11a6bfca --- /dev/null +++ b/Scripts/Disabling_Jobs_Schedules.sql @@ -0,0 +1,220 @@ +/* + + Disabling Jobs Shedules. + None. + 2018-12-11 by Jon Shaulis + 2020-04-18 by Konstantin Taranov + 1.0 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Disabling_Jobs_Schedules.sql.sql + https://jonshaulis.com/index.php/2018/12/11/how-to-stop-the-sql-scheduler-with-t-sql/ + +*/ + + +USE MSDB; + +/************************************************************* + Checking for history table. Creating it if it doesn't exist. +*************************************************************/ + +IF OBJECT_ID('dbo.JobsEnabledTracker', 'U') IS NULL +BEGIN +CREATE TABLE [dbo].[JobsEnabledTracker]( +[Id] [INT] IDENTITY(1, 1) NOT NULL, +[job_id] [UNIQUEIDENTIFIER] NULL, +[schedule_id] [BIGINT] NULL, +[enabled] [BIT] NULL); +END; +IF EXISTS +( + SELECT + 1 + FROM [dbo].[JobsEnabledTracker] + WHERE [enabled] = 1 +) + OR +( + SELECT + COUNT(*) + FROM [dbo].[JobsEnabledTracker] +) = 0 + BEGIN + PRINT 'There are jobs enabled or there are no jobs yet populated in the history table.'; + +/*********************** + Clear out history table +***********************/ + + PRINT 'Truncating history table: dbo.JobsEnabledTracker'; + TRUNCATE TABLE [dbo].[JobsEnabledTracker]; + + PRINT 'Inserting records into history table: dbo.JobsEnabledTracker'; + +/****************************** + Add in values to history table +******************************/ + + INSERT INTO [dbo].[JobsEnabledTracker] + ( + [job_id], + [schedule_id], + [enabled] + ) + SELECT + [jss].[job_id], + [jss].[schedule_id], + 1 AS 'enabled' + FROM [msdb].[dbo].[sysschedules] AS [ss] + INNER JOIN [msdb].[dbo].[sysjobschedules] AS [jss] ON [jss].[schedule_id] = [ss].[schedule_id] + WHERE [ss].[enabled] = 1; + +/********************************************************************************** + Table variable to hold schedules and jobs enabled. This is important for the loop. +**********************************************************************************/ + + DECLARE @JobsEnabled TABLE + ([Id] INT + PRIMARY KEY IDENTITY(1, 1), + [job_id] UNIQUEIDENTIFIER, + [schedule_id] BIGINT, + [enabled] BIT + ); + +/***************************************** + Insert schedules that we need to disable. +*****************************************/ + + INSERT INTO @JobsEnabled + ( + [job_id], + [schedule_id], + [enabled] + ) + SELECT + [job_id], + [schedule_id], + [enabled] + FROM [dbo].[JobsEnabledTracker]; + +/******************************** + Holds the job id and schedule id +********************************/ + + DECLARE @jobid UNIQUEIDENTIFIER; + DECLARE @scheduleid BIGINT; + +/*********************************** + Holds the ID of the row in the loop +***********************************/ + + DECLARE @ID INT= 0; + +/********************** + Check if records exist +**********************/ + + IF EXISTS + ( + SELECT + [Id] + FROM @JobsEnabled + ) + BEGIN + PRINT 'Loop mode, jobs found enabled.'; + +/********** + Begin loop +**********/ + + WHILE(1 = 1) + BEGIN + +/*************************************** + Grab jobid, scheduleid, and id of rows. +***************************************/ + + SELECT + @jobid = + ( + SELECT TOP 1 + [job_id] + FROM @JobsEnabled + ORDER BY + [job_id] + ); + SELECT + @scheduleid = + ( + SELECT TOP 1 + [schedule_id] + FROM @JobsEnabled + ORDER BY + [job_id] + ); + SELECT + @ID = + ( + SELECT TOP 1 + [Id] + FROM @JobsEnabled + ORDER BY + [job_id] + ); + +/************************************ + Re-enable schedule associated to job +************************************/ + + PRINT 'Disabling schedule_id: '+CAST(@scheduleid AS VARCHAR(255))+' paired to job_id: '+CAST(@jobid AS VARCHAR(255)); + EXEC [sp_update_schedule] + @schedule_id = @scheduleid, + @enabled = 0; + +/********************* + Removes row from loop +*********************/ + + DELETE FROM @JobsEnabled + WHERE + [Id] = @ID; + + UPDATE [dbo].[JobsEnabledTracker] + SET + [enabled] = 0 + WHERE + [job_id] = @jobid + AND [schedule_id] = @scheduleid; + +/**************************** + No more rows, stops deleting +****************************/ + + IF + ( + SELECT + COUNT(*) + FROM @JobsEnabled + ) <= 0 + BEGIN + BREAK + END; + +/******** + End Loop +********/ + END; + PRINT 'Exiting loop, disabling schedules paired to jobs complete.'; + +/********** + End elseif +**********/ + END; + ELSE + BEGIN + PRINT 'All done'; + END; + END; + ELSE + BEGIN + PRINT 'YOU HAVE JOBS STILL DISABLED, EXITING SCRIPT. PLEASE RUN SCRIPT TWO FIRST.'; + END; diff --git a/Scripts/Dynamic_GRANT_Generation.sql b/Scripts/Dynamic_GRANT_Generation.sql new file mode 100644 index 00000000..18277484 --- /dev/null +++ b/Scripts/Dynamic_GRANT_Generation.sql @@ -0,0 +1,35 @@ +/* + + Dynamically generate GRANTs. + PRINT dynamically generated GRANTs for user. + ? + 2020-02-08 by Konstantin Taranov + 1.0 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Dynamic_GRANT_Generation.sql + +*/ + + +SET NOCOUNT ON; +SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; + +DECLARE @userName sysname = QUOTENAME(N'user_name'); +DECLARE @tsql nvarchar(max) = N''; + +SELECT @tsql = @tsql + 'GRANT SELECT, INSERT, UPDATE, DELETE ON ' + + QUOTENAME(SCHEMA_NAME("schema_id")) + N'.' + + QUOTENAME("name") + N' TO ' + @userName + N';' + CHAR(13) + CHAR(10) +FROM sys.tables +/* +WHERE "name" NOT IN ('') +--*/ +; + +IF LEN(@tsql) <= 8000 +BEGIN + PRINT(@tsql); +END; +ELSE +BEGIN + SELECT @tsql; +END; diff --git a/Scripts/Enabling_Jobs_Schedules.sql b/Scripts/Enabling_Jobs_Schedules.sql new file mode 100644 index 00000000..05032972 --- /dev/null +++ b/Scripts/Enabling_Jobs_Schedules.sql @@ -0,0 +1,167 @@ +/* + + Enabling Jobs Shedules. + None. + 2018-12-11 by Jon Shaulis + 2020-04-19 by Konstantin Taranov + 1.0 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Enabling_Jobs_Schedules.sql.sql + https://jonshaulis.com/index.php/2018/12/11/how-to-stop-the-sql-scheduler-with-t-sql/ + +*/ + + +USE MSDB; +GO + +/******************************************************************************* + Check for history table. This physical table tells us what jobs we are going to + enable the scheduler for. +*******************************************************************************/ + +IF OBJECT_ID('dbo.JobsEnabledTracker', 'U') IS NOT NULL +BEGIN + IF EXISTS + ( + SELECT 1 + FROM [dbo].[JobsEnabledTracker] + WHERE [enabled] = 0 + ) + BEGIN + PRINT 'Jobs disabled in history table: dbo.JobsEnabledTracker found.'; + +/********************************************************************************** + Table variable to hold schedules and jobs enabled. This is important for the loop. +**********************************************************************************/ + + DECLARE @JobsEnabled TABLE + ( + [Id] int PRIMARY KEY IDENTITY(1, 1) + , [job_id] uniqueidentifier + , [schedule_id] bigint + , [enabled] bit + ); + +/******************************************************************************* + Insert schedules that we had disabled that we need to go back in and re-enable. +*******************************************************************************/ + + INSERT INTO @JobsEnabled( [job_id], [schedule_id], [enabled] ) + SELECT [job_id], [schedule_id], [enabled] + FROM [dbo].[JobsEnabledTracker]; + +/******************************** + Holds the job id and schedule id +********************************/ + + DECLARE @jobid uniqueidentifier; + DECLARE @scheduleid bigint; + +/*********************************** + Holds the ID of the row in the loop +***********************************/ + + DECLARE @ID int= 0; + +/********************** + Check if records exist +**********************/ + + IF EXISTS + ( + SELECT [Id] + FROM @JobsEnabled + ) + BEGIN + PRINT 'Loop mode, jobs found disabled.'; + +/********** + Begin loop +**********/ + + WHILE 1 = 1 + BEGIN + +/*************************************** + Grab jobid, scheduleid, and id of rows. +***************************************/ + + SELECT @jobid = + ( + SELECT TOP 1 [job_id] + FROM @JobsEnabled + ORDER BY [job_id] + ); + SELECT @scheduleid = + ( + SELECT TOP 1 [schedule_id] + FROM @JobsEnabled + ORDER BY [job_id] + ); + SELECT @ID = + ( + SELECT TOP 1 [Id] + FROM @JobsEnabled + ORDER BY [job_id] + ); + +/*************************************** + Re-enable schedule associated to job +***************************************/ + + PRINT 'Enabling schedule_id: '+CAST(@scheduleid AS varchar(255))+' paired to job_id: '+CAST(@jobid AS varchar(255)); + EXEC [sp_update_schedule] @schedule_id = @scheduleid, @enabled = 1; + +/********************* + Removes row from loop +*********************/ + + DELETE FROM @JobsEnabled + WHERE [Id] = @ID; + +/*********************** + Set job back to enabled +***********************/ + + UPDATE [dbo].[JobsEnabledTracker] + SET [enabled] = 1 + WHERE [job_id] = @jobid AND + [schedule_id] = @scheduleid; + +/**************************** + No more rows, stops deleting +****************************/ + + IF + ( + SELECT COUNT(*) + FROM @JobsEnabled + ) <= 0 + BEGIN + BREAK; + END; + +/******** + End Loop +********/ + END; + PRINT 'Exiting loop, enabling schedules paired to jobs complete.'; + +/********** + End elseif +**********/ + END; + ELSE + BEGIN + PRINT 'All done'; + END; + END; + ELSE + BEGIN + PRINT 'dbo.JobsEnabledTracker has no disabled jobs currently.'; + END; +END; +ELSE +BEGIN + PRINT 'dbo.JobsEnabledTracker is NULL, you may need to run the first script to create and populate this table.'; +END; diff --git a/Scripts/Find_Foreign_Key_Chains_For_Tables.sql b/Scripts/Find_Foreign_Key_Chains_For_Tables.sql new file mode 100644 index 00000000..4efe3b70 --- /dev/null +++ b/Scripts/Find_Foreign_Key_Chains_For_Tables.sql @@ -0,0 +1,81 @@ +/* + + Find Foreign Key Chains For Tables + nothing. + No + Konstantin Taranov + 2019-08-20 + 2019-08-24 by Konstantin Taranov + 1.0 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Find_Foreign_Key_Chains_For_Tables.sql + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Find_Foreign_Key_Chains_For_Tables.sql + +*/ + +WITH fk_tables AS + (SELECT s1.name AS from_schema + , o1.name AS from_table + , s2.name AS to_schema + , o2.name AS to_table + FROM sys.foreign_keys AS fk + INNER JOIN sys.objects AS o1 ON fk.parent_object_id = o1.object_id + INNER JOIN sys.schemas AS s1 ON o1.schema_id = s1.schema_id + INNER JOIN sys.objects AS o2 ON fk.referenced_object_id = o2.object_id + INNER JOIN sys.schemas AS s2 ON o2.schema_id = s2.schema_id + INNER JOIN (SELECT object_id, SUM(row_count) AS row_count + FROM sys.dm_db_partition_stats + WHERE index_id < 2 + GROUP BY object_id + ) AS rc ON o1.object_id = rc.object_id + /* For the purposes of finding dependency hierarchy + we're not worried about self-referencing tables */ + WHERE NOT + (s1.name = s2.name + AND o1.name = o2.name + ) + ) + , ordered_tables AS + (SELECT s.name AS SchemaName + , t.name AS TableName + , 0 AS TableLevel + FROM (SELECT name, schema_id FROM sys.tables) AS t + INNER JOIN sys.schemas AS s ON t.schema_id = s.schema_id + LEFT OUTER JOIN fk_tables AS fk ON s.name = fk.from_schema AND t.name = fk.from_table + WHERE fk.from_schema IS NULL + UNION ALL + SELECT fk.from_schema + , fk.from_table + , ot.TableLevel + 1 + FROM fk_tables AS fk + INNER JOIN ordered_tables ot ON fk.to_schema = ot.SchemaName AND fk.to_table = ot.TableName + ) + , final AS + (SELECT DISTINCT ot.SchemaName + , ot.TableName + , ot.TableLevel + FROM ordered_tables ot + INNER JOIN + (SELECT SchemaName + , TableName + , MAX(TableLevel) maxTableLevel + FROM ordered_tables + GROUP BY SchemaName + , TableName + ) mx ON ot.SchemaName = mx.SchemaName AND ot.TableName = mx.TableName AND mx.maxTableLevel = ot.TableLevel + ) +SELECT QUOTENAME(final.SchemaName) + '.' + QUOTENAME(final.TableName) AS TableName + , TableLevel +FROM final +WHERE( + /* exclude some schemes by IN */ + final.SchemaName NOT IN ('dbo') + /* exclude some tables by IN */ + AND final.TableName NOT IN ('Tep1') + /* exclude some tables by mask */ + AND final.TableName NOT LIKE '%Temp' + ) + /* add some tables by mask and with IN */ + OR final.TableName IN ('IPAdmin') + OR final.TableName LIKE 'AspNet%' + OR final.TableName LIKE 'Application%' +ORDER BY TableLevel; diff --git a/Scripts/Find_Maximum_Float_Values.sql b/Scripts/Find_Maximum_Float_Values.sql new file mode 100644 index 00000000..3b2473e4 --- /dev/null +++ b/Scripts/Find_Maximum_Float_Values.sql @@ -0,0 +1,47 @@ +/* +https://docs.microsoft.com/en-us/sql/t-sql/data-types/float-and-real-transact-sql +*/ + +SELECT CAST(-2.22999999999999E-308 AS float(53)) AS "Float(53) Negative Max" + , CAST(-1.797693134862315807E+308 AS float(53)) AS "Float(53) Negative Min" + , CAST(+1.797693134862315807E+308 AS float(53)) AS "Float(53) Positive Max"; + + +SET NOCOUNT ON; + +DROP TABLE IF EXISTS t; +CREATE TABLE t ( + i int IDENTITY(1, 1) NOT NULL + , f float(53) NOT NULL + , s varchar(100) NOT NULL +); +GO + +DECLARE @s varchar(100) = '+1.79'; /* +1.79 -2.22*/ +DECLARE @i int = 1; +DECLARE @j int = 9; + +WHILE (@i < 200 AND LEN(@s) < 22) +BEGIN + BEGIN TRY + SET @i = @i + 1; + + INSERT INTO t(f, s) SELECT CAST((@s + CAST(@j AS varchar) + 'E' + LEFT(@s, 1) + '308') AS float(53)), @s AS s; + SET @s = (@s + CAST(@j AS varchar)); + SET @j = 9; + END TRY + + BEGIN CATCH + SELECT ERROR_NUMBER() AS ErrorNumber + ,ERROR_SEVERITY() AS ErrorSeverity + ,ERROR_STATE() AS ErrorState + ,ERROR_PROCEDURE() AS ErrorProcedure + ,ERROR_LINE() AS ErrorLine + ,ERROR_MESSAGE() AS ErrorMessage; + SET @j = @j - 1; + END CATCH +END; + +SELECT i, f, s +FROM t +WHERE f = (SELECT MAX(f) AS FLOAT_MAX FROM t); diff --git a/Scripts/Find_SQL_Server_Integer_Columns_to_Make_Skinnier.sql b/Scripts/Find_SQL_Server_Integer_Columns_to_Make_Skinnier.sql new file mode 100644 index 00000000..f31640df --- /dev/null +++ b/Scripts/Find_SQL_Server_Integer_Columns_to_Make_Skinnier.sql @@ -0,0 +1,105 @@ +/* + + Find SQL Server Integer Columns to Make Skinnier + 1 data set: temp table #errlog. + No + Konstantin Taranov + 2019-07-25 + 2019-08-15 by Konstantin Taranov + 1.1 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Find_SQL_Server_Integer_Columns_to_Make_Skinnier.sql + https://www.mssqltips.com/sqlservertip/6107/find-sql-server-integer-columns-to-make-skinnier/ + +*/ + +SET NOCOUNT ON; + +IF OBJECT_ID(N'dbo.floob', 'U') IS NOT NULL DROP TABLE dbo.floob; +IF OBJECT_ID(N'dbo.mort', 'U') IS NOT NULL DROP TABLE dbo.mort; + +CREATE TABLE dbo.floob(x bigint, y int, z smallint); +INSERT dbo.floob(x,y,z) VALUES(1,1,1),(32766,32766,254); +CREATE TABLE dbo.mort(a int, b tinyint); +INSERT dbo.mort(a,b) VALUES(1,1),(32768,254); + +IF OBJECT_ID(N'tempdb..#cols', 'U') IS NOT NULL DROP TABLE #cols; + +DECLARE @src bigint = 2; +;WITH types AS +( + SELECT * FROM + (VALUES + (1,0,1, 104, N'bit', 1, 0, 1), + (2,1,1, 48, N'tinyint', 1, 0, 255), + (3,1,1, 52, N'smallint', 2, -(POWER(@src,15)), (POWER(@src,15)-1)), + (4,1,1, 56, N'int', 4, -(POWER(@src,31)), (POWER(@src,31)-1)), + (5,1,0, 127, N'bigint', 8, -(POWER(@src,62)-1)*2-2, (POWER(@src,62)-1)*2+1) + ) AS v(seq,src,trg,type_id,[type],bytes,minval,maxval) +), +cols AS +( + SELECT t.[object_id], + [schema] = s.name, + [table] = t.name, + [column] = QUOTENAME(c.name), + [type] = styp.name + COALESCE(' (alias: ' + utyp.name + ')', ''), + c.is_nullable, + trgtyp.seq, + trgtyp.type_id, + trgtype = trgtyp.[type], + savings = srctyp.bytes - trgtyp.bytes, + trgtyp.minval, + trgtyp.maxval, + [rowcount] = (SELECT SUM([rows]) FROM sys.partitions + WHERE object_id = t.object_id AND index_id IN (0,1)) + FROM sys.tables AS t + INNER JOIN sys.schemas AS s + ON s.[schema_id] = t.[schema_id] + INNER JOIN sys.columns AS c + ON t.[object_id] = c.[object_id] + INNER JOIN sys.types AS styp + ON c.system_type_id = styp.system_type_id + AND c.system_type_id = styp.user_type_id + LEFT OUTER JOIN sys.types AS utyp + ON c.user_type_id = utyp.user_type_id + AND utyp.user_type_id <> utyp.system_type_id + INNER JOIN types AS srctyp + ON srctyp.type_id = c.system_type_id + INNER JOIN types AS trgtyp + ON trgtyp.seq < srctyp.seq + WHERE srctyp.src = 1 + AND trgtyp.trg = 1 +) +SELECT * INTO #cols FROM cols; + +DECLARE @sql nvarchar(max) = N';WITH x([object_id], [column], minval, maxval) +AS (', + @core nvarchar(max) = N' + SELECT $oid, ''$c'', MIN($c), MAX($c) FROM $obj UNION ALL'; +SELECT @sql += REPLACE(REPLACE(REPLACE(@core, '$oid', RTRIM(object_id)), + '$c',[column]),'$obj',QUOTENAME([schema]) + '.' + QUOTENAME([table])) + FROM (SELECT [schema],[table],[column],object_id FROM #cols + GROUP BY [schema],[table],[column],object_id) AS x; +SET @sql += N' + SELECT NULL,NULL,NULL,NULL + ) + SELECT c.[schema], c.[table], c.[column], c.is_nullable, + current_type = c.[type], potential_type = c.trgtype, + space_savings = c.savings * c.[rowcount], x.minval, x.maxval, + range = RTRIM(c.minval) + '' -> '' + RTRIM(c.maxval) + FROM x + INNER JOIN #cols AS c + ON x.[object_id] = c.[object_id] + AND x.[column] = c.[column] + AND x.minval >= c.minval + AND x.maxval <= c.maxval;'; + +--PRINT(@sql); + +DECLARE @xml xml = (SELECT @sql FOR XML path('')); +SET @sql = + REPLACE(REPLACE(REPLACE(REPLACE(CONVERT(nvarchar(MAX), @xml, 1), ' ', CHAR(13)), '>', '>'), '<', '<'), '&', '&'); +/* Enable in SSMS option Tools->Options->Query Results->SQL Server->Results to Grid->Return CR/LF on copy or save */ +SELECT @sql AS SQL_Print; + +EXEC sys.sp_executesql @sql; diff --git a/Scripts/Find_Weak_Passwords.sql b/Scripts/Find_Weak_Passwords.sql new file mode 100644 index 00000000..5f45c305 --- /dev/null +++ b/Scripts/Find_Weak_Passwords.sql @@ -0,0 +1,87 @@ +/* + + Find weak passwords in sys.sql_logins + 1 data set: select query. + No + Mitch Wheat + 2019-07-21 + 2019-08-16 by Konstantin Taranov + 1.1 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Find_Weak_Passwords.sql + https://mitchwheat.com/2019/07/21/sql-server-security-find-users-with-weak-passwords/ + +*/ + +SET NOCOUNT ON; + +IF OBJECT_ID('tempdb..#CommonPasswords') IS NOT NULL + DROP TABLE #CommonPasswords; + +CREATE TABLE #CommonPasswords(Password varchar(30) not null primary key); + +INSERT INTO #CommonPasswords(Password) VALUES +(''), +('123'), +('1234'), +('12345'), +('123456'), +('1234567'), +('12345678'), +('123456789'), +('1234567890'), +('qwerty'), +('qwerty123'), +('password'), +('password1'), +('password123'), +('111111'), +('1111111'), +('abc123'), +('666666'), +('7777777'), +('654321'), +('123123'), +('123321'), +('iloveyou'), +('admin'), +('nimda'), +('welcome'), +('!@#$%^&*'), +('aa123456'), +('sunshine'), +('princess' ), +('football'), +('monkey'), +('charlie'), +('donald'), +('dragon'), +('passw0rd'), +('trustno1'), +('letmein'), +('whatever'), +('hello'), +('freedom'), +('master'), +('starwars'), +('qwertyuiop'), +('qazwsx'), +('login'); + +SELECT + name, + create_date, + is_disabled +FROM + sys.sql_logins sl (nolock) + cross apply #CommonPasswords cp +WHERE + PWDCOMPARE(cp.Password, sl.password_hash) = 1 + UNION ALL + SELECT + name, + create_date, + is_disabled +FROM + sys.sql_logins sl (nolock) +WHERE + PWDCOMPARE(sl.name, sl.password_hash) = 1; -- password same as username diff --git a/Scripts/Find_and_fix_that_troublesome_Windows_Power_setting.sql b/Scripts/Find_and_fix_that_troublesome_Windows_Power_setting.sql new file mode 100644 index 00000000..98aae26c --- /dev/null +++ b/Scripts/Find_and_fix_that_troublesome_Windows_Power_setting.sql @@ -0,0 +1,95 @@ +/* + + Fix troublesome Windows Power setting + No. + No + Jeff Iannucci + 2019-04-30 + + 1.0 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Jobs_Find_And_Replace_Text.sql + http://desertdba.com/find-and-fix-that-troublesome-windows-power-setting/ + +*/ + +SET NOCOUNT ON; + + +-- Collect current configuration settings + +DECLARE +@isCmdShellEnabled bit +, @isShowAdvanced bit +, @isGettinFixed bit; + +-- Do you want to Fix this? Then SET this to 1 + +SET @isGettinFixed = 0; + +SELECT @isCmdShellEnabled = CAST(value AS BIT) + +FROM sys.configurations + +WHERE name = 'xp_cmdshell'; + +SELECT @isShowAdvanced = CAST(value AS BIT) + +FROM sys.configurations + +WHERE name = 'show advanced options'; + +IF(@isShowAdvanced = 0) BEGIN + +EXEC sp_configure 'show advanced options', 1; + +RECONFIGURE; + +END; + +IF(@isCmdShellEnabled = 0) BEGIN + +EXEC sp_configure 'xp_cmdshell', 1; + +RECONFIGURE; + +END; + +-- Run xp_cmdshell to get power settings + +IF OBJECT_ID('tempdb..#Power') IS NOT NULL DROP TABLE #Power; + +CREATE TABLE #Power (PowerScheme varchar(1000)); + +INSERT #Power (PowerScheme) + +EXEC xp_cmdshell 'powercfg /list'; + +SELECT PowerScheme FROM #Power WHERE RIGHT(LTRIM(RTRIM(PowerScheme)),1) = '*'; + +-- Set to High Performance + +IF @isGettinFixed = 1 BEGIN + +EXEC xp_cmdshell 'powercfg.exe /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c'; + +END; + +-- If necessary, turn off 'xp_cmdshell' + +IF(@isCmdShellEnabled = 0) BEGIN + +EXEC sp_configure 'xp_cmdshell', 0; + +RECONFIGURE; + +END; + +-- If necessary, turn off 'show advanced options' + +IF(@isShowAdvanced = 0) BEGIN + +EXEC sp_configure 'show advanced options', 0; + +RECONFIGURE; + +END; diff --git a/Scripts/Finding_Host_Names_for_Failed_login_attempts.sql b/Scripts/Finding_Host_Names_for_Failed_login_attempts.sql new file mode 100644 index 00000000..c2c008d7 --- /dev/null +++ b/Scripts/Finding_Host_Names_for_Failed_login_attempts.sql @@ -0,0 +1,168 @@ +/* + + Inspects the SQL Server Error Log for failed logins, then uses xp_cmdshell to get the machine name by running nslookup against the IP address of the machine that initiated the failed login + 1 data set: temp table #errlog. + No + Konstantin Taranov + 2019-02-01 + 2019-08-09 by Konstantin Taranov + 1.0 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Finding_Host_Names_for_Failed_login_attempts.sql + https://www.sqlserverscience.com/security/finding-host-names-for-failed-login-attempts/ + + + Inspects the SQL Server Error Log for failed logins, then + uses xp_cmdshell to get the machine name by running nslookup against + the IP address of the machine that initiated the failed login. + + By: Max Vernon + https://www.sqlserverscience.com/security/finding-host-names-for-failed-login-attempts/ +*/ + +SET NOCOUNT ON; + +IF ( +SELECT CONVERT(INT, ISNULL(value, value_in_use)) AS config_value +FROM sys.configurations +WHERE name = 'xp_cmdshell') = 0 +RAISERROR (' +Please enable xp_cmdshell for this script using! +-- To allow advanced options to be changed. +EXEC sp_configure ''show advanced options'', 1 +GO +-- To update the currently configured value for advanced options. +RECONFIGURE +GO +-- To enable the feature. +EXEC sp_configure ''xp_cmdshell'', 1 +GO +-- To update the currently configured value for this feature. +RECONFIGURE +GO', 0, 1) WITH NOWAIT; + +IF OBJECT_ID(N'tempdb..#errlog', N'U') IS NULL +CREATE TABLE #errlog +( + ErrorLogFileNum int NULL + , LogDate datetime + , ProcessInfo varchar(255) + , [Text] varchar(4000) +); +TRUNCATE TABLE #errlog; + +DECLARE @ErrorLogCount int; +DECLARE @ErrorLogPath varchar(1000); +DECLARE @cmd varchar(2000); +DECLARE @output TABLE +( + txtID int NOT NULL PRIMARY KEY IDENTITY(1,1) + , txt varchar(1000) NULL +); + +SET @ErrorLogPath = CONVERT(varchar(1000), SERVERPROPERTY(N'errorlogfilename')); +SET @ErrorLogPath = LEFT(@ErrorLogPath, LEN(@ErrorLogPath) - CHARINDEX('\', REVERSE(@ErrorLogPath))); +SET @cmd = 'DIR /b "' + @ErrorLogPath + '\ERRORLOG*"'; + +INSERT INTO @output (txt) +EXEC xp_cmdshell @cmd; + +SELECT @ErrorLogCount = COUNT(*) +FROM @output o +WHERE o.txt IS NOT NULL; + +DECLARE @FileNum int; +SET @FileNum = 0 + +WHILE @FileNum < @ErrorLogCount +BEGIN + INSERT INTO #errlog (LogDate, ProcessInfo, [Text]) + EXEC sys.sp_readerrorlog @FileNum, 1; + + UPDATE #errlog + SET ErrorLogFileNum = @FileNum + WHERE ErrorLogFileNum IS NULL; + + SET @FileNum = @FileNum + 1; +END + +DECLARE @IPs TABLE( + [IP] varchar(15) NOT NULL + , Name varchar(255) +); +DECLARE @IP varchar(15); + +DECLARE cur CURSOR LOCAL FORWARD_ONLY STATIC +FOR +SELECT ClientIP = SUBSTRING(el.[Text] + , CHARINDEX('[', el.[Text]) + 9 + , CHARINDEX(']', el.[Text]) - (CHARINDEX('[', el.[Text]) + 9)) +FROM #errlog el +WHERE el.[Text] LIKE 'Login failed for user %.%' +GROUP BY SUBSTRING(el.[Text] + , CHARINDEX('[', el.[Text]) + 9 + , CHARINDEX(']', el.[Text]) - (CHARINDEX('[', el.[Text]) + 9)); +OPEN cur; +FETCH NEXT FROM cur INTO @IP; +WHILE @@FETCH_STATUS = 0 +BEGIN + DELETE FROM @output; + SET @cmd = 'nslookup ' + @IP; + INSERT INTO @output(txt) + EXEC sys.xp_cmdshell @cmd; + + DELETE + FROM @output + WHERE txt NOT LIKE 'Name: %'; + + UPDATE @output + SET txt = RIGHT(txt, LEN(txt) - 9); + + INSERT INTO @IPs (IP, Name) + SELECT @IP, txt + FROM @output; + FETCH NEXT FROM cur INTO @IP; +END +CLOSE cur; +DEALLOCATE cur; + +DELETE FROM @IPs WHERE Name IS NULL; + +--show only the most recent message for each client +SELECT MostRecentFailedLoginAttempt = MAX(el.LogDate) + , LoginName = SUBSTRING(el.[Text] + , CHARINDEX('''', el.[Text]) + 1 + , CHARINDEX('''', el.[Text], CHARINDEX('''', el.[Text]) + 1) - (CHARINDEX('''', el.[Text]) + 1)) + , FailureReason = SUBSTRING(el.[Text] + , CHARINDEX('.', el.[Text]) + 1 + , CHARINDEX('.', el.[Text], CHARINDEX('.', el.[Text]) + 1) - (CHARINDEX('.', el.[Text]) + 1)) + , ClientIP = SUBSTRING(el.[Text] + , CHARINDEX('[', el.[Text]) + 9 + , CHARINDEX(']', el.[Text]) - (CHARINDEX('[', el.[Text]) + 9)) + , ClientName = ips.Name +FROM #errlog el + LEFT JOIN @IPs ips ON (SUBSTRING(el.[Text] + , CHARINDEX('[', el.[Text]) + 9 + , CHARINDEX(']', el.[Text]) - (CHARINDEX('[', el.[Text]) + 9))) = ips.IP +WHERE el.[Text] LIKE 'Login failed for user %.%' +GROUP BY el.[Text] + , ips.Name +ORDER BY MAX(el.LogDate) DESC; + +--show all messages +SELECT el.LogDate + , LoginName = SUBSTRING(el.[Text] + , CHARINDEX('''', el.[Text]) + 1 + , CHARINDEX('''', el.[Text], CHARINDEX('''', el.[Text]) + 1) - (CHARINDEX('''', el.[Text]) + 1)) + , FailureReason = SUBSTRING(el.[Text] + , CHARINDEX('.', el.[Text]) + 1 + , CHARINDEX('.', el.[Text], CHARINDEX('.', el.[Text]) + 1) - (CHARINDEX('.', el.[Text]) + 1)) + , ClientIP = SUBSTRING(el.[Text] + , CHARINDEX('[', el.[Text]) + 9 + , CHARINDEX(']', el.[Text]) - (CHARINDEX('[', el.[Text]) + 9)) + , ClientName = ips.Name +FROM #errlog el + LEFT JOIN @IPs ips ON (SUBSTRING(el.[Text] + , CHARINDEX('[', el.[Text]) + 9 + , CHARINDEX(']', el.[Text]) - (CHARINDEX('[', el.[Text]) + 9))) = ips.IP +WHERE el.[Text] LIKE 'Login failed for user %.%' +ORDER BY el.LogDate DESC; diff --git a/Scripts/Fix_the_broken_dependencies_on_all__objects.sql b/Scripts/Fix_The_Broken_Dependencies_On_All_Objects.sql similarity index 100% rename from Scripts/Fix_the_broken_dependencies_on_all__objects.sql rename to Scripts/Fix_The_Broken_Dependencies_On_All_Objects.sql diff --git a/Scripts/Get_Amazon_RDS_Instance_Size.sql b/Scripts/Get_Amazon_RDS_Instance_Size.sql new file mode 100644 index 00000000..75cb23b5 --- /dev/null +++ b/Scripts/Get_Amazon_RDS_Instance_Size.sql @@ -0,0 +1,37 @@ +/* + + Get Amazon RDS Instance Size using TSQL + 1 data set: InstanceSize. + No + Mitch Wheat + 2008-07-27 + 2019-07-02 by Konstantin Taranov + 1.0 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Get_Amazon_RDS_Instance_Size.sql + https://mitchwheat.com/2019/07/27/amazon-rds-sql-server-get-instance-size-using-tsql/ + +*/ + +IF OBJECT_ID('tempdb..#AmazonErrorLog') IS NOT NULL + DROP TABLE #AmazonErrorLog; + +CREATE TABLE #AmazonErrorLog +( + LogDate datetime2, + ProcessInfo nvarchar(20), + [Text] nvarchar(1000) +); + +DECLARE @pattern nvarchar(30) = N'System Model:'; + +INSERT INTO #AmazonErrorLog +EXEC rdsadmin.dbo.rds_read_error_log; + +IF @@ROWCOUNT > 0 +BEGIN + SELECT InstanceSize = REPLACE(CAST(SUBSTRING([Text], LEN(@pattern) + 1 + PATINDEX (N'%' + @pattern + N'%', [Text]), 100), '''', '') AS varchar(100)) + FROM #AmazonErrorLog + WHERE PATINDEX (N'%' + @pattern + N'%', [Text]) > 0 +END; + +DROP TABLE #AmazonErrorLog; diff --git a/Scripts/Get_CPU_Usage_Per_Database.sql b/Scripts/Get_CPU_Usage_Per_Database.sql new file mode 100644 index 00000000..c039e63a --- /dev/null +++ b/Scripts/Get_CPU_Usage_Per_Database.sql @@ -0,0 +1,37 @@ +/* + + Get CPU Usage Per Database + 1 data set with 2 columns: database name and CPUTimeAsPercentage. + No + Eli Leiba + 2019-11-05 + 2019-11-05 + 1.0 + https://www.mssqltips.com/sqlservertip/6195/sql-server-function-to-measure-cpu-usage-per-database/ + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Get_CPU_Usage_Per_Database.sql + +*/ + +SELECT + T.[Database] + , T.CPUTimeAsPercentage + FROM + (SELECT + [Database], + CONVERT (DECIMAL (6, 3), [CPUTimeInMiliSeconds] * 1.0 / + SUM ([CPUTimeInMiliSeconds]) OVER () * 100.0) AS [CPUTimeAsPercentage] + FROM + (SELECT + dm_execplanattr.DatabaseID, + DB_Name(dm_execplanattr.DatabaseID) AS [Database], + SUM (dm_execquerystats.total_worker_time) AS CPUTimeInMiliSeconds + FROM sys.dm_exec_query_stats dm_execquerystats + CROSS APPLY + (SELECT + CONVERT (INT, value) AS [DatabaseID] + FROM sys.dm_exec_plan_attributes(dm_execquerystats.plan_handle) + WHERE attribute = N'dbid' + ) dm_execplanattr + GROUP BY dm_execplanattr.DatabaseID + ) AS CPUPerDb + ) AS T; diff --git a/Scripts/Get_Coulmn_Statistics_By_Name.sql b/Scripts/Get_Coulmn_Statistics_By_Name.sql new file mode 100644 index 00000000..cc9c5190 --- /dev/null +++ b/Scripts/Get_Coulmn_Statistics_By_Name.sql @@ -0,0 +1,49 @@ +/* + + Get table column min, max and other parameters + 1 data set + No + Konstantin Taranov + 2019-11-20 + 2019-11-30 by Konstantin Taranov + 1.2 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Get_Coulmn_Statistics_By_Name.sql + +*/ + +DECLARE @columnName sysname = N'ModifiedDate'; +DECLARE @tsql nvarchar(max) = N''; +DECLARE @sep nvarchar(50) = N' UNION ALL '; +DECLARE @crlf nvarchar(10) = CHAR(13) + CHAR(10); +DECLARE @debug bit = 0; +DECLARE @errMsg nvarchar(900) = N'In using database "' + DB_NAME() + + '" no tables with colum name equal "' + @columnName + + '". Choose another database or fix @columnName variable.'; + + +IF NOT EXISTS (SELECT 1 FROM sys.all_columns WHERE "name" = @columnName) +BEGIN + PRINT(@errMsg); +END +ELSE +BEGIN + SELECT -- TOP(2) + @tsql = @tsql + N'SELECT MAX(_C_) AS _C_Max, MIN(_C_) _C_Min, COUNT(_C_) AS _C_Count, ''' + + SCHEMA_NAME(o.schema_id) + ''' AS SchemaName,''' + + OBJECT_NAME(allc.object_id) + ''' AS TableName' + + ' FROM ' + + SCHEMA_NAME(o.schema_id) + '.' + OBJECT_NAME(allc.object_id) + + @crlf + @sep + FROM sys.all_columns AS allc + INNER JOIN sys.objects AS o + ON allc.object_id = o.object_id + WHERE allc."name" = 'ModifiedDate'; + + SET @tsql = REPLACE(@tsql, N'_C_', @columnName); + SET @tsql = LEFT(@tsql, (DATALENGTH(@tsql) - DATALENGTH(@sep)) / 2) + ' ORDER BY 1 DESC'; + + IF @debug = 1 + SELECT @tsql; + ELSE + EXEC sp_executesql @tsql; +END; diff --git a/Scripts/Get_Create_or_Alter_Index_Progress.sql b/Scripts/Get_Create_or_Alter_Index_Progress.sql new file mode 100644 index 00000000..8f812dd5 --- /dev/null +++ b/Scripts/Get_Create_or_Alter_Index_Progress.sql @@ -0,0 +1,47 @@ +/* + + Track progrees CREATE or ALTER Index commands + 1 data set + No + Solomon Rutzky + 2019-12-02 + 2019-12-02 + 1.0 + https://dba.stackexchange.com/a/139225/107045 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Get_Create_or_Alter_Index_Progress.sql + +*/ + +DECLARE @SPID int = 51; + +WITH agg AS +( + SELECT SUM(qp.[row_count]) AS [RowsProcessed], + SUM(qp.[estimate_row_count]) AS [TotalRows], + MAX(qp.last_active_time) - MIN(qp.first_active_time) AS [ElapsedMS], + MAX(IIF(qp.[close_time] = 0 AND qp.[first_row_time] > 0, + [physical_operator_name], + N'')) AS [CurrentStep] + FROM sys.dm_exec_query_profiles qp + WHERE qp.[physical_operator_name] IN (N'Table Scan', N'Clustered Index Scan', + N'Index Scan', N'Sort') + AND qp.[session_id] = @SPID +), comp AS +( + SELECT *, + ([TotalRows] - [RowsProcessed]) AS [RowsLeft], + ([ElapsedMS] / 1000.0) AS [ElapsedSeconds] + FROM agg +) +SELECT [CurrentStep], + [TotalRows], + [RowsProcessed], + [RowsLeft], + CONVERT(DECIMAL(5, 2), + (([RowsProcessed] * 1.0) / [TotalRows]) * 100) AS [PercentComplete], + [ElapsedSeconds], + (([ElapsedSeconds] / [RowsProcessed]) * [RowsLeft]) AS [EstimatedSecondsLeft], + DATEADD(SECOND, + (([ElapsedSeconds] / [RowsProcessed]) * [RowsLeft]), + GETDATE()) AS [EstimatedCompletionTime] +FROM comp; diff --git a/Scripts/Get_Latest_Success_and_Failure_Login.sql b/Scripts/Get_Latest_Success_and_Failure_Login.sql new file mode 100644 index 00000000..9316bb70 --- /dev/null +++ b/Scripts/Get_Latest_Success_and_Failure_Login.sql @@ -0,0 +1,83 @@ +/* + + Get latest success and failure logins. + Latest success and failure logins. + 2020-04-08 by Kenneth Fisher + 2020-04-17 by Konstantin Taranov + 1.1 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Get_Latest_Success_and_Failure_Login.sql + https://sqlstudies.com/2020/04/08/has-this-login-been-used-recently/ + +*/ + + +IF OBJECT_ID(N'tempdb..#LogInfo', N'U') IS NOT NULL DROP TABLE #LogInfo; + +DECLARE @searchstring1 nvarchar(500) = ''; +DECLARE @searchstring2 nvarchar(500) = ''; +DECLARE @Limit int = 10000; + +---------------------------------------------------------------------- +-- This part of the code was found here: +-- https://ask.sqlservercentral.com/questions/99484/number-of-error-log-files.html + +DECLARE @FileList AS TABLE ( + subdirectory NVARCHAR(4000) NOT NULL + ,DEPTH BIGINT NOT NULL + ,[FILE] BIGINT NOT NULL +); + +DECLARE @ErrorLog NVARCHAR(4000), @ErrorLogPath NVARCHAR(4000); +SELECT @ErrorLog = CAST(SERVERPROPERTY(N'errorlogfilename') AS NVARCHAR(4000)); +SELECT @ErrorLogPath = SUBSTRING(@ErrorLog, 1, LEN(@ErrorLog) - CHARINDEX(N'\', REVERSE(@ErrorLog))) + N'\'; + +INSERT INTO @FileList +EXEC xp_dirtree @ErrorLogPath, 0, 1; + +DECLARE @NumberOfLogfiles INT; +SET @NumberOfLogfiles = (SELECT COUNT(*) FROM @FileList WHERE [@FileList].subdirectory LIKE N'ERRORLOG%'); +-- SELECT @NumberOfLogfiles; +If @Limit IS NOT NULL AND @NumberOfLogfiles > @Limit + SET @NumberOfLogfiles = @Limit; +---------------------------------------------------------------------- + +CREATE TABLE #LogInfo ( + LogDate datetime, + ProcessInfo nvarchar(500), + ErrorText nvarchar(max) +); + +DECLARE @p1 INT = 0; + +WHILE @p1 < @NumberOfLogfiles +BEGIN + -- P1 is the file number starting at 0 + DECLARE + @p2 INT = 1, + -- P2 1 for SQL logs, 2 for SQL Agent logs + @p3 NVARCHAR(255) = @searchstring1, + -- P3 is a value to search on + @p4 NVARCHAR(255) = @searchstring2; + -- P4 is another search value + +BEGIN TRY + INSERT INTO #LogInfo + EXEC sys.xp_readerrorlog @p1, @p2, @p3, @p4; +END TRY +BEGIN CATCH + PRINT 'Error occurred processing file ' + CAST(@p1 as varchar(10)); +END CATCH + +SET @p1 = @p1 + 1; +END; + +SELECT + UserList.UserName + , MAX(CASE WHEN #LogInfo.ErrorText LIKE '%succeeded%' THEN LogDate ELSE NULL END) AS LatestSuccess + , MAX(CASE WHEN #LogInfo.ErrorText LIKE '%failed%' THEN LogDate ELSE NULL END) AS LatestFailure +FROM #LogInfo +CROSS APPLY (SELECT REPLACE(REPLACE(ErrorText,'Login succeeded for user ''',''),'Login failed for user ''','')) RemoveFront(ErrorText) +CROSS APPLY (SELECT SUBSTRING(RemoveFront.ErrorText,1,CHARINDEX('''', RemoveFront.ErrorText)-1)) AS UserList(UserName) +WHERE #LogInfo.ProcessInfo = 'Logon' +and #LogInfo.ErrorText like 'Login%' +GROUP BY UserList.UserName; diff --git a/Scripts/Get_Opened_Transactions_Info.sql b/Scripts/Get_Opened_Transactions_Info.sql new file mode 100644 index 00000000..dacc7a22 --- /dev/null +++ b/Scripts/Get_Opened_Transactions_Info.sql @@ -0,0 +1,46 @@ +/* + + Get opened transactions information + 1 data set with information about opened transactions. + 2017-01-01 by Paul Randal + 2020-11-19 by Konstantin Taranov + 1.1 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Get_Opened_Transactions_Info.sql + https://sqlstudies.com/2013/09/05/a-t-sql-query-to-get-current-job-activity/ + +*/ + +SELECT + s_tst.session_id + , s_es.login_name AS "Login Name" + , DB_NAME (s_tdt.database_id) AS "Database" + , s_tdt.database_transaction_begin_time AS "Begin Time" + , s_tdt.database_transaction_log_bytes_used AS "Log Bytes" + , s_tdt.database_transaction_log_bytes_reserved AS "Log Reserved Bytes" + , s_est.text AS "Last T-SQL Text" + , s_eqp.query_plan AS "Last Plan" +FROM + sys.dm_tran_database_transactions s_tdt +INNER JOIN + sys.dm_tran_session_transactions s_tst +ON + s_tst.transaction_id = s_tdt.transaction_id +INNER JOIN + sys.dm_exec_sessions s_es +ON + s_es.session_id = s_tst.session_id +INNER JOIN + sys.dm_exec_connections s_ec +ON + s_ec.session_id = s_tst.session_id +LEFT OUTER JOIN + sys.dm_exec_requests s_er +ON + s_er.session_id = s_tst.session_id +CROSS APPLY + sys.dm_exec_sql_text (s_ec.most_recent_sql_handle) AS s_est +OUTER APPLY + sys.dm_exec_query_plan (s_er.plan_handle) AS s_eqp +ORDER BY + s_tdt.database_transaction_begin_time ASC; +GO diff --git a/Scripts/Get_SQL_Server_NUMA_Memory.sql b/Scripts/Get_SQL_Server_NUMA_Memory.sql new file mode 100644 index 00000000..9645c6ae --- /dev/null +++ b/Scripts/Get_SQL_Server_NUMA_Memory.sql @@ -0,0 +1,54 @@ +/* +https://sql-sasquatch.blogspot.com/2019/09/placeholder.html +*/ + +WITH tgt AS (SELECT instance_name, cntr_value + FROM sys.dm_os_performance_counters + WHERE counter_name = 'Target Node Memory (KB)' + UNION ALL + SELECT 'TOTAL', cntr_value + FROM sys.dm_os_performance_counters + WHERE counter_name = 'Target Server Memory (KB)'), +tot AS (SELECT instance_name, cntr_value + FROM sys.dm_os_performance_counters + WHERE counter_name = 'Total Node Memory (KB)' + UNION ALL + SELECT 'TOTAL', cntr_value + FROM sys.dm_os_performance_counters + WHERE counter_name = 'Total Server Memory (KB)'), +dbc AS (SELECT instance_name, cntr_value + FROM sys.dm_os_performance_counters + WHERE counter_name = 'Database Node Memory (KB)' + UNION ALL + SELECT 'TOTAL', cntr_value + FROM sys.dm_os_performance_counters + WHERE counter_name = 'Database Cache Memory (KB)'), +stl AS (SELECT instance_name, cntr_value + FROM sys.dm_os_performance_counters + WHERE counter_name = 'Stolen Node Memory (KB)' + UNION ALL + SELECT 'TOTAL', cntr_value + FROM sys.dm_os_performance_counters + WHERE counter_name = 'Stolen Server Memory (KB)'), +fre AS (SELECT instance_name, cntr_value + FROM sys.dm_os_performance_counters + WHERE counter_name = 'Free Node Memory (KB)' + UNION ALL + SELECT 'TOTAL', cntr_value + FROM sys.dm_os_performance_counters + WHERE counter_name = 'Free Memory (KB)'), +frn AS (SELECT instance_name, cntr_value + FROM sys.dm_os_performance_counters + WHERE counter_name = 'Foreign Node Memory (KB)' + UNION ALL + SELECT 'TOTAL', cntr_value = CONVERT(INT, NULL)) +SELECT tgt.instance_name, target_kb = tgt.cntr_value, + total_kb = tot.cntr_value, dbCache_kb = dbc.cntr_value, + stolen_kb = stl.cntr_value, free_kb = fre.cntr_value, + foreign_kb = frn.cntr_value +FROM tgt +INNER JOIN tot ON tgt.instance_name = tot.instance_name +INNER JOIN frn ON tgt.instance_name = frn.instance_name +INNER JOIN dbc ON tgt.instance_name = dbc.instance_name +INNER JOIN stl ON tgt.instance_name = stl.instance_name +INNER JOIN fre ON tgt.instance_name = fre.instance_name; diff --git a/Scripts/Get_Table_and_Index_Storage_Size.sql b/Scripts/Get_Table_and_Index_Storage_Size.sql new file mode 100644 index 00000000..f87985fa --- /dev/null +++ b/Scripts/Get_Table_and_Index_Storage_Size.sql @@ -0,0 +1,56 @@ +/* + + Count tables and indexes sizes in database. + 1 query set with table and index sizes/returns> + Muhmud + 2019-03-26 + 2019-10-24 by Konstantin Taranov + 1.2 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Get_Table_and_Index_Storage_Size.sql + + If you divide the DataKb and IndexAllKb values by 1024.0, you will get the numbers you see in the SSMS. Takes into account internal tables, such as those used for XML storage. + +*/ + + +WITH TablePages AS ( + SELECT s.[object_id] + , SUM(s.reserved_page_count) AS reserved_pages + , SUM(s.used_page_count) AS used_pages + , SUM(CASE WHEN index_id < 2 THEN in_row_data_page_count + lob_used_page_count + row_overflow_used_page_count + ELSE lob_used_page_count + row_overflow_used_page_count + END) AS pages + , (SELECT COUNT(i.[object_id]) FROM sys.indexes AS i WHERE s.[object_id] = i.[object_id] AND i.[type] <> 0) AS IndexCount + , SUM(row_count) AS NumberOfRows + FROM sys.dm_db_partition_stats AS s + GROUP BY [object_id] +) +, ExtraData AS ( + SELECT p.[object_id] + , COUNT(*) AS IndexCount + , SUM(reserved_page_count) AS reserved_pages + , SUM(used_page_count) AS used_pages + FROM sys.dm_db_partition_stats AS p + LEFT JOIN sys.internal_tables AS it ON p.[object_id] = it.[object_id] + WHERE it.internal_type IN (202, 204, 211, 212, 213, 214, 215, 216) + GROUP BY p.[object_id] +) +SELECT p.[object_id] + , OBJECT_SCHEMA_NAME(p.[object_id]) AS ShemaName + , OBJECT_NAME(p.[object_id]) AS TableName + , p.NumberOfRows + , (p.reserved_pages + ISNULL(e.reserved_pages, 0)) * 8 AS ReservedKb + , p.pages * 8 AS DataKb + , p.IndexCount + , CASE WHEN p.IndexCount <> 0 AND p.used_pages + ISNULL(e.used_pages, 0) >= p.pages + THEN p.used_pages + ISNULL(e.used_pages, 0) - p.pages + ELSE 0 + END * 8 AS IndexAllKb + , CASE WHEN p.reserved_pages + ISNULL(e.reserved_pages, 0) > p.used_pages + ISNULL(e.used_pages, 0) + THEN p.reserved_pages + ISNULL(e.reserved_pages, 0) - p.used_pages + ISNULL(e.used_pages, 0) + ELSE 0 + END * 8 AS UnusedKb +FROM TablePages AS p +LEFT JOIN ExtraData AS e ON p.[object_id] = e.[object_id] +WHERE OBJECT_SCHEMA_NAME(p.[object_id]) <> 'sys' AND p.pages > 0 +ORDER BY DataKb ASC; diff --git a/Scripts/How_much_will_it_cost_or_save_to_rebuild_that_index.sql b/Scripts/How_much_will_it_cost_or_save_to_rebuild_that_index.sql new file mode 100644 index 00000000..ed160dd1 --- /dev/null +++ b/Scripts/How_much_will_it_cost_or_save_to_rebuild_that_index.sql @@ -0,0 +1,69 @@ +/* + + Detail Job History + 1 result set with detailed jobs information. + No + Max Vernon + 2019-07-21 + + 1.0 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/How_much_will_it_cost_or_save_to_rebuild_that_index.sql + https://www.sqlservercentral.com/articles/rebuild-index + +*/ + +/************************************************************************************************** + Purpose: + Display some things about indexes that wed normally like to know plus it calculates how much + extra space would be saved or used after a REBUILD for the current Fill Factor and for the 70, 80, + 90, and 100% Fill Factors. + Progammers Notes: + + 1. Keep in mind that these are all based on averages and so should be considered as approximations. + Also, indexes with very wide rows where there are less than 20 or so rows per page can cause + less accurate approximations. + 2. It would be quite easy to turn this into a system stored procedure that could be executed from + any database. + 3. Note that this has only been tested for non-partitioned rowstore indexes. + Revision History: + Rev 00 - 21 Jul 2019 - Jeff Moden + - Borrow parts of a much larger stored procedure that I use. +**************************************************************************************************/ + WITH cteStats AS +(--===== This CTE is used mostly to rename some of the very long names in the DMF. + SELECT DBName = DB_NAME() + ,ObjectID = ips.object_id + ,IndexID = ips.index_id + ,FragPct = CONVERT(INT,ips.avg_fragmentation_in_percent) + ,AvgFragSize = avg_fragment_size_in_pages + ,PageDensity = ips.avg_page_space_used_in_percent + ,PageCnt = ips.page_count + ,RowCnt = ips.record_count + ,CurSizeMB = ips.page_count/128 --Integer math produces whole numbers here. + FROM sys.dm_db_index_physical_stats (DB_ID(),NULL,NULL,NULL,'SAMPLED') ips + WHERE ips.index_id > 0 --NOT a HEAP + AND ips.page_count > 128 --This is 1 MB or 16 Extents and could be parameterized. +) + SELECT stats.DBName + ,SchemaName = OBJECT_SCHEMA_NAME(stats.ObjectID) + ,ObjectName = OBJECT_NAME(stats.ObjectID) + ,stats.ObjectID + ,IndexName = idx.name + ,stats.IndexID + ,CurFillFactor = idx.fill_factor + ,stats.FragPct + ,stats.AvgFragSize + ,stats.PageDensity + ,stats.PageCnt + ,stats.RowCnt + ,stats.CurSizeMB + ,SavingsMBCur = CONVERT(INT,(stats.PageCnt-(stats.PageDensity/ISNULL(NULLIF(idx.fill_factor,0),100)*stats.PageCnt))/128.0) + ,SavingsMB070 = CONVERT(INT,(stats.PageCnt-(stats.PageDensity/ 70*stats.PageCnt))/128.0) + ,SavingsMB080 = CONVERT(INT,(stats.PageCnt-(stats.PageDensity/ 80*stats.PageCnt))/128.0) + ,SavingsMB090 = CONVERT(INT,(stats.PageCnt-(stats.PageDensity/ 90*stats.PageCnt))/128.0) + ,SavingsMB100 = CONVERT(INT,(stats.PageCnt-(stats.PageDensity/100*stats.PageCnt))/128.0) + FROM cteStats stats + JOIN sys.indexes idx + ON stats.ObjectID = idx.object_id + AND stats.IndexID = idx.index_id +; \ No newline at end of file diff --git a/Scripts/Index_Creating_Info.sql b/Scripts/Index_Creating_Info.sql new file mode 100644 index 00000000..5bebae2d --- /dev/null +++ b/Scripts/Index_Creating_Info.sql @@ -0,0 +1,45 @@ +/* + + Track index creating progress + 1 data set: index creation info. + No + Solomon Rutzky + 2020-09-03 + 2021-08-12 by Konstantin Taranov + 1.0 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Index_Creating_Info.sql + https://dba.stackexchange.com/a/139225/107045 + +*/ + +WITH agg AS +( + SELECT SUM(qp.row_count) AS RowsProcessed, + SUM(qp.estimate_row_count) AS TotalRows, + MAX(qp.last_active_time) - MIN(qp.first_active_time) AS ElapsedMS, + MAX(IIF(qp.close_time = 0 AND qp.first_row_time > 0, + physical_operator_name, + N'')) AS CurrentStep + FROM sys.dm_exec_query_profiles qp + WHERE qp.[physical_operator_name] IN (N'Table Scan', N'Clustered Index Scan', + N'Index Scan', N'Sort') + AND qp.[session_id] IN (SELECT session_id from sys.dm_exec_requests where command IN ( 'CREATE INDEX','ALTER INDEX','ALTER TABLE') ) +), comp AS +( + SELECT *, + (TotalRows - RowsProcessed) AS RowsLeft, + (ElapsedMS / 1000.0) AS ElapsedSeconds + FROM agg +) +SELECT CurrentStep, + TotalRows, + RowsProcessed, + RowsLeft, + CONVERT(DECIMAL(5, 2), + ((RowsProcessed * 1.0) / TotalRows) * 100) AS PercentComplete, + ElapsedSeconds, + ((ElapsedSeconds / RowsProcessed) * RowsLeft) AS EstimatedSecondsLeft, + DATEADD(SECOND, + ((ElapsedSeconds / RowsProcessed) * RowsLeft), + GETDATE()) AS EstimatedCompletionTime +FROM comp; diff --git a/Scripts/Job_AG_Failover_Detected.sql b/Scripts/Job_AG_Failover_Detected.sql new file mode 100644 index 00000000..b674343d --- /dev/null +++ b/Scripts/Job_AG_Failover_Detected.sql @@ -0,0 +1,39 @@ +/* + + Use this event to run a job when the replica becomes primary + Create job to resume AG database data movement for suspended databases. + 2020-08-06 by Wayne Sheffield + 1.0 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Job_AG_Failover_Detected.sql + https://blog.waynesheffield.com/wayne/archive/2020/08/availability-group-issues-fixed-with-alerts/ + +*/ + +/* +Use this event to run a job when the replica becomes primary +*/ +USE msdb; +GO +EXEC msdb.dbo.sp_add_alert @name=N'AG Failover Detected - Now Primary', +@message_id=1480, +@severity=0, +@enabled=1, +@delay_between_responses=0, +@include_event_description_in=0, +@event_description_keyword=N'"RESOLVING" to "PRIMARY"', +@job_id=N'00000000-0000-0000-0000-000000000000'; +GO +/* +Use this event to run a job when the replica becomes secondary +*/ +USE msdb; +GO +EXEC msdb.dbo.sp_add_alert @name=N'AG Failover Detected - Now Secondary', +@message_id=1480, +@severity=0, +@enabled=1, +@delay_between_responses=0, +@include_event_description_in=0, +@event_description_keyword=N'"RESOLVING" to "SECONDARY"', +@job_id=N'00000000-0000-0000-0000-000000000000'; +GO diff --git a/Scripts/Job_AG_Resume_Data_Movement.sql b/Scripts/Job_AG_Resume_Data_Movement.sql new file mode 100644 index 00000000..310ce020 --- /dev/null +++ b/Scripts/Job_AG_Resume_Data_Movement.sql @@ -0,0 +1,129 @@ +/* + + Create job to resume AG database data movement for suspended databases. + Create alert to catch when data movement has been suspended, and run the job + + Create job to resume AG database data movement for suspended databases. + 2020-08-06 by Wayne Sheffield + 1.0 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Job_AG_Resume_Data_Movement.sql + https://blog.waynesheffield.com/wayne/archive/2020/08/availability-group-issues-fixed-with-alerts/ + +*/ + +USE msdb; +GO + +BEGIN TRANSACTION; +DECLARE @ReturnCode INT; +SELECT @ReturnCode = 0;DECLARE @jobname sysname = N'AG - Resume Data Movement'; +DECLARE @categoryname sysname = 'HADR-Availability Group'; + +IF EXISTS (SELECT name FROM dbo.sysjobs where name = @jobname) +BEGIN +EXECUTE msdb.dbo.sp_delete_job @job_name = @jobname; +END; + +IF NOT EXISTS (SELECT name FROM msdb.dbo.syscategories WHERE name=@categoryname AND category_class=1) +BEGIN +EXECUTE @ReturnCode = msdb.dbo.sp_add_category @class=N'JOB', @type=N'LOCAL', @name=@categoryname; +IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback; +END; + + +EXECUTE @ReturnCode = msdb.dbo.sp_add_job +@job_name=@jobname, +@enabled=1, +@notify_level_eventlog=0, +@notify_level_email=2, +@notify_level_netsend=2, +@notify_level_page=2, +@delete_level=0, +@description=N'Resume data movement on suspended Availability Group databases. + +This job can be run manually, or from an alert', +@category_name=N'HADR-Availability Group', +@owner_login_name=N'sa'; +IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback; + +EXECUTE @ReturnCode = msdb.dbo.sp_add_jobserver @job_name=@jobname, @server_name = N'(local)' +IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback; + +EXECUTE @ReturnCode = msdb.dbo.sp_add_jobstep +@job_name=@jobname, +@step_name=N'Resume data movement in AG databases', +@step_id=1, +@cmdexec_success_code=0, +@on_success_action=1, +@on_fail_action=2, +@retry_attempts=0, +@retry_interval=0, +@os_run_priority=0, +@subsystem=N'TSQL', +@command=N'DECLARE @SQLCMD VARCHAR(1000); +DECLARE cDBSuspended CURSOR FOR +SELECT ''ALTER DATABASE ['' + DB_NAME(database_id) + ''] SET HADR RESUME;'' +FROM sys.dm_hadr_database_replica_states drs +JOIN sys.availability_replicas ar ON ar.replica_id = drs.replica_id +WHERE ar.replica_server_name = @@SERVERNAME +AND drs.is_suspended = 1; + +OPEN cDBSuspended; +FETCH NEXT FROM cDBSuspended INTO @SQLCMD; +WHILE @@FETCH_STATUS = 0 +BEGIN +EXECUTE (@SQLCMD); +FETCH NEXT FROM cDBSuspended INTO @SQLCMD; +END; +CLOSE cDBSuspended; +DEALLOCATE cDBSuspended; +', +@database_name=N'master', +@flags=0; +IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback; + + +EXECUTE @ReturnCode = msdb.dbo.sp_update_job +@job_name=@jobname, +@enabled=1, +@start_step_id=1, +@notify_level_eventlog=0, +@notify_level_email=2, +@notify_level_netsend=2, +@notify_level_page=2, +@delete_level=0, +@description=N'Resume data movement on suspended Availability Group databases.', +@category_name=N'HADR-Availability Group', +@owner_login_name=N'sa', +@notify_email_operator_name=N'', +@notify_netsend_operator_name=N'', +@notify_page_operator_name=N''; +IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback; + +DECLARE @alertname sysname = N'AG Data Movement suspended'; +IF EXISTS (SELECT * FROM msdb.dbo.sysalerts WHERE name = @alertname) +BEGIN +EXECUTE @ReturnCode = msdb.dbo.sp_delete_alert @alertname; +IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback; +END; + +/* +Alert text: +AlwaysOn Availability Groups data movement for database '%.*ls' has been suspended for the following reason: "%S_MSG" (Source ID %d; Source string: '%.*ls'). To resume data movement on the database, you will need to resume the database manually. For information about how to resume an availability database, see SQL Server Books Online. +*/ +EXECUTE @ReturnCode = msdb.dbo.sp_add_alert +@name=@alertname, +@message_id=35264, +@severity=0, +@enabled=1, +@delay_between_responses=0, +@include_event_description_in=0, +@job_name = @jobname; +IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback; + +COMMIT TRANSACTION; +GOTO EndSave +QuitWithRollback: +IF (@@TRANCOUNT > 0) ROLLBACK TRANSACTION; +EndSave: +GO diff --git a/Scripts/Jobs_Detailed_History.sql b/Scripts/Jobs_Detailed_History.sql new file mode 100644 index 00000000..42165088 --- /dev/null +++ b/Scripts/Jobs_Detailed_History.sql @@ -0,0 +1,118 @@ +/* + + Detail Job History + 1 result set with detailed jobs information. + No + Konstantin Taranov + 2019-08-16 + 2019-08-27 by Konstantin Taranov + 1.1 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Read_Errorlog.sql + https://jasonbrimhall.info/2019/06/27/detail-job-history-back-to-basics/ + +*/ + +WITH jobhist +AS (SELECT jh.job_id, + jh.run_date, + jh.run_status, + jh.step_id, + ROW_NUMBER() OVER (PARTITION BY jh.job_id, jh.run_status ORDER BY jh.run_date DESC) AS rownum + FROM dbo.sysjobhistory jh + WHERE jh.step_id = 0), + agglastsixty +AS (SELECT sjh.job_id, + sjh.run_status, + COUNT(*) AS RunCount + FROM dbo.sysjobhistory AS sjh + INNER JOIN jobhist AS jh + ON jh.job_id = sjh.job_id + AND jh.run_status = sjh.run_status + AND jh.step_id = sjh.step_id + WHERE CONVERT(DATE, CONVERT(varchar(30), sjh.run_date)) > DATEADD(d, -60, CONVERT(DATE, CONVERT(varchar(30), jh.run_date))) + AND jh.rownum = 1 + GROUP BY sjh.job_id, + sjh.run_status), + aggtotal +AS (SELECT sjh.job_id, + sjh.run_status, + COUNT(*) AS RunCount + FROM dbo.sysjobhistory sjh + INNER JOIN jobhist jh + ON jh.job_id = sjh.job_id + AND jh.run_status = sjh.run_status + AND jh.step_id = sjh.step_id + WHERE jh.rownum = 1 + GROUP BY sjh.job_id, + sjh.run_status) +SELECT j.name AS JobName, + sc.name AS CategoryName, + j.date_created, + j.enabled, + CONVERT(DATE, CONVERT(VARCHAR(30), oa.run_date)) AS RunDate, + CASE oa.run_status + WHEN 0 THEN + 'Failed' + WHEN 1 THEN + 'Succeeded' + WHEN 2 THEN + 'Retry' + WHEN 3 THEN + 'Canceled' + WHEN 4 THEN + 'In Progress' + END AS run_status, + als.RunCount AS Last60StatusCount, + agt.RunCount AS TotalStatusCount, + js.subsystem AS JobStepSubsystem, + js.command, + CASE + WHEN js.subsystem = 'SSIS' + AND js.command LIKE '%DECRYPT%' THEN + LTRIM(RTRIM(SUBSTRING( + js.command, + CHARINDEX('/DECRYPT', js.command, 1) + 9, + CHARINDEX('/', js.command, CHARINDEX('/DECRYPT', js.command, 1) + 1) + - CHARINDEX('/DECRYPT', js.command, 1) - 9 + ) + ) + ) + ELSE + 'N/A' + END AS PkgPassword, + CASE + WHEN js.subsystem = 'SSIS' + AND js.command LIKE '%FILE%' THEN + LTRIM(RTRIM(SUBSTRING( + js.command, + CHARINDEX('/FILE', js.command, 1) + 9, + CHARINDEX('\""', js.command, CHARINDEX('/FILE', js.command, 1) + 1) + - CHARINDEX('/FILE', js.command, 1) - 9 + ) + ) + ) + ELSE + 'N/A' + END AS PkgPath, + spr.name AS ProxyName, + spr.credential_id +FROM dbo.sysjobs j + LEFT JOIN jobhist oa + ON oa.job_id = j.job_id + LEFT OUTER JOIN agglastsixty als + ON als.job_id = oa.job_id + AND als.run_status = oa.run_status + LEFT OUTER JOIN aggtotal agt + ON agt.job_id = oa.job_id + AND agt.run_status = oa.run_status + INNER JOIN sys.server_principals sp + ON j.owner_sid = sp.sid + INNER JOIN dbo.syscategories sc + ON j.category_id = sc.category_id + INNER JOIN dbo.sysjobsteps js + ON js.job_id = j.job_id + LEFT JOIN dbo.sysproxies spr + ON js.proxy_id = spr.proxy_id +WHERE oa.rownum = 1 +--AND oa.run_status = 0 +ORDER BY RunDate DESC; diff --git a/Scripts/Jobs_Find_And_Replace_Text.sql b/Scripts/Jobs_Find_And_Replace_Text.sql new file mode 100644 index 00000000..80bd077d --- /dev/null +++ b/Scripts/Jobs_Find_And_Replace_Text.sql @@ -0,0 +1,117 @@ +/* + + Replace text in jobs + No. + No + Max Vernon + 2019-04-30 + 2019-09-06 by Konstantin Taranov + 1.1 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Jobs_Find_And_Replace_Text.sql + https://www.sqlserverscience.com/tools/find-and-replace-sql-server-agent-jobs/ + +*/ + +USE msdb; +GO + +DECLARE @Find nvarchar(max); +DECLARE @Replace nvarchar(max); +DECLARE @DebugOnly bit; +SET @Find = N'\\SERVERA\Backups'; +SET @Replace = N'\\SERVERB\Backups'; +SET @DebugOnly = 1; + +IF OBJECT_ID(N'tempdb..#excludeJobs', N'U') IS NOT NULL +BEGIN + DROP TABLE #excludeJobs; +END +CREATE TABLE #excludeJobs +( + JobName sysname NOT NULL + PRIMARY KEY CLUSTERED +); + +INSERT INTO #excludeJobs (JobName) +VALUES ('The Name of a job you want to skip'); + +IF OBJECT_ID(N'tempdb..#deets', N'U') IS NOT NULL +DROP TABLE #deets; + +CREATE TABLE #deets +( + JobName sysname NOT NULL + , StepName sysname NOT NULL + , OldCommand nvarchar(max) NOT NULL + , NewCommand nvarchar(max) NOT NULL + , PRIMARY KEY (JobName, StepName) +); +DECLARE @JobName sysname; +DECLARE @StepName sysname; +DECLARE @StepID int; +DECLARE @Command nvarchar(max); +DECLARE @NewCommand nvarchar(max); + +BEGIN TRY + BEGIN TRANSACTION; + + DECLARE cur CURSOR LOCAL FORWARD_ONLY STATIC READ_ONLY + FOR + SELECT sj.name + , sjs.step_name + , sjs.step_id + , sjs.command + FROM dbo.sysjobsteps sjs + INNER JOIN dbo.sysjobs sj ON sjs.job_id = sj.job_id + WHERE sjs.command LIKE N'%' + @Find + N'%' ESCAPE N'|' COLLATE SQL_Latin1_General_CP1_CI_AS + AND sj.enabled = 1 + AND NOT EXISTS ( + SELECT 1 + FROM #excludeJobs ej + WHERE ej.JobName = sj.name + ) + ORDER BY sj.name + , sjs.step_name; + + OPEN cur; + FETCH NEXT FROM cur INTO @JobName + , @StepName + , @StepID + , @Command; + WHILE @@FETCH_STATUS = 0 + BEGIN + SET @NewCommand = REPLACE(@Command, @Find, @Replace) COLLATE SQL_Latin1_General_CP1_CI_AS; + INSERT INTO #deets (JobName, StepName, OldCommand, NewCommand) + SELECT JobName = @JobName + , StepName = @StepName + , PriorCommand = @Command + , NewCommand = @NewCommand; + + IF @DebugOnly = 0 + BEGIN + EXEC dbo.sp_update_jobstep @job_name = @JobName, @step_id = @StepID, @command = @NewCommand; + PRINT N'Updated ' + @JobName; + END + + FETCH NEXT FROM cur INTO @JobName + , @StepName + , @StepID + , @Command; + END + CLOSE cur; + DEALLOCATE cur; + + SELECT * + FROM #deets; + + COMMIT TRANSACTION; +END TRY +BEGIN CATCH + IF @@TRANCOUNT > 0 + BEGIN + ROLLBACK TRANSACTION; + PRINT N'Transaction rolled back'; + END + PRINT ERROR_MESSAGE(); + PRINT ERROR_LINE(); +END CATCH diff --git a/Scripts/Jobs_Get_Runing_info.sql b/Scripts/Jobs_Get_Runing_info.sql new file mode 100644 index 00000000..517abcf3 --- /dev/null +++ b/Scripts/Jobs_Get_Runing_info.sql @@ -0,0 +1,39 @@ +/* + + Return active jobs info. + 1 data set with information about current runnig jobs. + 2017-01-07 by Brenda + 2020-08-10 by Konstantin Taranov + 1.1 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Jobs_Get_runing_info.sql + https://sqlstudies.com/2013/09/05/a-t-sql-query-to-get-current-job-activity/ + +*/ + +SELECT + DISTINCT j.name as JobName + , CASE WHEN ja.last_executed_step_id IS NULL THEN js.step_name ELSE js2.step_name END AS StepName + , ja.start_execution_date AS StartDateTime + , 'Running' AS RunStatus + , RIGHT('0' + CONVERT(VARCHAR(2), DATEDIFF(second, ja.start_execution_date, GetDate())/3600), 2) + ':' + + RIGHT('0' + CONVERT(VARCHAR(2), DATEDIFF(second, ja.start_execution_date, GetDate())%3600/60), 2) + ':' + + RIGHT('0' + CONVERT(VARCHAR(2), DATEDIFF(second, ja.start_execution_date, GetDate())%60), 2) AS Duration + , '' AS message +FROM msdb.dbo.sysjobactivity ja + JOIN msdb.dbo.sysjobs j + ON ja.job_id = j.job_id + LEFT JOIN msdb.dbo.sysjobsteps js + ON j.job_id = js.job_id + AND CASE WHEN ja.last_executed_step_id IS NULL THEN j.start_step_id + ELSE ja.last_executed_step_id + END = js.step_id + LEFT JOIN msdb.dbo.sysjobsteps js2 + ON js.job_id = js2.job_id + AND js.on_success_step_id = js2.step_id +WHERE ja.session_id = ( + SELECT TOP(1) session_id + FROM msdb.dbo.syssessions + ORDER BY agent_start_date DESC + ) +AND ja.start_execution_date IS NOT NULL +AND ja.stop_execution_date IS NULL; diff --git a/Scripts/MaxDop_2016_and_higher.sql b/Scripts/MaxDop_2016_and_higher.sql new file mode 100644 index 00000000..00570a01 --- /dev/null +++ b/Scripts/MaxDop_2016_and_higher.sql @@ -0,0 +1,116 @@ +/* + + Calculate recommended MAXDOP value for your server. + 1 data set with information about current runnig jobs. + 2020-02-18 by John Welch + 2020-09-07 by Konstantin Taranov + 1.1 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/MaxDop_2016_and_higher.sql + https://www.sentryone.com/blog/is-maxdop-configured-correctly + +*/ + + +DECLARE @ProductVersion NVARCHAR(50); +DECLARE @Major INT; +DECLARE @NumaNodeCount INT; +DECLARE @LogicalProcessorPerNumaNodeCount INT; +DECLARE @EffectiveMaxDop INT; +DECLARE @LogicalProcessorThreshold INT; +DECLARE @ResultMessage NVARCHAR(255); + +SET @ProductVersion = CAST(SERVERPROPERTY('ProductVersion') AS NVARCHAR(50)); +SET @Major = CAST(LEFT(@ProductVersion, CHARINDEX('.', @ProductVersion)-1) AS INT); + +IF @Major < 13 +BEGIN + RAISERROR('This script is intended for SQL Server 2016 or higher. It will not work on version [%s].', 11, 1, @ProductVersion); +END + +/* Get the MAXDOP setting */ +SELECT + @EffectiveMaxDop = CAST(value_in_use AS INT) +FROM + sys.configurations +WHERE + [name] = N'max degree of parallelism'; + +IF @EffectiveMaxDop = 0 +BEGIN + SELECT + @EffectiveMaxDop = COUNT(*) + FROM + sys.dm_os_schedulers + WHERE + scheduler_id <= 1048575 + AND is_online = 1; +END + +-- Get the NUMA node count +-- Get the logical processors per numa node +SELECT + @NumaNodeCount = COUNT(*), @LogicalProcessorPerNumaNodeCount = MAX(online_scheduler_count) +FROM + sys.dm_os_nodes +WHERE node_id <> 64; --Excluded DAC node + +IF @NumaNodeCount < 1 OR @LogicalProcessorPerNumaNodeCount < 1 +BEGIN + RAISERROR('Could not capture NUMA node or logical processor count. Reported values - NUMA: [%d], Logical Processor: [%d]', + 11,1, @NumaNodeCount, @LogicalProcessorPerNumaNodeCount); +END + +SET @LogicalProcessorThreshold = IIF(@NumaNodeCount = 1, 8, 16); + +--If NUMA = 1 and LogiProcs <= 8 THEN ASSERT(MaxDop <= LogiProcs) +--If NUMA > 1 and LogiProcs <= 16 THEN ASSERT(MaxDop <= LogiProcs) +IF @LogicalProcessorPerNumaNodeCount <= @LogicalProcessorThreshold + AND @EffectiveMaxDop > @LogicalProcessorPerNumaNodeCount +BEGIN + SET @ResultMessage = N'MAXDOP should be less than or equal to the Logical Processor count per NUMA node.'; +END +ELSE +BEGIN + -- If NUMA = 1 and LogiProcs > 8 THEN ASSERT(MaxDop == 8) + IF @NumaNodeCount = 1 + AND @LogicalProcessorPerNumaNodeCount > @LogicalProcessorThreshold + AND @EffectiveMaxDop <> @LogicalProcessorThreshold + BEGIN + SET @ResultMessage = N'MAXDOP should be equal to 8.'; + END + -- If NUMA > 1 and LogiProcs > 16 THEN ASSERT(MaxDop <= 16 & MaxDop <= (LogiProcs / 2)) + ELSE + BEGIN + IF @LogicalProcessorPerNumaNodeCount > @LogicalProcessorThreshold + AND @EffectiveMaxDop > @LogicalProcessorThreshold + BEGIN + SET @ResultMessage = N'MAXDOP should not exceed a value of 16.'; + --RAISERROR('MAXDOP is not set based on recommendations in KB2806535. MAXDOP should not exceed a value of 16 . Reported values - NUMA: [%d], Logical Processor: [%d], MAXDOP: [%d]', + -- 15,1, @NumaNodeCount, @LogicalProcessorPerNumaNodeCount, @EffectiveMaxDop); + END + ELSE IF @LogicalProcessorPerNumaNodeCount > @LogicalProcessorThreshold + AND (@LogicalProcessorPerNumaNodeCount / 2) <= @LogicalProcessorThreshold + AND @EffectiveMaxDop <> (@LogicalProcessorPerNumaNodeCount / 2) + BEGIN + SET @ResultMessage = N'MAXDOP should be set at half the number of logical processors per NUMA node with a MAX value of 16.'; + --RAISERROR('MAXDOP is not set based on recommendations in KB2806535. MAXDOP should be set at half the number of logical processors per NUMA node with a MAX value of 16 . Reported values - NUMA: [%d], Logical Processor: [%d], MAXDOP: [%d]', + -- 15,1, @NumaNodeCount, @LogicalProcessorPerNumaNodeCount, @EffectiveMaxDop); + END + END +END +IF @EffectiveMaxDop = 1 +BEGIN + RAISERROR('MAXDOP is set to 1, which supresses parallel plan generation.', 0, 1); +END + +IF @ResultMessage IS NULL +BEGIN + RAISERROR('MAXDOP setting is in the recommended range. Reported values - NUMA: [%d], Logical Processor: [%d], MAXDOP: [%d]', + 0, 1, @NumaNodeCount, @LogicalProcessorPerNumaNodeCount, @EffectiveMaxDop); +END +ELSE +BEGIN + RAISERROR('MAXDOP is not set based on recommendations in KB2806535. %s Reported values - NUMA: [%d], Logical Processor: [%d], MAXDOP: [%d]', + 11, 1, @ResultMessage, @NumaNodeCount, @LogicalProcessorPerNumaNodeCount, @EffectiveMaxDop); +END +GO diff --git a/Scripts/Memory_Consumption_By_Object.sql b/Scripts/Memory_Consumption_By_Object.sql new file mode 100644 index 00000000..9cd0ed08 --- /dev/null +++ b/Scripts/Memory_Consumption_By_Object.sql @@ -0,0 +1,122 @@ +/* + + Get memory for all objects in all databases + Temp table #obd with memory consumption by objects + 2019-08-02 by Max Vernon + 2020-02-05 by Konstantin Taranov + 1.2 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Memory_Consumption_By_Object.sql + https://www.sqlserverscience.com/performance/memory-consumption-by-object/ + +*/ + +SET NOCOUNT ON; +SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; + +IF OBJECT_ID(N'tempdb..#obd', N'U') IS NOT NULL +BEGIN + DROP TABLE #obd; +END +CREATE TABLE #obd +( + database_id int NULL + , file_id int NULL + , page_id int NULL + , page_level int NULL + , allocation_unit_id bigint NULL + , page_type nvarchar(60) NULL + , row_count int NULL + , free_space_in_bytes int NULL + , is_modified bit NULL + , numa_node int NULL + , read_microsec bigint NULL +); + + +INSERT INTO #obd +( + database_id + , file_id + , page_id + , page_level + , allocation_unit_id + , page_type + , row_count + , free_space_in_bytes + , is_modified + , numa_node + , read_microsec +) +SELECT + obd.database_id + , obd.file_id + , obd.page_id + , obd.page_level + , obd.allocation_unit_id + , obd.page_type + , obd.row_count + , obd.free_space_in_bytes + , obd.is_modified + , obd.numa_node + , obd.read_microsec +FROM sys.dm_os_buffer_descriptors obd; + +SELECT d.name AS DatabaseName + , obd.page_type + , (COUNT(1) * 8192 / 1048576.0) AS MB_in_memory +FROM #obd obd + INNER JOIN sys.databases d ON obd.database_id = d.database_id +WHERE d.state_desc = N'ONLINE' +GROUP BY d.name + , obd.page_type +ORDER BY d.name + , obd.page_type; + +IF OBJECT_ID(N'tempdb..#allocunits', N'U') IS NOT NULL +BEGIN + DROP TABLE #allocunits; +END +CREATE TABLE #allocunits +( + allocation_unit_id bigint NOT NULL + , ObjectName nvarchar(128) NOT NULL + , database_id smallint NULL +); + +DECLARE @cmd nvarchar(max); +SET @cmd = N''; +DECLARE @serverCollation nvarchar(200) = CAST(SERVERPROPERTY('Collation') AS nvarchar(100)); + +SELECT @cmd = @cmd + CASE WHEN @cmd = N'' THEN N'' ELSE N' +UNION ALL +' END + N'SELECT au.allocation_unit_id + , o.name COLLATE ' + @serverCollation + N' AS ObjectName' + + N', ' + CONVERT(nvarchar(10), d.database_id) + N' AS database_id +FROM ' + QUOTENAME(d.name) + N'.sys.allocation_units au + INNER JOIN ' + QUOTENAME(d.name) + N'.sys.partitions p ON ((au.type = 1 OR au.type = 3) AND (au.container_id = p.hobt_id)) + OR (au.type = 2 AND au.container_id = p.partition_id) + INNER JOIN ' + QUOTENAME(d.name) + N'.sys.objects o ON p.object_id = o.object_id +WHERE o.is_ms_shipped = 0' +FROM sys.databases d +WHERE d.state_desc = N'ONLINE'; + +PRINT(@cmd); + +INSERT INTO #allocunits (allocation_unit_id, ObjectName, database_id) +EXEC sys.sp_executesql @cmd; + +SELECT d.name AS DatabaseName + , au.ObjectName + , obd.page_type + , (COUNT(1) * 8192 / 1048576.0) AS MB_in_memory +FROM #obd obd + INNER JOIN sys.databases d ON obd.database_id = d.database_id + INNER JOIN #allocunits au ON obd.database_id = au.database_id + AND obd.allocation_unit_id = au.allocation_unit_id +GROUP BY d.name + , au.ObjectName + , obd.page_type +ORDER BY d.name + , MB_in_memory DESC + , au.ObjectName + , obd.page_type; diff --git a/Scripts/Numbers_DATALENGTH.sql b/Scripts/Numbers_DATALENGTH.sql index 277431b6..f3d37075 100644 --- a/Scripts/Numbers_DATALENGTH.sql +++ b/Scripts/Numbers_DATALENGTH.sql @@ -1,13 +1,17 @@ -SELECT DATALENGTH(CAST(99999999999999999999999999999999999999 AS DECIMAL(38, 0))) AS DECIMAL38 - , DATALENGTH(CAST( 9999999999999999999999999999 AS DECIMAL(28, 0))) AS DECIMAL28 - , DATALENGTH(CAST( 9999999999999999999 AS DECIMAL(19, 0))) AS DECIMAL19 - , DATALENGTH(CAST( 999999999999999 AS DECIMAL(15, 0))) AS DECIMAL15 - , DATALENGTH(CAST( 9223372036854775807 AS BIGINT )) AS [BIGINT] - -- Arithmetic overflow error converting expression to data type bigint. - --, DATALENGTH(CAST( 9223372036854775808 AS BIGINT)) AS [BIGINT] - , DATALENGTH(CAST( 999999999 AS DECIMAL( 9, 0))) AS DECIMAL9 - , DATALENGTH(CAST( 2147483647 AS INT )) AS [INT] - , DATALENGTH(CAST( 32600 AS SMALLINT )) AS [SMALLINT] - , DATALENGTH(CAST( 255 AS TINYINT )) AS [TINYINT] - , DATALENGTH(CAST( 9 AS DECIMAL( 1, 0))) AS DECIMAL1 - , DATALENGTH(POWER(10.0, 37)) AS [Power10^37]; +SELECT DATALENGTH(CAST(99999999999999999999999999999999999999 AS decimal(38, 0))) AS DECIMAL38 + , DATALENGTH(CAST( 9999999999999999999999999999 AS decimal(28, 0))) AS DECIMAL28 + , DATALENGTH(CAST( 9999999999999999999 AS decimal(19, 0))) AS DECIMAL19 + , DATALENGTH(CAST( 999999999 AS decimal( 9, 0))) AS DECIMAL9 + , DATALENGTH(CAST( 9 AS decimal( 1, 0))) AS DECIMAL1 + , DATALENGTH(CAST( 1.797693134862315807E+308 AS float(53))) AS FLOAT53 + , DATALENGTH(CAST( 9999999999999999999999999 AS float(25))) AS FLOAT25 + , DATALENGTH(CAST( 999999999999999999999999 AS float(24))) AS FLOAT24 + , DATALENGTH(CAST( 9 AS float( 1))) AS FLOAT1 + , DATALENGTH(CAST( 999999999999999999999999 AS real)) AS "REAL" + , DATALENGTH(CAST( 9223372036854775807 AS bigint )) AS "BIGINT" + , DATALENGTH(CAST( 2147483647 AS int )) AS "INT" + , DATALENGTH(CAST( 32600 AS smallint )) AS "SMALLINT" + , DATALENGTH(CAST( 255 AS tinyint )) AS "TINYINT" + , DATALENGTH(CAST( 0 AS bit )) AS BIT0 + , DATALENGTH(CAST( 1.797693134862315807E+308 AS bit )) AS BIT1 + , DATALENGTH(POWER(10.0, 37)) AS "Power10^37"; diff --git a/Scripts/PIVOT_Columns_generator.sql b/Scripts/PIVOT_Columns_generator.sql new file mode 100644 index 00000000..5af63b2c --- /dev/null +++ b/Scripts/PIVOT_Columns_generator.sql @@ -0,0 +1,22 @@ +/* + + Generate numeric columns for PIVOT statement + 1 column + No + 2020-01-23 by Konstantin Taranov + 1.0 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/PIVOT_Columns_generator.sql + +*/ + +DECLARE @i int = 1990; +DECLARE @s varchar(max) = ''; +DECLARE @sep varchar(10) = ', '; + +WHILE @i <= 2020 +BEGIN + SET @s = @s + '[' + CAST(@i AS varchar) + ']' + @sep; + SET @i = @i + 1; +END; + +SELECT LEFT(@s, DATALENGTH(@s) - DATALENGTH(@sep)) AS y; diff --git a/Scripts/Pattern_Match.sql b/Scripts/Pattern_Match.sql new file mode 100644 index 00000000..0427bf1f --- /dev/null +++ b/Scripts/Pattern_Match.sql @@ -0,0 +1,63 @@ +/* +https://sqlserverfast.com/blog/hugo/2019/04/removing-multiple-patterns-from-a-string/ +*/ + +IF OBJECT_ID('Number', N'U') IS NULL +BEGIN + CREATE TABLE Number ( + N INT CONSTRAINT Number_PK PRIMARY KEY CLUSTERED(N) + ); + + WITH + L0 AS(SELECT 1 AS C UNION ALL SELECT 1 AS O), -- 2 rows + L1 AS(SELECT 1 AS C FROM L0 AS A CROSS JOIN L0 AS B), -- 4 rows + L2 AS(SELECT 1 AS C FROM L1 AS A CROSS JOIN L1 AS B), -- 16 rows + L3 AS(SELECT 1 AS C FROM L2 AS A CROSS JOIN L2 AS B), -- 256 rows + L4 AS(SELECT 1 AS C FROM L3 AS A CROSS JOIN L3 AS B), -- 65,536 rows + L5 AS(SELECT 1 AS C FROM L4 AS A CROSS JOIN L4 AS B), -- 4,294,967,296 rows + Nums AS(SELECT ROW_NUMBER() OVER(ORDER BY (SELECT NULL)) AS N FROM L5) + + INSERT INTO Number SELECT TOP 10000 N FROM Nums ORDER BY N; +END + +DECLARE @test table + (PartNo varchar(50) NOT NULL PRIMARY KEY); +INSERT @test +VALUES ('ABC-12%D^^^E3T'), + ('AB345%6%-44%^^^^No.XXXNo.W8RNo.8R8D'); + + +WITH Patterns + AS (SELECT Pattern, + Length + FROM (VALUES ('%-[0-9][0-9][%]%', 4), -- -@@% + ('%[0-9][0-9][%]%', 3), -- @@% + ('%-[0-9][%]%', 3), -- -@% + ('%[0-9][%]%', 2), -- @% + ('%No.[A-Z][A-Z0-9][A-Z]%', 6), -- No.X#X + ('%^^^%', 3), -- ^^^ + ('%[0-9][A-Z]', 2) -- @X (end of string) + ) AS Patterns (Pattern, Length) ) +SELECT t.PartNo, + (SELECT SUBSTRING(t.PartNo, n.N, 1) + FROM dbo.Number AS n + WHERE n.N BETWEEN 1 + AND LEN(t.PartNo) + AND NOT EXISTS (SELECT * + FROM Patterns AS p + WHERE PATINDEX( + p.Pattern, + STUFF(t.PartNo, + 1, + CASE WHEN n.N > p.Length + THEN n.N - p.Length + ELSE 0 + END, + '')) BETWEEN 1 + AND CASE WHEN n.N > p.Length + THEN p.Length + ELSE n.N + END) + ORDER BY n.N + FOR XML PATH('')) +FROM @test AS t; diff --git a/Scripts/Query_Store_Export.sql b/Scripts/Query_Store_Export.sql new file mode 100644 index 00000000..a4591945 --- /dev/null +++ b/Scripts/Query_Store_Export.sql @@ -0,0 +1,163 @@ +/* + + dump the previous 8 hours of data from Query Store + 1 query set + No + 2020-01-24 by Greg Gonzalez + 1.0 + https://sqlperformance.com/2020/01/sql-performance/why-waits-alone-are-not-enough + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Query_Store_Export.sql + +*/ + +DECLARE @HoursBack smallint = 8; +DECLARE @StartDate datetime2 = DATEADD(hour, -@HoursBack, GETUTCDATE()); + +WITH QueryRuntimeStats AS ( + SELECT + p.plan_id + ,q.query_id + ,q.query_hash + ,SUM(rs.count_executions) AS total_executions + ,SUM(rs.count_executions * rs.avg_duration) / 1000 AS total_duration_ms + ,SUM(rs.count_executions * rs.avg_cpu_time) / 1000 AS total_cpu_ms + ,SUM(rs.count_executions * rs.avg_clr_time) / 1000 AS total_clr_time_ms + ,SUM(rs.count_executions * rs.avg_query_max_used_memory) AS total_query_max_used_memory + ,SUM(rs.count_executions * rs.avg_logical_io_reads) AS total_logi_reads + ,SUM(rs.count_executions * rs.avg_logical_io_writes) AS total_logi_writes + ,SUM(rs.count_executions * rs.avg_physical_io_reads) AS total_phys_reads + ,SUM(rs.count_executions * rs.avg_rowcount) AS total_rowcount + ,SUM(rs.count_executions * rs.avg_log_bytes_used) AS total_log_bytes_used + ,SUM(rs.count_executions * rs.avg_tempdb_space_used) AS total_tempdb_space_used + from sys.query_store_plan p + join sys.query_store_query q + on q.query_id = p.query_id + join sys.query_store_runtime_stats rs + on rs.plan_id = p.plan_id + join sys.query_store_runtime_stats_interval rsi + on rsi.runtime_stats_interval_id = rs.runtime_stats_interval_id + where rsi.start_time > @StartDate + group by + p.plan_id + ,q.query_id + ,q.query_hash +) +,QueryWaitStats AS ( + SELECT + p.plan_id + ,q.query_id + ,q.query_hash + ,ws.wait_category_desc + ,SUM(ws.total_query_wait_time_ms) AS total_wait_time_ms + FROM sys.query_store_plan p + JOIN sys.query_store_query q + ON q.query_id = p.query_id + JOIN sys.query_store_wait_stats ws + ON ws.plan_id = p.plan_id + JOIN sys.query_store_runtime_stats_interval rsi + ON rsi.runtime_stats_interval_id = ws.runtime_stats_interval_id + WHERE rsi.start_time > @StartDate + GROUP BY + p.plan_id + ,q.query_id + ,q.query_hash + ,ws.wait_category_desc +) +,QueryWaitStatsByCategory +AS +( + SELECT * + FROM QueryWaitStats + PIVOT + ( + SUM(total_wait_time_ms) + FOR wait_category_desc IN + ( + [Unknown] + ,[CPU] + ,[Worker Thread] + ,[Lock] + ,[Latch] + ,[Buffer Latch] + ,[Buffer IO] + ,[Compilation] + ,[SQL CLR] + ,[Mirroring] + ,[Transaction] + ,[Idle] + ,[Preemptive] + ,[Service Broker] + ,[Tran Log IO] + ,[Network IO] + ,[Parallelism] + ,[Memory] + ,[User Wait] + ,[Tracing] + ,[Full Text Search] + ,[Other Disk IO] + ,[Replication] + ,[Log Rate Governor] + ) + ) AS pvt +) +,QueryWaitStatsTotals +AS +( + SELECT + plan_id + ,query_id + ,query_hash + ,SUM(total_wait_time_ms) AS total_wait_time_ms + FROM QueryWaitStats + GROUP BY + plan_id + ,query_id + ,query_hash +) +SELECT + rs.plan_id + , rs.query_id + , rs.query_hash + , rs.total_executions + , rs.total_duration_ms + , rs.total_cpu_ms + , rs.total_clr_time_ms + , rs.total_query_max_used_memory + , rs.total_logi_reads + , rs.total_logi_writes + , rs.total_phys_reads + , rs.total_rowcount + , rs.total_log_bytes_used + , rs.total_tempdb_space_used + , ws.total_wait_time_ms + , wsc.[CPU] + , wsc.[Lock] + , wsc.[Latch] + , wsc.[Buffer Latch] + , wsc.[Buffer IO] + , wsc.[Memory] + , wsc.[Tran Log IO] + , wsc.[Network IO] + , wsc.[Worker Thread] + , wsc.[Unknown] + , wsc.[Compilation] + , wsc.[SQL CLR] + , wsc.[Mirroring] + , wsc.[Transaction] + , wsc.[Idle] + , wsc.[Preemptive] + , wsc.[Service Broker] + , wsc.[Parallelism] + , wsc.[User Wait] + , wsc.[Tracing] + , wsc.[Full Text Search] + , wsc.[Other Disk IO] + , wsc.[Replication] + , wsc.[Log Rate Governor] +FROM QueryRuntimeStats rs +LEFT JOIN QueryWaitStatsTotals AS ws + ON rs.plan_id = ws.plan_id + AND rs.query_id = ws.query_id +LEFT JOIN QueryWaitStatsByCategory AS wsc + ON rs.plan_id = wsc.plan_id + AND rs.query_id = wsc.query_id; diff --git a/Scripts/Read_Default_Trace.sql b/Scripts/Read_Default_Trace.sql new file mode 100644 index 00000000..ce80a853 --- /dev/null +++ b/Scripts/Read_Default_Trace.sql @@ -0,0 +1,69 @@ +/* + + Dynamically generate GRANTs. + PRINT dynamically generated GRANTs for user. + 2020-03-02 by Aaron Bertrand + 2020-03-05 by Konstantin Taranov + 1.1 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Read_Default_Trace.sql + https://sqlperformance.com/2020/03/extended-events/removing-default-trace-1 + +*/ + + +IF OBJECT_ID('tempdb..#t','U') IS NOT NULL DROP TABLE #t; +GO + +WITH filesrc ([path]) AS +( + SELECT REVERSE(SUBSTRING(p, CHARINDEX(N'\', p), 260)) + N'log.trc' + FROM (SELECT REVERSE([path]) FROM sys.traces WHERE is_default = 1) s(p) +), +tracedata AS +( + SELECT Context = CASE + WHEN DDL = 1 THEN + CASE WHEN LEFT(ObjectName,8) = N'_WA_SYS_' + THEN 'AutoStat: ' + DBType + WHEN LEFT(ObjectName,2) IN (N'PK', N'UQ', N'IX') AND ObjectName LIKE N'%[_#]%' + THEN UPPER(LEFT(ObjectName,2)) + ': tempdb' + WHEN ObjectType = 17747 AND ObjectName LIKE N'TELEMETRY%' + THEN 'Telemetry' + ELSE 'Other DDL in ' + DBType END + WHEN EventClass = 116 THEN + CASE WHEN TextData LIKE N'%checkdb%' THEN 'DBCC CHECKDB' + -- several more of these ... + ELSE UPPER(CONVERT(nchar(32), TextData)) END + ELSE DBType END, + EventName = CASE WHEN DDL = 1 THEN 'DDL' ELSE EventName END, + EventSubClass, + EventClass, + StartTime + FROM + ( + SELECT DDL = CASE WHEN t.EventClass IN (46,47,164) THEN 1 ELSE 0 END, + TextData = LOWER(CONVERT(nvarchar(512), t.TextData)), + EventName = e.[name], + t.EventClass, + t.EventSubClass, + ObjectName = UPPER(t.ObjectName), + t.ObjectType, + t.StartTime, + DBType = CASE WHEN t.DatabaseID = 2 OR t.ObjectName LIKE N'#%' THEN 'tempdb' + WHEN t.DatabaseID IN (1,3,4) THEN 'System database' + WHEN t.DatabaseID IS NOT NULL THEN 'User database' ELSE '?' END + FROM filesrc CROSS APPLY sys.fn_trace_gettable(filesrc.[path], DEFAULT) AS t + LEFT OUTER JOIN sys.trace_events AS e ON t.EventClass = e.trace_event_id + ) AS src WHERE (EventSubClass IS NULL) + OR (EventSubClass = CASE WHEN DDL = 1 THEN 1 ELSE EventSubClass END) -- ddl_phase +) +SELECT @@SERVERNAME AS "Instance", + EventName, + Context, + EventCount = COUNT(*), + FirstSeen = MIN(StartTime), + LastSeen = MAX(StartTime) +INTO #t FROM tracedata +GROUP BY GROUPING SETS ((), (EventName, Context)); + +SELECT * FROM #t ORDER BY EventCount DESC; diff --git a/Scripts/Read_errorlog.sql b/Scripts/Read_errorlog.sql new file mode 100644 index 00000000..818a1eb7 --- /dev/null +++ b/Scripts/Read_errorlog.sql @@ -0,0 +1,108 @@ +/* + + Read error log with filters + 2 result sets with detailed info from error log. + No + Konstantin Taranov + 2019-06-27 + 2019-08-27 by Konstantin Taranov + 1.1 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Jobs_Detailed_History.sql + https://thelonedba.wordpress.com/2019/08/16/reading-sql-server-error-logs/ + +*/ + +DECLARE @daysback INT = 0; -- number of days to go back in the logs. 0 = today only + +-- table variable for holding the details of the error logs. +-- Yes, I know, table variables are evil. This one is unlikely to hold more than a few dozen rather narrow lines +DECLARE @ErrorLogs TABLE +( + Archive INT NOT NULL, + LogDate DATETIME NOT NULL, + LogFileSizeBytes BIGINT NOT NULL, + ReadThis TINYINT NULL +); + +-- useful trick if you don't know it: INSERT INTO a table the results of EXECing a SP. +INSERT INTO @ErrorLogs +( + Archive, + LogDate, + LogFileSizeBytes +) +EXEC sys.sp_enumerrorlogs; + +DECLARE @lognum INT = 0; +DECLARE @logdate DATETIME; + +--figure out which logfiles we need. +WITH NextLog +AS (SELECT Archive, + LogDate, + LogFileSizeBytes, + ReadThis, + ISNULL(LAG(LogDate) OVER (ORDER BY Archive), LogDate) AS nextlogdate + FROM @ErrorLogs) +UPDATE @ErrorLogs +SET ReadThis = CASE + WHEN e.Archive = 1 THEN + 1 -- always read the first file; doesn't always get identified by the next line + WHEN n.nextlogdate >= DATEADD(DAY, DATEDIFF(DAY, '20100101', GETDATE()) - ABS(@daysback), '20100101') THEN + 1 + ELSE + 0 + END +FROM NextLog AS n + INNER JOIN @ErrorLogs AS e + ON e.Archive = n.Archive; + +--just checking which files we're looking at... Probably comment this line out for production use +SELECT * +FROM @ErrorLogs +ORDER BY Archive; + +IF OBJECT_ID('tempdb.dbo.#spErrorLog', 'U') IS NOT NULL +BEGIN + DROP TABLE #spErrorLog; +END; + +CREATE TABLE #spErrorLog +( + logdate DATETIME NOT NULL, + ProcessInfo VARCHAR(20) NULL, + Text NVARCHAR(MAX) NOT NULL +); + +WHILE @lognum <= (SELECT MAX(Archive) FROM @ErrorLogs WHERE ReadThis = 1) +BEGIN + INSERT INTO #spErrorLog + EXEC sys.sp_readerrorlog @p1 = @lognum; + + SELECT @lognum = @lognum + 1; + + SELECT @logdate = LogDate + FROM @ErrorLogs + WHERE Archive = @lognum; +END; + +SELECT * +FROM #spErrorLog +WHERE 1 = 1 + AND + ( + ProcessInfo = 'Server' -- we like server-related boot messages. + OR + ( -- filter out noisy messages that we don't really need to see here + Text NOT LIKE '%Backup Log%' + AND Text NOT LIKE 'Log was backed up%' + AND Text NOT LIKE 'CHECKDB for database % finished without errors on %This is an informational message only; no user action is required.' + AND Text NOT LIKE 'DBCC CHECKDB % WITH all_errormsgs, no_infomsgs, data_purity executed by % found 0 errors and repaired 0 errors.%' + AND Text NOT LIKE 'BACKUP DATABASE WITH DIFFERENTIAL successfully processed % pages%' + AND Text NOT LIKE 'Database differential changes were backed up. Database: % This is an informational message. No user action is required.' + AND Text NOT LIKE 'BACKUP DATABASE successfully processed % pages %' + AND Text NOT LIKE 'Database backed up. Database: % This is an informational message only. No user action is required.' + AND logdate >= DATEADD(DAY, DATEDIFF(DAY, '20100101', GETDATE()) - ABS(@daysback), '20100101') + ) + ) +ORDER BY logdate; diff --git a/Scripts/Remove_Leading_and_Trailing_Backward_and_Forward_Slashes.sql b/Scripts/Remove_Leading_and_Trailing_Backward_and_Forward_Slashes.sql new file mode 100644 index 00000000..fb625d8d --- /dev/null +++ b/Scripts/Remove_Leading_and_Trailing_Backward_and_Forward_Slashes.sql @@ -0,0 +1,15 @@ +/* +https://sqlperformance.com/2019/10/t-sql-queries/overlooked-t-sql-gems +*/ + +SELECT string, leading_slash_count, trailing_slash_count, + STUFF(STUFF(string, LEN(string) - trailing_slash_count + 1, +trailing_slash_count, ''), 1, leading_slash_count, '') AS new_string +FROM ( VALUES + (CAST('//\\ remove leading and trailing backward (\) and forward (/) slashes \\//' AS varchar(200))), + ('//\\**remove leading and trailing backward (\) and forward (/) slashes**\\//') +) AS test_data(string) +CROSS APPLY ( +SELECT PATINDEX('%[^/\]%', string) - 1 AS leading_slash_count, + PATINDEX('%[^/\]%', REVERSE(string)) - 1 AS trailing_slash_count +) AS ca1; diff --git a/Scripts/SQL Managed Instance Diagnostic Information Queries.sql b/Scripts/SQL Managed Instance Diagnostic Information Queries.sql index 4c035bb5..9c6f6ca1 100644 --- a/Scripts/SQL Managed Instance Diagnostic Information Queries.sql +++ b/Scripts/SQL Managed Instance Diagnostic Information Queries.sql @@ -1,18 +1,14 @@ -- SQL Managed Instance Diagnostic Information Queries -- Glenn Berry --- Last Modified: July 18, 2019 --- https://www.sqlskills.com/blogs/glenn/ --- http://sqlserverperformance.wordpress.com/ +-- Last Modified: December 3, 2020 +-- https://glennsqlperformance.com/ +-- https://sqlserverperformance.wordpress.com/ +-- YouTube: https://bit.ly/2PkoAM1 -- Twitter: GlennAlanBerry --- Please listen to my Pluralsight courses --- https://www.pluralsight.com/author/glenn-berry - --- If you want to find all of our SQLskills SQL101 blog posts, check out https://bit.ly/2qLwfXW - - --- Please make sure you are using the correct version of these diagnostic queries for your version of SQL Server +-- Diagnostic Queries are available here +-- https://glennsqlperformance.com/resources/ -- If you like PowerShell, there is a very useful community solution for running these queries in an automated fashion @@ -23,11 +19,9 @@ --****************************************************************************** ---* Copyright (C) 2019 Glenn Berry, SQLskills.com +--* Copyright (C) 2020 Glenn Berry --* All rights reserved. --* ---* For more scripts and sample code, check out ---* https://www.sqlskills.com/blogs/glenn --* --* You may alter this code for your own *non-commercial* purposes. You may --* republish altered code as long as you include this copyright and give due credit. @@ -88,8 +82,8 @@ SERVERPROPERTY('InstanceDefaultDataPath') AS [InstanceDefaultDataPath], SERVERPROPERTY('InstanceDefaultLogPath') AS [InstanceDefaultLogPath], SERVERPROPERTY('BuildClrVersion') AS [Build CLR Version], SERVERPROPERTY('IsXTPSupported') AS [IsXTPSupported], -SERVERPROPERTY('IsPolybaseInstalled') AS [IsPolybaseInstalled], -- New for SQL Server 2016 -SERVERPROPERTY('IsAdvancedAnalyticsInstalled') AS [IsRServicesInstalled]; -- New for SQL Server 2016 +SERVERPROPERTY('IsPolybaseInstalled') AS [IsPolybaseInstalled], +SERVERPROPERTY('IsAdvancedAnalyticsInstalled') AS [IsRServicesInstalled]; ------ -- This gives you a lot of useful information about your "instance" of SQL Managed Instance @@ -194,10 +188,17 @@ WHERE node_state_desc <> N'ONLINE DAC' OPTION (RECOMPILE); -- Server Resource Statistics (Query 7) (Server Resource Stats) SELECT TOP(250) resource_type, resource_name, sku, hardware_generation, -virtual_core_count, avg_cpu_percent, -io_requests, io_bytes_read, io_bytes_written, start_time, end_time +virtual_core_count, avg_cpu_percent, io_requests, +CONVERT(DECIMAL(18,2), io_bytes_read/1048576.0) AS [MB Read], +CONVERT(DECIMAL(18,2), io_bytes_read * 1./(io_bytes_read + io_bytes_written) * 100.) AS [Read Percentage], +CONVERT(DECIMAL(18,2), io_bytes_written/1048576.0) AS [MB Written], +CONVERT(DECIMAL(18,2), io_bytes_written * 1./(io_bytes_read + io_bytes_written) * 100.) AS [Write Percentage], +CONVERT(DECIMAL(18,2), (io_bytes_read + io_bytes_written)/1048576.0) AS [MB Total IO], +start_time, end_time FROM master.sys.server_resource_stats WITH (NOLOCK) +WHERE io_bytes_read > 0 AND io_bytes_written > 0 ORDER BY end_time DESC OPTION (RECOMPILE); +------ -- Shows recent resource usage, in 15-second slices @@ -333,7 +334,6 @@ ORDER BY vs.volume_mount_point OPTION (RECOMPILE); -- Drive level latency information (Query 14) (Drive Level Latency) --- Based on code from Jimmy May SELECT tab.[Drive], tab.volume_mount_point AS [Volume Mount Point], CASE WHEN num_of_reads = 0 THEN 0 @@ -443,18 +443,25 @@ db.[compatibility_level] AS [DB Compatibility Level], db.is_mixed_page_allocation_on, db.page_verify_option_desc AS [Page Verify Option], db.is_auto_create_stats_on, db.is_auto_update_stats_on, db.is_auto_update_stats_async_on, db.is_parameterization_forced, db.snapshot_isolation_state_desc, db.is_read_committed_snapshot_on, db.is_auto_close_on, db.is_auto_shrink_on, -db.target_recovery_time_in_seconds, db.is_cdc_enabled, -db.delayed_durability_desc, db.is_auto_create_stats_incremental_on, -db.is_query_store_on, db.is_sync_with_backup, db.is_temporal_history_retention_enabled, -db.is_supplemental_logging_enabled, -db.is_encrypted, de.encryption_state, de.percent_complete, de.key_algorithm, de.key_length, db.resource_pool_id, -db.is_tempdb_spill_to_remote_store, db.is_result_set_caching_on, db.is_accelerated_database_recovery_on +db.target_recovery_time_in_seconds, db.is_cdc_enabled, db.delayed_durability_desc, +db.is_query_store_on, db.is_sync_with_backup, db.is_temporal_history_retention_enabled, +db.is_encrypted, de.encryption_state, de.percent_complete, de.key_algorithm, de.key_length, +db.is_accelerated_database_recovery_on FROM sys.databases AS db WITH (NOLOCK) LEFT OUTER JOIN sys.dm_database_encryption_keys AS de WITH (NOLOCK) ON db.database_id = de.database_id ORDER BY db.[name] OPTION (RECOMPILE); ------ +-- sys.databases (Transact-SQL) +-- https://bit.ly/2G5wqaX + +-- sys.dm_os_performance_counters (Transact-SQL) +-- https://bit.ly/3kEO2JR + +-- sys.dm_database_encryption_keys (Transact-SQL) +-- https://bit.ly/3mE7kkx + -- Things to look at: -- How many databases are on the instance? -- What recovery models are they using? @@ -526,14 +533,15 @@ ORDER BY [VLF Count] DESC OPTION (RECOMPILE); -- Get CPU utilization by database (Query 20) (CPU Usage by Database) WITH DB_CPU_Stats AS -(SELECT pa.DatabaseID, DB_Name(pa.DatabaseID) AS [Database Name], SUM(qs.total_worker_time/1000) AS [CPU_Time_Ms] +(SELECT pa.DatabaseID, DB_Name(pa.DatabaseID) AS [Database Name], + SUM(qs.total_worker_time/1000) AS [CPU_Time_Ms] FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) CROSS APPLY (SELECT CONVERT(int, value) AS [DatabaseID] FROM sys.dm_exec_plan_attributes(qs.plan_handle) WHERE attribute = N'dbid') AS pa GROUP BY DatabaseID) -SELECT ROW_NUMBER() OVER(ORDER BY [CPU_Time_Ms] DESC) AS [CPU Rank], - [Database Name], [CPU_Time_Ms] AS [CPU Time (ms)], +SELECT ROW_NUMBER() OVER(ORDER BY [CPU_Time_Ms] DESC) AS [CPU Rank], + [Database Name], DatabaseID, [CPU_Time_Ms] AS [CPU Time (ms)], CAST([CPU_Time_Ms] * 1.0 / SUM([CPU_Time_Ms]) OVER() * 100.0 AS DECIMAL(5, 2)) AS [CPU Percent] FROM DB_CPU_Stats WHERE DatabaseID <> 32767 -- ResourceDB @@ -541,6 +549,8 @@ ORDER BY [CPU Rank] OPTION (RECOMPILE); ------ -- Helps determine which database is using the most CPU resources on the instance +-- There are two copies on the master database. The low DatabaseID is the physical master, +-- and the high DatabaseID is the replicated master -- Note: This only reflects CPU usage from the currently cached query plans @@ -549,11 +559,11 @@ WITH Aggregate_IO_Statistics AS (SELECT DB_NAME(database_id) AS [Database Name], CAST(SUM(num_of_bytes_read + num_of_bytes_written) / 1048576 AS DECIMAL(12, 2)) AS [ioTotalMB], CAST(SUM(num_of_bytes_read ) / 1048576 AS DECIMAL(12, 2)) AS [ioReadMB], - CAST(SUM(num_of_bytes_written) / 1048576 AS DECIMAL(12, 2)) AS [ioWriteMB] + CAST(SUM(num_of_bytes_written) / 1048576 AS DECIMAL(12, 2)) AS [ioWriteMB], database_id FROM sys.dm_io_virtual_file_stats(NULL, NULL) AS [DM_IO_STATS] GROUP BY database_id) SELECT ROW_NUMBER() OVER (ORDER BY ioTotalMB DESC) AS [I/O Rank], - [Database Name], ioTotalMB AS [Total I/O (MB)], + [Database Name], database_id, ioTotalMB AS [Total I/O (MB)], CAST(ioTotalMB / SUM(ioTotalMB) OVER () * 100.0 AS DECIMAL(5, 2)) AS [Total I/O %], ioReadMB AS [Read I/O (MB)], CAST(ioReadMB / SUM(ioReadMB) OVER () * 100.0 AS DECIMAL(5, 2)) AS [Read I/O %], @@ -572,13 +582,14 @@ ORDER BY [I/O Rank] OPTION (RECOMPILE); -- This make take some time to run on a busy instance WITH AggregateBufferPoolUsage AS -(SELECT DB_NAME(database_id) AS [Database Name], +(SELECT DB_NAME(database_id) AS [Database Name], database_id, CAST(COUNT(*) * 8/1024.0 AS DECIMAL (10,2)) AS [CachedSize] FROM sys.dm_os_buffer_descriptors WITH (NOLOCK) WHERE database_id <> 32767 -- ResourceDB -GROUP BY DB_NAME(database_id)) -SELECT ROW_NUMBER() OVER(ORDER BY CachedSize DESC) AS [Buffer Pool Rank], [Database Name], CachedSize AS [Cached Size (MB)], - CAST(CachedSize / SUM(CachedSize) OVER() * 100.0 AS DECIMAL(5,2)) AS [Buffer Pool Percent] +GROUP BY DB_NAME(database_id), database_id) + SELECT ROW_NUMBER() OVER(ORDER BY CachedSize DESC) AS [Buffer Pool Rank], + [Database Name], database_id, CachedSize AS [Cached Size (MB)], + CAST(CachedSize / SUM(CachedSize) OVER() * 100.0 AS DECIMAL(5,2)) AS [Buffer Pool Percent] FROM AggregateBufferPoolUsage ORDER BY [Buffer Pool Rank] OPTION (RECOMPILE); ------ @@ -672,7 +683,7 @@ OPTION (RECOMPILE); -- Cumulative wait stats are not as useful on an idle instance that is not under load or performance pressure --- SQL Server Wait Types Library (Paul Randal) +-- SQL Server Wait Types Library -- https://bit.ly/2ePzYO2 -- The SQL Server Wait Type Repository @@ -1129,7 +1140,7 @@ qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_ CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] --- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan +--,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan FROM sys.procedures AS p WITH (NOLOCK) INNER JOIN sys.dm_exec_procedure_stats AS qs WITH (NOLOCK) ON p.[object_id] = qs.[object_id] @@ -1296,7 +1307,7 @@ ORDER BY cp.usecounts DESC OPTION (RECOMPILE); -- Breaks down buffers used by current database by object (table, index) in the buffer cache (Query 53) (Buffer Usage) -- Note: This query could take some time on a busy instance -SELECT SCHEMA_NAME(o.Schema_ID) AS [Schema Name], +SELECT fg.name AS [Filegroup Name], SCHEMA_NAME(o.Schema_ID) AS [Schema Name], OBJECT_NAME(p.[object_id]) AS [Object Name], p.index_id, CAST(COUNT(*)/128.0 AS DECIMAL(10, 2)) AS [Buffer size(MB)], COUNT(*) AS [BufferCount], p.[Rows] AS [Row Count], @@ -1308,12 +1319,17 @@ INNER JOIN sys.partitions AS p WITH (NOLOCK) ON a.container_id = p.hobt_id INNER JOIN sys.objects AS o WITH (NOLOCK) ON p.object_id = o.object_id +INNER JOIN sys.database_files AS f WITH (NOLOCK) +ON b.file_id = f.file_id +INNER JOIN sys.filegroups AS fg WITH (NOLOCK) +ON f.data_space_id = fg.data_space_id WHERE b.database_id = CONVERT(int, DB_ID()) AND p.[object_id] > 100 AND OBJECT_NAME(p.[object_id]) NOT LIKE N'plan_%' AND OBJECT_NAME(p.[object_id]) NOT LIKE N'sys%' AND OBJECT_NAME(p.[object_id]) NOT LIKE N'xml_index_nodes%' -GROUP BY o.Schema_ID, p.[object_id], p.index_id, p.data_compression_desc, p.[Rows] +GROUP BY fg.name, o.Schema_ID, p.[object_id], p.index_id, + p.data_compression_desc, p.[Rows] ORDER BY [BufferCount] DESC OPTION (RECOMPILE); ------ @@ -1441,7 +1457,8 @@ ORDER BY ps.avg_fragmentation_in_percent DESC OPTION (RECOMPILE); --- Index Read/Write stats (all tables in current DB) ordered by Reads (Query 59) (Overall Index Usage - Reads) -SELECT OBJECT_NAME(i.[object_id]) AS [ObjectName], i.[name] AS [IndexName], i.index_id, +SELECT SCHEMA_NAME(t.[schema_id]) AS [SchemaName], OBJECT_NAME(i.[object_id]) AS [ObjectName], + i.[name] AS [IndexName], i.index_id, s.user_seeks, s.user_scans, s.user_lookups, s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], s.user_updates AS [Writes], @@ -1452,6 +1469,8 @@ LEFT OUTER JOIN sys.dm_db_index_usage_stats AS s WITH (NOLOCK) ON i.[object_id] = s.[object_id] AND i.index_id = s.index_id AND s.database_id = DB_ID() +LEFT OUTER JOIN sys.tables AS t WITH (NOLOCK) +ON t.[object_id] = i.[object_id] WHERE OBJECTPROPERTY(i.[object_id],'IsUserTable') = 1 ORDER BY s.user_seeks + s.user_scans + s.user_lookups DESC OPTION (RECOMPILE); -- Order by reads ------ @@ -1460,7 +1479,8 @@ ORDER BY s.user_seeks + s.user_scans + s.user_lookups DESC OPTION (RECOMPILE); - --- Index Read/Write stats (all tables in current DB) ordered by Writes (Query 60) (Overall Index Usage - Writes) -SELECT OBJECT_NAME(i.[object_id]) AS [ObjectName], i.[name] AS [IndexName], i.index_id, +SELECT SCHEMA_NAME(t.[schema_id]) AS [SchemaName],OBJECT_NAME(i.[object_id]) AS [ObjectName], + i.[name] AS [IndexName], i.index_id, s.user_updates AS [Writes], s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], i.[type_desc] AS [Index Type], i.fill_factor AS [Fill Factor], i.has_filter, i.filter_definition, s.last_system_update, s.last_user_update @@ -1469,9 +1489,10 @@ LEFT OUTER JOIN sys.dm_db_index_usage_stats AS s WITH (NOLOCK) ON i.[object_id] = s.[object_id] AND i.index_id = s.index_id AND s.database_id = DB_ID() +LEFT OUTER JOIN sys.tables AS t WITH (NOLOCK) +ON t.[object_id] = i.[object_id] WHERE OBJECTPROPERTY(i.[object_id],'IsUserTable') = 1 ORDER BY s.user_updates DESC OPTION (RECOMPILE); -- Order by writes ------- -- Show which indexes in the current database are most active for Writes @@ -1631,6 +1652,8 @@ AND bs.[type] = 'D' ORDER BY bs.backup_finish_date DESC OPTION (RECOMPILE); ------ +-- Automatic database backups by the MI Service will not appear in this list + -- Are your backup sizes and times changing over time? -- Are you using backup compression? -- Are you using backup checksums? @@ -1643,36 +1666,10 @@ ORDER BY bs.backup_finish_date DESC OPTION (RECOMPILE); -- https://bit.ly/28Rpb2x --- These five Pluralsight Courses go into more detail about how to run these queries and interpret the results - --- SQL Server 2017: Diagnosing Performance Issues with DMVs --- https://bit.ly/2FqCeti - --- SQL Server 2017: Diagnosing Configuration Issues with DMVs --- https://bit.ly/2MSUDUL - --- SQL Server 2014 DMV Diagnostic Queries Part 1 --- https://bit.ly/2plxCer - --- SQL Server 2014 DMV Diagnostic Queries Part 2 --- https://bit.ly/2IuJpzI - --- SQL Server 2014 DMV Diagnostic Queries Part 3 --- https://bit.ly/2FIlCPb - - - --- Sign up for Microsoft Visual Studio Dev Essentials and get a free three month pass to Pluralsight - -- Microsoft Visual Studio Dev Essentials --- http://bit.ly/1q6xbDL - - --- Sign up for Microsoft Azure Essentials and get lots of free Azure usage credits, MCP exam voucher, three month Pluralsight subscription +-- https://bit.ly/2qjNRxi --- Microsoft Azure Essentials --- https://bit.ly/2JMWe8x +-- Microsoft Azure Learn +-- https://bit.ly/2O0Hacc --- August 2017 blog series about upgrading and migrating to SQL Server 2016/2017 --- https://bit.ly/2ftKVrX diff --git a/Scripts/SQL Server 2005 Diagnostic Information Queries.sql b/Scripts/SQL Server 2005 Diagnostic Information Queries.sql index 26ed0f99..da495695 100644 --- a/Scripts/SQL Server 2005 Diagnostic Information Queries.sql +++ b/Scripts/SQL Server 2005 Diagnostic Information Queries.sql @@ -1,25 +1,22 @@ -- SQL Server 2005 Diagnostic Information Queries -- Glenn Berry --- Last Modified: April 19, 2019 --- https://www.sqlserverperformance.wordpress.com/ --- https://www.sqlskills.com/blogs/glenn/ +-- Last Modified: December 3, 2020 +-- https://glennsqlperformance.com/ +-- https://sqlserverperformance.wordpress.com/ +-- YouTube: https://bit.ly/2PkoAM1 -- Twitter: GlennAlanBerry --- Please listen to my Pluralsight courses --- https://www.pluralsight.com/author/glenn-berry - --- If you want to find all of our SQLskills SQL101 blog posts, check out https://www.sqlskills.com/help/sql101/ +-- Diagnostic Queries are available here +-- https://glennsqlperformance.com/resources/ -- Many of these queries will not work if you have databases in 80 compatibility mode -- Please make sure you are using the correct version of these diagnostic queries for your version of SQL Server --****************************************************************************** ---* Copyright (C) 2019 Glenn Berry, SQLskills.com +--* Copyright (C) 2020 Glenn Berry --* All rights reserved. --* ---* For more scripts and sample code, check out ---* https://www.sqlskills.com/blogs/glenn --* --* You may alter this code for your own *non-commercial* purposes. You may --* republish altered code as long as you include this copyright and give due credit. @@ -150,7 +147,7 @@ ORDER BY name OPTION (RECOMPILE); ------ -- Gives you some basic information about your SQL Server Agent Alerts (which are different from SQL Server Agent jobs) --- Read more about Agent Alerts here: https://www.sqlskills.com/blogs/glenn/creating-sql-server-agent-alerts-for-critical-errors/ +-- Read more about Agent Alerts here: https://bit.ly/2v5YR37 -- Returns a list of all global trace flags that are enabled (Query 6) (Global Trace Flags) @@ -162,15 +159,15 @@ DBCC TRACESTATUS (-1); -- Common trace flags that should be enabled in most cases -- TF 1117 - When growing a data file, grow all files at the same time so they remain the same size, reducing allocation contention points --- http://support2.microsoft.com/kb/2154845 +-- https://bit.ly/2GY1kOl -- -- TF 1118 - Helps alleviate allocation contention in tempdb, SQL Server allocates full extents to each database object, -- thereby eliminating the contention on SGAM pages (more important with older versions of SQL Server) -- Recommendations to reduce allocation contention in SQL Server tempdb database --- http://support2.microsoft.com/kb/2154845 +-- https://bit.ly/2GY1kOl -- TF 3226 - Supresses logging of successful database backup messages to the SQL Server Error Log --- https://www.sqlskills.com/blogs/paul/fed-up-with-backup-success-messages-bloating-your-error-logs/ +-- https://bit.ly/38zDNAK -- Hardware Information from SQL Server 2005 (Query 7) (Hardware Info) @@ -362,6 +359,15 @@ AND ls.counter_name LIKE N'Log File(s) Size (KB)%' AND ls.cntr_value > 0 OPTION (RECOMPILE); ------ +-- sys.databases (Transact-SQL) +-- https://bit.ly/2G5wqaX + +-- sys.dm_os_performance_counters (Transact-SQL) +-- https://bit.ly/3kEO2JR + +-- sys.dm_database_encryption_keys (Transact-SQL) +-- https://bit.ly/3mE7kkx + -- Things to look at: -- How many databases are on the instance? -- What recovery models are they using? @@ -539,20 +545,20 @@ OPTION (RECOMPILE); -- Cumulative wait stats are not as useful on an idle instance that is not under load or performance pressure --- SQL Server Wait Types Library (Paul Randal) --- https://www.sqlskills.com/help/waits/ +-- SQL Server Wait Types Library +-- https://bit.ly/2ePzYO2 -- The SQL Server Wait Type Repository --- http://blogs.msdn.com/b/psssql/archive/2009/11/03/the-sql-server-wait-type-repository.aspx +-- https://bit.ly/1afzfjC -- Wait statistics, or please tell me where it hurts --- https://www.sqlskills.com/blogs/paul/wait-statistics-or-please-tell-me-where-it-hurts/ +-- https://bit.ly/2wsQHQE -- SQL Server 2005 Performance Tuning using the Waits and Queues --- http://technet.microsoft.com/en-us/library/cc966413.aspx +-- https://bit.ly/1o2NFoF -- sys.dm_os_wait_stats (Transact-SQL) --- http://msdn.microsoft.com/en-us/library/ms179984(v=sql.105).aspx +-- https://bit.ly/2Hjq9Yl @@ -1076,32 +1082,41 @@ ORDER BY ps.avg_fragmentation_in_percent DESC OPTION (RECOMPILE); --- Index Read/Write stats (all tables in current DB) ordered by Reads (Query 48) (Overall Index Usage - Reads) -SELECT OBJECT_NAME(s.[object_id]) AS [ObjectName], i.name AS [IndexName], i.index_id, - user_seeks + user_scans + user_lookups AS [Reads], s.user_updates AS [Writes], - i.type_desc AS [IndexType], i.fill_factor AS [FillFactor] -FROM sys.dm_db_index_usage_stats AS s WITH (NOLOCK) -INNER JOIN sys.indexes AS i WITH (NOLOCK) -ON s.[object_id] = i.[object_id] -WHERE OBJECTPROPERTY(s.[object_id],'IsUserTable') = 1 +SELECT SCHEMA_NAME(t.[schema_id]) AS [SchemaName], OBJECT_NAME(i.[object_id]) AS [ObjectName], + i.[name] AS [IndexName], i.index_id, + s.user_seeks, s.user_scans, s.user_lookups, + s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], + s.user_updates AS [Writes], + i.[type_desc] AS [Index Type], i.fill_factor AS [Fill Factor], i.has_filter, i.filter_definition, + s.last_user_scan, s.last_user_lookup, s.last_user_seek +FROM sys.indexes AS i WITH (NOLOCK) +LEFT OUTER JOIN sys.dm_db_index_usage_stats AS s WITH (NOLOCK) +ON i.[object_id] = s.[object_id] AND i.index_id = s.index_id AND s.database_id = DB_ID() -ORDER BY user_seeks + user_scans + user_lookups DESC OPTION (RECOMPILE); -- Order by reads +LEFT OUTER JOIN sys.tables AS t WITH (NOLOCK) +ON t.[object_id] = i.[object_id] +WHERE OBJECTPROPERTY(i.[object_id],'IsUserTable') = 1 +ORDER BY s.user_seeks + s.user_scans + s.user_lookups DESC OPTION (RECOMPILE); -- Order by reads ------ -- Show which indexes in the current database are most active for Reads --- Index Read/Write stats (all tables in current DB) ordered by Writes (Query 49) (Overall Index Usage - Writes) -SELECT OBJECT_NAME(s.[object_id]) AS [ObjectName], i.name AS [IndexName], i.index_id, - s.user_updates AS [Writes], user_seeks + user_scans + user_lookups AS [Reads], - i.type_desc AS [IndexType], i.fill_factor AS [FillFactor], +SELECT SCHEMA_NAME(t.[schema_id]) AS [SchemaName],OBJECT_NAME(i.[object_id]) AS [ObjectName], + i.[name] AS [IndexName], i.index_id, + s.user_updates AS [Writes], s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], + i.[type_desc] AS [Index Type], i.fill_factor AS [Fill Factor], i.has_filter, i.filter_definition, s.last_system_update, s.last_user_update -FROM sys.dm_db_index_usage_stats AS s WITH (NOLOCK) -INNER JOIN sys.indexes AS i WITH (NOLOCK) -ON s.[object_id] = i.[object_id] -WHERE OBJECTPROPERTY(s.[object_id],'IsUserTable') = 1 +FROM sys.indexes AS i WITH (NOLOCK) +LEFT OUTER JOIN sys.dm_db_index_usage_stats AS s WITH (NOLOCK) +ON i.[object_id] = s.[object_id] AND i.index_id = s.index_id AND s.database_id = DB_ID() +LEFT OUTER JOIN sys.tables AS t WITH (NOLOCK) +ON t.[object_id] = i.[object_id] +WHERE OBJECTPROPERTY(i.[object_id],'IsUserTable') = 1 ORDER BY s.user_updates DESC OPTION (RECOMPILE); -- Order by writes ------ @@ -1153,39 +1168,12 @@ ORDER BY bs.backup_finish_date DESC OPTION (RECOMPILE); --- These five Pluralsight Courses go into more detail about how to run these queries and interpret the results - --- SQL Server 2017: Diagnosing Performance Issues with DMVs --- https://bit.ly/2FqCeti - --- SQL Server 2017: Diagnosing Configuration Issues with DMVs --- https://bit.ly/2MSUDUL - - --- SQL Server 2014 DMV Diagnostic Queries Part 1 --- https://bit.ly/2plxCer - --- SQL Server 2014 DMV Diagnostic Queries Part 2 --- https://bit.ly/2IuJpzI - --- SQL Server 2014 DMV Diagnostic Queries Part 3 --- https://bit.ly/2FIlCPb - - - --- Sign up for Microsoft Visual Studio Dev Essentials and get a free three month pass to Pluralsight - -- Microsoft Visual Studio Dev Essentials --- http://bit.ly/1q6xbDL - - --- Sign up for Microsoft Azure Essentials and get lots of free Azure usage credits, MCP exam voucher, three month Pluralsight subscription +-- https://bit.ly/2qjNRxi --- Microsoft Azure Essentials --- https://bit.ly/2JMWe8x +-- Microsoft Azure Learn +-- https://bit.ly/2O0Hacc --- August 2017 blog series about upgrading and migrating SQL Server --- https://bit.ly/2ftKVrX diff --git a/Scripts/SQL Server 2008 Diagnostic Information Queries.sql b/Scripts/SQL Server 2008 Diagnostic Information Queries.sql index 05799fdd..1c5cb165 100644 --- a/Scripts/SQL Server 2008 Diagnostic Information Queries.sql +++ b/Scripts/SQL Server 2008 Diagnostic Information Queries.sql @@ -1,25 +1,22 @@ -- SQL Server 2008 Diagnostic Information Queries -- Glenn Berry --- Last Modified: May 30, 2019 +-- Last Modified: December 3, 2020 +-- https://glennsqlperformance.com/ -- https://sqlserverperformance.wordpress.com/ --- https://www.sqlskills.com/blogs/glenn/ +-- YouTube: https://bit.ly/2PkoAM1 -- Twitter: GlennAlanBerry --- Please listen to my Pluralsight courses --- https://www.pluralsight.com/author/glenn-berry - --- If you want to find all of our SQLskills SQL101 blog posts, check out https://www.sqlskills.com/help/sql101/ +-- Diagnostic Queries are available here +-- https://glennsqlperformance.com/resources/ -- Many of these queries will not work if you have databases in 80 compatibility mode -- Please make sure you are using the correct version of these diagnostic queries for your version of SQL Server --****************************************************************************** ---* Copyright (C) 2019 Glenn Berry, SQLskills.com +--* Copyright (C) 2020 Glenn Berry --* All rights reserved. --* ---* For more scripts and sample code, check out ---* https://www.sqlskills.com/blogs/glenn --* --* You may alter this code for your own *non-commercial* purposes. You may --* republish altered code as long as you include this copyright and give due credit. @@ -173,7 +170,7 @@ ORDER BY name OPTION (RECOMPILE); ------ -- Gives you some basic information about your SQL Server Agent Alerts (which are different from SQL Server Agent jobs) --- Read more about Agent Alerts here: https://www.sqlskills.com/blogs/glenn/creating-sql-server-agent-alerts-for-critical-errors/ +-- Read more about Agent Alerts here: https://bit.ly/2v5YR37 -- Returns a list of all global trace flags that are enabled (Query 6) (Global Trace Flags) @@ -185,18 +182,18 @@ DBCC TRACESTATUS (-1); -- Common trace flags that should be enabled in most cases -- TF 1117 - When growing a data file, grow all files at the same time so they remain the same size, reducing allocation contention points --- http://support2.microsoft.com/kb/2154845 +-- https://bit.ly/2GY1kOl -- -- TF 1118 - Helps alleviate allocation contention in tempdb, SQL Server allocates full extents to each database object, -- thereby eliminating the contention on SGAM pages (more important with older versions of SQL Server) -- Recommendations to reduce allocation contention in SQL Server tempdb database --- http://support2.microsoft.com/kb/2154845 +-- https://bit.ly/2GY1kOl -- TF 2371 - Lowers auto update statistics threshold for large tables --- http://blogs.msdn.com/b/saponsqlserver/archive/2011/09/07/changes-to-automatic-update-statistics-in-sql-server-traceflag-2371.aspx +-- https://bit.ly/30KO4Hh -- TF 3226 - Supresses logging of successful database backup messages to the SQL Server Error Log --- https://www.sqlskills.com/blogs/paul/fed-up-with-backup-success-messages-bloating-your-error-logs/ +-- https://bit.ly/38zDNAK -- SQL Server NUMA Node information (Query 7) (SQL Server NUMA Info) @@ -415,6 +412,15 @@ AND ls.counter_name LIKE N'Log File(s) Size (KB)%' AND ls.cntr_value > 0 OPTION (RECOMPILE); ------ +-- sys.databases (Transact-SQL) +-- https://bit.ly/2G5wqaX + +-- sys.dm_os_performance_counters (Transact-SQL) +-- https://bit.ly/3kEO2JR + +-- sys.dm_database_encryption_keys (Transact-SQL) +-- https://bit.ly/3mE7kkx + -- Things to look at: -- How many databases are on the instance? -- What recovery models are they using? @@ -592,20 +598,20 @@ OPTION (RECOMPILE); -- Cumulative wait stats are not as useful on an idle instance that is not under load or performance pressure --- SQL Server Wait Types Library (Paul Randal) --- https://www.sqlskills.com/help/waits/ +-- SQL Server Wait Types Library +-- https://bit.ly/2ePzYO2 -- The SQL Server Wait Type Repository --- http://blogs.msdn.com/b/psssql/archive/2009/11/03/the-sql-server-wait-type-repository.aspx +-- https://bit.ly/1afzfjC -- Wait statistics, or please tell me where it hurts --- https://www.sqlskills.com/blogs/paul/wait-statistics-or-please-tell-me-where-it-hurts/ +-- https://bit.ly/2wsQHQE -- SQL Server 2005 Performance Tuning using the Waits and Queues --- http://technet.microsoft.com/en-us/library/cc966413.aspx +-- https://bit.ly/1o2NFoF -- sys.dm_os_wait_stats (Transact-SQL) --- http://msdn.microsoft.com/en-us/library/ms179984(v=sql.105).aspx +-- https://bit.ly/2Hjq9Ylx @@ -682,7 +688,7 @@ WHERE scheduler_id < 255 OPTION (RECOMPILE); -- High Avg Pending DiskIO Counts are a sign of disk pressure -- How to Do Some Very Basic SQL Server Monitoring --- https://www.sqlskills.com/blogs/glenn/how-to-do-some-very-basic-sql-server-monitoring/ +-- https://bit.ly/30IRla0 @@ -737,7 +743,8 @@ ORDER BY qs.total_worker_time DESC OPTION (RECOMPILE); -- Good basic information about OS memory amounts and state (Query 30) (System Memory) SELECT total_physical_memory_kb/1024 AS [Physical Memory (MB)], available_physical_memory_kb/1024 AS [Available Memory (MB)], - total_page_file_kb/1024 AS [Total Page File (MB)], + total_page_file_kb/1024 AS [Page File Commit Limit (MB)], + total_page_file_kb/1024 - total_physical_memory_kb/1024 AS [Physical Page File Size (MB)], available_page_file_kb/1024 AS [Available Page File (MB)], system_cache_kb/1024 AS [System Cache (MB)], system_memory_state_desc AS [System Memory State] @@ -1212,17 +1219,22 @@ ORDER BY ps.avg_fragmentation_in_percent DESC OPTION (RECOMPILE); --- Index Read/Write stats (all tables in current DB) ordered by Reads (Query 56) (Overall Index Usage - Reads) -SELECT OBJECT_NAME(s.[object_id]) AS [ObjectName], i.name AS [IndexName], i.index_id, - user_seeks + user_scans + user_lookups AS [Reads], s.user_updates AS [Writes], - i.type_desc AS [IndexType], i.fill_factor AS [FillFactor], i.has_filter, i.filter_definition, +SELECT SCHEMA_NAME(t.[schema_id]) AS [SchemaName], OBJECT_NAME(i.[object_id]) AS [ObjectName], + i.[name] AS [IndexName], i.index_id, + s.user_seeks, s.user_scans, s.user_lookups, + s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], + s.user_updates AS [Writes], + i.[type_desc] AS [Index Type], i.fill_factor AS [Fill Factor], i.has_filter, i.filter_definition, s.last_user_scan, s.last_user_lookup, s.last_user_seek -FROM sys.dm_db_index_usage_stats AS s WITH (NOLOCK) -INNER JOIN sys.indexes AS i WITH (NOLOCK) -ON s.[object_id] = i.[object_id] -WHERE OBJECTPROPERTY(s.[object_id],'IsUserTable') = 1 +FROM sys.indexes AS i WITH (NOLOCK) +LEFT OUTER JOIN sys.dm_db_index_usage_stats AS s WITH (NOLOCK) +ON i.[object_id] = s.[object_id] AND i.index_id = s.index_id AND s.database_id = DB_ID() -ORDER BY user_seeks + user_scans + user_lookups DESC OPTION (RECOMPILE); -- Order by reads +LEFT OUTER JOIN sys.tables AS t WITH (NOLOCK) +ON t.[object_id] = i.[object_id] +WHERE OBJECTPROPERTY(i.[object_id],'IsUserTable') = 1 +ORDER BY s.user_seeks + s.user_scans + s.user_lookups DESC OPTION (RECOMPILE); -- Order by reads ------ @@ -1230,16 +1242,19 @@ ORDER BY user_seeks + user_scans + user_lookups DESC OPTION (RECOMPILE); -- Orde --- Index Read/Write stats (all tables in current DB) ordered by Writes (Query 57) (Overall Index Usage - Writes) -SELECT OBJECT_NAME(s.[object_id]) AS [ObjectName], i.name AS [IndexName], i.index_id, - s.user_updates AS [Writes], user_seeks + user_scans + user_lookups AS [Reads], - i.type_desc AS [IndexType], i.fill_factor AS [FillFactor], i.has_filter, i.filter_definition, +SELECT SCHEMA_NAME(t.[schema_id]) AS [SchemaName],OBJECT_NAME(i.[object_id]) AS [ObjectName], + i.[name] AS [IndexName], i.index_id, + s.user_updates AS [Writes], s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], + i.[type_desc] AS [Index Type], i.fill_factor AS [Fill Factor], i.has_filter, i.filter_definition, s.last_system_update, s.last_user_update -FROM sys.dm_db_index_usage_stats AS s WITH (NOLOCK) -INNER JOIN sys.indexes AS i WITH (NOLOCK) -ON s.[object_id] = i.[object_id] -WHERE OBJECTPROPERTY(s.[object_id],'IsUserTable') = 1 +FROM sys.indexes AS i WITH (NOLOCK) +LEFT OUTER JOIN sys.dm_db_index_usage_stats AS s WITH (NOLOCK) +ON i.[object_id] = s.[object_id] AND i.index_id = s.index_id AND s.database_id = DB_ID() +LEFT OUTER JOIN sys.tables AS t WITH (NOLOCK) +ON t.[object_id] = i.[object_id] +WHERE OBJECTPROPERTY(i.[object_id],'IsUserTable') = 1 ORDER BY s.user_updates DESC OPTION (RECOMPILE); -- Order by writes ------ @@ -1293,36 +1308,9 @@ ORDER BY bs.backup_finish_date DESC OPTION (RECOMPILE); -- Have you done any backup tuning with striped backups, or changing the parameters of the backup command? --- These five Pluralsight Courses go into more detail about how to run these queries and interpret the results - --- SQL Server 2017: Diagnosing Performance Issues with DMVs --- https://bit.ly/2FqCeti - --- SQL Server 2017: Diagnosing Configuration Issues with DMVs --- https://bit.ly/2MSUDUL - --- SQL Server 2014 DMV Diagnostic Queries Part 1 --- https://bit.ly/2plxCer - --- SQL Server 2014 DMV Diagnostic Queries Part 2 --- https://bit.ly/2IuJpzI - --- SQL Server 2014 DMV Diagnostic Queries Part 3 --- https://bit.ly/2FIlCPb - - - --- Sign up for Microsoft Visual Studio Dev Essentials and get a free three month pass to Pluralsight - -- Microsoft Visual Studio Dev Essentials --- http://bit.ly/1q6xbDL - - --- Sign up for Microsoft Azure Essentials and get lots of free Azure usage credits, MCP exam voucher, three month Pluralsight subscription - --- Microsoft Azure Essentials --- https://bit.ly/2JMWe8x +-- https://bit.ly/2qjNRxi +-- Microsoft Azure Learn +-- https://bit.ly/2O0Hacc --- August 2017 blog series about upgrading and migrating SQL Server --- https://bit.ly/2ftKVrX diff --git a/Scripts/SQL Server 2008 R2 Diagnostic Information Queries.sql b/Scripts/SQL Server 2008 R2 Diagnostic Information Queries.sql index 43f9b8f2..7b9c0840 100644 --- a/Scripts/SQL Server 2008 R2 Diagnostic Information Queries.sql +++ b/Scripts/SQL Server 2008 R2 Diagnostic Information Queries.sql @@ -1,25 +1,22 @@ -- SQL Server 2008 R2 Diagnostic Information Queries -- Glenn Berry --- Last Modified: May 30, 2019 --- https://www.sqlserverperformance.wordpress.com/ --- https://www.sqlskills.com/blogs/glenn/ +-- Last Modified: December 3, 2020 +-- https://glennsqlperformance.com/ +-- https://sqlserverperformance.wordpress.com/ +-- YouTube: https://bit.ly/2PkoAM1 -- Twitter: GlennAlanBerry --- Please listen to my Pluralsight courses --- https://www.pluralsight.com/author/glenn-berry - --- If you want to find all of our SQLskills SQL101 blog posts, check out https://www.sqlskills.com/help/sql101/ +-- Diagnostic Queries are available here +-- https://glennsqlperformance.com/resources/ -- Many of these queries will not work if you have databases in 80 compatibility mode -- Please make sure you are using the correct version of these diagnostic queries for your version of SQL Server --****************************************************************************** ---* Copyright (C) 2019 Glenn Berry, SQLskills.com +--* Copyright (C) 2020 Glenn Berry --* All rights reserved. --* ---* For more scripts and sample code, check out ---* https://www.sqlskills.com/blogs/glenn --* --* You may alter this code for your own *non-commercial* purposes. You may --* republish altered code as long as you include this copyright and give due credit. @@ -171,7 +168,7 @@ ORDER BY name OPTION (RECOMPILE); ------ -- Gives you some basic information about your SQL Server Agent Alerts (which are different from SQL Server Agent jobs) --- Read more about Agent Alerts here: https://www.sqlskills.com/blogs/glenn/creating-sql-server-agent-alerts-for-critical-errors/ +-- Read more about Agent Alerts here: https://bit.ly/2v5YR37 -- Returns a list of all global trace flags that are enabled (Query 6) (Global Trace Flags) @@ -183,18 +180,18 @@ DBCC TRACESTATUS (-1); -- Common trace flags that should be enabled in most cases -- TF 1117 - When growing a data file, grow all files at the same time so they remain the same size, reducing allocation contention points --- http://support2.microsoft.com/kb/2154845 +-- https://bit.ly/2GY1kOl5 -- -- TF 1118 - Helps alleviate allocation contention in tempdb, SQL Server allocates full extents to each database object, -- thereby eliminating the contention on SGAM pages (more important with older versions of SQL Server) -- Recommendations to reduce allocation contention in SQL Server tempdb database --- http://support2.microsoft.com/kb/2154845 +-- https://bit.ly/2GY1kOl -- TF 2371 - Lowers auto update statistics threshold for large tables --- http://blogs.msdn.com/b/saponsqlserver/archive/2011/09/07/changes-to-automatic-update-statistics-in-sql-server-traceflag-2371.aspx +-- https://bit.ly/30KO4Hh -- TF 3226 - Supresses logging of successful database backup messages to the SQL Server Error Log --- https://www.sqlskills.com/blogs/paul/fed-up-with-backup-success-messages-bloating-your-error-logs/ +-- https://bit.ly/38zDNAK -- Windows information (SQL Server 2008 R2 SP1 or greater) (Query 7) (Windows Info) @@ -478,6 +475,15 @@ AND ls.cntr_value > 0 ORDER BY db.[name] OPTION (RECOMPILE); ------ +-- sys.databases (Transact-SQL) +-- https://bit.ly/2G5wqaX + +-- sys.dm_os_performance_counters (Transact-SQL) +-- https://bit.ly/3kEO2JR + +-- sys.dm_database_encryption_keys (Transact-SQL) +-- https://bit.ly/3mE7kkx + -- Things to look at: -- How many databases are on the instance? -- What recovery models are they using? @@ -655,20 +661,20 @@ OPTION (RECOMPILE); -- Cumulative wait stats are not as useful on an idle instance that is not under load or performance pressure --- SQL Server Wait Types Library (Paul Randal) --- https://www.sqlskills.com/help/waits/ +-- SQL Server Wait Types Library +-- https://bit.ly/2ePzYO2 -- The SQL Server Wait Type Repository --- http://blogs.msdn.com/b/psssql/archive/2009/11/03/the-sql-server-wait-type-repository.aspx +-- https://bit.ly/1afzfjC -- Wait statistics, or please tell me where it hurts --- https://www.sqlskills.com/blogs/paul/wait-statistics-or-please-tell-me-where-it-hurts/ +-- https://bit.ly/2wsQHQE -- SQL Server 2005 Performance Tuning using the Waits and Queues --- http://technet.microsoft.com/en-us/library/cc966413.aspx +-- https://bit.ly/1o2NFoF -- sys.dm_os_wait_stats (Transact-SQL) --- http://msdn.microsoft.com/en-us/library/ms179984(v=sql.105).aspx +-- https://bit.ly/2Hjq9Yl @@ -745,7 +751,7 @@ WHERE scheduler_id < 255 OPTION (RECOMPILE); -- High Avg Pending DiskIO Counts are a sign of disk pressure -- How to Do Some Very Basic SQL Server Monitoring --- https://www.sqlskills.com/blogs/glenn/how-to-do-some-very-basic-sql-server-monitoring/ +-- https://bit.ly/30IRla0 @@ -800,7 +806,8 @@ ORDER BY qs.total_worker_time DESC OPTION (RECOMPILE); -- Good basic information about OS memory amounts and state (Query 34) (System Memory) SELECT total_physical_memory_kb/1024 AS [Physical Memory (MB)], available_physical_memory_kb/1024 AS [Available Memory (MB)], - total_page_file_kb/1024 AS [Total Page File (MB)], + total_page_file_kb/1024 AS [Page File Commit Limit (MB)], + total_page_file_kb/1024 - total_physical_memory_kb/1024 AS [Physical Page File Size (MB)], available_page_file_kb/1024 AS [Available Page File (MB)], system_cache_kb/1024 AS [System Cache (MB)], system_memory_state_desc AS [System Memory State] @@ -1147,7 +1154,7 @@ ORDER BY cp.usecounts DESC OPTION (RECOMPILE); -- Breaks down buffers used by current database by object (table, index) in the buffer cache (Query 54) (Buffer Usage) -- Note: This query could take some time on a busy instance -SELECT SCHEMA_NAME(o.Schema_ID) AS [Schema Name], +SELECT fg.name AS [Filegroup Name], SCHEMA_NAME(o.Schema_ID) AS [Schema Name], OBJECT_NAME(p.[object_id]) AS [Object Name], p.index_id, CAST(COUNT(*)/128.0 AS DECIMAL(10, 2)) AS [Buffer size(MB)], COUNT(*) AS [BufferCount], p.[Rows] AS [Row Count], @@ -1159,12 +1166,17 @@ INNER JOIN sys.partitions AS p WITH (NOLOCK) ON a.container_id = p.hobt_id INNER JOIN sys.objects AS o WITH (NOLOCK) ON p.object_id = o.object_id +INNER JOIN sys.database_files AS f WITH (NOLOCK) +ON b.file_id = f.file_id +INNER JOIN sys.filegroups AS fg WITH (NOLOCK) +ON f.data_space_id = fg.data_space_id WHERE b.database_id = CONVERT(int, DB_ID()) AND p.[object_id] > 100 AND OBJECT_NAME(p.[object_id]) NOT LIKE N'plan_%' AND OBJECT_NAME(p.[object_id]) NOT LIKE N'sys%' AND OBJECT_NAME(p.[object_id]) NOT LIKE N'xml_index_nodes%' -GROUP BY o.Schema_ID, p.[object_id], p.index_id, p.data_compression_desc, p.[Rows] +GROUP BY fg.name, o.Schema_ID, p.[object_id], p.index_id, + p.data_compression_desc, p.[Rows] ORDER BY [BufferCount] DESC OPTION (RECOMPILE); ------ @@ -1295,17 +1307,22 @@ ORDER BY ps.avg_fragmentation_in_percent DESC OPTION (RECOMPILE); --- Index Read/Write stats (all tables in current DB) ordered by Reads (Query 61) (Overall Index Usage - Reads) -SELECT OBJECT_NAME(s.[object_id]) AS [ObjectName], i.name AS [IndexName], i.index_id, - user_seeks + user_scans + user_lookups AS [Reads], s.user_updates AS [Writes], - i.type_desc AS [IndexType], i.fill_factor AS [FillFactor], i.has_filter, i.filter_definition, +SELECT SCHEMA_NAME(t.[schema_id]) AS [SchemaName], OBJECT_NAME(i.[object_id]) AS [ObjectName], + i.[name] AS [IndexName], i.index_id, + s.user_seeks, s.user_scans, s.user_lookups, + s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], + s.user_updates AS [Writes], + i.[type_desc] AS [Index Type], i.fill_factor AS [Fill Factor], i.has_filter, i.filter_definition, s.last_user_scan, s.last_user_lookup, s.last_user_seek -FROM sys.dm_db_index_usage_stats AS s WITH (NOLOCK) -INNER JOIN sys.indexes AS i WITH (NOLOCK) -ON s.[object_id] = i.[object_id] -WHERE OBJECTPROPERTY(s.[object_id],'IsUserTable') = 1 +FROM sys.indexes AS i WITH (NOLOCK) +LEFT OUTER JOIN sys.dm_db_index_usage_stats AS s WITH (NOLOCK) +ON i.[object_id] = s.[object_id] AND i.index_id = s.index_id AND s.database_id = DB_ID() -ORDER BY user_seeks + user_scans + user_lookups DESC OPTION (RECOMPILE); -- Order by reads +LEFT OUTER JOIN sys.tables AS t WITH (NOLOCK) +ON t.[object_id] = i.[object_id] +WHERE OBJECTPROPERTY(i.[object_id],'IsUserTable') = 1 +ORDER BY s.user_seeks + s.user_scans + s.user_lookups DESC OPTION (RECOMPILE); -- Order by reads ------ @@ -1313,16 +1330,19 @@ ORDER BY user_seeks + user_scans + user_lookups DESC OPTION (RECOMPILE); -- Orde --- Index Read/Write stats (all tables in current DB) ordered by Writes (Query 62) (Overall Index Usage - Writes) -SELECT OBJECT_NAME(s.[object_id]) AS [ObjectName], i.name AS [IndexName], i.index_id, - s.user_updates AS [Writes], user_seeks + user_scans + user_lookups AS [Reads], - i.type_desc AS [IndexType], i.fill_factor AS [FillFactor], i.has_filter, i.filter_definition, +SELECT SCHEMA_NAME(t.[schema_id]) AS [SchemaName],OBJECT_NAME(i.[object_id]) AS [ObjectName], + i.[name] AS [IndexName], i.index_id, + s.user_updates AS [Writes], s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], + i.[type_desc] AS [Index Type], i.fill_factor AS [Fill Factor], i.has_filter, i.filter_definition, s.last_system_update, s.last_user_update -FROM sys.dm_db_index_usage_stats AS s WITH (NOLOCK) -INNER JOIN sys.indexes AS i WITH (NOLOCK) -ON s.[object_id] = i.[object_id] -WHERE OBJECTPROPERTY(s.[object_id],'IsUserTable') = 1 +FROM sys.indexes AS i WITH (NOLOCK) +LEFT OUTER JOIN sys.dm_db_index_usage_stats AS s WITH (NOLOCK) +ON i.[object_id] = s.[object_id] AND i.index_id = s.index_id AND s.database_id = DB_ID() +LEFT OUTER JOIN sys.tables AS t WITH (NOLOCK) +ON t.[object_id] = i.[object_id] +WHERE OBJECTPROPERTY(i.[object_id],'IsUserTable') = 1 ORDER BY s.user_updates DESC OPTION (RECOMPILE); -- Order by writes ------ @@ -1375,36 +1395,9 @@ ORDER BY bs.backup_finish_date DESC OPTION (RECOMPILE); -- Have you done any backup tuning with striped backups, or changing the parameters of the backup command? --- These five Pluralsight Courses go into more detail about how to run these queries and interpret the results - --- SQL Server 2017: Diagnosing Performance Issues with DMVs --- https://bit.ly/2FqCeti - --- SQL Server 2017: Diagnosing Configuration Issues with DMVs --- https://bit.ly/2MSUDUL - --- SQL Server 2014 DMV Diagnostic Queries Part 1 --- https://bit.ly/2plxCer - --- SQL Server 2014 DMV Diagnostic Queries Part 2 --- https://bit.ly/2IuJpzI - --- SQL Server 2014 DMV Diagnostic Queries Part 3 --- https://bit.ly/2FIlCPb - - - --- Sign up for Microsoft Visual Studio Dev Essentials and get a free three month pass to Pluralsight - -- Microsoft Visual Studio Dev Essentials --- http://bit.ly/1q6xbDL - - --- Sign up for Microsoft Azure Essentials and get lots of free Azure usage credits, MCP exam voucher, three month Pluralsight subscription - --- Microsoft Azure Essentials --- https://bit.ly/2JMWe8x +-- https://bit.ly/2qjNRxi +-- Microsoft Azure Learn +-- https://bit.ly/2O0Hacc --- August 2017 blog series about upgrading and migrating SQL Server --- https://bit.ly/2ftKVrX diff --git a/Scripts/SQL Server 2012 Diagnostic Information Queries.sql b/Scripts/SQL Server 2012 Diagnostic Information Queries.sql index dc4944dd..a54e603a 100644 --- a/Scripts/SQL Server 2012 Diagnostic Information Queries.sql +++ b/Scripts/SQL Server 2012 Diagnostic Information Queries.sql @@ -1,15 +1,14 @@ -- SQL Server 2012 Diagnostic Information Queries -- Glenn Berry --- Last Modified: July 9, 2019 --- https://www.sqlskills.com/blogs/glenn/ --- http://sqlserverperformance.wordpress.com/ +-- Last Modified: December 3, 2020 +-- https://glennsqlperformance.com/ +-- https://sqlserverperformance.wordpress.com/ +-- YouTube: https://bit.ly/2PkoAM1 -- Twitter: GlennAlanBerry --- Please listen to my Pluralsight courses --- https://www.pluralsight.com/author/glenn-berry - --- If you want to find all of our SQLskills SQL101 blog posts, check out https://www.sqlskills.com/help/sql101/ +-- Diagnostic Queries are available here +-- https://glennsqlperformance.com/resources/ -- Please make sure you are using the correct version of these diagnostic queries for your version of SQL Server @@ -23,11 +22,9 @@ --****************************************************************************** ---* Copyright (C) 2019 Glenn Berry, SQLskills.com +--* Copyright (C) 2020 Glenn Berry --* All rights reserved. --* ---* For more scripts and sample code, check out ---* https://www.sqlskills.com/blogs/glenn --* --* You may alter this code for your own *non-commercial* purposes. You may --* republish altered code as long as you include this copyright and give due credit. @@ -95,9 +92,14 @@ SELECT @@SERVERNAME AS [Server Name], @@VERSION AS [SQL Server and OS Version In -- 11.0.6607 SP3 CU10 8/8/2017 -- 11.0.7001 SP4 RTM 10/3/2017 -- +-- +-- Security Update for SQL Server 2012 SP4 (KB4532098) +-- https://support.microsoft.com/en-us/help/4532098/security-update-for-sql-server-2012-sp4-gdr + -- Security Update for SQL Server 2012 SP4 (KB4057116) -- https://bit.ly/2F33Sc4 -- 11.0.7462 Security Update 1/12/2018 (Security Update for SQL Server 2012 SP4 (KB4057116)) +-- 11.0.7493.4 Security Update 2/11/2020 (Security Update for SQL Server 2012 SP4 (KB4532098)) -- SQL Server 2012 Service Pack 4 (SP4) Released! -- https://bit.ly/2qN8kr3 @@ -159,7 +161,6 @@ EXEC sys.xp_readerrorlog 0, 1, N'detected', N'socket'; -- New in SQL Server 2012 SP4 - -- Get selected server properties (Query 3) (Server Properties) SELECT SERVERPROPERTY('MachineName') AS [MachineName], SERVERPROPERTY('ServerName') AS [ServerName], @@ -184,6 +185,7 @@ SERVERPROPERTY('IsHadrEnabled') AS [IsHadrEnabled], SERVERPROPERTY('HadrManagerStatus') AS [HadrManagerStatus], SERVERPROPERTY('InstanceDefaultDataPath') AS [InstanceDefaultDataPath], SERVERPROPERTY('InstanceDefaultLogPath') AS [InstanceDefaultLogPath], +SERVERPROPERTY('ErrorLogFileName') AS [ErrorLogFileName], SERVERPROPERTY('BuildClrVersion') AS [Build CLR Version]; ------ @@ -230,13 +232,13 @@ DBCC TRACESTATUS (-1); -- https://bit.ly/2GY1kOl -- TF 2371 - Lowers auto update statistics threshold for large tables (on tables with more than 25,000 rows) --- https://bit.ly/2HySkAg +-- https://bit.ly/30KO4Hh -- TF 3023 - Enables backup checksum default -- https://bit.ly/2vtjqqc -- TF 3226 - Supresses logging of successful database backup messages to the SQL Server Error Log --- https://bit.ly/2p6MTjS +-- https://bit.ly/38zDNAK -- TF 3449 - Enables use of dirty page manager (SQL Server 2012 SP3 CU3 and later) -- https://bit.ly/2uj0h5M @@ -260,15 +262,12 @@ EXEC sys.xp_readerrorlog 0, 1, N'Database Instant File Initialization'; -- Lets you determine whether Instant File Initialization (IFI) is enabled for the instance -- This should be enabled in the vast majority of cases +-- Note: This query won't return any results if the SQL Server error log has been recycled -- (Added in SQL Server 2012 SP4) -- Database Instant File Initialization -- https://bit.ly/2nTX74y --- Misconceptions around instant file initialization --- https://bit.ly/2oBSKgZ - - -- SQL Server Process Address space info (Query 7) (Process Memory) -- (shows whether locked pages is enabled, among other things) @@ -311,11 +310,16 @@ FROM sys.dm_server_services WITH (NOLOCK) OPTION (RECOMPILE); SELECT ISNULL(d.[name], bs.[database_name]) AS [Database], d.recovery_model_desc AS [Recovery Model], d.log_reuse_wait_desc AS [Log Reuse Wait Desc], MAX(CASE WHEN [type] = 'D' THEN bs.backup_finish_date ELSE NULL END) AS [Last Full Backup], + MAX(CASE WHEN [type] = 'D' THEN bmf.physical_device_name ELSE NULL END) AS [Last Full Backup Location], MAX(CASE WHEN [type] = 'I' THEN bs.backup_finish_date ELSE NULL END) AS [Last Differential Backup], - MAX(CASE WHEN [type] = 'L' THEN bs.backup_finish_date ELSE NULL END) AS [Last Log Backup] + MAX(CASE WHEN [type] = 'I' THEN bmf.physical_device_name ELSE NULL END) AS [Last Differential Backup Location], + MAX(CASE WHEN [type] = 'L' THEN bs.backup_finish_date ELSE NULL END) AS [Last Log Backup], + MAX(CASE WHEN [type] = 'L' THEN bmf.physical_device_name ELSE NULL END) AS [Last Log Backup Location] FROM sys.databases AS d WITH (NOLOCK) LEFT OUTER JOIN msdb.dbo.backupset AS bs WITH (NOLOCK) -ON bs.[database_name] = d.[name] +ON bs.[database_name] = d.[name] +LEFT OUTER JOIN msdb.dbo.backupmediafamily AS bmf WITH (NOLOCK) +ON bs.media_set_id = bmf.media_set_id AND bs.backup_finish_date > GETDATE()- 30 WHERE d.name <> N'tempdb' GROUP BY ISNULL(d.[name], bs.[database_name]), d.recovery_model_desc, d.log_reuse_wait_desc, d.[name] @@ -351,6 +355,9 @@ ORDER BY sj.name OPTION (RECOMPILE); -- SQL Server Maintenance Solution -- https://bit.ly/1pgchQu +-- You can use this script to add default schedules to the standard Ola Hallengren Maintenance Solution jobs +-- https://bit.ly/3ane0gN + -- Get SQL Server Agent Alert Information (Query 11) (SQL Server Agent Alerts) SELECT name, event_source, message_id, severity, [enabled], has_notification, @@ -359,8 +366,9 @@ FROM msdb.dbo.sysalerts WITH (NOLOCK) ORDER BY name OPTION (RECOMPILE); ------ --- Gives you some basic information about your SQL Server Agent Alerts (which are different from SQL Server Agent jobs) --- Read more about Agent Alerts here: https://bit.ly/2Giz0Xf +-- Gives you some basic information about your SQL Server Agent Alerts +-- (which are different from SQL Server Agent jobs) +-- Read more about Agent Alerts here: https://bit.ly/2v5YR37 @@ -412,15 +420,16 @@ WHERE node_state_desc <> N'ONLINE DAC' OPTION (RECOMPILE); -- sys.dm_os_nodes (Transact-SQL) -- https://bit.ly/2pn5Mw8 --- Balancing Your Available SQL Server Core Licenses Evenly Across NUMA Nodes --- https://bit.ly/2vfC4Rq +-- How to Balance SQL Server Core Licenses Across NUMA Nodes +-- https://bit.ly/3i4TyVR -- Good basic information about OS memory amounts and state (Query 14) (System Memory) SELECT total_physical_memory_kb/1024 AS [Physical Memory (MB)], available_physical_memory_kb/1024 AS [Available Memory (MB)], - total_page_file_kb/1024 AS [Total Page File (MB)], + total_page_file_kb/1024 AS [Page File Commit Limit (MB)], + total_page_file_kb/1024 - total_physical_memory_kb/1024 AS [Physical Page File Size (MB)], available_page_file_kb/1024 AS [Available Page File (MB)], system_cache_kb/1024 AS [System Cache (MB)], system_memory_state_desc AS [System Memory State] @@ -467,8 +476,29 @@ FROM sys.dm_hadr_cluster WITH (NOLOCK) OPTION (RECOMPILE); -- You will see no results if your instance is not using AlwaysOn AGs +-- Good overview of AG health and status (Query 17) (AG Status) +SELECT ag.name AS [AG Name], ar.replica_server_name, ar.availability_mode_desc, adc.[database_name], + drs.is_local, drs.is_primary_replica, drs.synchronization_state_desc, drs.is_commit_participant, + drs.synchronization_health_desc, drs.recovery_lsn, drs.truncation_lsn, drs.last_sent_lsn, + drs.last_sent_time, drs.last_received_lsn, drs.last_received_time, drs.last_hardened_lsn, + drs.last_hardened_time, drs.last_redone_lsn, drs.last_redone_time, drs.log_send_queue_size, + drs.log_send_rate, drs.redo_queue_size, drs.redo_rate, drs.filestream_send_rate, + drs.end_of_log_lsn, drs.last_commit_lsn, drs.last_commit_time, drs.database_state_desc +FROM sys.dm_hadr_database_replica_states AS drs WITH (NOLOCK) +INNER JOIN sys.availability_databases_cluster AS adc WITH (NOLOCK) +ON drs.group_id = adc.group_id +AND drs.group_database_id = adc.group_database_id +INNER JOIN sys.availability_groups AS ag WITH (NOLOCK) +ON ag.group_id = drs.group_id +INNER JOIN sys.availability_replicas AS ar WITH (NOLOCK) +ON drs.group_id = ar.group_id +AND drs.replica_id = ar.replica_id +ORDER BY ag.name, ar.replica_server_name, adc.[database_name] OPTION (RECOMPILE); + +-- You will see no results if your instance is not using AlwaysOn AGs --- Hardware information from SQL Server 2012 (Query 17) (Hardware Info) + +-- Hardware information from SQL Server 2012 (Query 18) (Hardware Info) SELECT cpu_count AS [Logical CPU Count], scheduler_count, hyperthread_ratio AS [Hyperthread Ratio], cpu_count/hyperthread_ratio AS [Physical CPU Count], @@ -492,7 +522,7 @@ FROM sys.dm_os_sys_info WITH (NOLOCK) OPTION (RECOMPILE); -- https://bit.ly/2pczOYs --- Get System Manufacturer and model number from SQL Server Error log (Query 18) (System Manufacturer) +-- Get System Manufacturer and model number from SQL Server Error log (Query 19) (System Manufacturer) EXEC sys.xp_readerrorlog 0, 1, N'Manufacturer'; ------ @@ -502,16 +532,6 @@ EXEC sys.xp_readerrorlog 0, 1, N'Manufacturer'; -- This query will return no results if your error log has been recycled since the instance was started --- Get pvscsi info from Windows Registry (Query 19) (PVSCSI Driver Parameters) -EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SYSTEM\CurrentControlSet\services\pvscsi\Parameters\Device', N'DriverParameter'; ------- - --- This is valid for VMware VMs --- Recommended value for intensive I/O patterns from VMware is: RequestRingPages=32,MaxQueueDepth=254 --- https://kb.vmware.com/s/article/2053145 - - - -- Get BIOS date from Windows Registry (Query 20) (BIOS Date) EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\System\BIOS', N'BiosReleaseDate'; ------ @@ -536,6 +556,7 @@ EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\Syste + -- Get information on location, time and size of any memory dumps from SQL Server (Query 22) (Memory Dump Info) SELECT [filename], creation_time, size_in_bytes/1048576.0 AS [Size (MB)] FROM sys.dm_server_memory_dumps WITH (NOLOCK) @@ -624,7 +645,6 @@ ORDER BY vs.volume_mount_point OPTION (RECOMPILE); -- Drive level latency information (Query 27) (Drive Level Latency) --- Based on code from Jimmy May SELECT tab.[Drive], tab.volume_mount_point AS [Volume Mount Point], CASE WHEN num_of_reads = 0 THEN 0 @@ -667,6 +687,13 @@ ORDER BY [Overall Latency] OPTION (RECOMPILE); -- These latency numbers include all file activity against all SQL Server -- database files on each drive since SQL Server was last started +-- sys.dm_io_virtual_file_stats (Transact-SQL) +-- https://bit.ly/3bRWUc0 + +-- sys.dm_os_volume_stats (Transact-SQL) +-- https://bit.ly/33thz2j + + -- Calculates average stalls per read, per write, and per total input/output for each database file (Query 28) (IO Latency by File) SELECT DB_NAME(fs.database_id) AS [Database Name], CAST(fs.io_stall_read_ms/(1.0 + fs.num_of_reads) AS NUMERIC(10,1)) AS [avg_read_latency_ms], @@ -687,6 +714,10 @@ ORDER BY avg_io_latency_ms DESC OPTION (RECOMPILE); -- These latency numbers include all file activity against each SQL Server -- database file since SQL Server was last started +-- sys.dm_io_virtual_file_stats (Transact-SQL) +-- https://bit.ly/3bRWUc0 + + -- Look for I/O requests taking longer than 15 seconds in the six most recent SQL Server Error Logs (Query 29) (IO Warnings) CREATE TABLE #IOWarningResults(LogDate datetime, ProcessInfo sysname, LogText nvarchar(1000)); @@ -763,6 +794,15 @@ AND ls.cntr_value > 0 ORDER BY db.[name] OPTION (RECOMPILE); ------ +-- sys.databases (Transact-SQL) +-- https://bit.ly/2G5wqaX + +-- sys.dm_os_performance_counters (Transact-SQL) +-- https://bit.ly/3kEO2JR + +-- sys.dm_database_encryption_keys (Transact-SQL) +-- https://bit.ly/3mE7kkx + -- Things to look at: -- How many databases are on the instance? -- What recovery models are they using? @@ -776,13 +816,11 @@ ORDER BY db.[name] OPTION (RECOMPILE); -- Missing Indexes for all databases by Index Advantage (Query 32) (Missing Indexes All Databases) -SELECT CONVERT(decimal(18,2), user_seeks * avg_total_user_cost * (avg_user_impact * 0.01)) AS [index_advantage], -FORMAT(migs.last_user_seek, 'yyyy-MM-dd HH:mm:ss') AS [last_user_seek], -mid.[statement] AS [Database.Schema.Table], +SELECT CONVERT(decimal(18,2), migs.user_seeks * migs.avg_total_user_cost * (migs.avg_user_impact * 0.01)) AS [index_advantage], +FORMAT(migs.last_user_seek, 'yyyy-MM-dd HH:mm:ss') AS [last_user_seek], mid.[statement] AS [Database.Schema.Table], COUNT(1) OVER(PARTITION BY mid.[statement]) AS [missing_indexes_for_table], COUNT(1) OVER(PARTITION BY mid.[statement], equality_columns) AS [similar_missing_indexes_for_table], -mid.equality_columns, mid.inequality_columns, mid.included_columns, -migs.unique_compiles, migs.user_seeks, +mid.equality_columns, mid.inequality_columns, mid.included_columns, migs.user_seeks, CONVERT(decimal(18,2), migs.avg_total_user_cost) AS [avg_total_user_cost], migs.avg_user_impact FROM sys.dm_db_missing_index_group_stats AS migs WITH (NOLOCK) INNER JOIN sys.dm_db_missing_index_groups AS mig WITH (NOLOCK) @@ -797,6 +835,7 @@ ORDER BY index_advantage DESC OPTION (RECOMPILE); -- Also look at avg_user_impact and avg_total_user_cost to help determine importance -- SQL Server is overly eager to add included columns, so beware -- Do not just blindly add indexes that show up from this query!!! +-- Hkan Winther has given me some great suggestions for this query -- SQL Server Index Design Guide -- https://bit.ly/2qtZr4N @@ -835,6 +874,8 @@ DROP TABLE #VLFCountResults; -- and they can make full database restores and crash recovery take much longer -- Try to keep your VLF counts under 200 in most cases (depending on log file size) +-- SQL Server Transaction Log Architecture and Management Guide +-- https://bit.ly/2JjmQRZ -- Get CPU utilization by database (Query 34) (CPU Usage by Database) @@ -958,20 +999,20 @@ OPTION (RECOMPILE); -- Cumulative wait stats are not as useful on an idle instance that is not under load or performance pressure --- SQL Server Wait Types Library (Paul Randal) --- https://www.sqlskills.com/help/waits/ +-- SQL Server Wait Types Library +-- https://bit.ly/2ePzYO2 -- The SQL Server Wait Type Repository --- http://blogs.msdn.com/b/psssql/archive/2009/11/03/the-sql-server-wait-type-repository.aspx +-- https://bit.ly/1afzfjC -- Wait statistics, or please tell me where it hurts --- http://www.sqlskills.com/blogs/paul/wait-statistics-or-please-tell-me-where-it-hurts/ +-- https://bit.ly/2wsQHQE -- SQL Server 2005 Performance Tuning using the Waits and Queues --- http://technet.microsoft.com/en-us/library/cc966413.aspx +-- https://bit.ly/1o2NFoF -- sys.dm_os_wait_stats (Transact-SQL) --- http://msdn.microsoft.com/en-us/library/ms179984(v=sql.120).aspx +-- https://bit.ly/2Hjq9Yl @@ -1010,7 +1051,7 @@ WHERE scheduler_id < 255 OPTION (RECOMPILE); -- High Avg Pending DiskIO Counts are a sign of disk pressure -- How to Do Some Very Basic SQL Server Monitoring --- https://bit.ly/2q3Btgt +-- https://bit.ly/30IRla0 @@ -1081,7 +1122,7 @@ qs.min_logical_reads AS [Min Logical Reads], qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], qs.max_logical_reads AS [Max Logical Reads], qs.execution_count AS [Execution Count], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], qs.creation_time AS [Creation Time] --,t.[text] AS [Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) @@ -1163,7 +1204,7 @@ ORDER BY cp.size_in_bytes DESC, DB_NAME(t.[dbid]) OPTION (RECOMPILE); -- Enabling forced parameterization for the database can help, but test first! -- Plan cache, adhoc workloads and clearing the single-use plan cache bloat --- https://www.sqlskills.com/blogs/kimberly/plan-cache-adhoc-workloads-and-clearing-the-single-use-plan-cache-bloat/ +-- https://bit.ly/2EfYOkl -- Get top total logical reads queries for entire instance (Query 47) (Top Logical Reads Queries) @@ -1180,7 +1221,7 @@ qs.min_elapsed_time AS [Min Elapsed Time], qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], qs.max_elapsed_time AS [Max Elapsed Time], qs.execution_count AS [Execution Count], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], qs.creation_time AS [Creation Time] --,t.[text] AS [Complete Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) @@ -1203,7 +1244,7 @@ qs.execution_count AS [Execution Count], qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], qs.total_physical_reads/qs.execution_count AS [Avg Physical Reads], qs.total_worker_time/qs.execution_count AS [Avg Worker Time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], qs.creation_time AS [Creation Time] --,t.[text] AS [Complete Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) @@ -1228,7 +1269,10 @@ ORDER BY qs.total_elapsed_time/qs.execution_count DESC OPTION (RECOMPILE); SELECT f.name AS [File Name] , f.physical_name AS [Physical Name], CAST((f.size/128.0) AS DECIMAL(15,2)) AS [Total Size in MB], CAST(f.size/128.0 - CAST(FILEPROPERTY(f.name, 'SpaceUsed') AS int)/128.0 AS DECIMAL(15,2)) -AS [Available Space In MB], f.[file_id], fg.name AS [Filegroup Name], +AS [Available Space In MB], +CAST((f.size/128.0) AS DECIMAL(15,2)) - +CAST(f.size/128.0 - CAST(FILEPROPERTY(f.name, 'SpaceUsed') AS int)/128.0 AS DECIMAL(15,2)) AS [Used Space in MB], +f.[file_id], fg.name AS [Filegroup Name], f.is_percent_growth, f.growth, fg.is_default, fg.is_read_only FROM sys.database_files AS f WITH (NOLOCK) LEFT OUTER JOIN sys.filegroups AS fg WITH (NOLOCK) @@ -1271,7 +1315,7 @@ qs.total_worker_time AS [Total Worker Time], qs.total_worker_time/qs.execution_count AS [Avg Worker Time], qs.total_elapsed_time AS [Total Elapsed Time], qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], qs.creation_time AS [Creation Time] --,t.[text] AS [Complete Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) @@ -1282,14 +1326,15 @@ ORDER BY qs.execution_count DESC OPTION (RECOMPILE); ------ --- Queries 50 through 55 are the "Bad Man List" for stored procedures +-- Queries 52 through 57 are the "Bad Man List" for stored procedures + -- Top Cached SPs By Execution Count (Query 52) (SP Execution Counts) SELECT TOP(100) p.name AS [SP Name], qs.execution_count AS [Execution Count], ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], qs.total_worker_time/qs.execution_count AS [Avg Worker Time], qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1304,6 +1349,7 @@ ORDER BY qs.execution_count DESC OPTION (RECOMPILE); -- Tells you which cached stored procedures are called the most often -- This helps you characterize and baseline your workload +-- It also helps you find possible caching opportunities -- Top Cached SPs By Avg Elapsed Time (Query 53) (SP Avg Elapsed Time) @@ -1312,6 +1358,7 @@ qs.max_elapsed_time, qs.last_elapsed_time, qs.total_elapsed_time, qs.execution_c ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_worker_time/qs.execution_count AS [AvgWorkerTime], qs.total_worker_time AS [TotalWorkerTime], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1334,7 +1381,7 @@ SELECT TOP(25) p.name AS [SP Name], qs.total_worker_time AS [TotalWorkerTime], qs.total_worker_time/qs.execution_count AS [AvgWorkerTime], qs.execution_count, ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1356,7 +1403,7 @@ SELECT TOP(25) p.name AS [SP Name], qs.total_logical_reads AS [TotalLogicalReads qs.total_logical_reads/qs.execution_count AS [AvgLogicalReads],qs.execution_count, ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1377,7 +1424,7 @@ ORDER BY qs.total_logical_reads DESC OPTION (RECOMPILE); SELECT TOP(25) p.name AS [SP Name],qs.total_physical_reads AS [TotalPhysicalReads], qs.total_physical_reads/qs.execution_count AS [AvgPhysicalReads], qs.execution_count, qs.total_logical_reads,qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1401,7 +1448,7 @@ SELECT TOP(25) p.name AS [SP Name], qs.total_logical_writes AS [TotalLogicalWrit qs.total_logical_writes/qs.execution_count AS [AvgLogicalWrites], qs.execution_count, ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1465,13 +1512,10 @@ ORDER BY [Difference] DESC, [Total Writes] DESC, [Total Reads] ASC OPTION (RECOM -- Missing Indexes for current database by Index Advantage (Query 60) (Missing Indexes) -SELECT CONVERT(decimal(18,2), user_seeks * avg_total_user_cost * (avg_user_impact * 0.01)) AS [index_advantage], +SELECT DISTINCT CONVERT(decimal(18,2), migs.user_seeks * migs.avg_total_user_cost * (migs.avg_user_impact * 0.01)) AS [index_advantage], migs.last_user_seek, mid.[statement] AS [Database.Schema.Table], -COUNT(1) OVER(PARTITION BY mid.[statement]) AS [missing_indexes_for_table], -COUNT(1) OVER(PARTITION BY mid.[statement], equality_columns) AS [similar_missing_indexes_for_table], mid.equality_columns, mid.inequality_columns, mid.included_columns, -migs.unique_compiles, migs.user_seeks, -CONVERT(decimal(18,2), migs.avg_total_user_cost) AS [avg_total_user_cost], migs.avg_user_impact, +migs.user_seeks, migs.avg_total_user_cost, migs.avg_user_impact, OBJECT_NAME(mid.[object_id]) AS [Table Name], p.rows AS [Table Rows] FROM sys.dm_db_missing_index_group_stats AS migs WITH (NOLOCK) INNER JOIN sys.dm_db_missing_index_groups AS mig WITH (NOLOCK) @@ -1488,12 +1532,13 @@ ORDER BY index_advantage DESC OPTION (RECOMPILE); -- Look at index advantage, last user seek time, number of user seeks to help determine source and importance -- SQL Server is overly eager to add included columns, so beware -- Do not just blindly add indexes that show up from this query!!! +-- Hkan Winther has given me some great suggestions for this query -- Find missing index warnings for cached plans in the current database (Query 61) (Missing Index Warnings) -- Note: This query could take some time on a busy instance SELECT TOP(25) OBJECT_NAME(objectid) AS [ObjectName], - cp.objtype, cp.usecounts, cp.size_in_bytes, query_plan + cp.objtype, cp.usecounts, cp.size_in_bytes, qp.query_plan FROM sys.dm_exec_cached_plans AS cp WITH (NOLOCK) CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) AS qp WHERE CAST(query_plan AS NVARCHAR(MAX)) LIKE N'%MissingIndex%' @@ -1507,7 +1552,7 @@ ORDER BY cp.usecounts DESC OPTION (RECOMPILE); -- Breaks down buffers used by current database by object (table, index) in the buffer cache (Query 62) (Buffer Usage) -- Note: This query could take some time on a busy instance -SELECT SCHEMA_NAME(o.Schema_ID) AS [Schema Name], +SELECT fg.name AS [Filegroup Name], SCHEMA_NAME(o.Schema_ID) AS [Schema Name], OBJECT_NAME(p.[object_id]) AS [Object Name], p.index_id, CAST(COUNT(*)/128.0 AS DECIMAL(10, 2)) AS [Buffer size(MB)], COUNT(*) AS [BufferCount], p.[Rows] AS [Row Count], @@ -1519,12 +1564,17 @@ INNER JOIN sys.partitions AS p WITH (NOLOCK) ON a.container_id = p.hobt_id INNER JOIN sys.objects AS o WITH (NOLOCK) ON p.object_id = o.object_id +INNER JOIN sys.database_files AS f WITH (NOLOCK) +ON b.file_id = f.file_id +INNER JOIN sys.filegroups AS fg WITH (NOLOCK) +ON f.data_space_id = fg.data_space_id WHERE b.database_id = CONVERT(int, DB_ID()) AND p.[object_id] > 100 AND OBJECT_NAME(p.[object_id]) NOT LIKE N'plan_%' AND OBJECT_NAME(p.[object_id]) NOT LIKE N'sys%' AND OBJECT_NAME(p.[object_id]) NOT LIKE N'xml_index_nodes%' -GROUP BY o.Schema_ID, p.[object_id], p.index_id, p.data_compression_desc, p.[Rows] +GROUP BY fg.name, o.Schema_ID, p.[object_id], p.index_id, + p.data_compression_desc, p.[Rows] ORDER BY [BufferCount] DESC OPTION (RECOMPILE); ------ @@ -1534,7 +1584,7 @@ ORDER BY [BufferCount] DESC OPTION (RECOMPILE); -- Get Table names, row counts, and compression status for clustered index or heap (Query 63) (Table Sizes) SELECT SCHEMA_NAME(o.Schema_ID) AS [Schema Name], OBJECT_NAME(p.object_id) AS [ObjectName], -SUM(p.Rows) AS [RowCount], data_compression_desc AS [CompressionType] +SUM(p.Rows) AS [RowCount], p.data_compression_desc AS [Compression Type] FROM sys.partitions AS p WITH (NOLOCK) INNER JOIN sys.objects AS o WITH (NOLOCK) ON p.object_id = o.object_id @@ -1574,8 +1624,8 @@ ORDER BY OBJECT_NAME(t.[object_id]), p.index_id OPTION (RECOMPILE); -- When were Statistics last updated on all indexes? (Query 65) (Statistics Update) -SELECT SCHEMA_NAME(o.Schema_ID) + N'.' + o.NAME AS [Object Name], o.type_desc AS [Object Type], - i.name AS [Index Name], STATS_DATE(i.[object_id], i.index_id) AS [Statistics Date], +SELECT SCHEMA_NAME(o.Schema_ID) + N'.' + o.[NAME] AS [Object Name], o.[type_desc] AS [Object Type], + i.[name] AS [Index Name], STATS_DATE(i.[object_id], i.index_id) AS [Statistics Date], s.auto_created, s.no_recompute, s.user_created, s.is_temporary, st.row_count, st.used_page_count FROM sys.objects AS o WITH (NOLOCK) @@ -1598,6 +1648,10 @@ ORDER BY STATS_DATE(i.[object_id], i.index_id) DESC OPTION (RECOMPILE); -- sys.stats (Transact-SQL) -- https://msdn.microsoft.com/en-us/library/ms177623.aspx +-- UPDATEs to Statistics (Erin Stellato) +-- https://bit.ly/2vhrYQy + + -- Look at most frequently modified indexes and statistics (Query 66) (Volatile Indexes) @@ -1641,7 +1695,8 @@ ORDER BY ps.avg_fragmentation_in_percent DESC OPTION (RECOMPILE); --- Index Read/Write stats (all tables in current DB) ordered by Reads (Query 68) (Overall Index Usage - Reads) -SELECT OBJECT_NAME(i.[object_id]) AS [ObjectName], i.[name] AS [IndexName], i.index_id, +SELECT SCHEMA_NAME(t.[schema_id]) AS [SchemaName], OBJECT_NAME(i.[object_id]) AS [ObjectName], + i.[name] AS [IndexName], i.index_id, s.user_seeks, s.user_scans, s.user_lookups, s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], s.user_updates AS [Writes], @@ -1652,6 +1707,8 @@ LEFT OUTER JOIN sys.dm_db_index_usage_stats AS s WITH (NOLOCK) ON i.[object_id] = s.[object_id] AND i.index_id = s.index_id AND s.database_id = DB_ID() +LEFT OUTER JOIN sys.tables AS t WITH (NOLOCK) +ON t.[object_id] = i.[object_id] WHERE OBJECTPROPERTY(i.[object_id],'IsUserTable') = 1 ORDER BY s.user_seeks + s.user_scans + s.user_lookups DESC OPTION (RECOMPILE); -- Order by reads ------ @@ -1660,7 +1717,8 @@ ORDER BY s.user_seeks + s.user_scans + s.user_lookups DESC OPTION (RECOMPILE); - --- Index Read/Write stats (all tables in current DB) ordered by Writes (Query 69) (Overall Index Usage - Writes) -SELECT OBJECT_NAME(i.[object_id]) AS [ObjectName], i.[name] AS [IndexName], i.index_id, +SELECT SCHEMA_NAME(t.[schema_id]) AS [SchemaName],OBJECT_NAME(i.[object_id]) AS [ObjectName], + i.[name] AS [IndexName], i.index_id, s.user_updates AS [Writes], s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], i.[type_desc] AS [Index Type], i.fill_factor AS [Fill Factor], i.has_filter, i.filter_definition, s.last_system_update, s.last_user_update @@ -1669,6 +1727,8 @@ LEFT OUTER JOIN sys.dm_db_index_usage_stats AS s WITH (NOLOCK) ON i.[object_id] = s.[object_id] AND i.index_id = s.index_id AND s.database_id = DB_ID() +LEFT OUTER JOIN sys.tables AS t WITH (NOLOCK) +ON t.[object_id] = i.[object_id] WHERE OBJECTPROPERTY(i.[object_id],'IsUserTable') = 1 ORDER BY s.user_updates DESC OPTION (RECOMPILE); -- Order by writes ------ @@ -1721,36 +1781,10 @@ ORDER BY bs.backup_finish_date DESC OPTION (RECOMPILE); -- Have you done any backup tuning with striped backups, or changing the parameters of the backup command? --- These five Pluralsight Courses go into more detail about how to run these queries and interpret the results - --- SQL Server 2017: Diagnosing Performance Issues with DMVs --- https://bit.ly/2FqCeti - --- SQL Server 2017: Diagnosing Configuration Issues with DMVs --- https://bit.ly/2MSUDUL - --- SQL Server 2014 DMV Diagnostic Queries Part 1 --- https://bit.ly/2plxCer - --- SQL Server 2014 DMV Diagnostic Queries Part 2 --- https://bit.ly/2IuJpzI - --- SQL Server 2014 DMV Diagnostic Queries Part 3 --- https://bit.ly/2FIlCPb - - - --- Sign up for Microsoft Visual Studio Dev Essentials and get a free three month pass to Pluralsight - -- Microsoft Visual Studio Dev Essentials --- http://bit.ly/1q6xbDL - - --- Sign up for Microsoft Azure Essentials and get lots of free Azure usage credits, MCP exam voucher, three month Pluralsight subscription +-- https://bit.ly/2qjNRxi --- Microsoft Azure Essentials --- https://bit.ly/2JMWe8x +-- Microsoft Azure Learn +-- https://bit.ly/2O0Hacc --- August 2017 blog series about upgrading and migrating to SQL Server 2016/2017 --- https://bit.ly/2ftKVrX diff --git a/Scripts/SQL Server 2014 Diagnostic Information Queries.sql b/Scripts/SQL Server 2014 Diagnostic Information Queries.sql index 4d882753..59bb822e 100644 --- a/Scripts/SQL Server 2014 Diagnostic Information Queries.sql +++ b/Scripts/SQL Server 2014 Diagnostic Information Queries.sql @@ -1,15 +1,14 @@ -- SQL Server 2014 Diagnostic Information Queries -- Glenn Berry --- Last Modified: July 9, 2019 --- https://www.sqlskills.com/blogs/glenn/ --- http://sqlserverperformance.wordpress.com/ +-- Last Modified: December 3, 2020 +-- https://glennsqlperformance.com/ +-- https://sqlserverperformance.wordpress.com/ +-- YouTube: https://bit.ly/2PkoAM1 -- Twitter: GlennAlanBerry --- Please listen to my Pluralsight courses --- https://www.pluralsight.com/author/glenn-berry - --- If you want to find all of our SQLskills SQL101 blog posts, check out https://www.sqlskills.com/help/sql101/ +-- Diagnostic Queries are available here +-- https://glennsqlperformance.com/resources/ -- Please make sure you are using the correct version of these diagnostic queries for your version of SQL Server! @@ -23,11 +22,9 @@ --****************************************************************************** ---* Copyright (C) 2019 Glenn Berry, SQLskills.com +--* Copyright (C) 2020 Glenn Berry --* All rights reserved. --* ---* For more scripts and sample code, check out ---* https://www.sqlskills.com/blogs/glenn --* --* You may alter this code for your own *non-commercial* purposes. You may --* republish altered code as long as you include this copyright and give due credit. @@ -84,7 +81,7 @@ SELECT @@SERVERNAME AS [Server Name], @@VERSION AS [SQL Server and OS Version In -- 12.0.4502 SP1 CU11 2/21/2017 12.0.5540 SP2 CU4 2/21/2017 -- 12.0.4511 SP1 CU12 4/17/2017 12.0.5546 SP2 CU5 4/17/2017 -- 12.0.4522 SP1 CU13 7/17/2017 12.0.5552 SP2 CU6 7/17/2017 --- 12.0.5556 SP2 CU7 8/28/2017 +-- 12.0.5556 SP2 CU7 8/28/2017 -- 12.0.5557 SP2 CU8 10/16/2017 -- 12.0.5563 SP2 CU9 12/18/2017 -- 12.0.5571 SP2 CU10 1/16/2018 @@ -96,8 +93,11 @@ SELECT @@SERVERNAME AS [Server Name], @@VERSION AS [SQL Server and OS Version In -- 12.0.5605 SP2 CU15 12/12/2018 ----> 12.0.6205 SP3 CU1 12/12/2018 -- 12.0.5626 SP2 CU16 2/19/2019 ----> 12.0.6214 SP3 CU2 2/19/2019 -- 12.0.5632 SP2 CU17 4/16/2019 ----> 12.0.6259 SP3 CU3 4/16/2019 +-- 12.0.5687 SP2 CU18 7/29/2019 ----> 12.0.6329 SP3 CU4 7/29/2019 +-- 12.0.6372.1 Security Update for SQL Server 2016 SP3 CU4 February 11, 2020 +-- https://support.microsoft.com/en-us/help/4535288/description-of-the-security-update-for-sql-server-2014-sp3-cu4-feb -- How to determine the version, edition and update level of SQL Server and its components -- https://bit.ly/2oAjKgW @@ -169,6 +169,7 @@ SERVERPROPERTY('IsHadrEnabled') AS [IsHadrEnabled], SERVERPROPERTY('HadrManagerStatus') AS [HadrManagerStatus], SERVERPROPERTY('InstanceDefaultDataPath') AS [InstanceDefaultDataPath], SERVERPROPERTY('InstanceDefaultLogPath') AS [InstanceDefaultLogPath], +SERVERPROPERTY('ErrorLogFileName') AS [ErrorLogFileName], SERVERPROPERTY('BuildClrVersion') AS [Build CLR Version], SERVERPROPERTY('IsXTPSupported') AS [IsXTPSupported]; ------ @@ -217,10 +218,10 @@ DBCC TRACESTATUS (-1); -- https://bit.ly/2GY1kOl -- TF 2371 - Lowers auto update statistics threshold for large tables (on tables with more than 25,000 rows) --- https://bit.ly/2HySkAg +-- https://bit.ly/30KO4Hh -- TF 3226 - Supresses logging of successful database backup messages to the SQL Server Error Log --- https://bit.ly/2p6MTjS +-- https://bit.ly/38zDNAK -- TF 3449 - Enables use of dirty page manager (SQL Server 2014 SP1 CU7 and later) -- https://bit.ly/2uj0h5M @@ -245,15 +246,12 @@ EXEC sys.xp_readerrorlog 0, 1, N'Database Instant File Initialization'; -- Lets you determine whether Instant File Initialization (IFI) is enabled for the instance -- This should be enabled in the vast majority of cases +-- Note: This query won't return any results if the SQL Server error log has been recycled -- Database Instant File Initialization -- https://bit.ly/2nTX74y --- Misconceptions around instant file initialization --- https://bit.ly/2oBSKgZ - - -- SQL Server Process Address space info (Query 7) (Process Memory) -- (shows whether locked pages is enabled, among other things) @@ -296,11 +294,16 @@ FROM sys.dm_server_services WITH (NOLOCK) OPTION (RECOMPILE); SELECT ISNULL(d.[name], bs.[database_name]) AS [Database], d.recovery_model_desc AS [Recovery Model], d.log_reuse_wait_desc AS [Log Reuse Wait Desc], MAX(CASE WHEN [type] = 'D' THEN bs.backup_finish_date ELSE NULL END) AS [Last Full Backup], + MAX(CASE WHEN [type] = 'D' THEN bmf.physical_device_name ELSE NULL END) AS [Last Full Backup Location], MAX(CASE WHEN [type] = 'I' THEN bs.backup_finish_date ELSE NULL END) AS [Last Differential Backup], - MAX(CASE WHEN [type] = 'L' THEN bs.backup_finish_date ELSE NULL END) AS [Last Log Backup] + MAX(CASE WHEN [type] = 'I' THEN bmf.physical_device_name ELSE NULL END) AS [Last Differential Backup Location], + MAX(CASE WHEN [type] = 'L' THEN bs.backup_finish_date ELSE NULL END) AS [Last Log Backup], + MAX(CASE WHEN [type] = 'L' THEN bmf.physical_device_name ELSE NULL END) AS [Last Log Backup Location] FROM sys.databases AS d WITH (NOLOCK) LEFT OUTER JOIN msdb.dbo.backupset AS bs WITH (NOLOCK) -ON bs.[database_name] = d.[name] +ON bs.[database_name] = d.[name] +LEFT OUTER JOIN msdb.dbo.backupmediafamily AS bmf WITH (NOLOCK) +ON bs.media_set_id = bmf.media_set_id AND bs.backup_finish_date > GETDATE()- 30 WHERE d.name <> N'tempdb' GROUP BY ISNULL(d.[name], bs.[database_name]), d.recovery_model_desc, d.log_reuse_wait_desc, d.[name] @@ -336,6 +339,9 @@ ORDER BY sj.name OPTION (RECOMPILE); -- SQL Server Maintenance Solution -- https://bit.ly/1pgchQu +-- You can use this script to add default schedules to the standard Ola Hallengren Maintenance Solution jobs +-- https://bit.ly/3ane0gN + -- Get SQL Server Agent Alert Information (Query 11) (SQL Server Agent Alerts) SELECT name, event_source, message_id, severity, [enabled], has_notification, @@ -346,7 +352,7 @@ ORDER BY name OPTION (RECOMPILE); -- Gives you some basic information about your SQL Server Agent Alerts -- (which are different from SQL Server Agent jobs) --- Read more about Agent Alerts here: https://bit.ly/2Giz0Xf +-- Read more about Agent Alerts here: https://bit.ly/2v5YR37 @@ -398,15 +404,16 @@ WHERE node_state_desc <> N'ONLINE DAC' OPTION (RECOMPILE); -- sys.dm_os_nodes (Transact-SQL) -- https://bit.ly/2pn5Mw8 --- Balancing Your Available SQL Server Core Licenses Evenly Across NUMA Nodes --- https://bit.ly/2vfC4Rq +-- How to Balance SQL Server Core Licenses Across NUMA Nodes +-- https://bit.ly/3i4TyVR -- Good basic information about OS memory amounts and state (Query 14) (System Memory) SELECT total_physical_memory_kb/1024 AS [Physical Memory (MB)], available_physical_memory_kb/1024 AS [Available Memory (MB)], - total_page_file_kb/1024 AS [Total Page File (MB)], + total_page_file_kb/1024 AS [Page File Commit Limit (MB)], + total_page_file_kb/1024 - total_physical_memory_kb/1024 AS [Physical Page File Size (MB)], available_page_file_kb/1024 AS [Available Page File (MB)], system_cache_kb/1024 AS [System Cache (MB)], system_memory_state_desc AS [System Memory State] @@ -453,7 +460,7 @@ FROM sys.dm_hadr_cluster WITH (NOLOCK) OPTION (RECOMPILE); -- You will see no results if your instance is not using AlwaysOn AGs --- Good overview of AG health and status (Query 17) (AlwaysOn AG Status) +-- Good overview of AG health and status (Query 17) (AG Status) SELECT ag.name AS [AG Name], ar.replica_server_name, ar.availability_mode_desc, adc.[database_name], drs.is_local, drs.is_primary_replica, drs.synchronization_state_desc, drs.is_commit_participant, drs.synchronization_health_desc, drs.recovery_lsn, drs.truncation_lsn, drs.last_sent_lsn, @@ -498,15 +505,6 @@ FROM sys.dm_os_sys_info WITH (NOLOCK) OPTION (RECOMPILE); -- sys.dm_os_sys_info (Transact-SQL) -- https://bit.ly/2pczOYs --- Soft NUMA configuration was a new column for SQL Server 2016 --- OFF = Soft-NUMA feature is OFF --- ON = SQL Server automatically determines the NUMA node sizes for Soft-NUMA --- MANUAL = Manually configured soft-NUMA - --- Configure SQL Server to Use Soft-NUMA (SQL Server) --- https://bit.ly/2HTpKJt - - -- Get System Manufacturer and model number from SQL Server Error log (Query 19) (System Manufacturer) EXEC sys.xp_readerrorlog 0, 1, N'Manufacturer'; @@ -518,16 +516,7 @@ EXEC sys.xp_readerrorlog 0, 1, N'Manufacturer'; -- This query will return no results if your error log has been recycled since the instance was started --- Get pvscsi info from Windows Registry (Query 20) (PVSCSI Driver Parameters) -EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SYSTEM\CurrentControlSet\services\pvscsi\Parameters\Device', N'DriverParameter'; ------- - --- This is valid for VMware VMs --- Recommended value for intensive I/O patterns from VMware is: RequestRingPages=32,MaxQueueDepth=254 --- https://kb.vmware.com/s/article/2053145 - - --- Get BIOS date from Windows Registry (Query 21) (BIOS Date) +-- Get BIOS date from Windows Registry (Query 20) (BIOS Date) EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\System\BIOS', N'BiosReleaseDate'; ------ @@ -535,7 +524,7 @@ EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\Syste -- Not as useful for virtualization --- Get processor description from Windows Registry (Query 22) (Processor Description) +-- Get processor description from Windows Registry (Query 21) (Processor Description) EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\System\CentralProcessor\0', N'ProcessorNameString'; ------ @@ -552,7 +541,7 @@ EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\Syste --- Get information on location, time and size of any memory dumps from SQL Server (Query 23) (Memory Dump Info) +-- Get information on location, time and size of any memory dumps from SQL Server (Query 22) (Memory Dump Info) SELECT [filename], creation_time, size_in_bytes/1048576.0 AS [Size (MB)] FROM sys.dm_server_memory_dumps WITH (NOLOCK) ORDER BY creation_time DESC OPTION (RECOMPILE); @@ -566,7 +555,7 @@ ORDER BY creation_time DESC OPTION (RECOMPILE); --- Look at Suspect Pages table (Query 24) (Suspect Pages) +-- Look at Suspect Pages table (Query 23) (Suspect Pages) SELECT DB_NAME(database_id) AS [Database Name], [file_id], page_id, event_type, error_count, last_update_date FROM msdb.dbo.suspect_pages WITH (NOLOCK) @@ -589,7 +578,7 @@ ORDER BY database_id OPTION (RECOMPILE); -- https://bit.ly/2Fvr1c9 --- Get number of data files in tempdb database (Query 25) (Tempdb Data Files) +-- Get number of data files in tempdb database (Query 24) (Tempdb Data Files) EXEC sys.xp_readerrorlog 0, 1, N'The tempdb database has'; ------ @@ -599,7 +588,7 @@ EXEC sys.xp_readerrorlog 0, 1, N'The tempdb database has'; -- This will be blank unless you have Service Pack 2 or later --- File names and paths for all user and system databases on instance (Query 26) (Database Filenames and Paths) +-- File names and paths for all user and system databases on instance (Query 25) (Database Filenames and Paths) SELECT DB_NAME([database_id]) AS [Database Name], [file_id], [name], physical_name, [type_desc], state_desc, is_percent_growth, growth, @@ -619,7 +608,7 @@ ORDER BY DB_NAME([database_id]), [file_id] OPTION (RECOMPILE); -- Is percent growth enabled for any files (which is bad)? --- Volume info for all LUNS that have database files on the current instance (Query 27) (Volume Info) +-- Volume info for all LUNS that have database files on the current instance (Query 26) (Volume Info) SELECT DISTINCT vs.volume_mount_point, vs.file_system_type, vs.logical_volume_name, CONVERT(DECIMAL(18,2), vs.total_bytes/1073741824.0) AS [Total Size (GB)], CONVERT(DECIMAL(18,2), vs.available_bytes/1073741824.0) AS [Available Size (GB)], @@ -639,8 +628,7 @@ ORDER BY vs.volume_mount_point OPTION (RECOMPILE); --- Drive level latency information (Query 28) (Drive Level Latency) --- Based on code from Jimmy May +-- Drive level latency information (Query 27) (Drive Level Latency) SELECT tab.[Drive], tab.volume_mount_point AS [Volume Mount Point], CASE WHEN num_of_reads = 0 THEN 0 @@ -683,8 +671,15 @@ ORDER BY [Overall Latency] OPTION (RECOMPILE); -- These latency numbers include all file activity against all SQL Server -- database files on each drive since SQL Server was last started +-- sys.dm_io_virtual_file_stats (Transact-SQL) +-- https://bit.ly/3bRWUc0 + +-- sys.dm_os_volume_stats (Transact-SQL) +-- https://bit.ly/33thz2j + + --- Calculates average stalls per read, per write, and per total input/output for each database file (Query 29) (IO Latency by File) +-- Calculates average stalls per read, per write, and per total input/output for each database file (Query 28) (IO Latency by File) SELECT DB_NAME(fs.database_id) AS [Database Name], CAST(fs.io_stall_read_ms/(1.0 + fs.num_of_reads) AS NUMERIC(10,1)) AS [avg_read_latency_ms], CAST(fs.io_stall_write_ms/(1.0 + fs.num_of_writes) AS NUMERIC(10,1)) AS [avg_write_latency_ms], CAST((fs.io_stall_read_ms + fs.io_stall_write_ms)/(1.0 + fs.num_of_reads + fs.num_of_writes) AS NUMERIC(10,1)) AS [avg_io_latency_ms], @@ -704,8 +699,11 @@ ORDER BY avg_io_latency_ms DESC OPTION (RECOMPILE); -- These latency numbers include all file activity against each SQL Server -- database file since SQL Server was last started +-- sys.dm_io_virtual_file_stats (Transact-SQL) +-- https://bit.ly/3bRWUc0 --- Look for I/O requests taking longer than 15 seconds in the six most recent SQL Server Error Logs (Query 30) (IO Warnings) + +-- Look for I/O requests taking longer than 15 seconds in the six most recent SQL Server Error Logs (Query 29) (IO Warnings) CREATE TABLE #IOWarningResults(LogDate datetime, ProcessInfo sysname, LogText nvarchar(1000)); INSERT INTO #IOWarningResults @@ -741,7 +739,7 @@ DROP TABLE #IOWarningResults; -- https://bit.ly/2qtaw73 --- Resource Governor Resource Pool information (Query 31) (RG Resource Pools) +-- Resource Governor Resource Pool information (Query 30) (RG Resource Pools) SELECT pool_id, [Name], statistics_start_time, min_memory_percent, max_memory_percent, max_memory_kb/1024 AS [max_memory_mb], @@ -757,7 +755,7 @@ OPTION (RECOMPILE); --- Recovery model, log reuse wait description, log file size, log usage size (Query 32) (Database Properties) +-- Recovery model, log reuse wait description, log file size, log usage size (Query 31) (Database Properties) -- and compatibility level for all databases on instance SELECT db.[name] AS [Database Name], SUSER_SNAME(db.owner_sid) AS [Database Owner], db.recovery_model_desc AS [Recovery Model], db.state_desc, db.containment_desc, db.log_reuse_wait_desc AS [Log Reuse Wait Description], @@ -766,9 +764,8 @@ CAST(CAST(lu.cntr_value AS FLOAT) / CAST(ls.cntr_value AS FLOAT)AS DECIMAL(18,2) db.[compatibility_level] AS [DB Compatibility Level], db.page_verify_option_desc AS [Page Verify Option], db.is_auto_create_stats_on, db.is_auto_update_stats_on, db.is_auto_update_stats_async_on, db.is_parameterization_forced, db.snapshot_isolation_state_desc, db.is_read_committed_snapshot_on, db.is_auto_close_on, db.is_auto_shrink_on, -db.target_recovery_time_in_seconds, db.is_cdc_enabled, db.is_published, db.is_distributor, db.is_encrypted, -db.group_database_id, db.replica_id,db.is_memory_optimized_elevate_to_snapshot_on, -db.delayed_durability_desc, db.is_auto_create_stats_incremental_on, +db.target_recovery_time_in_seconds, db.is_cdc_enabled, db.is_published, db.is_distributor, +db.group_database_id, db.replica_id,db.is_memory_optimized_elevate_to_snapshot_on, db.delayed_durability_desc, db.is_encrypted, de.encryption_state, de.percent_complete, de.key_algorithm, de.key_length FROM sys.databases AS db WITH (NOLOCK) INNER JOIN sys.dm_os_performance_counters AS lu WITH (NOLOCK) @@ -783,6 +780,15 @@ AND ls.cntr_value > 0 ORDER BY db.[name] OPTION (RECOMPILE); ------ +-- sys.databases (Transact-SQL) +-- https://bit.ly/2G5wqaX + +-- sys.dm_os_performance_counters (Transact-SQL) +-- https://bit.ly/3kEO2JR + +-- sys.dm_database_encryption_keys (Transact-SQL) +-- https://bit.ly/3mE7kkx + -- Things to look at: -- How many databases are on the instance? -- What recovery models are they using? @@ -795,14 +801,12 @@ ORDER BY db.[name] OPTION (RECOMPILE); --- Missing Indexes for all databases by Index Advantage (Query 33) (Missing Indexes All Databases) -SELECT CONVERT(decimal(18,2), user_seeks * avg_total_user_cost * (avg_user_impact * 0.01)) AS [index_advantage], -FORMAT(migs.last_user_seek, 'yyyy-MM-dd HH:mm:ss') AS [last_user_seek], -mid.[statement] AS [Database.Schema.Table], +-- Missing Indexes for all databases by Index Advantage (Query 32) (Missing Indexes All Databases) +SELECT CONVERT(decimal(18,2), migs.user_seeks * migs.avg_total_user_cost * (migs.avg_user_impact * 0.01)) AS [index_advantage], +FORMAT(migs.last_user_seek, 'yyyy-MM-dd HH:mm:ss') AS [last_user_seek], mid.[statement] AS [Database.Schema.Table], COUNT(1) OVER(PARTITION BY mid.[statement]) AS [missing_indexes_for_table], COUNT(1) OVER(PARTITION BY mid.[statement], equality_columns) AS [similar_missing_indexes_for_table], -mid.equality_columns, mid.inequality_columns, mid.included_columns, -migs.unique_compiles, migs.user_seeks, +mid.equality_columns, mid.inequality_columns, mid.included_columns, migs.user_seeks, CONVERT(decimal(18,2), migs.avg_total_user_cost) AS [avg_total_user_cost], migs.avg_user_impact FROM sys.dm_db_missing_index_group_stats AS migs WITH (NOLOCK) INNER JOIN sys.dm_db_missing_index_groups AS mig WITH (NOLOCK) @@ -817,13 +821,14 @@ ORDER BY index_advantage DESC OPTION (RECOMPILE); -- Also look at avg_user_impact and avg_total_user_cost to help determine importance -- SQL Server is overly eager to add included columns, so beware -- Do not just blindly add indexes that show up from this query!!! +-- Hkan Winther has given me some great suggestions for this query -- SQL Server Index Design Guide -- https://bit.ly/2qtZr4N --- Get VLF Counts for all databases on the instance (Query 34) (VLF Counts) +-- Get VLF Counts for all databases on the instance (Query 33) (VLF Counts) -- (adapted from Michelle Ufford) CREATE TABLE #VLFInfo (RecoveryUnitID int, FileID int, FileSize bigint, StartOffset bigint, @@ -863,7 +868,8 @@ DROP TABLE #VLFCountResults; --- Get CPU utilization by database (Query 35) (CPU Usage by Database) + +-- Get CPU utilization by database (Query 34) (CPU Usage by Database) WITH DB_CPU_Stats AS (SELECT pa.DatabaseID, DB_Name(pa.DatabaseID) AS [Database Name], SUM(qs.total_worker_time/1000) AS [CPU_Time_Ms] @@ -884,7 +890,7 @@ ORDER BY [CPU Rank] OPTION (RECOMPILE); -- Note: This only reflects CPU usage from the currently cached query plans --- Get I/O utilization by database (Query 36) (IO Usage By Database) +-- Get I/O utilization by database (Query 35) (IO Usage By Database) WITH Aggregate_IO_Statistics AS (SELECT DB_NAME(database_id) AS [Database Name], CAST(SUM(num_of_bytes_read + num_of_bytes_written) / 1048576 AS DECIMAL(12, 2)) AS [ioTotalMB], @@ -908,7 +914,7 @@ ORDER BY [I/O Rank] OPTION (RECOMPILE); -- They include all I/O activity, not just the nominal I/O workload --- Get total buffer usage by database for current instance (Query 37) (Total Buffer Usage by Database) +-- Get total buffer usage by database for current instance (Query 36) (Total Buffer Usage by Database) -- This make take some time to run on a busy instance WITH AggregateBufferPoolUsage AS @@ -930,7 +936,7 @@ ORDER BY [Buffer Pool Rank] OPTION (RECOMPILE); -- Clear Wait Stats with this command -- DBCC SQLPERF('sys.dm_os_wait_stats', CLEAR); --- Isolate top waits for server instance since last restart or wait statistics clear (Query 38) (Top Waits) +-- Isolate top waits for server instance since last restart or wait statistics clear (Query 37) (Top Waits) WITH [Waits] AS (SELECT wait_type, wait_time_ms/ 1000.0 AS [WaitS], (wait_time_ms - signal_wait_time_ms) / 1000.0 AS [ResourceS], @@ -985,7 +991,7 @@ OPTION (RECOMPILE); -- Cumulative wait stats are not as useful on an idle instance that is not under load or performance pressure --- SQL Server Wait Types Library (Paul Randal) +-- SQL Server Wait Types Library -- https://bit.ly/2ePzYO2 -- The SQL Server Wait Type Repository @@ -1002,7 +1008,7 @@ OPTION (RECOMPILE); --- Get a count of SQL connections by IP address (Query 39) (Connection Counts by IP Address) +-- Get a count of SQL connections by IP address (Query 38) (Connection Counts by IP Address) SELECT ec.client_net_address, es.[program_name], es.[host_name], es.login_name, COUNT(ec.session_id) AS [connection count] FROM sys.dm_exec_sessions AS es WITH (NOLOCK) @@ -1020,7 +1026,7 @@ ORDER BY ec.client_net_address, es.[program_name] OPTION (RECOMPILE); --- Get Average Task Counts (run multiple times) (Query 40) (Avg Task Counts) +-- Get Average Task Counts (run multiple times) (Query 39) (Avg Task Counts) SELECT AVG(current_tasks_count) AS [Avg Task Count], AVG(work_queue_count) AS [Avg Work Queue Count], AVG(runnable_tasks_count) AS [Avg Runnable Task Count], @@ -1037,11 +1043,11 @@ WHERE scheduler_id < 255 OPTION (RECOMPILE); -- High Avg Pending DiskIO Counts are a sign of disk pressure -- How to Do Some Very Basic SQL Server Monitoring --- https://bit.ly/2q3Btgt +-- https://bit.ly/30IRla0 --- Detect blocking (run multiple times) (Query 41) (Detect Blocking) +-- Detect blocking (run multiple times) (Query 40) (Detect Blocking) SELECT t1.resource_type AS [lock type], DB_NAME(resource_database_id) AS [database], t1.resource_associated_entity_id AS [blk object],t1.request_mode AS [lock req], -- lock requested t1.request_session_id AS [waiter sid], t2.wait_duration_ms AS [wait time], -- spid of waiter @@ -1070,7 +1076,7 @@ ON t1.lock_owner_address = t2.resource_address OPTION (RECOMPILE); --- Get CPU Utilization History for last 256 minutes (in one minute intervals) (Query 42) (CPU Utilization History) +-- Get CPU Utilization History for last 256 minutes (in one minute intervals) (Query 41) (CPU Utilization History) DECLARE @ts_now bigint = (SELECT cpu_ticks/(cpu_ticks/ms_ticks) FROM sys.dm_os_sys_info WITH (NOLOCK)); SELECT TOP(256) SQLProcessUtilization AS [SQL Server Process CPU Utilization], @@ -1095,7 +1101,7 @@ ORDER BY record_id DESC OPTION (RECOMPILE); -- on high core count (> 64 cores) systems --- Get top total worker time queries for entire instance (Query 43) (Top Worker Time Queries) +-- Get top total worker time queries for entire instance (Query 42) (Top Worker Time Queries) SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], REPLACE(REPLACE(LEFT(t.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text], qs.total_worker_time AS [Total Worker Time], qs.min_worker_time AS [Min Worker Time], @@ -1108,7 +1114,7 @@ qs.min_logical_reads AS [Min Logical Reads], qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], qs.max_logical_reads AS [Max Logical Reads], qs.execution_count AS [Execution Count], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], qs.creation_time AS [Creation Time] --,t.[text] AS [Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) @@ -1123,7 +1129,7 @@ ORDER BY qs.total_worker_time DESC OPTION (RECOMPILE); --- Page Life Expectancy (PLE) value for each NUMA node in current instance (Query 44) (PLE by NUMA Node) +-- Page Life Expectancy (PLE) value for each NUMA node in current instance (Query 43) (PLE by NUMA Node) SELECT @@SERVERNAME AS [Server Name], RTRIM([object_name]) AS [Object Name], instance_name, cntr_value AS [Page Life Expectancy] FROM sys.dm_os_performance_counters WITH (NOLOCK) @@ -1139,7 +1145,7 @@ AND counter_name = N'Page life expectancy' OPTION (RECOMPILE); -- https://bit.ly/2EgynLa --- Memory Grants Pending value for current instance (Query 45) (Memory Grants Pending) +-- Memory Grants Pending value for current instance (Query 44) (Memory Grants Pending) SELECT @@SERVERNAME AS [Server Name], RTRIM([object_name]) AS [Object Name], cntr_value AS [Memory Grants Pending] FROM sys.dm_os_performance_counters WITH (NOLOCK) WHERE [object_name] LIKE N'%Memory Manager%' -- Handles named instances @@ -1150,7 +1156,7 @@ AND counter_name = N'Memory Grants Pending' OPTION (RECOMPILE); -- Memory Grants Pending above zero for a sustained period is a very strong indicator of internal memory pressure --- Memory Clerk Usage for instance (Query 46) (Memory Clerk Usage) +-- Memory Clerk Usage for instance (Query 45) (Memory Clerk Usage) -- Look for high value for CACHESTORE_SQLCP (Ad-hoc query plans) SELECT TOP(10) mc.[type] AS [Memory Clerk Type], CAST((SUM(mc.pages_kb)/1024.0) AS DECIMAL (15,2)) AS [Memory Usage (MB)] @@ -1172,7 +1178,7 @@ ORDER BY SUM(mc.pages_kb) DESC OPTION (RECOMPILE); --- Find single-use, ad-hoc and prepared queries that are bloating the plan cache (Query 47) (Ad hoc Queries) +-- Find single-use, ad-hoc and prepared queries that are bloating the plan cache (Query 46) (Ad hoc Queries) SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], t.[text] AS [Query Text], cp.objtype AS [Object Type], cp.cacheobjtype AS [Cache Object Type], cp.size_in_bytes/1024 AS [Plan Size in KB] @@ -1193,7 +1199,7 @@ ORDER BY cp.size_in_bytes DESC, DB_NAME(t.[dbid]) OPTION (RECOMPILE); -- https://bit.ly/2EfYOkl --- Get top total logical reads queries for entire instance (Query 48) (Top Logical Reads Queries) +-- Get top total logical reads queries for entire instance (Query 47) (Top Logical Reads Queries) SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], REPLACE(REPLACE(LEFT(t.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text], qs.total_logical_reads AS [Total Logical Reads], @@ -1207,7 +1213,7 @@ qs.min_elapsed_time AS [Min Elapsed Time], qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], qs.max_elapsed_time AS [Max Elapsed Time], qs.execution_count AS [Execution Count], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], qs.creation_time AS [Creation Time] --,t.[text] AS [Complete Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) @@ -1221,7 +1227,7 @@ ORDER BY qs.total_logical_reads DESC OPTION (RECOMPILE); -- Can also help track down parameter sniffing issues --- Get top average elapsed time queries for entire instance (Query 49) (Top Avg Elapsed Time Queries) +-- Get top average elapsed time queries for entire instance (Query 48) (Top Avg Elapsed Time Queries) SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], REPLACE(REPLACE(LEFT(t.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text], qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], @@ -1230,7 +1236,7 @@ qs.execution_count AS [Execution Count], qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], qs.total_physical_reads/qs.execution_count AS [Avg Physical Reads], qs.total_worker_time/qs.execution_count AS [Avg Worker Time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], qs.creation_time AS [Creation Time] --,t.[text] AS [Complete Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) @@ -1251,11 +1257,14 @@ ORDER BY qs.total_elapsed_time/qs.execution_count DESC OPTION (RECOMPILE); --USE YourDatabaseName; -- make sure to change to an actual database on your instance, not the master system database --GO --- Individual File Sizes and space available for current database (Query 50) (File Sizes and Space) +-- Individual File Sizes and space available for current database (Query 49) (File Sizes and Space) SELECT f.name AS [File Name] , f.physical_name AS [Physical Name], CAST((f.size/128.0) AS DECIMAL(15,2)) AS [Total Size in MB], CAST(f.size/128.0 - CAST(FILEPROPERTY(f.name, 'SpaceUsed') AS int)/128.0 AS DECIMAL(15,2)) -AS [Available Space In MB], f.[file_id], fg.name AS [Filegroup Name], +AS [Available Space In MB], +CAST((f.size/128.0) AS DECIMAL(15,2)) - +CAST(f.size/128.0 - CAST(FILEPROPERTY(f.name, 'SpaceUsed') AS int)/128.0 AS DECIMAL(15,2)) AS [Used Space in MB], +f.[file_id], fg.name AS [Filegroup Name], f.is_percent_growth, f.growth, fg.is_default, fg.is_read_only FROM sys.database_files AS f WITH (NOLOCK) LEFT OUTER JOIN sys.filegroups AS fg WITH (NOLOCK) @@ -1267,7 +1276,7 @@ ORDER BY f.[file_id] OPTION (RECOMPILE); -- Make sure the transaction log is not full!! --- Log space usage for current database (Query 51) (Log Space Usage) +-- Log space usage for current database (Query 50) (Log Space Usage) SELECT DB_NAME(lsu.database_id) AS [Database Name], db.recovery_model_desc AS [Recovery Model], CAST(lsu.total_log_size_in_bytes/1048576.0 AS DECIMAL(10, 2)) AS [Total Log Space (MB)], CAST(lsu.used_log_space_in_bytes/1048576.0 AS DECIMAL(10, 2)) AS [Used Log Space (MB)], @@ -1282,8 +1291,11 @@ OPTION (RECOMPILE); -- Look at log file size and usage, along with the log reuse wait description for the current database +-- sys.dm_db_log_space_usage (Transact-SQL) +-- https://bit.ly/2H4MQw9 + --- I/O Statistics by file for the current database (Query 52) (IO Stats By File) +-- I/O Statistics by file for the current database (Query 51) (IO Stats By File) SELECT DB_NAME(DB_ID()) AS [Database Name], df.name AS [Logical Name], vfs.[file_id], df.type_desc, df.physical_name AS [Physical Name], CAST(vfs.size_on_disk_bytes/1048576.0 AS DECIMAL(16, 2)) AS [Size on Disk (MB)], vfs.num_of_reads, vfs.num_of_writes, vfs.io_stall_read_ms, vfs.io_stall_write_ms, @@ -1306,7 +1318,7 @@ ON vfs.[file_id]= df.[file_id] OPTION (RECOMPILE); --- Get most frequently executed queries for this database (Query 53) (Query Execution Counts) +-- Get most frequently executed queries for this database (Query 52) (Query Execution Counts) SELECT TOP(50) LEFT(t.[text], 50) AS [Short Query Text], qs.execution_count AS [Execution Count], qs.total_logical_reads AS [Total Logical Reads], qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], @@ -1314,7 +1326,7 @@ qs.total_worker_time AS [Total Worker Time], qs.total_worker_time/qs.execution_count AS [Avg Worker Time], qs.total_elapsed_time AS [Total Elapsed Time], qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], qs.creation_time AS [Creation Time] --,t.[text] AS [Complete Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) @@ -1325,15 +1337,15 @@ ORDER BY qs.execution_count DESC OPTION (RECOMPILE); ------ --- Queries 54 through 59 are the "Bad Man List" for stored procedures +-- Queries 53 through 59 are the "Bad Man List" for stored procedures --- Top Cached SPs By Execution Count (Query 55) (SP Execution Counts) +-- Top Cached SPs By Execution Count (Query 53) (SP Execution Counts) SELECT TOP(100) p.name AS [SP Name], qs.execution_count AS [Execution Count], ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], qs.total_worker_time/qs.execution_count AS [Avg Worker Time], qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1348,15 +1360,16 @@ ORDER BY qs.execution_count DESC OPTION (RECOMPILE); -- Tells you which cached stored procedures are called the most often -- This helps you characterize and baseline your workload +-- It also helps you find possible caching opportunities --- Top Cached SPs By Avg Elapsed Time (Query 56) (SP Avg Elapsed Time) +-- Top Cached SPs By Avg Elapsed Time (Query 54) (SP Avg Elapsed Time) SELECT TOP(25) p.name AS [SP Name], qs.min_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], qs.max_elapsed_time, qs.last_elapsed_time, qs.total_elapsed_time, qs.execution_count, ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_worker_time/qs.execution_count AS [AvgWorkerTime], qs.total_worker_time AS [TotalWorkerTime], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1374,12 +1387,12 @@ ORDER BY avg_elapsed_time DESC OPTION (RECOMPILE); --- Top Cached SPs By Total Worker time. Worker time relates to CPU cost (Query 57) (SP Worker Time) +-- Top Cached SPs By Total Worker time. Worker time relates to CPU cost (Query 55) (SP Worker Time) SELECT TOP(25) p.name AS [SP Name], qs.total_worker_time AS [TotalWorkerTime], qs.total_worker_time/qs.execution_count AS [AvgWorkerTime], qs.execution_count, ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1396,12 +1409,12 @@ ORDER BY qs.total_worker_time DESC OPTION (RECOMPILE); -- You should look at this if you see signs of CPU pressure --- Top Cached SPs By Total Logical Reads. Logical reads relate to memory pressure (Query 58) (SP Logical Reads) +-- Top Cached SPs By Total Logical Reads. Logical reads relate to memory pressure (Query 56) (SP Logical Reads) SELECT TOP(25) p.name AS [SP Name], qs.total_logical_reads AS [TotalLogicalReads], qs.total_logical_reads/qs.execution_count AS [AvgLogicalReads],qs.execution_count, ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1418,11 +1431,11 @@ ORDER BY qs.total_logical_reads DESC OPTION (RECOMPILE); -- You should look at this if you see signs of memory pressure --- Top Cached SPs By Total Physical Reads. Physical reads relate to disk read I/O pressure (Query 59) (SP Physical Reads) +-- Top Cached SPs By Total Physical Reads. Physical reads relate to disk read I/O pressure (Query 57) (SP Physical Reads) SELECT TOP(25) p.name AS [SP Name],qs.total_physical_reads AS [TotalPhysicalReads], qs.total_physical_reads/qs.execution_count AS [AvgPhysicalReads], qs.execution_count, qs.total_logical_reads,qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1440,13 +1453,13 @@ ORDER BY qs.total_physical_reads DESC, qs.total_logical_reads DESC OPTION (RECOM --- Top Cached SPs By Total Logical Writes (Query 60) (SP Logical Writes) +-- Top Cached SPs By Total Logical Writes (Query 58) (SP Logical Writes) -- Logical writes relate to both memory and disk I/O pressure SELECT TOP(25) p.name AS [SP Name], qs.total_logical_writes AS [TotalLogicalWrites], qs.total_logical_writes/qs.execution_count AS [AvgLogicalWrites], qs.execution_count, ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1464,7 +1477,32 @@ ORDER BY qs.total_logical_writes DESC OPTION (RECOMPILE); -- You should look at this if you see signs of I/O pressure or of memory pressure --- Lists the top statements by average input/output usage for the current database (Query 61) (Top IO Statements) + +-- Cached SPs Missing Indexes by Execution Count (Query 59) (SP Missing Index) +SELECT TOP(25) p.name AS [SP Name], qs.execution_count AS [Execution Count], +ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], +qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], +qs.total_worker_time/qs.execution_count AS [Avg Worker Time], +qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], +FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], +FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] +-- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan +FROM sys.procedures AS p WITH (NOLOCK) +INNER JOIN sys.dm_exec_procedure_stats AS qs WITH (NOLOCK) +ON p.[object_id] = qs.[object_id] +CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) AS qp +WHERE qs.database_id = DB_ID() +AND DATEDIFF(Minute, qs.cached_time, GETDATE()) > 0 +AND CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' +ORDER BY qs.execution_count DESC OPTION (RECOMPILE); +------ + +-- This helps you find the most frequently executed cached stored procedures that have missing index warnings +-- This can often help you find index tuning candidates + + + +-- Lists the top statements by average input/output usage for the current database (Query 60) (Top IO Statements) SELECT TOP(50) OBJECT_NAME(qt.objectid, dbid) AS [SP Name], (qs.total_logical_reads + qs.total_logical_writes) /qs.execution_count AS [Avg IO], qs.execution_count AS [Execution Count], SUBSTRING(qt.[text],qs.statement_start_offset/2, @@ -1483,7 +1521,7 @@ ORDER BY [Avg IO] DESC OPTION (RECOMPILE); --- Possible Bad NC Indexes (writes > reads) (Query 62) (Bad NC Indexes) +-- Possible Bad NC Indexes (writes > reads) (Query 61) (Bad NC Indexes) SELECT SCHEMA_NAME(o.[schema_id]) AS [Schema Name], OBJECT_NAME(s.[object_id]) AS [Table Name], i.name AS [Index Name], i.index_id, @@ -1509,14 +1547,11 @@ ORDER BY [Difference] DESC, [Total Writes] DESC, [Total Reads] ASC OPTION (RECOM -- Investigate further before dropping an index! --- Missing Indexes for current database by Index Advantage (Query 63) (Missing Indexes) -SELECT CONVERT(decimal(18,2), user_seeks * avg_total_user_cost * (avg_user_impact * 0.01)) AS [index_advantage], +-- Missing Indexes for current database by Index Advantage (Query 62) (Missing Indexes) +SELECT DISTINCT CONVERT(decimal(18,2), migs.user_seeks * migs.avg_total_user_cost * (migs.avg_user_impact * 0.01)) AS [index_advantage], migs.last_user_seek, mid.[statement] AS [Database.Schema.Table], -COUNT(1) OVER(PARTITION BY mid.[statement]) AS [missing_indexes_for_table], -COUNT(1) OVER(PARTITION BY mid.[statement], equality_columns) AS [similar_missing_indexes_for_table], mid.equality_columns, mid.inequality_columns, mid.included_columns, -migs.unique_compiles, migs.user_seeks, -CONVERT(decimal(18,2), migs.avg_total_user_cost) AS [avg_total_user_cost], migs.avg_user_impact, +migs.user_seeks, migs.avg_total_user_cost, migs.avg_user_impact, OBJECT_NAME(mid.[object_id]) AS [Table Name], p.rows AS [Table Rows] FROM sys.dm_db_missing_index_group_stats AS migs WITH (NOLOCK) INNER JOIN sys.dm_db_missing_index_groups AS mig WITH (NOLOCK) @@ -1533,12 +1568,13 @@ ORDER BY index_advantage DESC OPTION (RECOMPILE); -- Look at index advantage, last user seek time, number of user seeks to help determine source and importance -- SQL Server is overly eager to add included columns, so beware -- Do not just blindly add indexes that show up from this query!!! +-- Hkan Winther has given me some great suggestions for this query --- Find missing index warnings for cached plans in the current database (Query 64) (Missing Index Warnings) +-- Find missing index warnings for cached plans in the current database (Query 63) (Missing Index Warnings) -- Note: This query could take some time on a busy instance SELECT TOP(25) OBJECT_NAME(objectid) AS [ObjectName], - cp.objtype, cp.usecounts, cp.size_in_bytes, query_plan + cp.objtype, cp.usecounts, cp.size_in_bytes, qp.query_plan FROM sys.dm_exec_cached_plans AS cp WITH (NOLOCK) CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) AS qp WHERE CAST(query_plan AS NVARCHAR(MAX)) LIKE N'%MissingIndex%' @@ -1552,7 +1588,7 @@ ORDER BY cp.usecounts DESC OPTION (RECOMPILE); -- Breaks down buffers used by current database by object (table, index) in the buffer cache (Query 64) (Buffer Usage) -- Note: This query could take some time on a busy instance -SELECT SCHEMA_NAME(o.Schema_ID) AS [Schema Name], +SELECT fg.name AS [Filegroup Name], SCHEMA_NAME(o.Schema_ID) AS [Schema Name], OBJECT_NAME(p.[object_id]) AS [Object Name], p.index_id, CAST(COUNT(*)/128.0 AS DECIMAL(10, 2)) AS [Buffer size(MB)], COUNT(*) AS [BufferCount], p.[Rows] AS [Row Count], @@ -1564,12 +1600,17 @@ INNER JOIN sys.partitions AS p WITH (NOLOCK) ON a.container_id = p.hobt_id INNER JOIN sys.objects AS o WITH (NOLOCK) ON p.object_id = o.object_id +INNER JOIN sys.database_files AS f WITH (NOLOCK) +ON b.file_id = f.file_id +INNER JOIN sys.filegroups AS fg WITH (NOLOCK) +ON f.data_space_id = fg.data_space_id WHERE b.database_id = CONVERT(int, DB_ID()) AND p.[object_id] > 100 AND OBJECT_NAME(p.[object_id]) NOT LIKE N'plan_%' AND OBJECT_NAME(p.[object_id]) NOT LIKE N'sys%' AND OBJECT_NAME(p.[object_id]) NOT LIKE N'xml_index_nodes%' -GROUP BY o.Schema_ID, p.[object_id], p.index_id, p.data_compression_desc, p.[Rows] +GROUP BY fg.name, o.Schema_ID, p.[object_id], p.index_id, + p.data_compression_desc, p.[Rows] ORDER BY [BufferCount] DESC OPTION (RECOMPILE); ------ @@ -1579,7 +1620,7 @@ ORDER BY [BufferCount] DESC OPTION (RECOMPILE); -- Get Table names, row counts, and compression status for clustered index or heap (Query 65) (Table Sizes) SELECT SCHEMA_NAME(o.Schema_ID) AS [Schema Name], OBJECT_NAME(p.object_id) AS [ObjectName], -SUM(p.Rows) AS [RowCount], data_compression_desc AS [CompressionType] +SUM(p.Rows) AS [RowCount], p.data_compression_desc AS [Compression Type] FROM sys.partitions AS p WITH (NOLOCK) INNER JOIN sys.objects AS o WITH (NOLOCK) ON p.object_id = o.object_id @@ -1650,6 +1691,7 @@ ORDER BY STATS_DATE(i.[object_id], i.index_id) DESC OPTION (RECOMPILE); + -- Look at most frequently modified indexes and statistics (Query 68) (Volatile Indexes) SELECT o.[name] AS [Object Name], o.[object_id], o.[type_desc], s.[name] AS [Statistics Name], s.stats_id, s.no_recompute, s.auto_created, s.is_incremental, s.is_temporary, @@ -1691,7 +1733,8 @@ ORDER BY ps.avg_fragmentation_in_percent DESC OPTION (RECOMPILE); --- Index Read/Write stats (all tables in current DB) ordered by Reads (Query 70) (Overall Index Usage - Reads) -SELECT OBJECT_NAME(i.[object_id]) AS [ObjectName], i.[name] AS [IndexName], i.index_id, +SELECT SCHEMA_NAME(t.[schema_id]) AS [SchemaName], OBJECT_NAME(i.[object_id]) AS [ObjectName], + i.[name] AS [IndexName], i.index_id, s.user_seeks, s.user_scans, s.user_lookups, s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], s.user_updates AS [Writes], @@ -1702,6 +1745,8 @@ LEFT OUTER JOIN sys.dm_db_index_usage_stats AS s WITH (NOLOCK) ON i.[object_id] = s.[object_id] AND i.index_id = s.index_id AND s.database_id = DB_ID() +LEFT OUTER JOIN sys.tables AS t WITH (NOLOCK) +ON t.[object_id] = i.[object_id] WHERE OBJECTPROPERTY(i.[object_id],'IsUserTable') = 1 ORDER BY s.user_seeks + s.user_scans + s.user_lookups DESC OPTION (RECOMPILE); -- Order by reads ------ @@ -1710,7 +1755,8 @@ ORDER BY s.user_seeks + s.user_scans + s.user_lookups DESC OPTION (RECOMPILE); - --- Index Read/Write stats (all tables in current DB) ordered by Writes (Query 71) (Overall Index Usage - Writes) -SELECT OBJECT_NAME(i.[object_id]) AS [ObjectName], i.[name] AS [IndexName], i.index_id, +SELECT SCHEMA_NAME(t.[schema_id]) AS [SchemaName],OBJECT_NAME(i.[object_id]) AS [ObjectName], + i.[name] AS [IndexName], i.index_id, s.user_updates AS [Writes], s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], i.[type_desc] AS [Index Type], i.fill_factor AS [Fill Factor], i.has_filter, i.filter_definition, s.last_system_update, s.last_user_update @@ -1719,6 +1765,8 @@ LEFT OUTER JOIN sys.dm_db_index_usage_stats AS s WITH (NOLOCK) ON i.[object_id] = s.[object_id] AND i.index_id = s.index_id AND s.database_id = DB_ID() +LEFT OUTER JOIN sys.tables AS t WITH (NOLOCK) +ON t.[object_id] = i.[object_id] WHERE OBJECTPROPERTY(i.[object_id],'IsUserTable') = 1 ORDER BY s.user_updates DESC OPTION (RECOMPILE); -- Order by writes ------ @@ -1808,36 +1856,10 @@ ORDER BY bs.backup_finish_date DESC OPTION (RECOMPILE); -- Have you done any backup tuning with striped backups, or changing the parameters of the backup command? --- These five Pluralsight Courses go into more detail about how to run these queries and interpret the results - --- SQL Server 2017: Diagnosing Performance Issues with DMVs --- https://bit.ly/2FqCeti - --- SQL Server 2017: Diagnosing Configuration Issues with DMVs --- https://bit.ly/2MSUDUL - --- SQL Server 2014 DMV Diagnostic Queries Part 1 --- https://bit.ly/2plxCer - --- SQL Server 2014 DMV Diagnostic Queries Part 2 --- https://bit.ly/2IuJpzI - --- SQL Server 2014 DMV Diagnostic Queries Part 3 --- https://bit.ly/2FIlCPb - - - --- Sign up for Microsoft Visual Studio Dev Essentials and get a free three month pass to Pluralsight - -- Microsoft Visual Studio Dev Essentials --- http://bit.ly/1q6xbDL - - --- Sign up for Microsoft Azure Essentials and get lots of free Azure usage credits, MCP exam voucher, three month Pluralsight subscription +-- https://bit.ly/2qjNRxi --- Microsoft Azure Essentials --- https://bit.ly/2JMWe8x +-- Microsoft Azure Learn +-- https://bit.ly/2O0Hacc --- August 2017 blog series about upgrading and migrating to SQL Server 2016/2017 --- https://bit.ly/2ftKVrX diff --git a/Scripts/SQL Server 2016 Diagnostic Information Queries.sql b/Scripts/SQL Server 2016 Diagnostic Information Queries.sql index 985c076c..0d8bc109 100644 --- a/Scripts/SQL Server 2016 Diagnostic Information Queries.sql +++ b/Scripts/SQL Server 2016 Diagnostic Information Queries.sql @@ -1,7 +1,7 @@ -- SQL Server 2016 Diagnostic Information Queries -- Glenn Berry --- Last Modified: July 12, 2019 +-- Last Modified: December 4, 2019 -- https://www.sqlskills.com/blogs/glenn/ -- http://sqlserverperformance.wordpress.com/ -- Twitter: GlennAlanBerry @@ -90,6 +90,9 @@ SELECT @@SERVERNAME AS [Server Name], @@VERSION AS [SQL Server and OS Version In -- 13.0.4550.1 SP1 CU13 1/23/2019 ----> 13.0.5264.1 SP2 CU5 1/23/2019 -- 13.0.4560.0 SP1 CU14 3/19/2019 ----> 13.0.5292.0 SP2 CU6 3/19/2019 -- 13.0.4574.0 SP1 CU15 5/16/2019 ----> 13.0.5337.0 SP2 CU7 5/22/2019 +-- 13.0.5426.0 SP2 CU8 7/31/2019 +-- 13.0.5470.0 SP2 CU9 9/30/2019 +-- 13.0.5492.2 SP2 CU10 10/8/2019 -- How to determine the version, edition and update level of SQL Server and its components @@ -223,6 +226,12 @@ DBCC TRACESTATUS (-1); -- TF 6534 - Enables use of native code to improve performance with spatial data -- https://bit.ly/2HrQUpU +-- TF 7745 - Prevents Query Store data from being written to disk in case of a failover or shutdown command +-- https://bit.ly/2GU69Km + +-- TF 7752 - Enables asynchronous load of Query Store +-- This allows a database to become online and queries to be executed before the Query Store has been fully recovered + -- The behavior of TF 1117, 1118 are enabled for tempdb in SQL Server 2016 by default -- SQL 2016 It Just Runs Faster: -T1117 and -T1118 changes for TEMPDB and user databases -- https://bit.ly/2lbNWxK @@ -237,26 +246,8 @@ DBCC TRACESTATUS (-1); --- Returns status of instant file initialization (Query 6) (IFI Status) -EXEC sys.xp_readerrorlog 0, 1, N'Database Instant File Initialization'; ------- - --- Lets you determine whether Instant File Initialization (IFI) is enabled for the instance --- This should be enabled in the vast majority of cases --- SQL Server 2016 lets you enable this during the SQL server installation process - --- Note: This query won't return any results if the SQL Server error log has been recycled --- Query 8 has a instant_file_initialization_enabled column that will show the status of IFI (if you have SP1 or later) - --- Database Instant File Initialization --- https://bit.ly/2nTX74y - --- Misconceptions around instant file initialization --- https://bit.ly/2oBSKgZ - - --- SQL Server Process Address space info (Query 7) (Process Memory) +-- SQL Server Process Address space info (Query 6) (Process Memory) -- (shows whether locked pages is enabled, among other things) SELECT physical_memory_in_use_kb/1024 AS [SQL Server Memory Usage (MB)], locked_page_allocations_kb/1024 AS [SQL Server Locked Pages Allocation (MB)], @@ -279,7 +270,7 @@ FROM sys.dm_os_process_memory WITH (NOLOCK) OPTION (RECOMPILE); --- SQL Server Services information (Query 8) (SQL Server Services Info) +-- SQL Server Services information (Query 7) (SQL Server Services Info) SELECT servicename, process_id, startup_type_desc, status_desc, last_startup_time, service_account, is_clustered, cluster_nodename, [filename], instant_file_initialization_enabled -- New in SQL Server 2016 SP1 @@ -295,7 +286,7 @@ FROM sys.dm_server_services WITH (NOLOCK) OPTION (RECOMPILE); -- https://bit.ly/2oKa1Un --- Last backup information by database (Query 9) (Last Backup By Database) +-- Last backup information by database (Query 8) (Last Backup By Database) SELECT ISNULL(d.[name], bs.[database_name]) AS [Database], d.recovery_model_desc AS [Recovery Model], d.log_reuse_wait_desc AS [Log Reuse Wait Desc], MAX(CASE WHEN [type] = 'D' THEN bs.backup_finish_date ELSE NULL END) AS [Last Full Backup], @@ -313,7 +304,7 @@ ORDER BY d.recovery_model_desc, d.[name] OPTION (RECOMPILE); -- This helps you spot runaway transaction logs and other issues with your backup schedule --- Get SQL Server Agent jobs and Category information (Query 10) (SQL Server Agent Jobs) +-- Get SQL Server Agent jobs and Category information (Query 9) (SQL Server Agent Jobs) SELECT sj.name AS [Job Name], sj.[description] AS [Job Description], SUSER_SNAME(sj.owner_sid) AS [Job Owner], sj.date_created AS [Date Created], sj.[enabled] AS [Job Enabled], sj.notify_email_operator_id, sj.notify_level_email, sc.name AS [CategoryName], @@ -340,7 +331,7 @@ ORDER BY sj.name OPTION (RECOMPILE); -- https://bit.ly/1pgchQu --- Get SQL Server Agent Alert Information (Query 11) (SQL Server Agent Alerts) +-- Get SQL Server Agent Alert Information (Query 10) (SQL Server Agent Alerts) SELECT name, event_source, message_id, severity, [enabled], has_notification, delay_between_responses, occurrence_count, last_occurrence_date, last_occurrence_time FROM msdb.dbo.sysalerts WITH (NOLOCK) @@ -353,7 +344,7 @@ ORDER BY name OPTION (RECOMPILE); --- Windows information (Query 12) (Windows Info) +-- Windows information (Query 11) (Windows Info) SELECT windows_release, windows_service_pack_level, windows_sku, os_language_version FROM sys.dm_os_windows_info WITH (NOLOCK) OPTION (RECOMPILE); @@ -387,7 +378,7 @@ FROM sys.dm_os_windows_info WITH (NOLOCK) OPTION (RECOMPILE); -- https://bit.ly/2F7Ax0P --- SQL Server NUMA Node information (Query 13) (SQL Server NUMA Info) +-- SQL Server NUMA Node information (Query 12) (SQL Server NUMA Info) SELECT node_id, node_state_desc, memory_node_id, processor_group, online_scheduler_count, idle_scheduler_count, active_worker_count, avg_load_balance, resource_monitor_state FROM sys.dm_os_nodes WITH (NOLOCK) @@ -407,7 +398,7 @@ WHERE node_state_desc <> N'ONLINE DAC' OPTION (RECOMPILE); --- Good basic information about OS memory amounts and state (Query 14) (System Memory) +-- Good basic information about OS memory amounts and state (Query 13) (System Memory) SELECT total_physical_memory_kb/1024 AS [Physical Memory (MB)], available_physical_memory_kb/1024 AS [Available Memory (MB)], total_page_file_kb/1024 AS [Total Page File (MB)], @@ -435,7 +426,7 @@ FROM sys.dm_os_sys_memory WITH (NOLOCK) OPTION (RECOMPILE); -- You can skip the next two queries if you know you don't have a clustered instance --- Get information about your cluster nodes and their status (Query 15) (Cluster Node Properties) +-- Get information about your cluster nodes and their status (Query 14) (Cluster Node Properties) -- (if your database server is in a failover cluster) SELECT NodeName, status_description, is_current_owner FROM sys.dm_os_cluster_nodes WITH (NOLOCK) OPTION (RECOMPILE); @@ -449,7 +440,7 @@ FROM sys.dm_os_cluster_nodes WITH (NOLOCK) OPTION (RECOMPILE); -- https://bit.ly/1z5BfCw --- Get information about any AlwaysOn AG cluster this instance is a part of (Query 16) (AlwaysOn AG Cluster) +-- Get information about any AlwaysOn AG cluster this instance is a part of (Query 15) (AlwaysOn AG Cluster) SELECT cluster_name, quorum_type_desc, quorum_state_desc FROM sys.dm_hadr_cluster WITH (NOLOCK) OPTION (RECOMPILE); ------ @@ -457,7 +448,7 @@ FROM sys.dm_hadr_cluster WITH (NOLOCK) OPTION (RECOMPILE); -- You will see no results if your instance is not using AlwaysOn AGs --- Good overview of AG health and status (Query 17) (AlwaysOn AG Status) +-- Good overview of AG health and status (Query 16) (AlwaysOn AG Status) SELECT ag.name AS [AG Name], ar.replica_server_name, ar.availability_mode_desc, adc.[database_name], drs.is_local, drs.is_primary_replica, drs.synchronization_state_desc, drs.is_commit_participant, drs.synchronization_health_desc, drs.recovery_lsn, drs.truncation_lsn, drs.last_sent_lsn, @@ -482,7 +473,7 @@ ORDER BY ag.name, ar.replica_server_name, adc.[database_name] OPTION (RECOMPILE) -- https://bit.ly/2dn1H6r --- Hardware information from SQL Server 2016 (Query 18) (Hardware Info) +-- Hardware information from SQL Server 2016 (Query 17) (Hardware Info) SELECT cpu_count AS [Logical CPU Count], scheduler_count, hyperthread_ratio AS [Hyperthread Ratio], cpu_count/hyperthread_ratio AS [Physical CPU Count], @@ -520,7 +511,7 @@ FROM sys.dm_os_sys_info WITH (NOLOCK) OPTION (RECOMPILE); -- LARGE_PAGES --- Get System Manufacturer and model number from SQL Server Error log (Query 19) (System Manufacturer) +-- Get System Manufacturer and model number from SQL Server Error log (Query 18) (System Manufacturer) EXEC sys.xp_readerrorlog 0, 1, N'Manufacturer'; ------ @@ -530,7 +521,7 @@ EXEC sys.xp_readerrorlog 0, 1, N'Manufacturer'; -- This query will return no results if your error log has been recycled since the instance was started --- Get pvscsi info from Windows Registry (Query 20) (PVSCSI Driver Parameters) +-- Get pvscsi info from Windows Registry (Query 19) (PVSCSI Driver Parameters) EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SYSTEM\CurrentControlSet\services\pvscsi\Parameters\Device', N'DriverParameter'; ------ @@ -540,7 +531,7 @@ EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SYSTEM\CurrentControlSet\s --- Get BIOS date from Windows Registry (Query 21) (BIOS Date) +-- Get BIOS date from Windows Registry (Query 20) (BIOS Date) EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\System\BIOS', N'BiosReleaseDate'; ------ @@ -548,7 +539,7 @@ EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\Syste -- Not as useful for virtualization --- Get processor description from Windows Registry (Query 22) (Processor Description) +-- Get processor description from Windows Registry (Query 21) (Processor Description) EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\System\CentralProcessor\0', N'ProcessorNameString'; ------ @@ -565,7 +556,7 @@ EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\Syste --- Get information on location, time and size of any memory dumps from SQL Server (Query 23) (Memory Dump Info) +-- Get information on location, time and size of any memory dumps from SQL Server (Query 22) (Memory Dump Info) SELECT [filename], creation_time, size_in_bytes/1048576.0 AS [Size (MB)] FROM sys.dm_server_memory_dumps WITH (NOLOCK) ORDER BY creation_time DESC OPTION (RECOMPILE); @@ -579,7 +570,7 @@ ORDER BY creation_time DESC OPTION (RECOMPILE); --- Look at Suspect Pages table (Query 24) (Suspect Pages) +-- Look at Suspect Pages table (Query 23) (Suspect Pages) SELECT DB_NAME(database_id) AS [Database Name], [file_id], page_id, event_type, error_count, last_update_date FROM msdb.dbo.suspect_pages WITH (NOLOCK) @@ -602,7 +593,7 @@ ORDER BY database_id OPTION (RECOMPILE); -- https://bit.ly/2Fvr1c9 --- Get number of data files in tempdb database (Query 25) (TempDB Data Files) +-- Get number of data files in tempdb database (Query 24) (TempDB Data Files) EXEC sys.xp_readerrorlog 0, 1, N'The tempdb database has'; ------ @@ -611,7 +602,7 @@ EXEC sys.xp_readerrorlog 0, 1, N'The tempdb database has'; -- This query will return no results if your error log has been recycled since the instance was last started --- File names and paths for all user and system databases on instance (Query 26) (Database Filenames and Paths) +-- File names and paths for all user and system databases on instance (Query 25) (Database Filenames and Paths) SELECT DB_NAME([database_id]) AS [Database Name], [file_id], [name], physical_name, [type_desc], state_desc, is_percent_growth, growth, @@ -631,7 +622,7 @@ ORDER BY DB_NAME([database_id]), [file_id] OPTION (RECOMPILE); -- Is percent growth enabled for any files (which is bad)? --- Volume info for all LUNS that have database files on the current instance (Query 27) (Volume Info) +-- Volume info for all LUNS that have database files on the current instance (Query 26) (Volume Info) SELECT DISTINCT vs.volume_mount_point, vs.file_system_type, vs.logical_volume_name, CONVERT(DECIMAL(18,2), vs.total_bytes/1073741824.0) AS [Total Size (GB)], CONVERT(DECIMAL(18,2), vs.available_bytes/1073741824.0) AS [Available Size (GB)], @@ -651,7 +642,7 @@ ORDER BY vs.volume_mount_point OPTION (RECOMPILE); --- Drive level latency information (Query 28) (Drive Level Latency) +-- Drive level latency information (Query 27) (Drive Level Latency) -- Based on code from Jimmy May SELECT tab.[Drive], tab.volume_mount_point AS [Volume Mount Point], CASE @@ -696,7 +687,7 @@ ORDER BY [Overall Latency] OPTION (RECOMPILE); -- database files on each drive since SQL Server was last started --- Calculates average stalls per read, per write, and per total input/output for each database file (Query 29) (IO Latency by File) +-- Calculates average stalls per read, per write, and per total input/output for each database file (Query 28) (IO Latency by File) SELECT DB_NAME(fs.database_id) AS [Database Name], CAST(fs.io_stall_read_ms/(1.0 + fs.num_of_reads) AS NUMERIC(10,1)) AS [avg_read_latency_ms], CAST(fs.io_stall_write_ms/(1.0 + fs.num_of_writes) AS NUMERIC(10,1)) AS [avg_write_latency_ms], CAST((fs.io_stall_read_ms + fs.io_stall_write_ms)/(1.0 + fs.num_of_reads + fs.num_of_writes) AS NUMERIC(10,1)) AS [avg_io_latency_ms], @@ -717,7 +708,7 @@ ORDER BY avg_io_latency_ms DESC OPTION (RECOMPILE); -- database file since SQL Server was last started --- Look for I/O requests taking longer than 15 seconds in the six most recent SQL Server Error Logs (Query 30) (IO Warnings) +-- Look for I/O requests taking longer than 15 seconds in the six most recent SQL Server Error Logs (Query 29) (IO Warnings) CREATE TABLE #IOWarningResults(LogDate datetime, ProcessInfo sysname, LogText nvarchar(1000)); INSERT INTO #IOWarningResults @@ -753,7 +744,7 @@ DROP TABLE #IOWarningResults; -- https://bit.ly/2qtaw73 --- Resource Governor Resource Pool information (Query 31) (RG Resource Pools) +-- Resource Governor Resource Pool information (Query 30) (RG Resource Pools) SELECT pool_id, [Name], statistics_start_time, min_memory_percent, max_memory_percent, max_memory_kb/1024 AS [max_memory_mb], @@ -769,7 +760,7 @@ OPTION (RECOMPILE); --- Recovery model, log reuse wait description, log file size, log usage size (Query 32) (Database Properties) +-- Recovery model, log reuse wait description, log file size, log usage size (Query 31) (Database Properties) -- and compatibility level for all databases on instance SELECT db.[name] AS [Database Name], SUSER_SNAME(db.owner_sid) AS [Database Owner], db.recovery_model_desc AS [Recovery Model], db.state_desc, db.containment_desc, db.log_reuse_wait_desc AS [Log Reuse Wait Description], @@ -820,14 +811,13 @@ ORDER BY db.[name] OPTION (RECOMPILE); -- https://bit.ly/2pdggk3 --- Missing Indexes for all databases by Index Advantage (Query 33) (Missing Indexes All Databases) -SELECT CONVERT(decimal(18,2), user_seeks * avg_total_user_cost * (avg_user_impact * 0.01)) AS [index_advantage], +-- Missing Indexes for all databases by Index Advantage (Query 32) (Missing Indexes All Databases) +SELECT CONVERT(decimal(18,2), migs.user_seeks * migs.avg_total_user_cost * (migs.avg_user_impact * 0.01)) AS [index_advantage], FORMAT(migs.last_user_seek, 'yyyy-MM-dd HH:mm:ss') AS [last_user_seek], mid.[statement] AS [Database.Schema.Table], COUNT(1) OVER(PARTITION BY mid.[statement]) AS [missing_indexes_for_table], COUNT(1) OVER(PARTITION BY mid.[statement], equality_columns) AS [similar_missing_indexes_for_table], -mid.equality_columns, mid.inequality_columns, mid.included_columns, -migs.unique_compiles, migs.user_seeks, +mid.equality_columns, mid.inequality_columns, mid.included_columns, migs.user_seeks, CONVERT(decimal(18,2), migs.avg_total_user_cost) AS [avg_total_user_cost], migs.avg_user_impact FROM sys.dm_db_missing_index_group_stats AS migs WITH (NOLOCK) INNER JOIN sys.dm_db_missing_index_groups AS mig WITH (NOLOCK) @@ -842,13 +832,14 @@ ORDER BY index_advantage DESC OPTION (RECOMPILE); -- Also look at avg_user_impact and avg_total_user_cost to help determine importance -- SQL Server is overly eager to add included columns, so beware -- Do not just blindly add indexes that show up from this query!!! +-- Hkan Winther has given me some great suggestions for this query -- SQL Server Index Design Guide -- https://bit.ly/2qtZr4N --- Get VLF Counts for all databases on the instance (Query 34) (VLF Counts) +-- Get VLF Counts for all databases on the instance (Query 33) (VLF Counts) -- (adapted from Michelle Ufford) CREATE TABLE #VLFInfo (RecoveryUnitID int, FileID int, FileSize bigint, StartOffset bigint, @@ -889,7 +880,7 @@ DROP TABLE #VLFCountResults; --- Get CPU utilization by database (Query 35) (CPU Usage by Database) +-- Get CPU utilization by database (Query 34) (CPU Usage by Database) WITH DB_CPU_Stats AS (SELECT pa.DatabaseID, DB_Name(pa.DatabaseID) AS [Database Name], SUM(qs.total_worker_time/1000) AS [CPU_Time_Ms] @@ -910,7 +901,7 @@ ORDER BY [CPU Rank] OPTION (RECOMPILE); -- Note: This only reflects CPU usage from the currently cached query plans --- Get I/O utilization by database (Query 36) (IO Usage By Database) +-- Get I/O utilization by database (Query 35) (IO Usage By Database) WITH Aggregate_IO_Statistics AS (SELECT DB_NAME(database_id) AS [Database Name], CAST(SUM(num_of_bytes_read + num_of_bytes_written) / 1048576 AS DECIMAL(12, 2)) AS [ioTotalMB], @@ -934,7 +925,7 @@ ORDER BY [I/O Rank] OPTION (RECOMPILE); -- They include all I/O activity, not just the nominal I/O workload --- Get total buffer usage by database for current instance (Query 37) (Total Buffer Usage by Database) +-- Get total buffer usage by database for current instance (Query 36) (Total Buffer Usage by Database) -- This make take some time to run on a busy instance WITH AggregateBufferPoolUsage AS @@ -956,7 +947,7 @@ ORDER BY [Buffer Pool Rank] OPTION (RECOMPILE); -- Clear Wait Stats with this command -- DBCC SQLPERF('sys.dm_os_wait_stats', CLEAR); --- Isolate top waits for server instance since last restart or wait statistics clear (Query 38) (Top Waits) +-- Isolate top waits for server instance since last restart or wait statistics clear (Query 37) (Top Waits) WITH [Waits] AS (SELECT wait_type, wait_time_ms/ 1000.0 AS [WaitS], (wait_time_ms - signal_wait_time_ms) / 1000.0 AS [ResourceS], @@ -1039,7 +1030,7 @@ OPTION (RECOMPILE); --- Get a count of SQL connections by IP address (Query 39) (Connection Counts by IP Address) +-- Get a count of SQL connections by IP address (Query 38) (Connection Counts by IP Address) SELECT ec.client_net_address, es.[program_name], es.[host_name], es.login_name, COUNT(ec.session_id) AS [connection count] FROM sys.dm_exec_sessions AS es WITH (NOLOCK) @@ -1057,7 +1048,7 @@ ORDER BY ec.client_net_address, es.[program_name] OPTION (RECOMPILE); --- Get Average Task Counts (run multiple times) (Query 40) (Avg Task Counts) +-- Get Average Task Counts (run multiple times) (Query 39) (Avg Task Counts) SELECT AVG(current_tasks_count) AS [Avg Task Count], AVG(work_queue_count) AS [Avg Work Queue Count], AVG(runnable_tasks_count) AS [Avg Runnable Task Count], @@ -1078,7 +1069,7 @@ WHERE scheduler_id < 255 OPTION (RECOMPILE); --- Detect blocking (run multiple times) (Query 41) (Detect Blocking) +-- Detect blocking (run multiple times) (Query 40) (Detect Blocking) SELECT t1.resource_type AS [lock type], DB_NAME(resource_database_id) AS [database], t1.resource_associated_entity_id AS [blk object],t1.request_mode AS [lock req], -- lock requested t1.request_session_id AS [waiter sid], t2.wait_duration_ms AS [wait time], -- spid of waiter @@ -1107,7 +1098,7 @@ ON t1.lock_owner_address = t2.resource_address OPTION (RECOMPILE); --- Get CPU Utilization History for last 256 minutes (in one minute intervals) (Query 42) (CPU Utilization History) +-- Get CPU Utilization History for last 256 minutes (in one minute intervals) (Query 41) (CPU Utilization History) DECLARE @ts_now bigint = (SELECT cpu_ticks/(cpu_ticks/ms_ticks) FROM sys.dm_os_sys_info WITH (NOLOCK)); SELECT TOP(256) SQLProcessUtilization AS [SQL Server Process CPU Utilization], @@ -1132,7 +1123,7 @@ ORDER BY record_id DESC OPTION (RECOMPILE); -- on high core count (> 64 cores) systems --- Get top total worker time queries for entire instance (Query 43) (Top Worker Time Queries) +-- Get top total worker time queries for entire instance (Query 42) (Top Worker Time Queries) SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], REPLACE(REPLACE(LEFT(t.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text], qs.total_worker_time AS [Total Worker Time], qs.min_worker_time AS [Min Worker Time], @@ -1160,7 +1151,7 @@ ORDER BY qs.total_worker_time DESC OPTION (RECOMPILE); --- Page Life Expectancy (PLE) value for each NUMA node in current instance (Query 44) (PLE by NUMA Node) +-- Page Life Expectancy (PLE) value for each NUMA node in current instance (Query 43) (PLE by NUMA Node) SELECT @@SERVERNAME AS [Server Name], RTRIM([object_name]) AS [Object Name], instance_name, cntr_value AS [Page Life Expectancy] FROM sys.dm_os_performance_counters WITH (NOLOCK) @@ -1176,7 +1167,7 @@ AND counter_name = N'Page life expectancy' OPTION (RECOMPILE); -- https://bit.ly/2EgynLa --- Memory Grants Pending value for current instance (Query 45) (Memory Grants Pending) +-- Memory Grants Pending value for current instance (Query 44) (Memory Grants Pending) SELECT @@SERVERNAME AS [Server Name], RTRIM([object_name]) AS [Object Name], cntr_value AS [Memory Grants Pending] FROM sys.dm_os_performance_counters WITH (NOLOCK) WHERE [object_name] LIKE N'%Memory Manager%' -- Handles named instances @@ -1187,7 +1178,7 @@ AND counter_name = N'Memory Grants Pending' OPTION (RECOMPILE); -- Memory Grants Pending above zero for a sustained period is a very strong indicator of internal memory pressure --- Memory Clerk Usage for instance (Query 46) (Memory Clerk Usage) +-- Memory Clerk Usage for instance (Query 45) (Memory Clerk Usage) -- Look for high value for CACHESTORE_SQLCP (Ad-hoc query plans) SELECT TOP(10) mc.[type] AS [Memory Clerk Type], CAST((SUM(mc.pages_kb)/1024.0) AS DECIMAL (15,2)) AS [Memory Usage (MB)] @@ -1209,7 +1200,7 @@ ORDER BY SUM(mc.pages_kb) DESC OPTION (RECOMPILE); --- Find single-use, ad-hoc and prepared queries that are bloating the plan cache (Query 47) (Ad hoc Queries) +-- Find single-use, ad-hoc and prepared queries that are bloating the plan cache (Query 46) (Ad hoc Queries) SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], t.[text] AS [Query Text], cp.objtype AS [Object Type], cp.cacheobjtype AS [Cache Object Type], cp.size_in_bytes/1024 AS [Plan Size in KB] @@ -1230,7 +1221,7 @@ ORDER BY cp.size_in_bytes DESC, DB_NAME(t.[dbid]) OPTION (RECOMPILE); -- https://bit.ly/2EfYOkl --- Get top total logical reads queries for entire instance (Query 48) (Top Logical Reads Queries) +-- Get top total logical reads queries for entire instance (Query 47) (Top Logical Reads Queries) SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], REPLACE(REPLACE(LEFT(t.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text], qs.total_logical_reads AS [Total Logical Reads], @@ -1258,7 +1249,7 @@ ORDER BY qs.total_logical_reads DESC OPTION (RECOMPILE); -- Can also help track down parameter sniffing issues --- Get top average elapsed time queries for entire instance (Query 49) (Top Avg Elapsed Time Queries) +-- Get top average elapsed time queries for entire instance (Query 48) (Top Avg Elapsed Time Queries) SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], REPLACE(REPLACE(LEFT(t.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text], qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], @@ -1280,7 +1271,7 @@ ORDER BY qs.total_elapsed_time/qs.execution_count DESC OPTION (RECOMPILE); -- Can also help track down parameter sniffing issues --- Look at UDF execution statistics (Query 50) (UDF Stats by DB) +-- Look at UDF execution statistics (Query 49) (UDF Stats by DB) SELECT TOP (25) DB_NAME(database_id) AS [Database Name], OBJECT_NAME(object_id, database_id) AS [Function Name], total_worker_time, execution_count, total_elapsed_time, @@ -1303,7 +1294,7 @@ ORDER BY total_worker_time DESC OPTION (RECOMPILE); --USE YourDatabaseName; -- make sure to change to an actual database on your instance, not the master system database --GO --- Individual File Sizes and space available for current database (Query 51) (File Sizes and Space) +-- Individual File Sizes and space available for current database (Query 50) (File Sizes and Space) SELECT f.name AS [File Name] , f.physical_name AS [Physical Name], CAST((f.size/128.0) AS DECIMAL(15,2)) AS [Total Size in MB], CAST(f.size/128.0 - CAST(FILEPROPERTY(f.name, 'SpaceUsed') AS int)/128.0 AS DECIMAL(15,2)) @@ -1325,7 +1316,7 @@ ORDER BY f.[file_id] OPTION (RECOMPILE); -- https://bit.ly/2evRZSR --- Log space usage for current database (Query 52) (Log Space Usage) +-- Log space usage for current database (Query 51) (Log Space Usage) SELECT DB_NAME(lsu.database_id) AS [Database Name], db.recovery_model_desc AS [Recovery Model], CAST(lsu.total_log_size_in_bytes/1048576.0 AS DECIMAL(10, 2)) AS [Total Log Space (MB)], CAST(lsu.used_log_space_in_bytes/1048576.0 AS DECIMAL(10, 2)) AS [Used Log Space (MB)], @@ -1342,7 +1333,7 @@ OPTION (RECOMPILE); --- Get database scoped configuration values for current database (Query 53) (Database-scoped Configurations) +-- Get database scoped configuration values for current database (Query 52) (Database-scoped Configurations) SELECT configuration_id, name, [value] AS [value_for_primary], value_for_secondary FROM sys.database_scoped_configurations WITH (NOLOCK) OPTION (RECOMPILE); ------ @@ -1356,7 +1347,7 @@ FROM sys.database_scoped_configurations WITH (NOLOCK) OPTION (RECOMPILE); -- https://bit.ly/2sOH7nb --- I/O Statistics by file for the current database (Query 54) (IO Stats By File) +-- I/O Statistics by file for the current database (Query 53) (IO Stats By File) SELECT DB_NAME(DB_ID()) AS [Database Name], df.name AS [Logical Name], vfs.[file_id], df.type_desc, df.physical_name AS [Physical Name], CAST(vfs.size_on_disk_bytes/1048576.0 AS DECIMAL(16, 2)) AS [Size on Disk (MB)], vfs.num_of_reads, vfs.num_of_writes, vfs.io_stall_read_ms, vfs.io_stall_write_ms, @@ -1379,7 +1370,7 @@ ON vfs.[file_id]= df.[file_id] OPTION (RECOMPILE); --- Get most frequently executed queries for this database (Query 55) (Query Execution Counts) +-- Get most frequently executed queries for this database (Query 54) (Query Execution Counts) SELECT TOP(50) LEFT(t.[text], 50) AS [Short Query Text], qs.execution_count AS [Execution Count], qs.total_logical_reads AS [Total Logical Reads], qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], @@ -1398,9 +1389,9 @@ ORDER BY qs.execution_count DESC OPTION (RECOMPILE); ------ --- Queries 56 through 61 are the "Bad Man List" for stored procedures +-- Queries 55 through 60 are the "Bad Man List" for stored procedures --- Top Cached SPs By Execution Count (Query 56) (SP Execution Counts) +-- Top Cached SPs By Execution Count (Query 55) (SP Execution Counts) SELECT TOP(100) p.name AS [SP Name], qs.execution_count AS [Execution Count], ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], @@ -1423,7 +1414,7 @@ ORDER BY qs.execution_count DESC OPTION (RECOMPILE); -- This helps you characterize and baseline your workload --- Top Cached SPs By Avg Elapsed Time (Query 57) (SP Avg Elapsed Time) +-- Top Cached SPs By Avg Elapsed Time (Query 56) (SP Avg Elapsed Time) SELECT TOP(25) p.name AS [SP Name], qs.min_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], qs.max_elapsed_time, qs.last_elapsed_time, qs.total_elapsed_time, qs.execution_count, ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], @@ -1447,7 +1438,7 @@ ORDER BY avg_elapsed_time DESC OPTION (RECOMPILE); --- Top Cached SPs By Total Worker time. Worker time relates to CPU cost (Query 58) (SP Worker Time) +-- Top Cached SPs By Total Worker time. Worker time relates to CPU cost (Query 57) (SP Worker Time) SELECT TOP(25) p.name AS [SP Name], qs.total_worker_time AS [TotalWorkerTime], qs.total_worker_time/qs.execution_count AS [AvgWorkerTime], qs.execution_count, ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], @@ -1469,7 +1460,7 @@ ORDER BY qs.total_worker_time DESC OPTION (RECOMPILE); -- You should look at this if you see signs of CPU pressure --- Top Cached SPs By Total Logical Reads. Logical reads relate to memory pressure (Query 59) (SP Logical Reads) +-- Top Cached SPs By Total Logical Reads. Logical reads relate to memory pressure (Query 58) (SP Logical Reads) SELECT TOP(25) p.name AS [SP Name], qs.total_logical_reads AS [TotalLogicalReads], qs.total_logical_reads/qs.execution_count AS [AvgLogicalReads],qs.execution_count, ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], @@ -1491,7 +1482,7 @@ ORDER BY qs.total_logical_reads DESC OPTION (RECOMPILE); -- You should look at this if you see signs of memory pressure --- Top Cached SPs By Total Physical Reads. Physical reads relate to disk read I/O pressure (Query 60) (SP Physical Reads) +-- Top Cached SPs By Total Physical Reads. Physical reads relate to disk read I/O pressure (Query 59) (SP Physical Reads) SELECT TOP(25) p.name AS [SP Name],qs.total_physical_reads AS [TotalPhysicalReads], qs.total_physical_reads/qs.execution_count AS [AvgPhysicalReads], qs.execution_count, qs.total_logical_reads,qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], @@ -1513,7 +1504,7 @@ ORDER BY qs.total_physical_reads DESC, qs.total_logical_reads DESC OPTION (RECOM --- Top Cached SPs By Total Logical Writes (Query 61) (SP Logical Writes) +-- Top Cached SPs By Total Logical Writes (Query 60) (SP Logical Writes) -- Logical writes relate to both memory and disk I/O pressure SELECT TOP(25) p.name AS [SP Name], qs.total_logical_writes AS [TotalLogicalWrites], qs.total_logical_writes/qs.execution_count AS [AvgLogicalWrites], qs.execution_count, @@ -1537,7 +1528,7 @@ ORDER BY qs.total_logical_writes DESC OPTION (RECOMPILE); -- You should look at this if you see signs of I/O pressure or of memory pressure --- Lists the top statements by average input/output usage for the current database (Query 62) (Top IO Statements) +-- Lists the top statements by average input/output usage for the current database (Query 61) (Top IO Statements) SELECT TOP(50) OBJECT_NAME(qt.objectid, dbid) AS [SP Name], (qs.total_logical_reads + qs.total_logical_writes) /qs.execution_count AS [Avg IO], qs.execution_count AS [Execution Count], SUBSTRING(qt.[text],qs.statement_start_offset/2, @@ -1556,7 +1547,7 @@ ORDER BY [Avg IO] DESC OPTION (RECOMPILE); --- Possible Bad NC Indexes (writes > reads) (Query 63) (Bad NC Indexes) +-- Possible Bad NC Indexes (writes > reads) (Query 62) (Bad NC Indexes) SELECT SCHEMA_NAME(o.[schema_id]) AS [Schema Name], OBJECT_NAME(s.[object_id]) AS [Table Name], i.name AS [Index Name], i.index_id, @@ -1582,14 +1573,11 @@ ORDER BY [Difference] DESC, [Total Writes] DESC, [Total Reads] ASC OPTION (RECOM -- Investigate further before dropping an index! --- Missing Indexes for current database by Index Advantage (Query 64) (Missing Indexes) -SELECT CONVERT(decimal(18,2), user_seeks * avg_total_user_cost * (avg_user_impact * 0.01)) AS [index_advantage], +-- Missing Indexes for current database by Index Advantage (Query 63) (Missing Indexes) +SELECT DISTINCT CONVERT(decimal(18,2), migs.user_seeks * migs.avg_total_user_cost * (migs.avg_user_impact * 0.01)) AS [index_advantage], migs.last_user_seek, mid.[statement] AS [Database.Schema.Table], -COUNT(1) OVER(PARTITION BY mid.[statement]) AS [missing_indexes_for_table], -COUNT(1) OVER(PARTITION BY mid.[statement], equality_columns) AS [similar_missing_indexes_for_table], mid.equality_columns, mid.inequality_columns, mid.included_columns, -migs.unique_compiles, migs.user_seeks, -CONVERT(decimal(18,2), migs.avg_total_user_cost) AS [avg_total_user_cost], migs.avg_user_impact, +migs.user_seeks, migs.avg_total_user_cost, migs.avg_user_impact, OBJECT_NAME(mid.[object_id]) AS [Table Name], p.rows AS [Table Rows] FROM sys.dm_db_missing_index_group_stats AS migs WITH (NOLOCK) INNER JOIN sys.dm_db_missing_index_groups AS mig WITH (NOLOCK) @@ -1606,12 +1594,13 @@ ORDER BY index_advantage DESC OPTION (RECOMPILE); -- Look at index advantage, last user seek time, number of user seeks to help determine source and importance -- SQL Server is overly eager to add included columns, so beware -- Do not just blindly add indexes that show up from this query!!! +-- Hkan Winther has given me some great suggestions for this query --- Find missing index warnings for cached plans in the current database (Query 65) (Missing Index Warnings) +-- Find missing index warnings for cached plans in the current database (Query 64) (Missing Index Warnings) -- Note: This query could take some time on a busy instance SELECT TOP(25) OBJECT_NAME(objectid) AS [ObjectName], - cp.objtype, cp.usecounts, cp.size_in_bytes, query_plan + cp.objtype, cp.usecounts, cp.size_in_bytes, qp.query_plan FROM sys.dm_exec_cached_plans AS cp WITH (NOLOCK) CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) AS qp WHERE CAST(query_plan AS NVARCHAR(MAX)) LIKE N'%MissingIndex%' @@ -1623,7 +1612,7 @@ ORDER BY cp.usecounts DESC OPTION (RECOMPILE); -- This can help you decide whether to add them or not --- Breaks down buffers used by current database by object (table, index) in the buffer cache (Query 66) (Buffer Usage) +-- Breaks down buffers used by current database by object (table, index) in the buffer cache (Query 65) (Buffer Usage) -- Note: This query could take some time on a busy instance SELECT SCHEMA_NAME(o.Schema_ID) AS [Schema Name], OBJECT_NAME(p.[object_id]) AS [Object Name], p.index_id, @@ -1650,9 +1639,9 @@ ORDER BY [BufferCount] DESC OPTION (RECOMPILE); -- It can help identify possible candidates for data compression --- Get Table names, row counts, and compression status for clustered index or heap (Query 67) (Table Sizes) +-- Get Table names, row counts, and compression status for clustered index or heap (Query 66) (Table Sizes) SELECT SCHEMA_NAME(o.Schema_ID) AS [Schema Name], OBJECT_NAME(p.object_id) AS [ObjectName], -SUM(p.Rows) AS [RowCount], data_compression_desc AS [CompressionType] +SUM(p.Rows) AS [RowCount], p.data_compression_desc AS [Compression Type] FROM sys.partitions AS p WITH (NOLOCK) INNER JOIN sys.objects AS o WITH (NOLOCK) ON p.object_id = o.object_id @@ -1675,7 +1664,7 @@ ORDER BY SUM(p.Rows) DESC OPTION (RECOMPILE); --- Get some key table properties (Query 68) (Table Properties) +-- Get some key table properties (Query 67) (Table Properties) SELECT OBJECT_NAME(t.[object_id]) AS [ObjectName], p.[rows] AS [Table Rows], p.index_id, p.data_compression_desc AS [Index Data Compression], t.create_date, t.lock_on_bulk_load, t.is_replicated, t.has_replication_filter, @@ -1698,7 +1687,7 @@ ORDER BY OBJECT_NAME(t.[object_id]), p.index_id OPTION (RECOMPILE); --- When were Statistics last updated on all indexes? (Query 69) (Statistics Update) +-- When were Statistics last updated on all indexes? (Query 68) (Statistics Update) SELECT SCHEMA_NAME(o.Schema_ID) + N'.' + o.[NAME] AS [Object Name], o.[type_desc] AS [Object Type], i.[name] AS [Index Name], STATS_DATE(i.[object_id], i.index_id) AS [Statistics Date], s.auto_created, s.no_recompute, s.user_created, s.is_incremental, s.is_temporary, @@ -1728,7 +1717,7 @@ ORDER BY STATS_DATE(i.[object_id], i.index_id) DESC OPTION (RECOMPILE); --- Look at most frequently modified indexes and statistics (Query 70) (Volatile Indexes) +-- Look at most frequently modified indexes and statistics (Query 69) (Volatile Indexes) SELECT o.[name] AS [Object Name], o.[object_id], o.[type_desc], s.[name] AS [Statistics Name], s.stats_id, s.no_recompute, s.auto_created, s.is_incremental, s.is_temporary, sp.modification_counter, sp.[rows], sp.rows_sampled, sp.last_updated @@ -1746,7 +1735,7 @@ ORDER BY sp.modification_counter DESC, o.name OPTION (RECOMPILE); --- Get fragmentation info for all indexes above a certain size in the current database (Query 71) (Index Fragmentation) +-- Get fragmentation info for all indexes above a certain size in the current database (Query 70) (Index Fragmentation) -- Note: This query could take some time on a very large database SELECT DB_NAME(ps.database_id) AS [Database Name], SCHEMA_NAME(o.[schema_id]) AS [Schema Name], OBJECT_NAME(ps.OBJECT_ID) AS [Object Name], i.[name] AS [Index Name], ps.index_id, @@ -1768,7 +1757,7 @@ ORDER BY ps.avg_fragmentation_in_percent DESC OPTION (RECOMPILE); -- and how effective your index maintenance strategy is ---- Index Read/Write stats (all tables in current DB) ordered by Reads (Query 72) (Overall Index Usage - Reads) +--- Index Read/Write stats (all tables in current DB) ordered by Reads (Query 71) (Overall Index Usage - Reads) SELECT OBJECT_NAME(i.[object_id]) AS [ObjectName], i.[name] AS [IndexName], i.index_id, s.user_seeks, s.user_scans, s.user_lookups, s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], @@ -1787,7 +1776,7 @@ ORDER BY s.user_seeks + s.user_scans + s.user_lookups DESC OPTION (RECOMPILE); - -- Show which indexes in the current database are most active for Reads ---- Index Read/Write stats (all tables in current DB) ordered by Writes (Query 73) (Overall Index Usage - Writes) +--- Index Read/Write stats (all tables in current DB) ordered by Writes (Query 72) (Overall Index Usage - Writes) SELECT OBJECT_NAME(i.[object_id]) AS [ObjectName], i.[name] AS [IndexName], i.index_id, s.user_updates AS [Writes], s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], i.[type_desc] AS [Index Type], i.fill_factor AS [Fill Factor], i.has_filter, i.filter_definition, @@ -1804,7 +1793,7 @@ ORDER BY s.user_updates DESC OPTION (RECOMPILE); -- Order by writes -- Show which indexes in the current database are most active for Writes --- Get in-memory OLTP index usage (Query 74) (XTP Index Usage) +-- Get in-memory OLTP index usage (Query 73) (XTP Index Usage) SELECT OBJECT_NAME(i.[object_id]) AS [Object Name], i.index_id, i.[name] AS [Index Name], i.[type_desc], xis.scans_started, xis.scans_retries, xis.rows_touched, xis.rows_returned @@ -1822,7 +1811,7 @@ ORDER BY OBJECT_NAME(i.[object_id]) OPTION (RECOMPILE); -- https://bit.ly/2GCP8lF --- Look at Columnstore index physical statistics (Query 75) (Columnstore Index Physical Stat) +-- Look at Columnstore index physical statistics (Query 74) (Columnstore Index Physical Stat) SELECT OBJECT_NAME(ps.object_id) AS [TableName], i.[name] AS [IndexName], ps.index_id, ps.partition_number, ps.delta_store_hobt_id, ps.state_desc, ps.total_rows, ps.size_in_bytes, @@ -1840,7 +1829,7 @@ ORDER BY ps.object_id, ps.partition_number, ps.row_group_id OPTION (RECOMPILE); -- https://bit.ly/2q276XQ --- Get lock waits for current database (Query 76) (Lock Waits) +-- Get lock waits for current database (Query 75) (Lock Waits) SELECT o.name AS [table_name], i.name AS [index_name], ios.index_id, ios.partition_number, SUM(ios.row_lock_wait_count) AS [total_row_lock_waits], SUM(ios.row_lock_wait_in_ms) AS [total_row_lock_wait_in_ms], @@ -1863,7 +1852,7 @@ ORDER BY total_lock_wait_in_ms DESC OPTION (RECOMPILE); --- Look at UDF execution statistics (Query 77) (UDF Statistics) +-- Look at UDF execution statistics (Query 76) (UDF Statistics) SELECT OBJECT_NAME(object_id) AS [Function Name], execution_count, total_worker_time, total_logical_reads, total_physical_reads, total_elapsed_time, total_elapsed_time/execution_count AS [avg_elapsed_time], @@ -1881,7 +1870,7 @@ ORDER BY total_worker_time DESC OPTION (RECOMPILE); -- https://bit.ly/2q1Q6BM --- Get Query Store Options for this database (Query 78) (QueryStore Options) +-- Get Query Store Options for this database (Query 77) (QueryStore Options) SELECT actual_state_desc, desired_state_desc, [interval_length_minutes], current_storage_size_mb, [max_storage_size_mb], query_capture_mode_desc, size_based_cleanup_mode_desc @@ -1896,7 +1885,7 @@ FROM sys.database_query_store_options WITH (NOLOCK) OPTION (RECOMPILE); --- Get input buffer information for the current database (Query 79) (Input Buffer) +-- Get input buffer information for the current database (Query 78) (Input Buffer) SELECT es.session_id, DB_NAME(es.database_id) AS [Database Name], es.login_time, es.cpu_time, es.logical_reads, es.[status], ib.event_info AS [Input Buffer] @@ -1914,7 +1903,7 @@ AND es.session_id <> @@SPID OPTION (RECOMPILE); --- Look at recent Full backups for the current database (Query 80) (Recent Full Backups) +-- Look at recent Full backups for the current database (Query 79) (Recent Full Backups) SELECT TOP (30) bs.machine_name, bs.server_name, bs.database_name AS [Database Name], bs.recovery_model, CONVERT (BIGINT, bs.backup_size / 1048576 ) AS [Uncompressed Backup Size (MB)], CONVERT (BIGINT, bs.compressed_backup_size / 1048576 ) AS [Compressed Backup Size (MB)], @@ -1941,7 +1930,10 @@ ORDER BY bs.backup_finish_date DESC OPTION (RECOMPILE); -- https://bit.ly/28Rpb2x --- These five Pluralsight Courses go into more detail about how to run these queries and interpret the results +-- These six Pluralsight Courses go into more detail about how to run these queries and interpret the results + +-- Azure SQL Database: Diagnosing Performance Issues with DMVs +-- https://bit.ly/2meDRCN -- SQL Server 2017: Diagnosing Performance Issues with DMVs -- https://bit.ly/2FqCeti @@ -1960,20 +1952,13 @@ ORDER BY bs.backup_finish_date DESC OPTION (RECOMPILE); --- Sign up for Microsoft Visual Studio Dev Essentials and get a free three month pass to Pluralsight - -- Microsoft Visual Studio Dev Essentials --- http://bit.ly/1q6xbDL - - --- Sign up for Microsoft Azure Essentials and get lots of free Azure usage credits, MCP exam voucher, three month Pluralsight subscription - --- Microsoft Azure Essentials --- https://bit.ly/2JMWe8x +-- https://bit.ly/2qjNRxi +-- Microsoft Azure Learn +-- https://bit.ly/2O0Hacc -- August 2017 blog series about upgrading and migrating to SQL Server 2016/2017 -- https://bit.ly/2ftKVrX - diff --git a/Scripts/SQL Server 2016 SP1 Diagnostic Information Queries.sql b/Scripts/SQL Server 2016 SP1 Diagnostic Information Queries.sql new file mode 100644 index 00000000..061677ad --- /dev/null +++ b/Scripts/SQL Server 2016 SP1 Diagnostic Information Queries.sql @@ -0,0 +1,2015 @@ + +-- SQL Server 2016 Diagnostic Information Queries +-- Glenn Berry +-- Last Modified: December 3, 2020 +-- https://glennsqlperformance.com/ +-- https://sqlserverperformance.wordpress.com/ +-- YouTube: https://bit.ly/2PkoAM1 +-- Twitter: GlennAlanBerry + +-- Diagnostic Queries are available here +-- https://glennsqlperformance.com/resources/ + + +-- Please make sure you are using the correct version of these diagnostic queries for your version of SQL Server + + +-- If you like PowerShell, there is a very useful community solution for running these queries in an automated fashion +-- https://dbatools.io/ + +-- Invoke-DbaDiagnosticQuery +-- https://dbatools.io/functions/invoke-dbadiagnosticquery/ + + +--****************************************************************************** +--* Copyright (C) 2020 Glenn Berry +--* All rights reserved. +--* +--* +--* You may alter this code for your own *non-commercial* purposes. You may +--* republish altered code as long as you include this copyright and give due credit. +--* +--* +--* THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF +--* ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED +--* TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A +--* PARTICULAR PURPOSE. +--* +--****************************************************************************** + +-- Check the major product version to see if it is SQL Server 2016 CTP 2 or greater +IF NOT EXISTS (SELECT * WHERE CONVERT(varchar(128), SERVERPROPERTY('ProductVersion')) LIKE '13%') + BEGIN + DECLARE @ProductVersion varchar(128) = CONVERT(varchar(128), SERVERPROPERTY('ProductVersion')); + RAISERROR ('Script does not match the ProductVersion [%s] of this instance. Many of these queries may not work on this version.' , 18 , 16 , @ProductVersion); + END + ELSE + PRINT N'You have the correct major version of SQL Server for this diagnostic information script'; + + +-- Instance level queries ******************************* + +-- SQL and OS Version information for current instance (Query 1) (Version Info) +SELECT @@SERVERNAME AS [Server Name], @@VERSION AS [SQL Server and OS Version Info]; +------ + +-- SQL Server 2016 RTM Branch Builds -- SQL Server 2016 SP1 Branch Builds -- SQL Server 2016 SP2 Branch Builds +-- Build Description Release Date Build Description Release Date Build Description Release Date +-- 13.0.200.172 CTP 2.0 5/26/2015 +-- 13.0.300.44 CTP 2.1 6/14/2015 +-- 13.0.407.1 CTP 2.2 7/28/2015 +-- 13.0.500.53 CTP 2.3 9/4/2015 +-- 13.0.600.65 CTP 2.4 9/30/2015 +-- 13.0.700.242 CTP 3.0 10/29/2015 +-- 13.0.900.73 CTP 3.2 12/12/2015 +-- 13.0.1000.276 CTP 3.3 1/27/2016 +-- 13.0.1100.288 RC0 3/2/2016 +-- 13.0.1200.242 RC1 3/18/2016 +-- 13.0.1300.275 RC2 3/28/2016 +-- 13.0.1400.361 RC3 4/11/2016 +-- 13.0.1601.5 RTM 6/1/2016 +-- 13.0.1708.0 RTM-GDR 6/12/2016 +-- 13.0.2149.0 RTM CU1 7/25/2016 +-- 13.0.2164.0 RTM CU2 9/22/2016 +-- 13.0.2186.0 RTM CU3 11/16/2016 ----> 13.0.4001.0 SP1 RTM 11/16/2016 +-- 13.0.2193.0 RTM CU4 1/18/2017 ----> 13.0.4411.0 SP1 CU1 1/18/2017 +-- 13.0.2197.0 RTM CU5 3/20/2017 ----> 13.0.4422.0 SP1 CU2 3/20/2017 +-- 13.0.2204.0 RTM CU6 5/15/2017 ----> 13.0.4435.0 SP1 CU3 5/15/2017 +-- 13.0.2210.0 RTM CU7 8/8/2017 ----> 13.0.4446.0 SP1 CU4 8/8/2017 +-- 13.0.2213.0 RTM CU8 9/18/2017 ----> 13.0.4451.0 SP1 CU5 9/18/2017 +-- 13.0.2216.0 RTM CU9 11/21/2017 ----> 13.0.4457.0 SP1 CU6 11/21/2017 +-- 13.0.4466.4 SP1 CU7 1/4/2018 +-- 13.0.4474.0 SP1 CU8 3/20/2018 ----> 13.0.5026.0 SP2 RTM 4/24/2018 +-- 13.0.4502.0 SP1 CU9 5/30/2018 ----> 13.0.5149.0 SP2 CU1 5/30/2018 +-- 13.0.4514.0 SP1 CU10 7/16/2018 ----> 13.0.5153.0 SP2 CU2 7/16/2018 +-- 13.0.4528.0 SP1 CU11 9/17/2018 ----> 13.0.5216.0 SP2 CU3 9/20/2018 +-- 13.0.4541.0 SP1 CU12 11/13/2018 ----> 13.0.5233.0 SP2 CU4 11/13/2018 +-- 13.0.4550.1 SP1 CU13 1/23/2019 ----> 13.0.5264.1 SP2 CU5 1/23/2019 +-- 13.0.4560.0 SP1 CU14 3/19/2019 ----> 13.0.5292.0 SP2 CU6 3/19/2019 +-- 13.0.4574.0 SP1 CU15 5/16/2019 ----> 13.0.5337.0 SP2 CU7 5/22/2019 +-- 13.0.5426.0 SP2 CU8 7/31/2019 +-- 13.0.5470.0 SP2 CU9 9/30/2019 +-- 13.0.5492.2 SP2 CU10 10/8/2019 +-- 13.0.5598.27 SP2 CU11 12/9/2019 +-- 13.0.5698.0 SP2 CU12 2/25/2020 +-- 13.0.5820.21 SP2 CU13 5/28/2020 +-- 13.0.5830.85 SP2 CU14 8/6/2020 +-- 13.0.5850.14 SP2 CU15 9/28/2020 + +-- How to determine the version, edition and update level of SQL Server and its components +-- https://bit.ly/2oAjKgW + +-- How to obtain the latest Service Pack for SQL Server 2016 +-- https://bit.ly/2egtfzK + +-- SQL Server 2016 build versions +-- https://bit.ly/2epkTDT + +-- Recommended updates and configuration options for SQL Server 2017 and 2016 with high-performance workloads +-- https://bit.ly/2JsReue + +-- Performance and Stability Related Fixes in Post-SQL Server 2016 SP1 Builds +-- https://bit.ly/2gr7k9L + +-- Performance and Stability Related Fixes in Post-SQL Server 2016 SP2 Builds +-- https://bit.ly/2K3LoPf + +-- Update Center for Microsoft SQL Server +-- https://bit.ly/2pZptuQ + +-- Download SQL Server Management Studio (SSMS) +-- https://bit.ly/1OcupT9 + +-- Download and install Azure Data Studio +-- https://bit.ly/2vgke1A + +-- SQL Server 2016 Configuration Manager is SQLServerManager13.msc + + +-- Get socket, physical core and logical core count from the SQL Server Error log. (Query 2) (Core Counts) +-- This query might take a few seconds depending on the size of your error log +EXEC sys.xp_readerrorlog 0, 1, N'detected', N'socket'; +------ + +-- This can help you determine the exact core counts used by SQL Server and whether HT is enabled or not +-- It can also help you confirm your SQL Server licensing model +-- Be on the lookout for this message "using 40 logical processors based on SQL Server licensing" +-- (when you have more than 40 logical cores) which means grandfathered Server/CAL licensing +-- This query will return no results if your error log has been recycled since the instance was last started + + + +-- Get selected server properties (Query 3) (Server Properties) +SELECT SERVERPROPERTY('MachineName') AS [MachineName], +SERVERPROPERTY('ServerName') AS [ServerName], +SERVERPROPERTY('InstanceName') AS [Instance], +SERVERPROPERTY('IsClustered') AS [IsClustered], +SERVERPROPERTY('ComputerNamePhysicalNetBIOS') AS [ComputerNamePhysicalNetBIOS], +SERVERPROPERTY('Edition') AS [Edition], +SERVERPROPERTY('ProductLevel') AS [ProductLevel], -- What servicing branch (RTM/SP/CU) +SERVERPROPERTY('ProductUpdateLevel') AS [ProductUpdateLevel], -- Within a servicing branch, what CU# is applied +SERVERPROPERTY('ProductVersion') AS [ProductVersion], +SERVERPROPERTY('ProductMajorVersion') AS [ProductMajorVersion], +SERVERPROPERTY('ProductMinorVersion') AS [ProductMinorVersion], +SERVERPROPERTY('ProductBuild') AS [ProductBuild], +SERVERPROPERTY('ProductBuildType') AS [ProductBuildType], -- Is this a GDR or OD hotfix (NULL if on a CU build) +SERVERPROPERTY('ProductUpdateReference') AS [ProductUpdateReference], -- KB article number that is applicable for this build +SERVERPROPERTY('ProcessID') AS [ProcessID], +SERVERPROPERTY('Collation') AS [Collation], +SERVERPROPERTY('IsFullTextInstalled') AS [IsFullTextInstalled], +SERVERPROPERTY('IsIntegratedSecurityOnly') AS [IsIntegratedSecurityOnly], +SERVERPROPERTY('FilestreamConfiguredLevel') AS [FilestreamConfiguredLevel], +SERVERPROPERTY('IsHadrEnabled') AS [IsHadrEnabled], +SERVERPROPERTY('HadrManagerStatus') AS [HadrManagerStatus], +SERVERPROPERTY('InstanceDefaultDataPath') AS [InstanceDefaultDataPath], +SERVERPROPERTY('InstanceDefaultLogPath') AS [InstanceDefaultLogPath], +SERVERPROPERTY('ErrorLogFileName') AS [ErrorLogFileName], +SERVERPROPERTY('BuildClrVersion') AS [Build CLR Version], +SERVERPROPERTY('IsXTPSupported') AS [IsXTPSupported], +SERVERPROPERTY('IsPolybaseInstalled') AS [IsPolybaseInstalled], -- New for SQL Server 2016 +SERVERPROPERTY('IsAdvancedAnalyticsInstalled') AS [IsRServicesInstalled]; -- New for SQL Server 2016 +------ + +-- This gives you a lot of useful information about your instance of SQL Server, +-- such as the ProcessID for SQL Server and your collation +-- Note: Some columns will be NULL on older SQL Server builds + +-- SERVERPROPERTY (Transact-SQL) +-- https://bit.ly/2eeaXeI + + + +-- Get instance-level configuration values for instance (Query 4) (Configuration Values) +SELECT name, value, value_in_use, minimum, maximum, [description], is_dynamic, is_advanced +FROM sys.configurations WITH (NOLOCK) +ORDER BY name OPTION (RECOMPILE); +------ + +-- Focus on these settings: +-- automatic soft-NUMA disabled (should be 0 in most cases) +-- backup checksum default (should be 1) +-- backup compression default (should be 1 in most cases) +-- clr enabled (only enable if it is needed) +-- cost threshold for parallelism (depends on your workload) +-- lightweight pooling (should be zero) +-- max degree of parallelism (depends on your workload and hardware) +-- max server memory (MB) (set to an appropriate value, not the default) +-- optimize for ad hoc workloads (should be 1) +-- priority boost (should be zero) +-- remote admin connections (should be 1) + + +-- sys.configurations (Transact-SQL) +-- https://bit.ly/2HsyDZI + +-- New configuration options for SQL Server 2016 +-- allow polybase export (Allow INSERT into a Hadoop external table) +-- automatic soft-NUMA disabled (Automatic soft-NUMA is enabled by default) +-- external scripts enabled (Allows execution of external scripts, for R Services) +-- hadoop connectivity (Configure SQL Server to connect to external Hadoop or Microsoft Azure storage blob data sources through PolyBase) +-- polybase network encryption (Configure SQL Server to encrypt control and data channels when using PolyBase) +-- remote data archive (Allow the use of the REMOTE_DATA_ARCHIVE data access for Stretch databases) + +-- SQLSweet16!, Episode 1: Backup Compression for TDE-enabled Databases +-- https://bit.ly/28Rpb2x + + + +-- Returns a list of all global trace flags that are enabled (Query 5) (Global Trace Flags) +DBCC TRACESTATUS (-1); +------ + +-- If no global trace flags are enabled, no results will be returned. +-- It is very useful to know what global trace flags are currently enabled as part of the diagnostic process. + +-- Common trace flags that should be enabled in most cases +-- TF 460 - Improvement: Optional replacement for "String or binary data would be truncated" message with extended information in SQL Server 2017 +-- https://bit.ly/2sboMli (added in SP2 CU6) + +-- TF 3226 - Supresses logging of successful database backup messages to the SQL Server Error Log +-- https://bit.ly/38zDNAK + +-- TF 6534 - Enables use of native code to improve performance with spatial data +-- https://bit.ly/2HrQUpU + +-- TF 7745 - Prevents Query Store data from being written to disk in case of a failover or shutdown command +-- https://bit.ly/2GU69Km + +-- TF 7752 - Enables asynchronous load of Query Store +-- This allows a database to become online and queries to be executed before the Query Store has been fully recovered + +-- The behavior of TF 1117, 1118 are enabled for tempdb in SQL Server 2016 by default +-- SQL 2016 It Just Runs Faster: -T1117 and -T1118 changes for TEMPDB and user databases +-- https://bit.ly/2lbNWxK + +-- The behavior of TF 2371 is enabled by default in SQL Server 2016 and newer (in compat level 130 and higher) + +-- DBCC TRACEON - Trace Flags (Transact-SQL) +-- https://bit.ly/2FuSvPg + +-- Recommended updates and configuration options for SQL Server 2017 and 2016 with high-performance workloads +-- https://bit.ly/2VVRGTY + + + + +-- SQL Server Process Address space info (Query 6) (Process Memory) +-- (shows whether locked pages is enabled, among other things) +SELECT physical_memory_in_use_kb/1024 AS [SQL Server Memory Usage (MB)], + locked_page_allocations_kb/1024 AS [SQL Server Locked Pages Allocation (MB)], + large_page_allocations_kb/1024 AS [SQL Server Large Pages Allocation (MB)], + page_fault_count, memory_utilization_percentage, available_commit_limit_kb, + process_physical_memory_low, process_virtual_memory_low +FROM sys.dm_os_process_memory WITH (NOLOCK) OPTION (RECOMPILE); +------ + +-- You want to see 0 for process_physical_memory_low +-- You want to see 0 for process_virtual_memory_low +-- This indicates that you are not under internal memory pressure +-- If locked_page_allocations_kb > 0, then LPIM is enabled + +-- How to enable the "locked pages" feature in SQL Server 2012 +-- https://bit.ly/2F5UjOA + +-- Memory Management Architecture Guide +-- https://bit.ly/2JKkadC + + + +-- SQL Server Services information (Query 7) (SQL Server Services Info) +SELECT servicename, process_id, startup_type_desc, status_desc, +last_startup_time, service_account, is_clustered, cluster_nodename, [filename], +instant_file_initialization_enabled +FROM sys.dm_server_services WITH (NOLOCK) OPTION (RECOMPILE); +------ + +-- Tells you the account being used for the SQL Server Service and the SQL Agent Service +-- Shows the process_id, when they were last started, and their current status +-- Also shows whether you are running on a failover cluster instance, and what node you are running on +-- Also shows whether IFI is enabled + +-- sys.dm_server_services (Transact-SQL) +-- https://bit.ly/2oKa1Un + + +-- Last backup information by database (Query 8) (Last Backup By Database) +SELECT ISNULL(d.[name], bs.[database_name]) AS [Database], d.recovery_model_desc AS [Recovery Model], + d.log_reuse_wait_desc AS [Log Reuse Wait Desc], + MAX(CASE WHEN [type] = 'D' THEN bs.backup_finish_date ELSE NULL END) AS [Last Full Backup], + MAX(CASE WHEN [type] = 'D' THEN bmf.physical_device_name ELSE NULL END) AS [Last Full Backup Location], + MAX(CASE WHEN [type] = 'I' THEN bs.backup_finish_date ELSE NULL END) AS [Last Differential Backup], + MAX(CASE WHEN [type] = 'I' THEN bmf.physical_device_name ELSE NULL END) AS [Last Differential Backup Location], + MAX(CASE WHEN [type] = 'L' THEN bs.backup_finish_date ELSE NULL END) AS [Last Log Backup], + MAX(CASE WHEN [type] = 'L' THEN bmf.physical_device_name ELSE NULL END) AS [Last Log Backup Location] +FROM sys.databases AS d WITH (NOLOCK) +LEFT OUTER JOIN msdb.dbo.backupset AS bs WITH (NOLOCK) +ON bs.[database_name] = d.[name] +LEFT OUTER JOIN msdb.dbo.backupmediafamily AS bmf WITH (NOLOCK) +ON bs.media_set_id = bmf.media_set_id +AND bs.backup_finish_date > GETDATE()- 30 +WHERE d.name <> N'tempdb' +GROUP BY ISNULL(d.[name], bs.[database_name]), d.recovery_model_desc, d.log_reuse_wait_desc, d.[name] +ORDER BY d.recovery_model_desc, d.[name] OPTION (RECOMPILE); +------ + +-- This helps you spot runaway transaction logs and other issues with your backup schedule + + +-- Get SQL Server Agent jobs and Category information (Query 9) (SQL Server Agent Jobs) +SELECT sj.name AS [Job Name], sj.[description] AS [Job Description], SUSER_SNAME(sj.owner_sid) AS [Job Owner], +sj.date_created AS [Date Created], sj.[enabled] AS [Job Enabled], +sj.notify_email_operator_id, sj.notify_level_email, sc.name AS [CategoryName], +s.[enabled] AS [Sched Enabled], js.next_run_date, js.next_run_time +FROM msdb.dbo.sysjobs AS sj WITH (NOLOCK) +INNER JOIN msdb.dbo.syscategories AS sc WITH (NOLOCK) +ON sj.category_id = sc.category_id +LEFT OUTER JOIN msdb.dbo.sysjobschedules AS js WITH (NOLOCK) +ON sj.job_id = js.job_id +LEFT OUTER JOIN msdb.dbo.sysschedules AS s WITH (NOLOCK) +ON js.schedule_id = s.schedule_id +ORDER BY sj.name OPTION (RECOMPILE); +------ + +-- Gives you some basic information about your SQL Server Agent jobs, who owns them and how they are configured +-- Look for Agent jobs that are not owned by sa +-- Look for jobs that have a notify_email_operator_id set to 0 (meaning no operator) +-- Look for jobs that have a notify_level_email set to 0 (meaning no e-mail is ever sent) +-- +-- MSDN sysjobs documentation +-- https://bit.ly/2paDEOP + +-- SQL Server Maintenance Solution +-- https://bit.ly/1pgchQu + +-- You can use this script to add default schedules to the standard Ola Hallengren Maintenance Solution jobs +-- https://bit.ly/3ane0gN + + +-- Get SQL Server Agent Alert Information (Query 10) (SQL Server Agent Alerts) +SELECT name, event_source, message_id, severity, [enabled], has_notification, + delay_between_responses, occurrence_count, last_occurrence_date, last_occurrence_time +FROM msdb.dbo.sysalerts WITH (NOLOCK) +ORDER BY name OPTION (RECOMPILE); +------ + +-- Gives you some basic information about your SQL Server Agent Alerts +-- (which are different from SQL Server Agent jobs) +-- Read more about Agent Alerts here: https://bit.ly/2v5YR37 + + + +-- Windows information (Query 11) (Windows Info) +SELECT windows_release, windows_service_pack_level, + windows_sku, os_language_version +FROM sys.dm_os_windows_info WITH (NOLOCK) OPTION (RECOMPILE); +------ + +-- Gives you major OS version, Service Pack, Edition, and language info for the operating system +-- 10.0 is either Windows 10 or Windows Server 2016 +-- 6.3 is either Windows 8.1 or Windows Server 2012 R2 +-- 6.2 is either Windows 8 or Windows Server 2012 + + +-- Windows SKU codes +-- 4 is Enterprise Edition +-- 7 is Standard Server Edition +-- 8 is Datacenter Server Edition +-- 10 is Enterprise Server Edition +-- 48 is Professional Edition +-- 161 is Pro for Workstations + +-- 1033 for os_language_version is US-English + +-- SQL Server 2016 requires Windows Server 2012 or newer + +-- Quick-Start Installation of SQL Server 2016 +-- https://bit.ly/2qtxQ3G + +-- Hardware and Software Requirements for Installing SQL Server 2016 +-- https://bit.ly/2JJIUTl + +-- Using SQL Server in Windows 8 and later versions of Windows operating system +-- https://bit.ly/2F7Ax0P + + +-- SQL Server NUMA Node information (Query 12) (SQL Server NUMA Info) +SELECT node_id, node_state_desc, memory_node_id, processor_group, online_scheduler_count, + idle_scheduler_count, active_worker_count, avg_load_balance, resource_monitor_state +FROM sys.dm_os_nodes WITH (NOLOCK) +WHERE node_state_desc <> N'ONLINE DAC' OPTION (RECOMPILE); +------ + +-- Gives you some useful information about the composition and relative load on your NUMA nodes +-- You want to see an equal number of schedulers on each NUMA node +-- Watch out if SQL Server 2016 Standard Edition has been installed +-- on a physical or virtual machine with more than four sockets or more than 24 physical cores + +-- sys.dm_os_nodes (Transact-SQL) +-- https://bit.ly/2pn5Mw8 + +-- How to Balance SQL Server Core Licenses Across NUMA Nodes +-- https://bit.ly/3i4TyVR + + + +-- Good basic information about OS memory amounts and state (Query 13) (System Memory) +SELECT total_physical_memory_kb/1024 AS [Physical Memory (MB)], + available_physical_memory_kb/1024 AS [Available Memory (MB)], + total_page_file_kb/1024 AS [Page File Commit Limit (MB)], + total_page_file_kb/1024 - total_physical_memory_kb/1024 AS [Physical Page File Size (MB)], + available_page_file_kb/1024 AS [Available Page File (MB)], + system_cache_kb/1024 AS [System Cache (MB)], + system_memory_state_desc AS [System Memory State] +FROM sys.dm_os_sys_memory WITH (NOLOCK) OPTION (RECOMPILE); +------ + +-- You want to see "Available physical memory is high" for System Memory State +-- This indicates that you are not under external memory pressure + +-- Possible System Memory State values: +-- Available physical memory is high +-- Physical memory usage is steady +-- Available physical memory is low +-- Available physical memory is running low +-- Physical memory state is transitioning + +-- sys.dm_os_sys_memory (Transact-SQL) +-- https://bit.ly/2pcV0xq + + + +-- You can skip the next two queries if you know you don't have a clustered instance + + +-- Get information about your cluster nodes and their status (Query 14) (Cluster Node Properties) +-- (if your database server is in a failover cluster) +SELECT NodeName, status_description, is_current_owner +FROM sys.dm_os_cluster_nodes WITH (NOLOCK) OPTION (RECOMPILE); +------ + +-- Knowing which node owns the cluster resources is critical +-- Especially when you are installing Windows or SQL Server updates +-- You will see no results if your instance is not clustered + +-- Recommended hotfixes and updates for Windows Server 2012 R2-based failover clusters +-- https://bit.ly/1z5BfCw + + +-- Get information about any AlwaysOn AG cluster this instance is a part of (Query 15) (AlwaysOn AG Cluster) +SELECT cluster_name, quorum_type_desc, quorum_state_desc +FROM sys.dm_hadr_cluster WITH (NOLOCK) OPTION (RECOMPILE); +------ + +-- You will see no results if your instance is not using AlwaysOn AGs + + +-- Good overview of AG health and status (Query 16) (AG Status) +SELECT ag.name AS [AG Name], ar.replica_server_name, ar.availability_mode_desc, adc.[database_name], + drs.is_local, drs.is_primary_replica, drs.synchronization_state_desc, drs.is_commit_participant, + drs.synchronization_health_desc, drs.recovery_lsn, drs.truncation_lsn, drs.last_sent_lsn, + drs.last_sent_time, drs.last_received_lsn, drs.last_received_time, drs.last_hardened_lsn, + drs.last_hardened_time, drs.last_redone_lsn, drs.last_redone_time, drs.log_send_queue_size, + drs.log_send_rate, drs.redo_queue_size, drs.redo_rate, drs.filestream_send_rate, + drs.end_of_log_lsn, drs.last_commit_lsn, drs.last_commit_time, drs.database_state_desc +FROM sys.dm_hadr_database_replica_states AS drs WITH (NOLOCK) +INNER JOIN sys.availability_databases_cluster AS adc WITH (NOLOCK) +ON drs.group_id = adc.group_id +AND drs.group_database_id = adc.group_database_id +INNER JOIN sys.availability_groups AS ag WITH (NOLOCK) +ON ag.group_id = drs.group_id +INNER JOIN sys.availability_replicas AS ar WITH (NOLOCK) +ON drs.group_id = ar.group_id +AND drs.replica_id = ar.replica_id +ORDER BY ag.name, ar.replica_server_name, adc.[database_name] OPTION (RECOMPILE); + +-- You will see no results if your instance is not using AlwaysOn AGs + +-- SQL Server 2016 It Just Runs Faster: Always On Availability Groups Turbocharged +-- https://bit.ly/2dn1H6r + + +-- Hardware information from SQL Server 2016 (Query 17) (Hardware Info) +SELECT cpu_count AS [Logical CPU Count], scheduler_count, + hyperthread_ratio AS [Hyperthread Ratio], + cpu_count/hyperthread_ratio AS [Physical CPU Count], + physical_memory_kb/1024 AS [Physical Memory (MB)], + committed_kb/1024 AS [Committed Memory (MB)], + committed_target_kb/1024 AS [Committed Target Memory (MB)], + max_workers_count AS [Max Workers Count], + affinity_type_desc AS [Affinity Type], + sqlserver_start_time AS [SQL Server Start Time], + DATEDIFF(hour, sqlserver_start_time, GETDATE()) AS [SQL Server Up Time (hrs)], + virtual_machine_type_desc AS [Virtual Machine Type], + softnuma_configuration_desc AS [Soft NUMA Configuration], + sql_memory_model_desc -- New in SQL Server 2016 +FROM sys.dm_os_sys_info WITH (NOLOCK) OPTION (RECOMPILE); +------ + +-- Gives you some good basic hardware information about your database server +-- Note: virtual_machine_type_desc of HYPERVISOR does not automatically mean you are running SQL Server inside of a VM +-- It merely indicates that you have a hypervisor running on your host + +-- sys.dm_os_sys_info (Transact-SQL) +-- https://bit.ly/2pczOYs + +-- Soft NUMA configuration was a new column for SQL Server 2016 +-- OFF = Soft-NUMA feature is OFF +-- ON = SQL Server automatically determines the NUMA node sizes for Soft-NUMA +-- MANUAL = Manually configured soft-NUMA + +-- Configure SQL Server to Use Soft-NUMA (SQL Server) +-- https://bit.ly/2HTpKJt + +-- sql_memory_model_desc values (Added in SQL Server 2016 SP1) +-- CONVENTIONAL +-- LOCK_PAGES +-- LARGE_PAGES + + +-- Get System Manufacturer and model number from SQL Server Error log (Query 18) (System Manufacturer) +EXEC sys.xp_readerrorlog 0, 1, N'Manufacturer'; +------ + +-- This can help you determine the capabilities and capacities of your database server +-- Can also be used to confirm if you are running in a VM +-- This query might take a few seconds if you have not recycled your error log recently +-- This query will return no results if your error log has been recycled since the instance was started + + +-- Get BIOS date from Windows Registry (Query 19) (BIOS Date) +EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\System\BIOS', N'BiosReleaseDate'; +------ + +-- Helps you understand whether the main system BIOS is up to date, and the possible age of the hardware +-- Not as useful for virtualization + + +-- Get processor description from Windows Registry (Query 20) (Processor Description) +EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\System\CentralProcessor\0', N'ProcessorNameString'; +------ + +-- Gives you the model number and rated clock speed of your processor(s) +-- Your processors may be running at less than the rated clock speed due +-- to the Windows Power Plan or hardware power management + +-- You can use CPU-Z to get your actual CPU core speed and a lot of other useful information +-- https://bit.ly/QhR6xF + +-- You can learn more about processor selection for SQL Server by following this link +-- https://bit.ly/2F3aVlP + + + + +-- Get information on location, time and size of any memory dumps from SQL Server (Query 21) (Memory Dump Info) +SELECT [filename], creation_time, size_in_bytes/1048576.0 AS [Size (MB)] +FROM sys.dm_server_memory_dumps WITH (NOLOCK) +ORDER BY creation_time DESC OPTION (RECOMPILE); +------ + +-- This will not return any rows if you have +-- not had any memory dumps (which is a good thing) + +-- sys.dm_server_memory_dumps (Transact-SQL) +-- https://bit.ly/2elwWll + + + +-- Look at Suspect Pages table (Query 22) (Suspect Pages) +SELECT DB_NAME(database_id) AS [Database Name], [file_id], page_id, + event_type, error_count, last_update_date +FROM msdb.dbo.suspect_pages WITH (NOLOCK) +ORDER BY database_id OPTION (RECOMPILE); +------ + +-- event_type value descriptions +-- 1 = 823 error caused by an operating system CRC error +-- or 824 error other than a bad checksum or a torn page (for example, a bad page ID) +-- 2 = Bad checksum +-- 3 = Torn page +-- 4 = Restored (The page was restored after it was marked bad) +-- 5 = Repaired (DBCC repaired the page) +-- 7 = Deallocated by DBCC + +-- Ideally, this query returns no results. The table is limited to 1000 rows. +-- If you do get results here, you should do further investigation to determine the root cause + +-- Manage the suspect_pages Table +-- https://bit.ly/2Fvr1c9 + + +-- Get number of data files in tempdb database (Query 23) (TempDB Data Files) +EXEC sys.xp_readerrorlog 0, 1, N'The tempdb database has'; +------ + +-- Get the number of data files in the tempdb database +-- 4-8 data files that are all the same size is a good starting point +-- This query will return no results if your error log has been recycled since the instance was last started + + +-- File names and paths for all user and system databases on instance (Query 24) (Database Filenames and Paths) +SELECT DB_NAME([database_id]) AS [Database Name], + [file_id], [name], physical_name, [type_desc], state_desc, + is_percent_growth, growth, + CONVERT(bigint, growth/128.0) AS [Growth in MB], + CONVERT(bigint, size/128.0) AS [Total Size in MB], max_size +FROM sys.master_files WITH (NOLOCK) +ORDER BY DB_NAME([database_id]), [file_id] OPTION (RECOMPILE); +------ + +-- Things to look at: +-- Are data files and log files on different drives? +-- Is everything on the C: drive? +-- Is tempdb on dedicated drives? +-- Is there only one tempdb data file? +-- Are all of the tempdb data files the same size? +-- Are there multiple data files for user databases? +-- Is percent growth enabled for any files (which is bad)? + + +-- Volume info for all LUNS that have database files on the current instance (Query 25) (Volume Info) +SELECT DISTINCT vs.volume_mount_point, vs.file_system_type, vs.logical_volume_name, +CONVERT(DECIMAL(18,2), vs.total_bytes/1073741824.0) AS [Total Size (GB)], +CONVERT(DECIMAL(18,2), vs.available_bytes/1073741824.0) AS [Available Size (GB)], +CONVERT(DECIMAL(18,2), vs.available_bytes * 1. / vs.total_bytes * 100.) AS [Space Free %], +vs.supports_compression, vs.is_compressed, +vs.supports_sparse_files, vs.supports_alternate_streams +FROM sys.master_files AS f WITH (NOLOCK) +CROSS APPLY sys.dm_os_volume_stats(f.database_id, f.[file_id]) AS vs +ORDER BY vs.volume_mount_point OPTION (RECOMPILE); +------ + +-- Shows you the total and free space on the LUNs where you have database files +-- Being low on free space can negatively affect performance + +-- sys.dm_os_volume_stats (Transact-SQL) +-- https://bit.ly/2oBPNNr + + + +-- Drive level latency information (Query 26) (Drive Level Latency) +SELECT tab.[Drive], tab.volume_mount_point AS [Volume Mount Point], + CASE + WHEN num_of_reads = 0 THEN 0 + ELSE (io_stall_read_ms/num_of_reads) + END AS [Read Latency], + CASE + WHEN num_of_writes = 0 THEN 0 + ELSE (io_stall_write_ms/num_of_writes) + END AS [Write Latency], + CASE + WHEN (num_of_reads = 0 AND num_of_writes = 0) THEN 0 + ELSE (io_stall/(num_of_reads + num_of_writes)) + END AS [Overall Latency], + CASE + WHEN num_of_reads = 0 THEN 0 + ELSE (num_of_bytes_read/num_of_reads) + END AS [Avg Bytes/Read], + CASE + WHEN num_of_writes = 0 THEN 0 + ELSE (num_of_bytes_written/num_of_writes) + END AS [Avg Bytes/Write], + CASE + WHEN (num_of_reads = 0 AND num_of_writes = 0) THEN 0 + ELSE ((num_of_bytes_read + num_of_bytes_written)/(num_of_reads + num_of_writes)) + END AS [Avg Bytes/Transfer] +FROM (SELECT LEFT(UPPER(mf.physical_name), 2) AS Drive, SUM(num_of_reads) AS num_of_reads, + SUM(io_stall_read_ms) AS io_stall_read_ms, SUM(num_of_writes) AS num_of_writes, + SUM(io_stall_write_ms) AS io_stall_write_ms, SUM(num_of_bytes_read) AS num_of_bytes_read, + SUM(num_of_bytes_written) AS num_of_bytes_written, SUM(io_stall) AS io_stall, vs.volume_mount_point + FROM sys.dm_io_virtual_file_stats(NULL, NULL) AS vfs + INNER JOIN sys.master_files AS mf WITH (NOLOCK) + ON vfs.database_id = mf.database_id AND vfs.file_id = mf.file_id + CROSS APPLY sys.dm_os_volume_stats(mf.database_id, mf.[file_id]) AS vs + GROUP BY LEFT(UPPER(mf.physical_name), 2), vs.volume_mount_point) AS tab +ORDER BY [Overall Latency] OPTION (RECOMPILE); +------ + +-- Shows you the drive-level latency for reads and writes, in milliseconds +-- Latency above 30-40ms is usually a problem +-- These latency numbers include all file activity against all SQL Server +-- database files on each drive since SQL Server was last started + +-- sys.dm_io_virtual_file_stats (Transact-SQL) +-- https://bit.ly/3bRWUc0 + +-- sys.dm_os_volume_stats (Transact-SQL) +-- https://bit.ly/33thz2j + + +-- Calculates average stalls per read, per write, and per total input/output for each database file (Query 27) (IO Latency by File) +SELECT DB_NAME(fs.database_id) AS [Database Name], CAST(fs.io_stall_read_ms/(1.0 + fs.num_of_reads) AS NUMERIC(10,1)) AS [avg_read_latency_ms], +CAST(fs.io_stall_write_ms/(1.0 + fs.num_of_writes) AS NUMERIC(10,1)) AS [avg_write_latency_ms], +CAST((fs.io_stall_read_ms + fs.io_stall_write_ms)/(1.0 + fs.num_of_reads + fs.num_of_writes) AS NUMERIC(10,1)) AS [avg_io_latency_ms], +CONVERT(DECIMAL(18,2), mf.size/128.0) AS [File Size (MB)], mf.physical_name, mf.type_desc, fs.io_stall_read_ms, fs.num_of_reads, +fs.io_stall_write_ms, fs.num_of_writes, fs.io_stall_read_ms + fs.io_stall_write_ms AS [io_stalls], fs.num_of_reads + fs.num_of_writes AS [total_io], +io_stall_queued_read_ms AS [Resource Governor Total Read IO Latency (ms)], io_stall_queued_write_ms AS [Resource Governor Total Write IO Latency (ms)] +FROM sys.dm_io_virtual_file_stats(null,null) AS fs +INNER JOIN sys.master_files AS mf WITH (NOLOCK) +ON fs.database_id = mf.database_id +AND fs.[file_id] = mf.[file_id] +ORDER BY avg_io_latency_ms DESC OPTION (RECOMPILE); +------ + +-- Helps determine which database files on the entire instance have the most I/O bottlenecks +-- This can help you decide whether certain LUNs are overloaded and whether you might +-- want to move some files to a different location or perhaps improve your I/O performance +-- These latency numbers include all file activity against each SQL Server +-- database file since SQL Server was last started + +-- sys.dm_io_virtual_file_stats (Transact-SQL) +-- https://bit.ly/3bRWUc0 + + +-- Look for I/O requests taking longer than 15 seconds in the six most recent SQL Server Error Logs (Query 28) (IO Warnings) +CREATE TABLE #IOWarningResults(LogDate datetime, ProcessInfo sysname, LogText nvarchar(1000)); + + INSERT INTO #IOWarningResults + EXEC xp_readerrorlog 0, 1, N'taking longer than 15 seconds'; + + INSERT INTO #IOWarningResults + EXEC xp_readerrorlog 1, 1, N'taking longer than 15 seconds'; + + INSERT INTO #IOWarningResults + EXEC xp_readerrorlog 2, 1, N'taking longer than 15 seconds'; + + INSERT INTO #IOWarningResults + EXEC xp_readerrorlog 3, 1, N'taking longer than 15 seconds'; + + INSERT INTO #IOWarningResults + EXEC xp_readerrorlog 4, 1, N'taking longer than 15 seconds'; + + INSERT INTO #IOWarningResults + EXEC xp_readerrorlog 5, 1, N'taking longer than 15 seconds'; + +SELECT LogDate, ProcessInfo, LogText +FROM #IOWarningResults +ORDER BY LogDate DESC; + +DROP TABLE #IOWarningResults; +------ + +-- Finding 15 second I/O warnings in the SQL Server Error Log is useful evidence of +-- poor I/O performance (which might have many different causes) +-- Look to see if you see any patterns in the results (same files, same drives, same time of day, etc.) + +-- Diagnostics in SQL Server help detect stalled and stuck I/O operations +-- https://bit.ly/2qtaw73 + + +-- Resource Governor Resource Pool information (Query 29) (RG Resource Pools) +SELECT pool_id, [Name], statistics_start_time, + min_memory_percent, max_memory_percent, + max_memory_kb/1024 AS [max_memory_mb], + used_memory_kb/1024 AS [used_memory_mb], + target_memory_kb/1024 AS [target_memory_mb], + min_iops_per_volume, max_iops_per_volume +FROM sys.dm_resource_governor_resource_pools WITH (NOLOCK) +OPTION (RECOMPILE); +------ + +-- sys.dm_resource_governor_resource_pools (Transact-SQL) +-- https://bit.ly/2MVU0Vy + + + +-- Recovery model, log reuse wait description, log file size, log usage size (Query 30) (Database Properties) +-- and compatibility level for all databases on instance +SELECT db.[name] AS [Database Name], SUSER_SNAME(db.owner_sid) AS [Database Owner], db.recovery_model_desc AS [Recovery Model], +db.state_desc, db.containment_desc, db.log_reuse_wait_desc AS [Log Reuse Wait Description], +CONVERT(DECIMAL(18,2), ls.cntr_value/1024.0) AS [Log Size (MB)], CONVERT(DECIMAL(18,2), lu.cntr_value/1024.0) AS [Log Used (MB)], +CAST(CAST(lu.cntr_value AS FLOAT) / CAST(ls.cntr_value AS FLOAT)AS DECIMAL(18,2)) * 100 AS [Log Used %], +db.[compatibility_level] AS [DB Compatibility Level], +db.is_mixed_page_allocation_on, db.page_verify_option_desc AS [Page Verify Option], +db.is_auto_create_stats_on, db.is_auto_update_stats_on, db.is_auto_update_stats_async_on, db.is_parameterization_forced, +db.snapshot_isolation_state_desc, db.is_read_committed_snapshot_on, db.is_auto_close_on, db.is_auto_shrink_on, +db.target_recovery_time_in_seconds, db.is_cdc_enabled, db.is_published, db.is_distributor, +db.group_database_id, db.replica_id,db.is_memory_optimized_elevate_to_snapshot_on, +db.delayed_durability_desc, db.is_query_store_on, db.is_sync_with_backup, db.is_remote_data_archive_enabled, +db.is_encrypted, de.encryption_state, de.percent_complete, de.key_algorithm, de.key_length +FROM sys.databases AS db WITH (NOLOCK) +INNER JOIN sys.dm_os_performance_counters AS lu WITH (NOLOCK) +ON db.name = lu.instance_name +INNER JOIN sys.dm_os_performance_counters AS ls WITH (NOLOCK) +ON db.name = ls.instance_name +LEFT OUTER JOIN sys.dm_database_encryption_keys AS de WITH (NOLOCK) +ON db.database_id = de.database_id +WHERE lu.counter_name LIKE N'Log File(s) Used Size (KB)%' +AND ls.counter_name LIKE N'Log File(s) Size (KB)%' +AND ls.cntr_value > 0 +ORDER BY db.[name] OPTION (RECOMPILE); +------ + +-- sys.databases (Transact-SQL) +-- https://bit.ly/2G5wqaX + +-- sys.dm_os_performance_counters (Transact-SQL) +-- https://bit.ly/3kEO2JR + +-- sys.dm_database_encryption_keys (Transact-SQL) +-- https://bit.ly/3mE7kkx + +-- Things to look at: +-- How many databases are on the instance? +-- What recovery models are they using? +-- What is the log reuse wait description? +-- How full are the transaction logs? +-- What compatibility level are the databases on? +-- What is the Page Verify Option? (should be CHECKSUM) +-- Is Auto Update Statistics Asynchronously enabled? +-- Is Delayed Durability enabled +-- Make sure auto_shrink and auto_close are not enabled! + +-- is_mixed_page_allocation_on is a new property for SQL Server 2016. Equivalent to TF 1118 for a user database +-- SQL Server 2016: Changes in default behavior for autogrow and allocations for tempdb and user databases +-- https://bit.ly/2evRZSR + +-- A non-zero value for target_recovery_time_in_seconds means that indirect checkpoint is enabled +-- If the setting has a zero value it indicates that automatic checkpoint is enabled + +-- Changes in SQL Server 2016 Checkpoint Behavior +-- https://bit.ly/2pdggk3 + + +-- Missing Indexes for all databases by Index Advantage (Query 31) (Missing Indexes All Databases) +SELECT CONVERT(decimal(18,2), migs.user_seeks * migs.avg_total_user_cost * (migs.avg_user_impact * 0.01)) AS [index_advantage], +FORMAT(migs.last_user_seek, 'yyyy-MM-dd HH:mm:ss') AS [last_user_seek], mid.[statement] AS [Database.Schema.Table], +COUNT(1) OVER(PARTITION BY mid.[statement]) AS [missing_indexes_for_table], +COUNT(1) OVER(PARTITION BY mid.[statement], equality_columns) AS [similar_missing_indexes_for_table], +mid.equality_columns, mid.inequality_columns, mid.included_columns, migs.user_seeks, +CONVERT(decimal(18,2), migs.avg_total_user_cost) AS [avg_total_user_cost], migs.avg_user_impact +FROM sys.dm_db_missing_index_group_stats AS migs WITH (NOLOCK) +INNER JOIN sys.dm_db_missing_index_groups AS mig WITH (NOLOCK) +ON migs.group_handle = mig.index_group_handle +INNER JOIN sys.dm_db_missing_index_details AS mid WITH (NOLOCK) +ON mig.index_handle = mid.index_handle +ORDER BY index_advantage DESC OPTION (RECOMPILE); +------ + +-- Getting missing index information for all of the databases on the instance is very useful +-- Look at last user seek time, number of user seeks to help determine source and importance +-- Also look at avg_user_impact and avg_total_user_cost to help determine importance +-- SQL Server is overly eager to add included columns, so beware +-- Do not just blindly add indexes that show up from this query!!! +-- Hkan Winther has given me some great suggestions for this query + +-- SQL Server Index Design Guide +-- https://bit.ly/2qtZr4N + + + +-- Get VLF Counts for all databases on the instance (Query 32) (VLF Counts) +-- (adapted from Michelle Ufford) +CREATE TABLE #VLFInfo (RecoveryUnitID int, FileID int, + FileSize bigint, StartOffset bigint, + FSeqNo bigint, [Status] bigint, + Parity bigint, CreateLSN numeric(38)); + +CREATE TABLE #VLFCountResults(DatabaseName sysname, VLFCount int); + +EXEC sp_MSforeachdb N'Use [?]; + + INSERT INTO #VLFInfo + EXEC sp_executesql N''DBCC LOGINFO([?])''; + + INSERT INTO #VLFCountResults + SELECT DB_NAME(), COUNT(*) + FROM #VLFInfo; + + TRUNCATE TABLE #VLFInfo;' + +SELECT DatabaseName, VLFCount +FROM #VLFCountResults +ORDER BY VLFCount DESC; + +DROP TABLE #VLFInfo; +DROP TABLE #VLFCountResults; +------ + +-- High VLF counts can affect write performance to the log file +-- and they can make full database restores and crash recovery take much longer +-- Try to keep your VLF counts under 200 in most cases (depending on log file size) + +-- Important change to VLF creation algorithm in SQL Server 2014 +-- https://bit.ly/2Hsjbg4 + +-- SQL Server Transaction Log Architecture and Management Guide +-- https://bit.ly/2JjmQRZ + + + + +-- Get CPU utilization by database (Query 33) (CPU Usage by Database) +WITH DB_CPU_Stats +AS +(SELECT pa.DatabaseID, DB_Name(pa.DatabaseID) AS [Database Name], SUM(qs.total_worker_time/1000) AS [CPU_Time_Ms] + FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) + CROSS APPLY (SELECT CONVERT(int, value) AS [DatabaseID] + FROM sys.dm_exec_plan_attributes(qs.plan_handle) + WHERE attribute = N'dbid') AS pa + GROUP BY DatabaseID) +SELECT ROW_NUMBER() OVER(ORDER BY [CPU_Time_Ms] DESC) AS [CPU Rank], + [Database Name], [CPU_Time_Ms] AS [CPU Time (ms)], + CAST([CPU_Time_Ms] * 1.0 / SUM([CPU_Time_Ms]) OVER() * 100.0 AS DECIMAL(5, 2)) AS [CPU Percent] +FROM DB_CPU_Stats +WHERE DatabaseID <> 32767 -- ResourceDB +ORDER BY [CPU Rank] OPTION (RECOMPILE); +------ + +-- Helps determine which database is using the most CPU resources on the instance +-- Note: This only reflects CPU usage from the currently cached query plans + + +-- Get I/O utilization by database (Query 34) (IO Usage By Database) +WITH Aggregate_IO_Statistics +AS (SELECT DB_NAME(database_id) AS [Database Name], + CAST(SUM(num_of_bytes_read + num_of_bytes_written) / 1048576 AS DECIMAL(12, 2)) AS [ioTotalMB], + CAST(SUM(num_of_bytes_read ) / 1048576 AS DECIMAL(12, 2)) AS [ioReadMB], + CAST(SUM(num_of_bytes_written) / 1048576 AS DECIMAL(12, 2)) AS [ioWriteMB] + FROM sys.dm_io_virtual_file_stats(NULL, NULL) AS [DM_IO_STATS] + GROUP BY database_id) +SELECT ROW_NUMBER() OVER (ORDER BY ioTotalMB DESC) AS [I/O Rank], + [Database Name], ioTotalMB AS [Total I/O (MB)], + CAST(ioTotalMB / SUM(ioTotalMB) OVER () * 100.0 AS DECIMAL(5, 2)) AS [Total I/O %], + ioReadMB AS [Read I/O (MB)], + CAST(ioReadMB / SUM(ioReadMB) OVER () * 100.0 AS DECIMAL(5, 2)) AS [Read I/O %], + ioWriteMB AS [Write I/O (MB)], + CAST(ioWriteMB / SUM(ioWriteMB) OVER () * 100.0 AS DECIMAL(5, 2)) AS [Write I/O %] +FROM Aggregate_IO_Statistics +ORDER BY [I/O Rank] OPTION (RECOMPILE); +------ + +-- Helps determine which database is using the most I/O resources on the instance +-- These numbers are cumulative since the last service restart +-- They include all I/O activity, not just the nominal I/O workload + + +-- Get total buffer usage by database for current instance (Query 35) (Total Buffer Usage by Database) +-- This make take some time to run on a busy instance +WITH AggregateBufferPoolUsage +AS +(SELECT DB_NAME(database_id) AS [Database Name], +CAST(COUNT(*) * 8/1024.0 AS DECIMAL (10,2)) AS [CachedSize] +FROM sys.dm_os_buffer_descriptors WITH (NOLOCK) +WHERE database_id <> 32767 -- ResourceDB +GROUP BY DB_NAME(database_id)) +SELECT ROW_NUMBER() OVER(ORDER BY CachedSize DESC) AS [Buffer Pool Rank], [Database Name], CachedSize AS [Cached Size (MB)], + CAST(CachedSize / SUM(CachedSize) OVER() * 100.0 AS DECIMAL(5,2)) AS [Buffer Pool Percent] +FROM AggregateBufferPoolUsage +ORDER BY [Buffer Pool Rank] OPTION (RECOMPILE); +------ + +-- Tells you how much memory (in the buffer pool) +-- is being used by each database on the instance + + +-- Clear Wait Stats with this command +-- DBCC SQLPERF('sys.dm_os_wait_stats', CLEAR); + +-- Isolate top waits for server instance since last restart or wait statistics clear (Query 36) (Top Waits) +WITH [Waits] +AS (SELECT wait_type, wait_time_ms/ 1000.0 AS [WaitS], + (wait_time_ms - signal_wait_time_ms) / 1000.0 AS [ResourceS], + signal_wait_time_ms / 1000.0 AS [SignalS], + waiting_tasks_count AS [WaitCount], + 100.0 * wait_time_ms / SUM (wait_time_ms) OVER() AS [Percentage], + ROW_NUMBER() OVER(ORDER BY wait_time_ms DESC) AS [RowNum] + FROM sys.dm_os_wait_stats WITH (NOLOCK) + WHERE [wait_type] NOT IN ( + N'BROKER_EVENTHANDLER', N'BROKER_RECEIVE_WAITFOR', N'BROKER_TASK_STOP', + N'BROKER_TO_FLUSH', N'BROKER_TRANSMITTER', N'CHECKPOINT_QUEUE', + N'CHKPT', N'CLR_AUTO_EVENT', N'CLR_MANUAL_EVENT', N'CLR_SEMAPHORE', + N'DBMIRROR_DBM_EVENT', N'DBMIRROR_EVENTS_QUEUE', N'DBMIRROR_WORKER_QUEUE', + N'DBMIRRORING_CMD', N'DIRTY_PAGE_POLL', N'DISPATCHER_QUEUE_SEMAPHORE', + N'EXECSYNC', N'FSAGENT', N'FT_IFTS_SCHEDULER_IDLE_WAIT', N'FT_IFTSHC_MUTEX', + N'HADR_CLUSAPI_CALL', N'HADR_FILESTREAM_IOMGR_IOCOMPLETION', N'HADR_LOGCAPTURE_WAIT', + N'HADR_NOTIFICATION_DEQUEUE', N'HADR_TIMER_TASK', N'HADR_WORK_QUEUE', + N'KSOURCE_WAKEUP', N'LAZYWRITER_SLEEP', N'LOGMGR_QUEUE', + N'MEMORY_ALLOCATION_EXT', N'ONDEMAND_TASK_QUEUE', + N'PARALLEL_REDO_DRAIN_WORKER', N'PARALLEL_REDO_LOG_CACHE', N'PARALLEL_REDO_TRAN_LIST', + N'PARALLEL_REDO_WORKER_SYNC', N'PARALLEL_REDO_WORKER_WAIT_WORK', + N'PREEMPTIVE_HADR_LEASE_MECHANISM', N'PREEMPTIVE_SP_SERVER_DIAGNOSTICS', + N'PREEMPTIVE_OS_LIBRARYOPS', N'PREEMPTIVE_OS_COMOPS', N'PREEMPTIVE_OS_CRYPTOPS', + N'PREEMPTIVE_OS_PIPEOPS', N'PREEMPTIVE_OS_AUTHENTICATIONOPS', + N'PREEMPTIVE_OS_GENERICOPS', N'PREEMPTIVE_OS_VERIFYTRUST', + N'PREEMPTIVE_OS_FILEOPS', N'PREEMPTIVE_OS_DEVICEOPS', N'PREEMPTIVE_OS_QUERYREGISTRY', + N'PREEMPTIVE_OS_WRITEFILE', + N'PREEMPTIVE_XE_CALLBACKEXECUTE', N'PREEMPTIVE_XE_DISPATCHER', + N'PREEMPTIVE_XE_GETTARGETSTATE', N'PREEMPTIVE_XE_SESSIONCOMMIT', + N'PREEMPTIVE_XE_TARGETINIT', N'PREEMPTIVE_XE_TARGETFINALIZE', + N'PWAIT_ALL_COMPONENTS_INITIALIZED', N'PWAIT_DIRECTLOGCONSUMER_GETNEXT', + N'QDS_PERSIST_TASK_MAIN_LOOP_SLEEP', + N'QDS_ASYNC_QUEUE', + N'QDS_CLEANUP_STALE_QUERIES_TASK_MAIN_LOOP_SLEEP', N'REQUEST_FOR_DEADLOCK_SEARCH', + N'RESOURCE_QUEUE', N'SERVER_IDLE_CHECK', N'SLEEP_BPOOL_FLUSH', N'SLEEP_DBSTARTUP', + N'SLEEP_DCOMSTARTUP', N'SLEEP_MASTERDBREADY', N'SLEEP_MASTERMDREADY', + N'SLEEP_MASTERUPGRADED', N'SLEEP_MSDBSTARTUP', N'SLEEP_SYSTEMTASK', N'SLEEP_TASK', + N'SLEEP_TEMPDBSTARTUP', N'SNI_HTTP_ACCEPT', N'SP_SERVER_DIAGNOSTICS_SLEEP', + N'SQLTRACE_BUFFER_FLUSH', N'SQLTRACE_INCREMENTAL_FLUSH_SLEEP', N'SQLTRACE_WAIT_ENTRIES', + N'WAIT_FOR_RESULTS', N'WAITFOR', N'WAITFOR_TASKSHUTDOWN', N'WAIT_XTP_HOST_WAIT', + N'WAIT_XTP_OFFLINE_CKPT_NEW_LOG', N'WAIT_XTP_CKPT_CLOSE', N'WAIT_XTP_RECOVERY', + N'XE_BUFFERMGR_ALLPROCESSED_EVENT', N'XE_DISPATCHER_JOIN', + N'XE_DISPATCHER_WAIT', N'XE_LIVE_TARGET_TVF', N'XE_TIMER_EVENT') + AND waiting_tasks_count > 0) +SELECT + MAX (W1.wait_type) AS [WaitType], + CAST (MAX (W1.Percentage) AS DECIMAL (5,2)) AS [Wait Percentage], + CAST ((MAX (W1.WaitS) / MAX (W1.WaitCount)) AS DECIMAL (16,4)) AS [AvgWait_Sec], + CAST ((MAX (W1.ResourceS) / MAX (W1.WaitCount)) AS DECIMAL (16,4)) AS [AvgRes_Sec], + CAST ((MAX (W1.SignalS) / MAX (W1.WaitCount)) AS DECIMAL (16,4)) AS [AvgSig_Sec], + CAST (MAX (W1.WaitS) AS DECIMAL (16,2)) AS [Wait_Sec], + CAST (MAX (W1.ResourceS) AS DECIMAL (16,2)) AS [Resource_Sec], + CAST (MAX (W1.SignalS) AS DECIMAL (16,2)) AS [Signal_Sec], + MAX (W1.WaitCount) AS [Wait Count], + CAST (N'https://www.sqlskills.com/help/waits/' + W1.wait_type AS XML) AS [Help/Info URL] +FROM Waits AS W1 +INNER JOIN Waits AS W2 +ON W2.RowNum <= W1.RowNum +GROUP BY W1.RowNum, W1.wait_type +HAVING SUM (W2.Percentage) - MAX (W1.Percentage) < 99 -- percentage threshold +OPTION (RECOMPILE); +------ + +-- Cumulative wait stats are not as useful on an idle instance that is not under load or performance pressure + +-- SQL Server Wait Types Library +-- https://bit.ly/2ePzYO2 + +-- The SQL Server Wait Type Repository +-- https://bit.ly/1afzfjC + +-- Wait statistics, or please tell me where it hurts +-- https://bit.ly/2wsQHQE + +-- SQL Server 2005 Performance Tuning using the Waits and Queues +-- https://bit.ly/1o2NFoF + +-- sys.dm_os_wait_stats (Transact-SQL) +-- https://bit.ly/2Hjq9Yl + + + +-- Get a count of SQL connections by IP address (Query 37) (Connection Counts by IP Address) +SELECT ec.client_net_address, es.[program_name], es.[host_name], es.login_name, +COUNT(ec.session_id) AS [connection count] +FROM sys.dm_exec_sessions AS es WITH (NOLOCK) +INNER JOIN sys.dm_exec_connections AS ec WITH (NOLOCK) +ON es.session_id = ec.session_id +GROUP BY ec.client_net_address, es.[program_name], es.[host_name], es.login_name +ORDER BY ec.client_net_address, es.[program_name] OPTION (RECOMPILE); +------ + +-- This helps you figure where your database load is coming from +-- and verifies connectivity from other machines + +-- Solving Connectivity errors to SQL Server +-- https://bit.ly/2EgzoD0 + + + +-- Get Average Task Counts (run multiple times) (Query 38) (Avg Task Counts) +SELECT AVG(current_tasks_count) AS [Avg Task Count], +AVG(work_queue_count) AS [Avg Work Queue Count], +AVG(runnable_tasks_count) AS [Avg Runnable Task Count], +AVG(pending_disk_io_count) AS [Avg Pending DiskIO Count] +FROM sys.dm_os_schedulers WITH (NOLOCK) +WHERE scheduler_id < 255 OPTION (RECOMPILE); +------ + +-- Sustained values above 10 suggest further investigation in that area +-- High Avg Task Counts are often caused by blocking/deadlocking or other resource contention + +-- Sustained values above 1 suggest further investigation in that area +-- High Avg Runnable Task Counts are a good sign of CPU pressure +-- High Avg Pending DiskIO Counts are a sign of disk pressure + +-- How to Do Some Very Basic SQL Server Monitoring +-- https://bit.ly/30IRla0 + + + +-- Detect blocking (run multiple times) (Query 39) (Detect Blocking) +SELECT t1.resource_type AS [lock type], DB_NAME(resource_database_id) AS [database], +t1.resource_associated_entity_id AS [blk object],t1.request_mode AS [lock req], -- lock requested +t1.request_session_id AS [waiter sid], t2.wait_duration_ms AS [wait time], -- spid of waiter +(SELECT [text] FROM sys.dm_exec_requests AS r WITH (NOLOCK) -- get sql for waiter +CROSS APPLY sys.dm_exec_sql_text(r.[sql_handle]) +WHERE r.session_id = t1.request_session_id) AS [waiter_batch], +(SELECT SUBSTRING(qt.[text],r.statement_start_offset/2, + (CASE WHEN r.statement_end_offset = -1 + THEN LEN(CONVERT(nvarchar(max), qt.[text])) * 2 + ELSE r.statement_end_offset END - r.statement_start_offset)/2) +FROM sys.dm_exec_requests AS r WITH (NOLOCK) +CROSS APPLY sys.dm_exec_sql_text(r.[sql_handle]) AS qt +WHERE r.session_id = t1.request_session_id) AS [waiter_stmt], -- statement blocked +t2.blocking_session_id AS [blocker sid], -- spid of blocker +(SELECT [text] FROM sys.sysprocesses AS p -- get sql for blocker +CROSS APPLY sys.dm_exec_sql_text(p.[sql_handle]) +WHERE p.spid = t2.blocking_session_id) AS [blocker_batch] +FROM sys.dm_tran_locks AS t1 WITH (NOLOCK) +INNER JOIN sys.dm_os_waiting_tasks AS t2 WITH (NOLOCK) +ON t1.lock_owner_address = t2.resource_address OPTION (RECOMPILE); +------ + +-- Helps troubleshoot blocking and deadlocking issues +-- The results will change from second to second on a busy system +-- You should run this query multiple times when you see signs of blocking + + + +-- Get CPU Utilization History for last 256 minutes (in one minute intervals) (Query 40) (CPU Utilization History) +DECLARE @ts_now bigint = (SELECT cpu_ticks/(cpu_ticks/ms_ticks) FROM sys.dm_os_sys_info WITH (NOLOCK)); + +SELECT TOP(256) SQLProcessUtilization AS [SQL Server Process CPU Utilization], + SystemIdle AS [System Idle Process], + 100 - SystemIdle - SQLProcessUtilization AS [Other Process CPU Utilization], + DATEADD(ms, -1 * (@ts_now - [timestamp]), GETDATE()) AS [Event Time] +FROM (SELECT record.value('(./Record/@id)[1]', 'int') AS record_id, + record.value('(./Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int') + AS [SystemIdle], + record.value('(./Record/SchedulerMonitorEvent/SystemHealth/ProcessUtilization)[1]', 'int') + AS [SQLProcessUtilization], [timestamp] + FROM (SELECT [timestamp], CONVERT(xml, record) AS [record] + FROM sys.dm_os_ring_buffers WITH (NOLOCK) + WHERE ring_buffer_type = N'RING_BUFFER_SCHEDULER_MONITOR' + AND record LIKE N'%%') AS x) AS y +ORDER BY record_id DESC OPTION (RECOMPILE); +------ + +-- Look at the trend over the entire period +-- Also look at high sustained 'Other Process' CPU Utilization values +-- Note: This query sometimes gives inaccurate results (negative values) +-- on high core count (> 64 cores) systems + + +-- Get top total worker time queries for entire instance (Query 41) (Top Worker Time Queries) +SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], +REPLACE(REPLACE(LEFT(t.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text], +qs.total_worker_time AS [Total Worker Time], qs.min_worker_time AS [Min Worker Time], +qs.total_worker_time/qs.execution_count AS [Avg Worker Time], +qs.max_worker_time AS [Max Worker Time], +qs.min_elapsed_time AS [Min Elapsed Time], +qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], +qs.max_elapsed_time AS [Max Elapsed Time], +qs.min_logical_reads AS [Min Logical Reads], +qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], +qs.max_logical_reads AS [Max Logical Reads], +qs.execution_count AS [Execution Count], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +qs.creation_time AS [Creation Time] +--,t.[text] AS [Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel +FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) +CROSS APPLY sys.dm_exec_sql_text(plan_handle) AS t +CROSS APPLY sys.dm_exec_query_plan(plan_handle) AS qp +ORDER BY qs.total_worker_time DESC OPTION (RECOMPILE); +------ + + +-- Helps you find the most expensive queries from a CPU perspective across the entire instance +-- Can also help track down parameter sniffing issues + + + +-- Page Life Expectancy (PLE) value for each NUMA node in current instance (Query 42) (PLE by NUMA Node) +SELECT @@SERVERNAME AS [Server Name], RTRIM([object_name]) AS [Object Name], + instance_name, cntr_value AS [Page Life Expectancy] +FROM sys.dm_os_performance_counters WITH (NOLOCK) +WHERE [object_name] LIKE N'%Buffer Node%' -- Handles named instances +AND counter_name = N'Page life expectancy' OPTION (RECOMPILE); +------ + +-- PLE is a good measurement of internal memory pressure +-- Higher PLE is better. Watch the trend over time, not the absolute value +-- This will only return one row for non-NUMA systems + +-- Page Life Expectancy isnt what you think +-- https://bit.ly/2EgynLa + + +-- Memory Grants Pending value for current instance (Query 43) (Memory Grants Pending) +SELECT @@SERVERNAME AS [Server Name], RTRIM([object_name]) AS [Object Name], cntr_value AS [Memory Grants Pending] +FROM sys.dm_os_performance_counters WITH (NOLOCK) +WHERE [object_name] LIKE N'%Memory Manager%' -- Handles named instances +AND counter_name = N'Memory Grants Pending' OPTION (RECOMPILE); +------ + +-- Run multiple times, and run periodically if you suspect you are under memory pressure +-- Memory Grants Pending above zero for a sustained period is a very strong indicator of internal memory pressure + + +-- Memory Clerk Usage for instance (Query 44) (Memory Clerk Usage) +-- Look for high value for CACHESTORE_SQLCP (Ad-hoc query plans) +SELECT TOP(10) mc.[type] AS [Memory Clerk Type], + CAST((SUM(mc.pages_kb)/1024.0) AS DECIMAL (15,2)) AS [Memory Usage (MB)] +FROM sys.dm_os_memory_clerks AS mc WITH (NOLOCK) +GROUP BY mc.[type] +ORDER BY SUM(mc.pages_kb) DESC OPTION (RECOMPILE); +------ + +-- MEMORYCLERK_SQLBUFFERPOOL was new for SQL Server 2012. It should be your highest consumer of memory + +-- CACHESTORE_SQLCP SQL Plans +-- These are cached SQL statements or batches that aren't in stored procedures, functions and triggers +-- Watch out for high values for CACHESTORE_SQLCP +-- Enabling 'optimize for ad hoc workloads' at the instance level can help reduce this +-- Running DBCC FREESYSTEMCACHE ('SQL Plans') periodically may be required to better control this + +-- CACHESTORE_OBJCP Object Plans +-- These are compiled plans for stored procedures, functions and triggers + +-- sys.dm_os_memory_clerks (Transact-SQL) +-- https://bit.ly/2H31xDR + + + +-- Find single-use, ad-hoc and prepared queries that are bloating the plan cache (Query 45) (Ad hoc Queries) +SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], t.[text] AS [Query Text], +cp.objtype AS [Object Type], cp.cacheobjtype AS [Cache Object Type], +cp.size_in_bytes/1024 AS [Plan Size in KB] +FROM sys.dm_exec_cached_plans AS cp WITH (NOLOCK) +CROSS APPLY sys.dm_exec_sql_text(plan_handle) AS t +WHERE cp.cacheobjtype = N'Compiled Plan' +AND cp.objtype IN (N'Adhoc', N'Prepared') +AND cp.usecounts = 1 +ORDER BY cp.size_in_bytes DESC, DB_NAME(t.[dbid]) OPTION (RECOMPILE); +------ + +-- Gives you the text, type and size of single-use ad-hoc and prepared queries that waste space in the plan cache +-- Enabling 'optimize for ad hoc workloads' for the instance can help (SQL Server 2008 and above only) +-- Running DBCC FREESYSTEMCACHE ('SQL Plans') periodically may be required to better control this +-- Enabling forced parameterization for the database can help, but test first! + +-- Plan cache, adhoc workloads and clearing the single-use plan cache bloat +-- https://bit.ly/2EfYOkl + + +-- Get top total logical reads queries for entire instance (Query 46) (Top Logical Reads Queries) +SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], +REPLACE(REPLACE(LEFT(t.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text], +qs.total_logical_reads AS [Total Logical Reads], +qs.min_logical_reads AS [Min Logical Reads], +qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], +qs.max_logical_reads AS [Max Logical Reads], +qs.min_worker_time AS [Min Worker Time], +qs.total_worker_time/qs.execution_count AS [Avg Worker Time], +qs.max_worker_time AS [Max Worker Time], +qs.min_elapsed_time AS [Min Elapsed Time], +qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], +qs.max_elapsed_time AS [Max Elapsed Time], +qs.execution_count AS [Execution Count], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +qs.creation_time AS [Creation Time] +--,t.[text] AS [Complete Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel +FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) +CROSS APPLY sys.dm_exec_sql_text(plan_handle) AS t +CROSS APPLY sys.dm_exec_query_plan(plan_handle) AS qp +ORDER BY qs.total_logical_reads DESC OPTION (RECOMPILE); +------ + + +-- Helps you find the most expensive queries from a memory perspective across the entire instance +-- Can also help track down parameter sniffing issues + + +-- Get top average elapsed time queries for entire instance (Query 47) (Top Avg Elapsed Time Queries) +SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], +REPLACE(REPLACE(LEFT(t.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text], +qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], +qs.min_elapsed_time, qs.max_elapsed_time, qs.last_elapsed_time, +qs.execution_count AS [Execution Count], +qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], +qs.total_physical_reads/qs.execution_count AS [Avg Physical Reads], +qs.total_worker_time/qs.execution_count AS [Avg Worker Time], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +qs.creation_time AS [Creation Time] +--,t.[text] AS [Complete Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel +FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) +CROSS APPLY sys.dm_exec_sql_text(plan_handle) AS t +CROSS APPLY sys.dm_exec_query_plan(plan_handle) AS qp +ORDER BY qs.total_elapsed_time/qs.execution_count DESC OPTION (RECOMPILE); +------ + +-- Helps you find the highest average elapsed time queries across the entire instance +-- Can also help track down parameter sniffing issues + + +-- Look at UDF execution statistics (Query 48) (UDF Stats by DB) +SELECT TOP (25) DB_NAME(database_id) AS [Database Name], + OBJECT_NAME(object_id, database_id) AS [Function Name], + total_worker_time, execution_count, total_elapsed_time, + total_elapsed_time/execution_count AS [avg_elapsed_time], + last_elapsed_time, last_execution_time, cached_time, [type_desc] +FROM sys.dm_exec_function_stats WITH (NOLOCK) +ORDER BY total_worker_time DESC OPTION (RECOMPILE); +------ + +-- sys.dm_exec_function_stats (Transact-SQL) +-- https://bit.ly/2q1Q6BM + +-- Showplan Enhancements for UDFs +-- https://bit.ly/2LVqiQ1 + +-- Database specific queries ***************************************************************** + +-- **** Please switch to a user database that you are interested in! ***** +--USE YourDatabaseName; -- make sure to change to an actual database on your instance, not the master system database +--GO + +-- Individual File Sizes and space available for current database (Query 49) (File Sizes and Space) +SELECT f.name AS [File Name] , f.physical_name AS [Physical Name], +CAST((f.size/128.0) AS DECIMAL(15,2)) AS [Total Size in MB], +CAST(f.size/128.0 - CAST(FILEPROPERTY(f.name, 'SpaceUsed') AS int)/128.0 AS DECIMAL(15,2)) +AS [Available Space In MB], +CAST((f.size/128.0) AS DECIMAL(15,2)) - +CAST(f.size/128.0 - CAST(FILEPROPERTY(f.name, 'SpaceUsed') AS int)/128.0 AS DECIMAL(15,2)) AS [Used Space in MB], +f.[file_id], fg.name AS [Filegroup Name], +f.is_percent_growth, f.growth, fg.is_default, fg.is_read_only, +fg.is_autogrow_all_files +FROM sys.database_files AS f WITH (NOLOCK) +LEFT OUTER JOIN sys.filegroups AS fg WITH (NOLOCK) +ON f.data_space_id = fg.data_space_id +ORDER BY f.[file_id] OPTION (RECOMPILE); +------ + +-- Look at how large and how full the files are and where they are located +-- Make sure the transaction log is not full!! + +-- is_autogrow_all_files is new for SQL Server 2016. Equivalent to TF 1117 for user databases + +-- SQL Server 2016: Changes in default behavior for autogrow and allocations for tempdb and user databases +-- https://bit.ly/2evRZSR + + +-- Log space usage for current database (Query 50) (Log Space Usage) +SELECT DB_NAME(lsu.database_id) AS [Database Name], db.recovery_model_desc AS [Recovery Model], + CAST(lsu.total_log_size_in_bytes/1048576.0 AS DECIMAL(10, 2)) AS [Total Log Space (MB)], + CAST(lsu.used_log_space_in_bytes/1048576.0 AS DECIMAL(10, 2)) AS [Used Log Space (MB)], + CAST(lsu.used_log_space_in_percent AS DECIMAL(10, 2)) AS [Used Log Space %], + CAST(lsu.log_space_in_bytes_since_last_backup/1048576.0 AS DECIMAL(10, 2)) AS [Used Log Space Since Last Backup (MB)], + db.log_reuse_wait_desc +FROM sys.dm_db_log_space_usage AS lsu WITH (NOLOCK) +INNER JOIN sys.databases AS db WITH (NOLOCK) +ON lsu.database_id = db.database_id +OPTION (RECOMPILE); +------ + +-- Look at log file size and usage, along with the log reuse wait description for the current database + +-- sys.dm_db_log_space_usage (Transact-SQL) +-- https://bit.ly/2H4MQw9 + + +-- Get database scoped configuration values for current database (Query 51) (Database-scoped Configurations) +SELECT configuration_id, name, [value] AS [value_for_primary], value_for_secondary +FROM sys.database_scoped_configurations WITH (NOLOCK) OPTION (RECOMPILE); +------ + +-- This lets you see the value of these new properties for the current database + +-- Clear plan cache for current database +-- ALTER DATABASE SCOPED CONFIGURATION CLEAR PROCEDURE_CACHE; + +-- ALTER DATABASE SCOPED CONFIGURATION (Transact-SQL) +-- https://bit.ly/2sOH7nb + + +-- I/O Statistics by file for the current database (Query 52) (IO Stats By File) +SELECT DB_NAME(DB_ID()) AS [Database Name], df.name AS [Logical Name], vfs.[file_id], df.type_desc, +df.physical_name AS [Physical Name], CAST(vfs.size_on_disk_bytes/1048576.0 AS DECIMAL(16, 2)) AS [Size on Disk (MB)], +vfs.num_of_reads, vfs.num_of_writes, vfs.io_stall_read_ms, vfs.io_stall_write_ms, +CAST(100. * vfs.io_stall_read_ms/(vfs.io_stall_read_ms + vfs.io_stall_write_ms) AS DECIMAL(16,1)) AS [IO Stall Reads Pct], +CAST(100. * vfs.io_stall_write_ms/(vfs.io_stall_write_ms + vfs.io_stall_read_ms) AS DECIMAL(16,1)) AS [IO Stall Writes Pct], +(vfs.num_of_reads + vfs.num_of_writes) AS [Writes + Reads], +CAST(vfs.num_of_bytes_read/1048576.0 AS DECIMAL(16, 2)) AS [MB Read], +CAST(vfs.num_of_bytes_written/1048576.0 AS DECIMAL(16, 2)) AS [MB Written], +CAST(100. * vfs.num_of_reads/(vfs.num_of_reads + vfs.num_of_writes) AS DECIMAL(16,1)) AS [# Reads Pct], +CAST(100. * vfs.num_of_writes/(vfs.num_of_reads + vfs.num_of_writes) AS DECIMAL(16,1)) AS [# Write Pct], +CAST(100. * vfs.num_of_bytes_read/(vfs.num_of_bytes_read + vfs.num_of_bytes_written) AS DECIMAL(16,1)) AS [Read Bytes Pct], +CAST(100. * vfs.num_of_bytes_written/(vfs.num_of_bytes_read + vfs.num_of_bytes_written) AS DECIMAL(16,1)) AS [Written Bytes Pct] +FROM sys.dm_io_virtual_file_stats(DB_ID(), NULL) AS vfs +INNER JOIN sys.database_files AS df WITH (NOLOCK) +ON vfs.[file_id]= df.[file_id] OPTION (RECOMPILE); +------ + +-- This helps you characterize your workload better from an I/O perspective for this database +-- It helps you determine whether you has an OLTP or DW/DSS type of workload + + + +-- Get most frequently executed queries for this database (Query 53) (Query Execution Counts) +SELECT TOP(50) LEFT(t.[text], 50) AS [Short Query Text], qs.execution_count AS [Execution Count], +qs.total_logical_reads AS [Total Logical Reads], +qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], +qs.total_worker_time AS [Total Worker Time], +qs.total_worker_time/qs.execution_count AS [Avg Worker Time], +qs.total_elapsed_time AS [Total Elapsed Time], +qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +qs.creation_time AS [Creation Time] +--,t.[text] AS [Complete Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel +FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) +CROSS APPLY sys.dm_exec_sql_text(plan_handle) AS t +CROSS APPLY sys.dm_exec_query_plan(plan_handle) AS qp +WHERE t.dbid = DB_ID() +ORDER BY qs.execution_count DESC OPTION (RECOMPILE); +------ + + +-- Queries 54 through 60 are the "Bad Man List" for stored procedures + +-- Top Cached SPs By Execution Count (Query 54) (SP Execution Counts) +SELECT TOP(100) p.name AS [SP Name], qs.execution_count AS [Execution Count], +ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], +qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], +qs.total_worker_time/qs.execution_count AS [Avg Worker Time], +qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], +FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] +-- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan +FROM sys.procedures AS p WITH (NOLOCK) +INNER JOIN sys.dm_exec_procedure_stats AS qs WITH (NOLOCK) +ON p.[object_id] = qs.[object_id] +CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) AS qp +WHERE qs.database_id = DB_ID() +AND DATEDIFF(Minute, qs.cached_time, GETDATE()) > 0 +ORDER BY qs.execution_count DESC OPTION (RECOMPILE); +------ + +-- Tells you which cached stored procedures are called the most often +-- This helps you characterize and baseline your workload +-- It also helps you find possible caching opportunities + + +-- Top Cached SPs By Avg Elapsed Time (Query 55) (SP Avg Elapsed Time) +SELECT TOP(25) p.name AS [SP Name], qs.min_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], +qs.max_elapsed_time, qs.last_elapsed_time, qs.total_elapsed_time, qs.execution_count, +ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], +qs.total_worker_time/qs.execution_count AS [AvgWorkerTime], +qs.total_worker_time AS [TotalWorkerTime], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], +FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] +-- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan +FROM sys.procedures AS p WITH (NOLOCK) +INNER JOIN sys.dm_exec_procedure_stats AS qs WITH (NOLOCK) +ON p.[object_id] = qs.[object_id] +CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) AS qp +WHERE qs.database_id = DB_ID() +AND DATEDIFF(Minute, qs.cached_time, GETDATE()) > 0 +ORDER BY avg_elapsed_time DESC OPTION (RECOMPILE); +------ + +-- This helps you find high average elapsed time cached stored procedures that +-- may be easy to optimize with standard query tuning techniques + + + +-- Top Cached SPs By Total Worker time. Worker time relates to CPU cost (Query 56) (SP Worker Time) +SELECT TOP(25) p.name AS [SP Name], qs.total_worker_time AS [TotalWorkerTime], +qs.total_worker_time/qs.execution_count AS [AvgWorkerTime], qs.execution_count, +ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], +qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], +FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] +-- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan +FROM sys.procedures AS p WITH (NOLOCK) +INNER JOIN sys.dm_exec_procedure_stats AS qs WITH (NOLOCK) +ON p.[object_id] = qs.[object_id] +CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) AS qp +WHERE qs.database_id = DB_ID() +AND DATEDIFF(Minute, qs.cached_time, GETDATE()) > 0 +ORDER BY qs.total_worker_time DESC OPTION (RECOMPILE); +------ + +-- This helps you find the most expensive cached stored procedures from a CPU perspective +-- You should look at this if you see signs of CPU pressure + + +-- Top Cached SPs By Total Logical Reads. Logical reads relate to memory pressure (Query 57) (SP Logical Reads) +SELECT TOP(25) p.name AS [SP Name], qs.total_logical_reads AS [TotalLogicalReads], +qs.total_logical_reads/qs.execution_count AS [AvgLogicalReads],qs.execution_count, +ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], +qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], +FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] +-- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan +FROM sys.procedures AS p WITH (NOLOCK) +INNER JOIN sys.dm_exec_procedure_stats AS qs WITH (NOLOCK) +ON p.[object_id] = qs.[object_id] +CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) AS qp +WHERE qs.database_id = DB_ID() +AND DATEDIFF(Minute, qs.cached_time, GETDATE()) > 0 +ORDER BY qs.total_logical_reads DESC OPTION (RECOMPILE); +------ + +-- This helps you find the most expensive cached stored procedures from a memory perspective +-- You should look at this if you see signs of memory pressure + + +-- Top Cached SPs By Total Physical Reads. Physical reads relate to disk read I/O pressure (Query 58) (SP Physical Reads) +SELECT TOP(25) p.name AS [SP Name],qs.total_physical_reads AS [TotalPhysicalReads], +qs.total_physical_reads/qs.execution_count AS [AvgPhysicalReads], qs.execution_count, +qs.total_logical_reads,qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], +FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] +-- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan +FROM sys.procedures AS p WITH (NOLOCK) +INNER JOIN sys.dm_exec_procedure_stats AS qs WITH (NOLOCK) +ON p.[object_id] = qs.[object_id] +CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) AS qp +WHERE qs.database_id = DB_ID() +AND qs.total_physical_reads > 0 +ORDER BY qs.total_physical_reads DESC, qs.total_logical_reads DESC OPTION (RECOMPILE); +------ + +-- This helps you find the most expensive cached stored procedures from a read I/O perspective +-- You should look at this if you see signs of I/O pressure or of memory pressure + + + +-- Top Cached SPs By Total Logical Writes (Query 59) (SP Logical Writes) +-- Logical writes relate to both memory and disk I/O pressure +SELECT TOP(25) p.name AS [SP Name], qs.total_logical_writes AS [TotalLogicalWrites], +qs.total_logical_writes/qs.execution_count AS [AvgLogicalWrites], qs.execution_count, +ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], +qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], +FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] +-- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan +FROM sys.procedures AS p WITH (NOLOCK) +INNER JOIN sys.dm_exec_procedure_stats AS qs WITH (NOLOCK) +ON p.[object_id] = qs.[object_id] +CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) AS qp +WHERE qs.database_id = DB_ID() +AND qs.total_logical_writes > 0 +AND DATEDIFF(Minute, qs.cached_time, GETDATE()) > 0 +ORDER BY qs.total_logical_writes DESC OPTION (RECOMPILE); +------ + +-- This helps you find the most expensive cached stored procedures from a write I/O perspective +-- You should look at this if you see signs of I/O pressure or of memory pressure + + + +-- Cached SPs Missing Indexes by Execution Count (Query 60) (SP Missing Index) +SELECT TOP(25) p.name AS [SP Name], qs.execution_count AS [Execution Count], +ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], +qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], +qs.total_worker_time/qs.execution_count AS [Avg Worker Time], +qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], +FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], +FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] +-- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan +FROM sys.procedures AS p WITH (NOLOCK) +INNER JOIN sys.dm_exec_procedure_stats AS qs WITH (NOLOCK) +ON p.[object_id] = qs.[object_id] +CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) AS qp +WHERE qs.database_id = DB_ID() +AND DATEDIFF(Minute, qs.cached_time, GETDATE()) > 0 +AND CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' +ORDER BY qs.execution_count DESC OPTION (RECOMPILE); +------ + +-- This helps you find the most frequently executed cached stored procedures that have missing index warnings +-- This can often help you find index tuning candidates + + + +-- Lists the top statements by average input/output usage for the current database (Query 61) (Top IO Statements) +SELECT TOP(50) OBJECT_NAME(qt.objectid, dbid) AS [SP Name], +(qs.total_logical_reads + qs.total_logical_writes) /qs.execution_count AS [Avg IO], qs.execution_count AS [Execution Count], +SUBSTRING(qt.[text],qs.statement_start_offset/2, + (CASE + WHEN qs.statement_end_offset = -1 + THEN LEN(CONVERT(nvarchar(max), qt.[text])) * 2 + ELSE qs.statement_end_offset + END - qs.statement_start_offset)/2) AS [Query Text] +FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) +CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) AS qt +WHERE qt.[dbid] = DB_ID() +ORDER BY [Avg IO] DESC OPTION (RECOMPILE); +------ + +-- Helps you find the most expensive statements for I/O by SP + + + +-- Possible Bad NC Indexes (writes > reads) (Query 62) (Bad NC Indexes) +SELECT SCHEMA_NAME(o.[schema_id]) AS [Schema Name], +OBJECT_NAME(s.[object_id]) AS [Table Name], +i.name AS [Index Name], i.index_id, +i.is_disabled, i.is_hypothetical, i.has_filter, i.fill_factor, +s.user_updates AS [Total Writes], s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], +s.user_updates - (s.user_seeks + s.user_scans + s.user_lookups) AS [Difference] +FROM sys.dm_db_index_usage_stats AS s WITH (NOLOCK) +INNER JOIN sys.indexes AS i WITH (NOLOCK) +ON s.[object_id] = i.[object_id] +AND i.index_id = s.index_id +INNER JOIN sys.objects AS o WITH (NOLOCK) +ON i.[object_id] = o.[object_id] +WHERE OBJECTPROPERTY(s.[object_id],'IsUserTable') = 1 +AND s.database_id = DB_ID() +AND s.user_updates > (s.user_seeks + s.user_scans + s.user_lookups) +AND i.index_id > 1 AND i.[type_desc] = N'NONCLUSTERED' +AND i.is_primary_key = 0 AND i.is_unique_constraint = 0 AND i.is_unique = 0 +ORDER BY [Difference] DESC, [Total Writes] DESC, [Total Reads] ASC OPTION (RECOMPILE); +------ + +-- Look for indexes with high numbers of writes and zero or very low numbers of reads +-- Consider your complete workload, and how long your instance has been running +-- Investigate further before dropping an index! + + +-- Missing Indexes for current database by Index Advantage (Query 63) (Missing Indexes) +SELECT DISTINCT CONVERT(decimal(18,2), migs.user_seeks * migs.avg_total_user_cost * (migs.avg_user_impact * 0.01)) AS [index_advantage], +migs.last_user_seek, mid.[statement] AS [Database.Schema.Table], +mid.equality_columns, mid.inequality_columns, mid.included_columns, +migs.user_seeks, migs.avg_total_user_cost, migs.avg_user_impact, +OBJECT_NAME(mid.[object_id]) AS [Table Name], p.rows AS [Table Rows] +FROM sys.dm_db_missing_index_group_stats AS migs WITH (NOLOCK) +INNER JOIN sys.dm_db_missing_index_groups AS mig WITH (NOLOCK) +ON migs.group_handle = mig.index_group_handle +INNER JOIN sys.dm_db_missing_index_details AS mid WITH (NOLOCK) +ON mig.index_handle = mid.index_handle +INNER JOIN sys.partitions AS p WITH (NOLOCK) +ON p.[object_id] = mid.[object_id] +WHERE mid.database_id = DB_ID() +AND p.index_id < 2 +ORDER BY index_advantage DESC OPTION (RECOMPILE); +------ + +-- Look at index advantage, last user seek time, number of user seeks to help determine source and importance +-- SQL Server is overly eager to add included columns, so beware +-- Do not just blindly add indexes that show up from this query!!! +-- Hkan Winther has given me some great suggestions for this query + + +-- Find missing index warnings for cached plans in the current database (Query 64) (Missing Index Warnings) +-- Note: This query could take some time on a busy instance +SELECT TOP(25) OBJECT_NAME(objectid) AS [ObjectName], + cp.objtype, cp.usecounts, cp.size_in_bytes, qp.query_plan +FROM sys.dm_exec_cached_plans AS cp WITH (NOLOCK) +CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) AS qp +WHERE CAST(query_plan AS NVARCHAR(MAX)) LIKE N'%MissingIndex%' +AND dbid = DB_ID() +ORDER BY cp.usecounts DESC OPTION (RECOMPILE); +------ + +-- Helps you connect missing indexes to specific stored procedures or queries +-- This can help you decide whether to add them or not + + +-- Breaks down buffers used by current database by object (table, index) in the buffer cache (Query 65) (Buffer Usage) +-- Note: This query could take some time on a busy instance +SELECT fg.name AS [Filegroup Name], SCHEMA_NAME(o.Schema_ID) AS [Schema Name], +OBJECT_NAME(p.[object_id]) AS [Object Name], p.index_id, +CAST(COUNT(*)/128.0 AS DECIMAL(10, 2)) AS [Buffer size(MB)], +COUNT(*) AS [BufferCount], p.[Rows] AS [Row Count], +p.data_compression_desc AS [Compression Type] +FROM sys.allocation_units AS a WITH (NOLOCK) +INNER JOIN sys.dm_os_buffer_descriptors AS b WITH (NOLOCK) +ON a.allocation_unit_id = b.allocation_unit_id +INNER JOIN sys.partitions AS p WITH (NOLOCK) +ON a.container_id = p.hobt_id +INNER JOIN sys.objects AS o WITH (NOLOCK) +ON p.object_id = o.object_id +INNER JOIN sys.database_files AS f WITH (NOLOCK) +ON b.file_id = f.file_id +INNER JOIN sys.filegroups AS fg WITH (NOLOCK) +ON f.data_space_id = fg.data_space_id +WHERE b.database_id = CONVERT(int, DB_ID()) +AND p.[object_id] > 100 +AND OBJECT_NAME(p.[object_id]) NOT LIKE N'plan_%' +AND OBJECT_NAME(p.[object_id]) NOT LIKE N'sys%' +AND OBJECT_NAME(p.[object_id]) NOT LIKE N'xml_index_nodes%' +GROUP BY fg.name, o.Schema_ID, p.[object_id], p.index_id, + p.data_compression_desc, p.[Rows] +ORDER BY [BufferCount] DESC OPTION (RECOMPILE); +------ + +-- Tells you what tables and indexes are using the most memory in the buffer cache +-- It can help identify possible candidates for data compression + + +-- Get Table names, row counts, and compression status for clustered index or heap (Query 66) (Table Sizes) +SELECT SCHEMA_NAME(o.Schema_ID) AS [Schema Name], OBJECT_NAME(p.object_id) AS [ObjectName], +SUM(p.Rows) AS [RowCount], p.data_compression_desc AS [Compression Type] +FROM sys.partitions AS p WITH (NOLOCK) +INNER JOIN sys.objects AS o WITH (NOLOCK) +ON p.object_id = o.object_id +WHERE index_id < 2 --ignore the partitions from the non-clustered index if any +AND OBJECT_NAME(p.object_id) NOT LIKE N'sys%' +AND OBJECT_NAME(p.object_id) NOT LIKE N'spt_%' +AND OBJECT_NAME(p.object_id) NOT LIKE N'queue_%' +AND OBJECT_NAME(p.object_id) NOT LIKE N'filestream_tombstone%' +AND OBJECT_NAME(p.object_id) NOT LIKE N'fulltext%' +AND OBJECT_NAME(p.object_id) NOT LIKE N'ifts_comp_fragment%' +AND OBJECT_NAME(p.object_id) NOT LIKE N'filetable_updates%' +AND OBJECT_NAME(p.object_id) NOT LIKE N'xml_index_nodes%' +AND OBJECT_NAME(p.object_id) NOT LIKE N'sqlagent_job%' +AND OBJECT_NAME(p.object_id) NOT LIKE N'plan_persist%' +GROUP BY SCHEMA_NAME(o.Schema_ID), p.object_id, data_compression_desc +ORDER BY SUM(p.Rows) DESC OPTION (RECOMPILE); +------ + +-- Gives you an idea of table sizes, and possible data compression opportunities + + + +-- Get some key table properties (Query 67) (Table Properties) +SELECT OBJECT_NAME(t.[object_id]) AS [ObjectName], p.[rows] AS [Table Rows], p.index_id, + p.data_compression_desc AS [Index Data Compression], + t.create_date, t.lock_on_bulk_load, t.is_replicated, t.has_replication_filter, + t.is_tracked_by_cdc, t.lock_escalation_desc, t.is_filetable, + t.is_memory_optimized, t.durability_desc, + t.temporal_type_desc, t.is_remote_data_archive_enabled, t.is_external -- new for SQL Server 2016 +FROM sys.tables AS t WITH (NOLOCK) +INNER JOIN sys.partitions AS p WITH (NOLOCK) +ON t.[object_id] = p.[object_id] +WHERE OBJECT_NAME(t.[object_id]) NOT LIKE N'sys%' +ORDER BY OBJECT_NAME(t.[object_id]), p.index_id OPTION (RECOMPILE); +------ + +-- Gives you some good information about your tables +-- is_memory_optimized and durability_desc were new in SQL Server 2014 +-- temporal_type_desc, is_remote_data_archive_enabled, is_external were new in SQL Server 2016 + +-- sys.tables (Transact-SQL) +-- https://bit.ly/2Gk7998 + + + +-- When were Statistics last updated on all indexes? (Query 68) (Statistics Update) +SELECT SCHEMA_NAME(o.Schema_ID) + N'.' + o.[NAME] AS [Object Name], o.[type_desc] AS [Object Type], + i.[name] AS [Index Name], STATS_DATE(i.[object_id], i.index_id) AS [Statistics Date], + s.auto_created, s.no_recompute, s.user_created, s.is_incremental, s.is_temporary, + st.row_count, st.used_page_count +FROM sys.objects AS o WITH (NOLOCK) +INNER JOIN sys.indexes AS i WITH (NOLOCK) +ON o.[object_id] = i.[object_id] +INNER JOIN sys.stats AS s WITH (NOLOCK) +ON i.[object_id] = s.[object_id] +AND i.index_id = s.stats_id +INNER JOIN sys.dm_db_partition_stats AS st WITH (NOLOCK) +ON o.[object_id] = st.[object_id] +AND i.[index_id] = st.[index_id] +WHERE o.[type] IN ('U', 'V') +AND st.row_count > 0 +ORDER BY STATS_DATE(i.[object_id], i.index_id) DESC OPTION (RECOMPILE); +------ + +-- Helps discover possible problems with out-of-date statistics +-- Also gives you an idea which indexes are the most active + +-- sys.stats (Transact-SQL) +-- https://bit.ly/2GyAxrn + +-- UPDATEs to Statistics (Erin Stellato) +-- https://bit.ly/2vhrYQy + + + + +-- Look at most frequently modified indexes and statistics (Query 69) (Volatile Indexes) +SELECT o.[name] AS [Object Name], o.[object_id], o.[type_desc], s.[name] AS [Statistics Name], + s.stats_id, s.no_recompute, s.auto_created, s.is_incremental, s.is_temporary, + sp.modification_counter, sp.[rows], sp.rows_sampled, sp.last_updated +FROM sys.objects AS o WITH (NOLOCK) +INNER JOIN sys.stats AS s WITH (NOLOCK) +ON s.object_id = o.object_id +CROSS APPLY sys.dm_db_stats_properties(s.object_id, s.stats_id) AS sp +WHERE o.[type_desc] NOT IN (N'SYSTEM_TABLE', N'INTERNAL_TABLE') +AND sp.modification_counter > 0 +ORDER BY sp.modification_counter DESC, o.name OPTION (RECOMPILE); +------ + +-- This helps you understand your workload and make better decisions about +-- things like data compression and adding new indexes to a table + + + +-- Get fragmentation info for all indexes above a certain size in the current database (Query 70) (Index Fragmentation) +-- Note: This query could take some time on a very large database +SELECT DB_NAME(ps.database_id) AS [Database Name], SCHEMA_NAME(o.[schema_id]) AS [Schema Name], +OBJECT_NAME(ps.OBJECT_ID) AS [Object Name], i.[name] AS [Index Name], ps.index_id, +ps.index_type_desc, ps.avg_fragmentation_in_percent, +ps.fragment_count, ps.page_count, i.fill_factor, i.has_filter, +i.filter_definition, i.[allow_page_locks] +FROM sys.dm_db_index_physical_stats(DB_ID(),NULL, NULL, NULL , N'LIMITED') AS ps +INNER JOIN sys.indexes AS i WITH (NOLOCK) +ON ps.[object_id] = i.[object_id] +AND ps.index_id = i.index_id +INNER JOIN sys.objects AS o WITH (NOLOCK) +ON i.[object_id] = o.[object_id] +WHERE ps.database_id = DB_ID() +AND ps.page_count > 2500 +ORDER BY ps.avg_fragmentation_in_percent DESC OPTION (RECOMPILE); +------ + +-- Helps determine whether you have framentation in your relational indexes +-- and how effective your index maintenance strategy is + + +--- Index Read/Write stats (all tables in current DB) ordered by Reads (Query 71) (Overall Index Usage - Reads) +SELECT SCHEMA_NAME(t.[schema_id]) AS [SchemaName], OBJECT_NAME(i.[object_id]) AS [ObjectName], + i.[name] AS [IndexName], i.index_id, + s.user_seeks, s.user_scans, s.user_lookups, + s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], + s.user_updates AS [Writes], + i.[type_desc] AS [Index Type], i.fill_factor AS [Fill Factor], i.has_filter, i.filter_definition, + s.last_user_scan, s.last_user_lookup, s.last_user_seek +FROM sys.indexes AS i WITH (NOLOCK) +LEFT OUTER JOIN sys.dm_db_index_usage_stats AS s WITH (NOLOCK) +ON i.[object_id] = s.[object_id] +AND i.index_id = s.index_id +AND s.database_id = DB_ID() +LEFT OUTER JOIN sys.tables AS t WITH (NOLOCK) +ON t.[object_id] = i.[object_id] +WHERE OBJECTPROPERTY(i.[object_id],'IsUserTable') = 1 +ORDER BY s.user_seeks + s.user_scans + s.user_lookups DESC OPTION (RECOMPILE); -- Order by reads +------ + +-- Show which indexes in the current database are most active for Reads + + +--- Index Read/Write stats (all tables in current DB) ordered by Writes (Query 72) (Overall Index Usage - Writes) +SELECT SCHEMA_NAME(t.[schema_id]) AS [SchemaName],OBJECT_NAME(i.[object_id]) AS [ObjectName], + i.[name] AS [IndexName], i.index_id, + s.user_updates AS [Writes], s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], + i.[type_desc] AS [Index Type], i.fill_factor AS [Fill Factor], i.has_filter, i.filter_definition, + s.last_system_update, s.last_user_update +FROM sys.indexes AS i WITH (NOLOCK) +LEFT OUTER JOIN sys.dm_db_index_usage_stats AS s WITH (NOLOCK) +ON i.[object_id] = s.[object_id] +AND i.index_id = s.index_id +AND s.database_id = DB_ID() +LEFT OUTER JOIN sys.tables AS t WITH (NOLOCK) +ON t.[object_id] = i.[object_id] +WHERE OBJECTPROPERTY(i.[object_id],'IsUserTable') = 1 +ORDER BY s.user_updates DESC OPTION (RECOMPILE); -- Order by writes +------ + +-- Show which indexes in the current database are most active for Writes + + +-- Get in-memory OLTP index usage (Query 73) (XTP Index Usage) +SELECT OBJECT_NAME(i.[object_id]) AS [Object Name], i.index_id, i.[name] AS [Index Name], + i.[type_desc], xis.scans_started, xis.scans_retries, + xis.rows_touched, xis.rows_returned +FROM sys.dm_db_xtp_index_stats AS xis WITH (NOLOCK) +INNER JOIN sys.indexes AS i WITH (NOLOCK) +ON i.[object_id] = xis.[object_id] +AND i.index_id = xis.index_id +ORDER BY OBJECT_NAME(i.[object_id]) OPTION (RECOMPILE); +------ + +-- This gives you some index usage statistics for in-memory OLTP +-- Returns no data if you are not using in-memory OLTP + +-- Guidelines for Using Indexes on Memory-Optimized Tables +-- https://bit.ly/2GCP8lF + + + +-- Look at Columnstore index physical statistics (Query 74) (Columnstore Index Physical Stat) +SELECT OBJECT_NAME(ps.object_id) AS [TableName], + i.[name] AS [IndexName], ps.index_id, ps.partition_number, + ps.delta_store_hobt_id, ps.state_desc, ps.total_rows, ps.size_in_bytes, + ps.trim_reason_desc, ps.generation, ps.transition_to_compressed_state_desc, + ps.has_vertipaq_optimization, ps.deleted_rows, + 100 * (ISNULL(ps.deleted_rows, 0))/ps.total_rows AS [Fragmentation] +FROM sys.dm_db_column_store_row_group_physical_stats AS ps WITH (NOLOCK) +INNER JOIN sys.indexes AS i WITH (NOLOCK) +ON ps.object_id = i.object_id +AND ps.index_id = i.index_id +ORDER BY ps.object_id, ps.partition_number, ps.row_group_id OPTION (RECOMPILE); +------ + +-- sys.dm_db_column_store_row_group_physical_stats (Transact-SQL) +-- https://bit.ly/2q276XQ + + + +-- Get lock waits for current database (Query 75) (Lock Waits) +SELECT o.name AS [table_name], i.name AS [index_name], ios.index_id, ios.partition_number, + SUM(ios.row_lock_wait_count) AS [total_row_lock_waits], + SUM(ios.row_lock_wait_in_ms) AS [total_row_lock_wait_in_ms], + SUM(ios.page_lock_wait_count) AS [total_page_lock_waits], + SUM(ios.page_lock_wait_in_ms) AS [total_page_lock_wait_in_ms], + SUM(ios.page_lock_wait_in_ms)+ SUM(row_lock_wait_in_ms) AS [total_lock_wait_in_ms] +FROM sys.dm_db_index_operational_stats(DB_ID(), NULL, NULL, NULL) AS ios +INNER JOIN sys.objects AS o WITH (NOLOCK) +ON ios.[object_id] = o.[object_id] +INNER JOIN sys.indexes AS i WITH (NOLOCK) +ON ios.[object_id] = i.[object_id] +AND ios.index_id = i.index_id +WHERE o.[object_id] > 100 +GROUP BY o.name, i.name, ios.index_id, ios.partition_number +HAVING SUM(ios.page_lock_wait_in_ms)+ SUM(row_lock_wait_in_ms) > 0 +ORDER BY total_lock_wait_in_ms DESC OPTION (RECOMPILE); +------ + +-- This query is helpful for troubleshooting blocking and deadlocking issues + + + +-- Look at UDF execution statistics (Query 76) (UDF Statistics) +SELECT OBJECT_NAME(object_id) AS [Function Name], execution_count, + total_worker_time, total_logical_reads, total_physical_reads, total_elapsed_time, + total_elapsed_time/execution_count AS [avg_elapsed_time], + FORMAT(cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] +FROM sys.dm_exec_function_stats WITH (NOLOCK) +WHERE database_id = DB_ID() +ORDER BY total_worker_time DESC OPTION (RECOMPILE); +------ + +-- New for SQL Server 2016 +-- Helps you investigate scalar UDF performance issues +-- Does not return information for table valued functions + +-- sys.dm_exec_function_stats (Transact-SQL) +-- https://bit.ly/2q1Q6BM + + +-- Get QueryStore Options for this database (Query 77) (QueryStore Options) +SELECT actual_state_desc, desired_state_desc, [interval_length_minutes], + current_storage_size_mb, [max_storage_size_mb], + query_capture_mode_desc, size_based_cleanup_mode_desc +FROM sys.database_query_store_options WITH (NOLOCK) OPTION (RECOMPILE); +------ + +-- New for SQL Server 2016 +-- Requires that Query Store is enabled for this database + +-- Make sure that the actual_state_desc is the same as desired_state_desc +-- Make sure that the current_storage_size_mb is less than the max_storage_size_mb + +-- Tuning Workload Performance with Query Store +-- https://bit.ly/1kHSl7w + + + +-- Get input buffer information for the current database (Query 78) (Input Buffer) +SELECT es.session_id, DB_NAME(es.database_id) AS [Database Name], + es.login_time, es.cpu_time, es.logical_reads, es.memory_usage, + es.[status], ib.event_info AS [Input Buffer] +FROM sys.dm_exec_sessions AS es WITH (NOLOCK) +CROSS APPLY sys.dm_exec_input_buffer(es.session_id, NULL) AS ib +WHERE es.database_id = DB_ID() +AND es.session_id > 50 +AND es.session_id <> @@SPID OPTION (RECOMPILE); +------ + +-- Gives you input buffer information from all non-system sessions for the current database +-- Replaces DBCC INPUTBUFFER + +-- New DMF for retrieving input buffer in SQL Server +-- https://bit.ly/2uHKMbz + +-- sys.dm_exec_input_buffer (Transact-SQL) +-- https://bit.ly/2J5Hf9q + + + +-- Look at recent Full backups for the current database (Query 79) (Recent Full Backups) +SELECT TOP (30) bs.machine_name, bs.server_name, bs.database_name AS [Database Name], bs.recovery_model, +CONVERT (BIGINT, bs.backup_size / 1048576 ) AS [Uncompressed Backup Size (MB)], +CONVERT (BIGINT, bs.compressed_backup_size / 1048576 ) AS [Compressed Backup Size (MB)], +CONVERT (NUMERIC (20,2), (CONVERT (FLOAT, bs.backup_size) / +CONVERT (FLOAT, bs.compressed_backup_size))) AS [Compression Ratio], bs.has_backup_checksums, bs.is_copy_only, bs.encryptor_type, +DATEDIFF (SECOND, bs.backup_start_date, bs.backup_finish_date) AS [Backup Elapsed Time (sec)], +bs.backup_finish_date AS [Backup Finish Date], bmf.physical_device_name AS [Backup Location], bmf.physical_block_size +FROM msdb.dbo.backupset AS bs WITH (NOLOCK) +INNER JOIN msdb.dbo.backupmediafamily AS bmf WITH (NOLOCK) +ON bs.media_set_id = bmf.media_set_id +WHERE bs.database_name = DB_NAME(DB_ID()) +AND bs.[type] = 'D' -- Change to L if you want Log backups +ORDER BY bs.backup_finish_date DESC OPTION (RECOMPILE); +------ + +-- Are your backup sizes and times changing over time? +-- Are you using backup compression? +-- Are you using backup checksums? +-- Are you doing copy_only backups? +-- Are you doing encrypted backups? +-- Have you done any backup tuning with striped backups, or changing the parameters of the backup command? + +-- In SQL Server 2016, native SQL Server backup compression actually works +-- much better with databases that are using TDE than in previous versions +-- https://bit.ly/28Rpb2x + + +-- Microsoft Visual Studio Dev Essentials +-- https://bit.ly/2qjNRxi + +-- Microsoft Azure Learn +-- https://bit.ly/2O0Hacc + + + + diff --git a/Scripts/SQL Server 2016 SP2 Diagnostic Information Queries.sql b/Scripts/SQL Server 2016 SP2 Diagnostic Information Queries.sql index e104d2f2..8a4d729d 100644 --- a/Scripts/SQL Server 2016 SP2 Diagnostic Information Queries.sql +++ b/Scripts/SQL Server 2016 SP2 Diagnostic Information Queries.sql @@ -1,15 +1,14 @@ -- SQL Server 2016 SP2 Diagnostic Information Queries -- Glenn Berry --- Last Modified: July 12, 2019 --- https://www.sqlskills.com/blogs/glenn/ --- http://sqlserverperformance.wordpress.com/ +-- Last Modified: December 3, 2020 +-- https://glennsqlperformance.com/ +-- https://sqlserverperformance.wordpress.com/ +-- YouTube: https://bit.ly/2PkoAM1 -- Twitter: GlennAlanBerry --- Please listen to my Pluralsight courses --- https://www.pluralsight.com/author/glenn-berry - --- If you want to find all of our SQLskills SQL101 blog posts, check out https://bit.ly/2qLwfXW +-- Diagnostic Queries are available here +-- https://glennsqlperformance.com/resources/ -- Please make sure you are using the correct version of these diagnostic queries for your version of SQL Server @@ -23,11 +22,9 @@ --****************************************************************************** ---* Copyright (C) 2019 Glenn Berry, SQLskills.com +--* Copyright (C) 2020 Glenn Berry --* All rights reserved. --* ---* For more scripts and sample code, check out ---* https://www.sqlskills.com/blogs/glenn --* --* You may alter this code for your own *non-commercial* purposes. You may --* republish altered code as long as you include this copyright and give due credit. @@ -72,9 +69,16 @@ SELECT @@SERVERNAME AS [Server Name], @@VERSION AS [SQL Server and OS Version In -- 13.0.5264.1 SP2 CU5 1/23/2019 https://support.microsoft.com/en-us/help/4475776/cumulative-update-5-for-sql-server-2016-sp2 -- 13.0.5292.0 SP2 CU6 3/19/2019 https://support.microsoft.com/en-us/help/4488536/cumulative-update-6-for-sql-server-2016-sp2 -- 13.0.5337.0 SP2 CU7 5/22/2019 https://support.microsoft.com/en-us/help/4495256/cumulative-update-7-for-sql-server-2016-sp2 --- 13.0.5366.0 SP2 CU7 + Security Update 7/9/2019 https://support.microsoft.com/en-us/help/4505222/security-update-for-sql-server-2016-sp2-cu7-gdr-july-9-2019 - - +-- 13.0.5366.0 SP2 CU7 + Security Update 7/9/2019 https://support.microsoft.com/en-us/help/4505222/security-update-for-sql-server-2016-sp2-cu7-gdr-july-9-2019 +-- 13.0.5426.0 SP2 CU8 7/31/2019 https://support.microsoft.com/en-us/help/4505830/cumulative-update-8-for-sql-server-2016-sp2 +-- 13.0.5470.0 SP2 CU9 9/30/2019 https://support.microsoft.com/en-us/help/4515435/cumulative-update-9-for-sql-server-2016-sp2 +-- 13.0.5492.2 SP2 CU10 10/8/2019 https://support.microsoft.com/en-us/help/4524334/cumulative-update-10-for-sql-server-2016-sp2 +-- 13.0.5598.27 SP2 CU11 12/9/2019 https://support.microsoft.com/en-us/help/4527378/cumulative-update-11-for-sql-server-2016-sp2 +-- 13.0.5622.0 SP2 CU11 + Security Update 2/11/2010 https://support.microsoft.com/en-us/help/4535706/description-of-the-security-update-for-sql-server-2016-sp2-cu11-februa +-- 13.0.5698.0 SP2 CU12 2/25/2020 https://support.microsoft.com/en-us/help/4536648/cumulative-update-12-for-sql-server-2016-sp2 +-- 13.0.5820.21 SP2 CU13 5/38/2020 https://support.microsoft.com/en-us/help/4549825/cumulative-update-13-for-sql-server-2016-sp2 +-- 13.0.5830.85 SP2 CU14 8/6/2020 https://support.microsoft.com/en-us/help/4564903/cumulative-update-14-for-sql-server-2016-sp2 +-- 13.0.5850.14 SP2 CU15 9/28/2020 https://support.microsoft.com/en-us/help/4577775/cumulative-update-15-for-sql-server-2016-sp2 -- How to determine the version, edition and update level of SQL Server and its components @@ -143,6 +147,7 @@ SERVERPROPERTY('IsHadrEnabled') AS [IsHadrEnabled], SERVERPROPERTY('HadrManagerStatus') AS [HadrManagerStatus], SERVERPROPERTY('InstanceDefaultDataPath') AS [InstanceDefaultDataPath], SERVERPROPERTY('InstanceDefaultLogPath') AS [InstanceDefaultLogPath], +SERVERPROPERTY('ErrorLogFileName') AS [ErrorLogFileName], SERVERPROPERTY('BuildClrVersion') AS [Build CLR Version], SERVERPROPERTY('IsXTPSupported') AS [IsXTPSupported], SERVERPROPERTY('IsPolybaseInstalled') AS [IsPolybaseInstalled], -- New for SQL Server 2016 @@ -194,11 +199,17 @@ DBCC TRACESTATUS (-1); -- https://bit.ly/2sboMli (added in SP2 CU6) -- TF 3226 - Supresses logging of successful database backup messages to the SQL Server Error Log --- https://bit.ly/2p6MTjS +-- https://bit.ly/38zDNAK -- TF 6534 - Enables use of native code to improve performance with spatial data -- https://bit.ly/2HrQUpU +-- TF 7745 - Prevents Query Store data from being written to disk in case of a failover or shutdown command +-- https://bit.ly/2GU69Km + +-- TF 7752 - Enables asynchronous load of Query Store +-- This allows a database to become online and queries to be executed before the Query Store has been fully recovered + -- The behavior of TF 1117, 1118 are enabled for tempdb in SQL Server 2016 by default -- SQL 2016 It Just Runs Faster: -T1117 and -T1118 changes for TEMPDB and user databases -- https://bit.ly/2lbNWxK @@ -213,27 +224,8 @@ DBCC TRACESTATUS (-1); --- Returns status of instant file initialization (Query 6) (IFI Status) -EXEC sys.xp_readerrorlog 0, 1, N'Database Instant File Initialization'; ------- - --- Lets you determine whether Instant File Initialization (IFI) is enabled for the instance --- This should be enabled in the vast majority of cases --- SQL Server 2016 and newer lets you enable this during the SQL server installation process - --- Note: This query won't return any results if the SQL Server error log has been recycled --- Query 8 has a instant_file_initialization_enabled column that will show the status of IFI - - --- Database Instant File Initialization --- https://bit.ly/2nTX74y --- Misconceptions around instant file initialization --- https://bit.ly/2oBSKgZ - - - --- SQL Server Process Address space info (Query 7) (Process Memory) +-- SQL Server Process Address space info (Query 6) (Process Memory) -- (shows whether locked pages is enabled, among other things) SELECT physical_memory_in_use_kb/1024 AS [SQL Server Memory Usage (MB)], locked_page_allocations_kb/1024 AS [SQL Server Locked Pages Allocation (MB)], @@ -256,7 +248,7 @@ FROM sys.dm_os_process_memory WITH (NOLOCK) OPTION (RECOMPILE); --- SQL Server Services information (Query 8) (SQL Server Services Info) +-- SQL Server Services information (Query 7) (SQL Server Services Info) SELECT servicename, process_id, startup_type_desc, status_desc, last_startup_time, service_account, is_clustered, cluster_nodename, [filename], instant_file_initialization_enabled @@ -272,15 +264,20 @@ FROM sys.dm_server_services WITH (NOLOCK) OPTION (RECOMPILE); -- https://bit.ly/2oKa1Un --- Last backup information by database (Query 9) (Last Backup By Database) +-- Last backup information by database (Query 8) (Last Backup By Database) SELECT ISNULL(d.[name], bs.[database_name]) AS [Database], d.recovery_model_desc AS [Recovery Model], d.log_reuse_wait_desc AS [Log Reuse Wait Desc], MAX(CASE WHEN [type] = 'D' THEN bs.backup_finish_date ELSE NULL END) AS [Last Full Backup], + MAX(CASE WHEN [type] = 'D' THEN bmf.physical_device_name ELSE NULL END) AS [Last Full Backup Location], MAX(CASE WHEN [type] = 'I' THEN bs.backup_finish_date ELSE NULL END) AS [Last Differential Backup], - MAX(CASE WHEN [type] = 'L' THEN bs.backup_finish_date ELSE NULL END) AS [Last Log Backup] + MAX(CASE WHEN [type] = 'I' THEN bmf.physical_device_name ELSE NULL END) AS [Last Differential Backup Location], + MAX(CASE WHEN [type] = 'L' THEN bs.backup_finish_date ELSE NULL END) AS [Last Log Backup], + MAX(CASE WHEN [type] = 'L' THEN bmf.physical_device_name ELSE NULL END) AS [Last Log Backup Location] FROM sys.databases AS d WITH (NOLOCK) LEFT OUTER JOIN msdb.dbo.backupset AS bs WITH (NOLOCK) -ON bs.[database_name] = d.[name] +ON bs.[database_name] = d.[name] +LEFT OUTER JOIN msdb.dbo.backupmediafamily AS bmf WITH (NOLOCK) +ON bs.media_set_id = bmf.media_set_id AND bs.backup_finish_date > GETDATE()- 30 WHERE d.name <> N'tempdb' GROUP BY ISNULL(d.[name], bs.[database_name]), d.recovery_model_desc, d.log_reuse_wait_desc, d.[name] @@ -290,7 +287,7 @@ ORDER BY d.recovery_model_desc, d.[name] OPTION (RECOMPILE); -- This helps you spot runaway transaction logs and other issues with your backup schedule --- Get SQL Server Agent jobs and Category information (Query 10) (SQL Server Agent Jobs) +-- Get SQL Server Agent jobs and Category information (Query 9) (SQL Server Agent Jobs) SELECT sj.name AS [Job Name], sj.[description] AS [Job Description], SUSER_SNAME(sj.owner_sid) AS [Job Owner], sj.date_created AS [Date Created], sj.[enabled] AS [Job Enabled], sj.notify_email_operator_id, sj.notify_level_email, sc.name AS [CategoryName], @@ -316,8 +313,11 @@ ORDER BY sj.name OPTION (RECOMPILE); -- SQL Server Maintenance Solution -- https://bit.ly/1pgchQu +-- You can use this script to add default schedules to the standard Ola Hallengren Maintenance Solution jobs +-- https://bit.ly/3ane0gN + --- Get SQL Server Agent Alert Information (Query 11) (SQL Server Agent Alerts) +-- Get SQL Server Agent Alert Information (Query 10) (SQL Server Agent Alerts) SELECT name, event_source, message_id, severity, [enabled], has_notification, delay_between_responses, occurrence_count, last_occurrence_date, last_occurrence_time FROM msdb.dbo.sysalerts WITH (NOLOCK) @@ -326,11 +326,11 @@ ORDER BY name OPTION (RECOMPILE); -- Gives you some basic information about your SQL Server Agent Alerts -- (which are different from SQL Server Agent jobs) --- Read more about Agent Alerts here: https://bit.ly/2Giz0Xf +-- Read more about Agent Alerts here: https://bit.ly/2v5YR37 --- Windows information (Query 12) (Windows Info) +-- Windows information (Query 11) (Windows Info) SELECT windows_release, windows_service_pack_level, windows_sku, os_language_version FROM sys.dm_os_windows_info WITH (NOLOCK) OPTION (RECOMPILE); @@ -364,7 +364,7 @@ FROM sys.dm_os_windows_info WITH (NOLOCK) OPTION (RECOMPILE); -- https://bit.ly/2F7Ax0P --- SQL Server NUMA Node information (Query 13) (SQL Server NUMA Info) +-- SQL Server NUMA Node information (Query 12) (SQL Server NUMA Info) SELECT node_id, node_state_desc, memory_node_id, processor_group, cpu_count, online_scheduler_count, idle_scheduler_count, active_worker_count, avg_load_balance, resource_monitor_state FROM sys.dm_os_nodes WITH (NOLOCK) @@ -373,21 +373,22 @@ WHERE node_state_desc <> N'ONLINE DAC' OPTION (RECOMPILE); -- Gives you some useful information about the composition and relative load on your NUMA nodes -- You want to see an equal number of schedulers on each NUMA node --- Watch out if SQL Server 2017 Standard Edition has been installed +-- Watch out if SQL Server 2016 Standard Edition has been installed -- on a physical or virtual machine with more than four sockets or more than 24 physical cores -- sys.dm_os_nodes (Transact-SQL) -- https://bit.ly/2pn5Mw8 --- Balancing Your Available SQL Server Core Licenses Evenly Across NUMA Nodes --- https://bit.ly/2vfC4Rq +-- How to Balance SQL Server Core Licenses Across NUMA Nodes +-- https://bit.ly/3i4TyVR --- Good basic information about OS memory amounts and state (Query 14) (System Memory) +-- Good basic information about OS memory amounts and state (Query 13) (System Memory) SELECT total_physical_memory_kb/1024 AS [Physical Memory (MB)], available_physical_memory_kb/1024 AS [Available Memory (MB)], - total_page_file_kb/1024 AS [Total Page File (MB)], + total_page_file_kb/1024 AS [Page File Commit Limit (MB)], + total_page_file_kb/1024 - total_physical_memory_kb/1024 AS [Physical Page File Size (MB)], available_page_file_kb/1024 AS [Available Page File (MB)], system_cache_kb/1024 AS [System Cache (MB)], system_memory_state_desc AS [System Memory State] @@ -412,7 +413,7 @@ FROM sys.dm_os_sys_memory WITH (NOLOCK) OPTION (RECOMPILE); -- You can skip the next two queries if you know you don't have a clustered instance --- Get information about your cluster nodes and their status (Query 15) (Cluster Node Properties) +-- Get information about your cluster nodes and their status (Query 14) (Cluster Node Properties) -- (if your database server is in a failover cluster) SELECT NodeName, status_description, is_current_owner FROM sys.dm_os_cluster_nodes WITH (NOLOCK) OPTION (RECOMPILE); @@ -426,7 +427,7 @@ FROM sys.dm_os_cluster_nodes WITH (NOLOCK) OPTION (RECOMPILE); -- https://bit.ly/1z5BfCw --- Get information about any AlwaysOn AG cluster this instance is a part of (Query 16) (AlwaysOn AG Cluster) +-- Get information about any AlwaysOn AG cluster this instance is a part of (Query 15) (AlwaysOn AG Cluster) SELECT cluster_name, quorum_type_desc, quorum_state_desc FROM sys.dm_hadr_cluster WITH (NOLOCK) OPTION (RECOMPILE); ------ @@ -434,7 +435,7 @@ FROM sys.dm_hadr_cluster WITH (NOLOCK) OPTION (RECOMPILE); -- You will see no results if your instance is not using AlwaysOn AGs --- Good overview of AG health and status (Query 17) (AlwaysOn AG Status) +-- Good overview of AG health and status (Query 16) (AG Status) SELECT ag.name AS [AG Name], ar.replica_server_name, ar.availability_mode_desc, adc.[database_name], drs.is_local, drs.is_primary_replica, drs.synchronization_state_desc, drs.is_commit_participant, drs.synchronization_health_desc, drs.recovery_lsn, drs.truncation_lsn, drs.last_sent_lsn, @@ -459,7 +460,7 @@ ORDER BY ag.name, ar.replica_server_name, adc.[database_name] OPTION (RECOMPILE) -- https://bit.ly/2dn1H6r --- Hardware information from SQL Server 2016 SP2 (Query 18) (Hardware Info) +-- Hardware information from SQL Server 2016 SP2 (Query 17) (Hardware Info) SELECT cpu_count AS [Logical CPU Count], scheduler_count, (socket_count * cores_per_socket) AS [Physical Core Count], socket_count AS [Socket Count], cores_per_socket, numa_node_count, @@ -495,7 +496,7 @@ FROM sys.dm_os_sys_info WITH (NOLOCK) OPTION (RECOMPILE); -- LARGE_PAGES --- Get System Manufacturer and model number from SQL Server Error log (Query 19) (System Manufacturer) +-- Get System Manufacturer and model number from SQL Server Error log (Query 18) (System Manufacturer) EXEC sys.xp_readerrorlog 0, 1, N'Manufacturer'; ------ @@ -505,17 +506,7 @@ EXEC sys.xp_readerrorlog 0, 1, N'Manufacturer'; -- This query will return no results if your error log has been recycled since the instance was started --- Get pvscsi info from Windows Registry (Query 20) (PVSCSI Driver Parameters) -EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SYSTEM\CurrentControlSet\services\pvscsi\Parameters\Device', N'DriverParameter'; ------- - --- This is valid for VMware VMs --- Recommended value for intensive I/O patterns from VMware is: RequestRingPages=32,MaxQueueDepth=254 --- https://kb.vmware.com/s/article/2053145 - - - --- Get BIOS date from Windows Registry (Query 21) (BIOS Date) +-- Get BIOS date from Windows Registry (Query 19) (BIOS Date) EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\System\BIOS', N'BiosReleaseDate'; ------ @@ -523,7 +514,7 @@ EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\Syste -- Not as useful for virtualization --- Get processor description from Windows Registry (Query 22) (Processor Description) +-- Get processor description from Windows Registry (Query 20) (Processor Description) EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\System\CentralProcessor\0', N'ProcessorNameString'; ------ @@ -540,7 +531,7 @@ EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\Syste --- Get information on location, time and size of any memory dumps from SQL Server (Query 23) (Memory Dump Info) +-- Get information on location, time and size of any memory dumps from SQL Server (Query 21) (Memory Dump Info) SELECT [filename], creation_time, size_in_bytes/1048576.0 AS [Size (MB)] FROM sys.dm_server_memory_dumps WITH (NOLOCK) ORDER BY creation_time DESC OPTION (RECOMPILE); @@ -554,7 +545,7 @@ ORDER BY creation_time DESC OPTION (RECOMPILE); --- Look at Suspect Pages table (Query 24) (Suspect Pages) +-- Look at Suspect Pages table (Query 22) (Suspect Pages) SELECT DB_NAME(database_id) AS [Database Name], [file_id], page_id, event_type, error_count, last_update_date FROM msdb.dbo.suspect_pages WITH (NOLOCK) @@ -577,7 +568,7 @@ ORDER BY database_id OPTION (RECOMPILE); -- https://bit.ly/2Fvr1c9 --- Get number of data files in tempdb database (Query 25) (TempDB Data Files) +-- Get number of data files in tempdb database (Query 23) (TempDB Data Files) EXEC sys.xp_readerrorlog 0, 1, N'The tempdb database has'; ------ @@ -586,7 +577,7 @@ EXEC sys.xp_readerrorlog 0, 1, N'The tempdb database has'; -- This query will return no results if your error log has been recycled since the instance was last started --- File names and paths for all user and system databases on instance (Query 26) (Database Filenames and Paths) +-- File names and paths for all user and system databases on instance (Query 24) (Database Filenames and Paths) SELECT DB_NAME([database_id]) AS [Database Name], [file_id], [name], physical_name, [type_desc], state_desc, is_percent_growth, growth, @@ -607,7 +598,7 @@ ORDER BY DB_NAME([database_id]), [file_id] OPTION (RECOMPILE); --- Volume info for all LUNS that have database files on the current instance (Query 27) (Volume Info) +-- Volume info for all LUNS that have database files on the current instance (Query 25) (Volume Info) SELECT DISTINCT vs.volume_mount_point, vs.file_system_type, vs.logical_volume_name, CONVERT(DECIMAL(18,2), vs.total_bytes/1073741824.0) AS [Total Size (GB)], CONVERT(DECIMAL(18,2), vs.available_bytes/1073741824.0) AS [Available Size (GB)], @@ -627,8 +618,7 @@ ORDER BY vs.volume_mount_point OPTION (RECOMPILE); --- Drive level latency information (Query 28) (Drive Level Latency) --- Based on code from Jimmy May +-- Drive level latency information (Query 26) (Drive Level Latency) SELECT tab.[Drive], tab.volume_mount_point AS [Volume Mount Point], CASE WHEN num_of_reads = 0 THEN 0 @@ -671,8 +661,14 @@ ORDER BY [Overall Latency] OPTION (RECOMPILE); -- These latency numbers include all file activity against all SQL Server -- database files on each drive since SQL Server was last started +-- sys.dm_io_virtual_file_stats (Transact-SQL) +-- https://bit.ly/3bRWUc0 + +-- sys.dm_os_volume_stats (Transact-SQL) +-- https://bit.ly/33thz2j + --- Calculates average stalls per read, per write, and per total input/output for each database file (Query 29) (IO Latency by File) +-- Calculates average stalls per read, per write, and per total input/output for each database file (Query 27) (IO Latency by File) SELECT DB_NAME(fs.database_id) AS [Database Name], CAST(fs.io_stall_read_ms/(1.0 + fs.num_of_reads) AS NUMERIC(10,1)) AS [avg_read_latency_ms], CAST(fs.io_stall_write_ms/(1.0 + fs.num_of_writes) AS NUMERIC(10,1)) AS [avg_write_latency_ms], CAST((fs.io_stall_read_ms + fs.io_stall_write_ms)/(1.0 + fs.num_of_reads + fs.num_of_writes) AS NUMERIC(10,1)) AS [avg_io_latency_ms], @@ -692,8 +688,11 @@ ORDER BY avg_io_latency_ms DESC OPTION (RECOMPILE); -- These latency numbers include all file activity against each SQL Server -- database file since SQL Server was last started +-- sys.dm_io_virtual_file_stats (Transact-SQL) +-- https://bit.ly/3bRWUc0 --- Look for I/O requests taking longer than 15 seconds in the six most recent SQL Server Error Logs (Query 30) (IO Warnings) + +-- Look for I/O requests taking longer than 15 seconds in the six most recent SQL Server Error Logs (Query 28) (IO Warnings) CREATE TABLE #IOWarningResults(LogDate datetime, ProcessInfo sysname, LogText nvarchar(1000)); INSERT INTO #IOWarningResults @@ -729,8 +728,7 @@ DROP TABLE #IOWarningResults; -- https://bit.ly/2qtaw73 - --- Resource Governor Resource Pool information (Query 31) (RG Resource Pools) +-- Resource Governor Resource Pool information (Query 29) (RG Resource Pools) SELECT pool_id, [Name], statistics_start_time, min_memory_percent, max_memory_percent, max_memory_kb/1024 AS [max_memory_mb], @@ -746,7 +744,7 @@ OPTION (RECOMPILE); --- Recovery model, log reuse wait description, log file size, log usage size (Query 32) (Database Properties) +-- Recovery model, log reuse wait description, log file size, log usage size (Query 30) (Database Properties) -- and compatibility level for all databases on instance SELECT db.[name] AS [Database Name], SUSER_SNAME(db.owner_sid) AS [Database Owner], db.recovery_model_desc AS [Recovery Model], db.state_desc, db.containment_desc, db.log_reuse_wait_desc AS [Log Reuse Wait Description], @@ -758,9 +756,7 @@ db.is_auto_create_stats_on, db.is_auto_update_stats_on, db.is_auto_update_stats_ db.snapshot_isolation_state_desc, db.is_read_committed_snapshot_on, db.is_auto_close_on, db.is_auto_shrink_on, db.target_recovery_time_in_seconds, db.is_cdc_enabled, db.is_published, db.is_distributor, db.group_database_id, db.replica_id,db.is_memory_optimized_elevate_to_snapshot_on, -db.delayed_durability_desc, db.is_auto_create_stats_incremental_on, -db.is_query_store_on, db.is_sync_with_backup, -db.is_supplemental_logging_enabled, db.is_remote_data_archive_enabled, +db.delayed_durability_desc, db.is_query_store_on, db.is_sync_with_backup, db.is_remote_data_archive_enabled, db.is_encrypted, de.encryption_state, de.percent_complete, de.key_algorithm, de.key_length FROM sys.databases AS db WITH (NOLOCK) INNER JOIN sys.dm_os_performance_counters AS lu WITH (NOLOCK) @@ -775,6 +771,15 @@ AND ls.cntr_value > 0 ORDER BY db.[name] OPTION (RECOMPILE); ------ +-- sys.databases (Transact-SQL) +-- https://bit.ly/2G5wqaX + +-- sys.dm_os_performance_counters (Transact-SQL) +-- https://bit.ly/3kEO2JR + +-- sys.dm_database_encryption_keys (Transact-SQL) +-- https://bit.ly/3mE7kkx + -- Things to look at: -- How many databases are on the instance? -- What recovery models are they using? @@ -797,14 +802,12 @@ ORDER BY db.[name] OPTION (RECOMPILE); -- https://bit.ly/2pdggk3 --- Missing Indexes for all databases by Index Advantage (Query 33) (Missing Indexes All Databases) -SELECT CONVERT(decimal(18,2), user_seeks * avg_total_user_cost * (avg_user_impact * 0.01)) AS [index_advantage], -FORMAT(migs.last_user_seek, 'yyyy-MM-dd HH:mm:ss') AS [last_user_seek], -mid.[statement] AS [Database.Schema.Table], +-- Missing Indexes for all databases by Index Advantage (Query 31) (Missing Indexes All Databases) +SELECT CONVERT(decimal(18,2), migs.user_seeks * migs.avg_total_user_cost * (migs.avg_user_impact * 0.01)) AS [index_advantage], +FORMAT(migs.last_user_seek, 'yyyy-MM-dd HH:mm:ss') AS [last_user_seek], mid.[statement] AS [Database.Schema.Table], COUNT(1) OVER(PARTITION BY mid.[statement]) AS [missing_indexes_for_table], COUNT(1) OVER(PARTITION BY mid.[statement], equality_columns) AS [similar_missing_indexes_for_table], -mid.equality_columns, mid.inequality_columns, mid.included_columns, -migs.unique_compiles, migs.user_seeks, +mid.equality_columns, mid.inequality_columns, mid.included_columns, migs.user_seeks, CONVERT(decimal(18,2), migs.avg_total_user_cost) AS [avg_total_user_cost], migs.avg_user_impact FROM sys.dm_db_missing_index_group_stats AS migs WITH (NOLOCK) INNER JOIN sys.dm_db_missing_index_groups AS mig WITH (NOLOCK) @@ -819,13 +822,14 @@ ORDER BY index_advantage DESC OPTION (RECOMPILE); -- Also look at avg_user_impact and avg_total_user_cost to help determine importance -- SQL Server is overly eager to add included columns, so beware -- Do not just blindly add indexes that show up from this query!!! +-- Hkan Winther has given me some great suggestions for this query -- SQL Server Index Design Guide -- https://bit.ly/2qtZr4N --- Get VLF Counts for all databases on the instance (Query 34) (VLF Counts) +-- Get VLF Counts for all databases on the instance (Query 32) (VLF Counts) SELECT [name] AS [Database Name], [VLF Count] FROM sys.databases AS db WITH (NOLOCK) CROSS APPLY (SELECT file_id, COUNT(*) AS [VLF Count] @@ -846,7 +850,7 @@ ORDER BY [VLF Count] DESC OPTION (RECOMPILE); --- Get CPU utilization by database (Query 35) (CPU Usage by Database) +-- Get CPU utilization by database (Query 33) (CPU Usage by Database) WITH DB_CPU_Stats AS (SELECT pa.DatabaseID, DB_Name(pa.DatabaseID) AS [Database Name], SUM(qs.total_worker_time/1000) AS [CPU_Time_Ms] @@ -867,7 +871,7 @@ ORDER BY [CPU Rank] OPTION (RECOMPILE); -- Note: This only reflects CPU usage from the currently cached query plans --- Get I/O utilization by database (Query 36) (IO Usage By Database) +-- Get I/O utilization by database (Query 34) (IO Usage By Database) WITH Aggregate_IO_Statistics AS (SELECT DB_NAME(database_id) AS [Database Name], CAST(SUM(num_of_bytes_read + num_of_bytes_written) / 1048576 AS DECIMAL(12, 2)) AS [ioTotalMB], @@ -891,7 +895,7 @@ ORDER BY [I/O Rank] OPTION (RECOMPILE); -- They include all I/O activity, not just the nominal I/O workload --- Get total buffer usage by database for current instance (Query 37) (Total Buffer Usage by Database) +-- Get total buffer usage by database for current instance (Query 35) (Total Buffer Usage by Database) -- This make take some time to run on a busy instance WITH AggregateBufferPoolUsage AS @@ -910,7 +914,7 @@ ORDER BY [Buffer Pool Rank] OPTION (RECOMPILE); -- is being used by each database on the instance --- Get tempdb version store space usage by database (Query 38) (Version Store Space Usage) +-- Get tempdb version store space usage by database (Query 36) (Version Store Space Usage) SELECT DB_NAME(database_id) AS [Database Name], reserved_page_count AS [Version Store Reserved Page Count], reserved_space_kb/1024 AS [Version Store Reserved Space (MB)] @@ -927,7 +931,7 @@ ORDER BY reserved_space_kb/1024 DESC OPTION (RECOMPILE); -- Clear Wait Stats with this command -- DBCC SQLPERF('sys.dm_os_wait_stats', CLEAR); --- Isolate top waits for server instance since last restart or wait statistics clear (Query 39) (Top Waits) +-- Isolate top waits for server instance since last restart or wait statistics clear (Query 37) (Top Waits) WITH [Waits] AS (SELECT wait_type, wait_time_ms/ 1000.0 AS [WaitS], (wait_time_ms - signal_wait_time_ms) / 1000.0 AS [ResourceS], @@ -993,7 +997,7 @@ OPTION (RECOMPILE); -- Cumulative wait stats are not as useful on an idle instance that is not under load or performance pressure --- SQL Server Wait Types Library (Paul Randal) +-- SQL Server Wait Types Library -- https://bit.ly/2ePzYO2 -- The SQL Server Wait Type Repository @@ -1010,7 +1014,7 @@ OPTION (RECOMPILE); --- Get a count of SQL connections by IP address (Query 40) (Connection Counts by IP Address) +-- Get a count of SQL connections by IP address (Query 38) (Connection Counts by IP Address) SELECT ec.client_net_address, es.[program_name], es.[host_name], es.login_name, COUNT(ec.session_id) AS [connection count] FROM sys.dm_exec_sessions AS es WITH (NOLOCK) @@ -1028,7 +1032,7 @@ ORDER BY ec.client_net_address, es.[program_name] OPTION (RECOMPILE); --- Get Average Task Counts (run multiple times) (Query 41) (Avg Task Counts) +-- Get Average Task Counts (run multiple times) (Query 39) (Avg Task Counts) SELECT AVG(current_tasks_count) AS [Avg Task Count], AVG(work_queue_count) AS [Avg Work Queue Count], AVG(runnable_tasks_count) AS [Avg Runnable Task Count], @@ -1045,11 +1049,11 @@ WHERE scheduler_id < 255 OPTION (RECOMPILE); -- High Avg Pending DiskIO Counts are a sign of disk pressure -- How to Do Some Very Basic SQL Server Monitoring --- https://bit.ly/2q3Btgt +-- https://bit.ly/30IRla0 --- Detect blocking (run multiple times) (Query 42) (Detect Blocking) +-- Detect blocking (run multiple times) (Query 40) (Detect Blocking) SELECT t1.resource_type AS [lock type], DB_NAME(resource_database_id) AS [database], t1.resource_associated_entity_id AS [blk object],t1.request_mode AS [lock req], -- lock requested t1.request_session_id AS [waiter sid], t2.wait_duration_ms AS [wait time], -- spid of waiter @@ -1078,7 +1082,7 @@ ON t1.lock_owner_address = t2.resource_address OPTION (RECOMPILE); --- Get CPU Utilization History for last 256 minutes (in one minute intervals) (Query 43) (CPU Utilization History) +-- Get CPU Utilization History for last 256 minutes (in one minute intervals) (Query 41) (CPU Utilization History) DECLARE @ts_now bigint = (SELECT cpu_ticks/(cpu_ticks/ms_ticks) FROM sys.dm_os_sys_info WITH (NOLOCK)); SELECT TOP(256) SQLProcessUtilization AS [SQL Server Process CPU Utilization], @@ -1103,7 +1107,7 @@ ORDER BY record_id DESC OPTION (RECOMPILE); -- on high core count (> 64 cores) systems --- Get top total worker time queries for entire instance (Query 44) (Top Worker Time Queries) +-- Get top total worker time queries for entire instance (Query 42) (Top Worker Time Queries) SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], REPLACE(REPLACE(LEFT(t.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text], qs.total_worker_time AS [Total Worker Time], qs.min_worker_time AS [Min Worker Time], @@ -1116,7 +1120,7 @@ qs.min_logical_reads AS [Min Logical Reads], qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], qs.max_logical_reads AS [Max Logical Reads], qs.execution_count AS [Execution Count], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], qs.creation_time AS [Creation Time] --,t.[text] AS [Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) @@ -1131,7 +1135,7 @@ ORDER BY qs.total_worker_time DESC OPTION (RECOMPILE); --- Page Life Expectancy (PLE) value for each NUMA node in current instance (Query 45) (PLE by NUMA Node) +-- Page Life Expectancy (PLE) value for each NUMA node in current instance (Query 43) (PLE by NUMA Node) SELECT @@SERVERNAME AS [Server Name], RTRIM([object_name]) AS [Object Name], instance_name, cntr_value AS [Page Life Expectancy] FROM sys.dm_os_performance_counters WITH (NOLOCK) @@ -1147,7 +1151,7 @@ AND counter_name = N'Page life expectancy' OPTION (RECOMPILE); -- https://bit.ly/2EgynLa --- Memory Grants Pending value for current instance (Query 46) (Memory Grants Pending) +-- Memory Grants Pending value for current instance (Query 44) (Memory Grants Pending) SELECT @@SERVERNAME AS [Server Name], RTRIM([object_name]) AS [Object Name], cntr_value AS [Memory Grants Pending] FROM sys.dm_os_performance_counters WITH (NOLOCK) WHERE [object_name] LIKE N'%Memory Manager%' -- Handles named instances @@ -1158,7 +1162,7 @@ AND counter_name = N'Memory Grants Pending' OPTION (RECOMPILE); -- Memory Grants Pending above zero for a sustained period is a very strong indicator of internal memory pressure --- Memory Clerk Usage for instance (Query 47) (Memory Clerk Usage) +-- Memory Clerk Usage for instance (Query 45) (Memory Clerk Usage) -- Look for high value for CACHESTORE_SQLCP (Ad-hoc query plans) SELECT TOP(10) mc.[type] AS [Memory Clerk Type], CAST((SUM(mc.pages_kb)/1024.0) AS DECIMAL (15,2)) AS [Memory Usage (MB)] @@ -1183,7 +1187,7 @@ ORDER BY SUM(mc.pages_kb) DESC OPTION (RECOMPILE); --- Find single-use, ad-hoc and prepared queries that are bloating the plan cache (Query 48) (Ad hoc Queries) +-- Find single-use, ad-hoc and prepared queries that are bloating the plan cache (Query 46) (Ad hoc Queries) SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], t.[text] AS [Query Text], cp.objtype AS [Object Type], cp.cacheobjtype AS [Cache Object Type], cp.size_in_bytes/1024 AS [Plan Size in KB] @@ -1204,7 +1208,7 @@ ORDER BY cp.size_in_bytes DESC, DB_NAME(t.[dbid]) OPTION (RECOMPILE); -- https://bit.ly/2EfYOkl --- Get top total logical reads queries for entire instance (Query 49) (Top Logical Reads Queries) +-- Get top total logical reads queries for entire instance (Query 47) (Top Logical Reads Queries) SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], REPLACE(REPLACE(LEFT(t.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text], qs.total_logical_reads AS [Total Logical Reads], @@ -1218,7 +1222,7 @@ qs.min_elapsed_time AS [Min Elapsed Time], qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], qs.max_elapsed_time AS [Max Elapsed Time], qs.execution_count AS [Execution Count], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], qs.creation_time AS [Creation Time] --,t.[text] AS [Complete Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) @@ -1232,7 +1236,7 @@ ORDER BY qs.total_logical_reads DESC OPTION (RECOMPILE); -- Can also help track down parameter sniffing issues --- Get top average elapsed time queries for entire instance (Query 50) (Top Avg Elapsed Time Queries) +-- Get top average elapsed time queries for entire instance (Query 48) (Top Avg Elapsed Time Queries) SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], REPLACE(REPLACE(LEFT(t.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text], qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], @@ -1241,7 +1245,7 @@ qs.execution_count AS [Execution Count], qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], qs.total_physical_reads/qs.execution_count AS [Avg Physical Reads], qs.total_worker_time/qs.execution_count AS [Avg Worker Time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], qs.creation_time AS [Creation Time] --,t.[text] AS [Complete Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) @@ -1254,7 +1258,7 @@ ORDER BY qs.total_elapsed_time/qs.execution_count DESC OPTION (RECOMPILE); -- Can also help track down parameter sniffing issues --- Look at UDF execution statistics (Query 51) (UDF Stats by DB) +-- Look at UDF execution statistics (Query 49) (UDF Stats by DB) SELECT TOP (25) DB_NAME(database_id) AS [Database Name], OBJECT_NAME(object_id, database_id) AS [Function Name], total_worker_time, execution_count, total_elapsed_time, @@ -1267,7 +1271,8 @@ ORDER BY total_worker_time DESC OPTION (RECOMPILE); -- sys.dm_exec_function_stats (Transact-SQL) -- https://bit.ly/2q1Q6BM - +-- Showplan Enhancements for UDFs +-- https://bit.ly/2LVqiQ1 -- Database specific queries ***************************************************************** @@ -1275,11 +1280,14 @@ ORDER BY total_worker_time DESC OPTION (RECOMPILE); --USE YourDatabaseName; -- make sure to change to an actual database on your instance, not the master system database --GO --- Individual File Sizes and space available for current database (Query 52) (File Sizes and Space) +-- Individual File Sizes and space available for current database (Query 50) (File Sizes and Space) SELECT f.name AS [File Name] , f.physical_name AS [Physical Name], CAST((f.size/128.0) AS DECIMAL(15,2)) AS [Total Size in MB], CAST(f.size/128.0 - CAST(FILEPROPERTY(f.name, 'SpaceUsed') AS int)/128.0 AS DECIMAL(15,2)) -AS [Available Space In MB], f.[file_id], fg.name AS [Filegroup Name], +AS [Available Space In MB], +CAST((f.size/128.0) AS DECIMAL(15,2)) - +CAST(f.size/128.0 - CAST(FILEPROPERTY(f.name, 'SpaceUsed') AS int)/128.0 AS DECIMAL(15,2)) AS [Used Space in MB], +f.[file_id], fg.name AS [Filegroup Name], f.is_percent_growth, f.growth, fg.is_default, fg.is_read_only, fg.is_autogrow_all_files FROM sys.database_files AS f WITH (NOLOCK) @@ -1291,13 +1299,13 @@ ORDER BY f.[file_id] OPTION (RECOMPILE); -- Look at how large and how full the files are and where they are located -- Make sure the transaction log is not full!! --- is_autogrow_all_files was new for SQL Server 2016. Equivalent to TF 1117 for user databases +-- is_autogrow_all_files is new for SQL Server 2016. Equivalent to TF 1117 for user databases -- SQL Server 2016: Changes in default behavior for autogrow and allocations for tempdb and user databases -- https://bit.ly/2evRZSR --- Log space usage for current database (Query 53) (Log Space Usage) +-- Log space usage for current database (Query 51) (Log Space Usage) SELECT DB_NAME(lsu.database_id) AS [Database Name], db.recovery_model_desc AS [Recovery Model], CAST(lsu.total_log_size_in_bytes/1048576.0 AS DECIMAL(10, 2)) AS [Total Log Space (MB)], CAST(lsu.used_log_space_in_bytes/1048576.0 AS DECIMAL(10, 2)) AS [Used Log Space (MB)], @@ -1316,7 +1324,7 @@ OPTION (RECOMPILE); -- https://bit.ly/2H4MQw9 --- Status of last VLF for current database (Query 54) (Last VLF Status) +-- Status of last VLF for current database (Query 52) (Last VLF Status) SELECT TOP(1) DB_NAME(li.database_id) AS [Database Name], li.[file_id], li.vlf_size_mb, li.vlf_sequence_number, li.vlf_active, li.vlf_status FROM sys.dm_db_log_info(DB_ID()) AS li @@ -1335,7 +1343,7 @@ ORDER BY vlf_sequence_number DESC OPTION (RECOMPILE); --- Get database scoped configuration values for current database (Query 55) (Database-scoped Configurations) +-- Get database scoped configuration values for current database (Query 53) (Database-scoped Configurations) SELECT configuration_id, name, [value] AS [value_for_primary], value_for_secondary FROM sys.database_scoped_configurations WITH (NOLOCK) OPTION (RECOMPILE); ------ @@ -1349,7 +1357,7 @@ FROM sys.database_scoped_configurations WITH (NOLOCK) OPTION (RECOMPILE); -- https://bit.ly/2sOH7nb --- I/O Statistics by file for the current database (Query 56) (IO Stats By File) +-- I/O Statistics by file for the current database (Query 54) (IO Stats By File) SELECT DB_NAME(DB_ID()) AS [Database Name], df.name AS [Logical Name], vfs.[file_id], df.type_desc, df.physical_name AS [Physical Name], CAST(vfs.size_on_disk_bytes/1048576.0 AS DECIMAL(16, 2)) AS [Size on Disk (MB)], vfs.num_of_reads, vfs.num_of_writes, vfs.io_stall_read_ms, vfs.io_stall_write_ms, @@ -1372,7 +1380,7 @@ ON vfs.[file_id]= df.[file_id] OPTION (RECOMPILE); --- Get most frequently executed queries for this database (Query 57) (Query Execution Counts) +-- Get most frequently executed queries for this database (Query 55) (Query Execution Counts) SELECT TOP(50) LEFT(t.[text], 50) AS [Short Query Text], qs.execution_count AS [Execution Count], qs.total_logical_reads AS [Total Logical Reads], qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], @@ -1380,7 +1388,7 @@ qs.total_worker_time AS [Total Worker Time], qs.total_worker_time/qs.execution_count AS [Avg Worker Time], qs.total_elapsed_time AS [Total Elapsed Time], qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], qs.creation_time AS [Creation Time] --,t.[text] AS [Complete Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) @@ -1391,15 +1399,15 @@ ORDER BY qs.execution_count DESC OPTION (RECOMPILE); ------ --- Queries 60 through 65 are the "Bad Man List" for stored procedures +-- Queries 56 through 62 are the "Bad Man List" for stored procedures --- Top Cached SPs By Execution Count (Query 58) (SP Execution Counts) +-- Top Cached SPs By Execution Count (Query 56) (SP Execution Counts) SELECT TOP(100) p.name AS [SP Name], qs.execution_count AS [Execution Count], ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], qs.total_worker_time/qs.execution_count AS [Avg Worker Time], qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1414,15 +1422,16 @@ ORDER BY qs.execution_count DESC OPTION (RECOMPILE); -- Tells you which cached stored procedures are called the most often -- This helps you characterize and baseline your workload +-- It also helps you find possible caching opportunities --- Top Cached SPs By Avg Elapsed Time (Query 59) (SP Avg Elapsed Time) +-- Top Cached SPs By Avg Elapsed Time (Query 57) (SP Avg Elapsed Time) SELECT TOP(25) p.name AS [SP Name], qs.min_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], qs.max_elapsed_time, qs.last_elapsed_time, qs.total_elapsed_time, qs.execution_count, ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_worker_time/qs.execution_count AS [AvgWorkerTime], qs.total_worker_time AS [TotalWorkerTime], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1440,12 +1449,12 @@ ORDER BY avg_elapsed_time DESC OPTION (RECOMPILE); --- Top Cached SPs By Total Worker time. Worker time relates to CPU cost (Query 60) (SP Worker Time) +-- Top Cached SPs By Total Worker time. Worker time relates to CPU cost (Query 58) (SP Worker Time) SELECT TOP(25) p.name AS [SP Name], qs.total_worker_time AS [TotalWorkerTime], qs.total_worker_time/qs.execution_count AS [AvgWorkerTime], qs.execution_count, ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1462,12 +1471,12 @@ ORDER BY qs.total_worker_time DESC OPTION (RECOMPILE); -- You should look at this if you see signs of CPU pressure --- Top Cached SPs By Total Logical Reads. Logical reads relate to memory pressure (Query 61) (SP Logical Reads) +-- Top Cached SPs By Total Logical Reads. Logical reads relate to memory pressure (Query 59) (SP Logical Reads) SELECT TOP(25) p.name AS [SP Name], qs.total_logical_reads AS [TotalLogicalReads], qs.total_logical_reads/qs.execution_count AS [AvgLogicalReads],qs.execution_count, ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1484,11 +1493,11 @@ ORDER BY qs.total_logical_reads DESC OPTION (RECOMPILE); -- You should look at this if you see signs of memory pressure --- Top Cached SPs By Total Physical Reads. Physical reads relate to disk read I/O pressure (Query 62) (SP Physical Reads) +-- Top Cached SPs By Total Physical Reads. Physical reads relate to disk read I/O pressure (Query 60) (SP Physical Reads) SELECT TOP(25) p.name AS [SP Name],qs.total_physical_reads AS [TotalPhysicalReads], qs.total_physical_reads/qs.execution_count AS [AvgPhysicalReads], qs.execution_count, qs.total_logical_reads,qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1506,13 +1515,13 @@ ORDER BY qs.total_physical_reads DESC, qs.total_logical_reads DESC OPTION (RECOM --- Top Cached SPs By Total Logical Writes (Query 63) (SP Logical Writes) +-- Top Cached SPs By Total Logical Writes (Query 61) (SP Logical Writes) -- Logical writes relate to both memory and disk I/O pressure SELECT TOP(25) p.name AS [SP Name], qs.total_logical_writes AS [TotalLogicalWrites], qs.total_logical_writes/qs.execution_count AS [AvgLogicalWrites], qs.execution_count, ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1530,7 +1539,32 @@ ORDER BY qs.total_logical_writes DESC OPTION (RECOMPILE); -- You should look at this if you see signs of I/O pressure or of memory pressure --- Lists the top statements by average input/output usage for the current database (Query 64) (Top IO Statements) + +-- Cached SPs Missing Indexes by Execution Count (Query 62) (SP Missing Index) +SELECT TOP(25) p.name AS [SP Name], qs.execution_count AS [Execution Count], +ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], +qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], +qs.total_worker_time/qs.execution_count AS [Avg Worker Time], +qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], +FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], +FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] +-- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan +FROM sys.procedures AS p WITH (NOLOCK) +INNER JOIN sys.dm_exec_procedure_stats AS qs WITH (NOLOCK) +ON p.[object_id] = qs.[object_id] +CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) AS qp +WHERE qs.database_id = DB_ID() +AND DATEDIFF(Minute, qs.cached_time, GETDATE()) > 0 +AND CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' +ORDER BY qs.execution_count DESC OPTION (RECOMPILE); +------ + +-- This helps you find the most frequently executed cached stored procedures that have missing index warnings +-- This can often help you find index tuning candidates + + + +-- Lists the top statements by average input/output usage for the current database (Query 63) (Top IO Statements) SELECT TOP(50) OBJECT_NAME(qt.objectid, dbid) AS [SP Name], (qs.total_logical_reads + qs.total_logical_writes) /qs.execution_count AS [Avg IO], qs.execution_count AS [Execution Count], SUBSTRING(qt.[text],qs.statement_start_offset/2, @@ -1549,7 +1583,7 @@ ORDER BY [Avg IO] DESC OPTION (RECOMPILE); --- Possible Bad NC Indexes (writes > reads) (Query 65) (Bad NC Indexes) +-- Possible Bad NC Indexes (writes > reads) (Query 64) (Bad NC Indexes) SELECT SCHEMA_NAME(o.[schema_id]) AS [Schema Name], OBJECT_NAME(s.[object_id]) AS [Table Name], i.name AS [Index Name], i.index_id, @@ -1575,14 +1609,11 @@ ORDER BY [Difference] DESC, [Total Writes] DESC, [Total Reads] ASC OPTION (RECOM -- Investigate further before dropping an index! --- Missing Indexes for current database by Index Advantage (Query 66) (Missing Indexes) -SELECT CONVERT(decimal(18,2), user_seeks * avg_total_user_cost * (avg_user_impact * 0.01)) AS [index_advantage], +-- Missing Indexes for current database by Index Advantage (Query 65) (Missing Indexes) +SELECT DISTINCT CONVERT(decimal(18,2), migs.user_seeks * migs.avg_total_user_cost * (migs.avg_user_impact * 0.01)) AS [index_advantage], migs.last_user_seek, mid.[statement] AS [Database.Schema.Table], -COUNT(1) OVER(PARTITION BY mid.[statement]) AS [missing_indexes_for_table], -COUNT(1) OVER(PARTITION BY mid.[statement], equality_columns) AS [similar_missing_indexes_for_table], mid.equality_columns, mid.inequality_columns, mid.included_columns, -migs.unique_compiles, migs.user_seeks, -CONVERT(decimal(18,2), migs.avg_total_user_cost) AS [avg_total_user_cost], migs.avg_user_impact, +migs.user_seeks, migs.avg_total_user_cost, migs.avg_user_impact, OBJECT_NAME(mid.[object_id]) AS [Table Name], p.rows AS [Table Rows] FROM sys.dm_db_missing_index_group_stats AS migs WITH (NOLOCK) INNER JOIN sys.dm_db_missing_index_groups AS mig WITH (NOLOCK) @@ -1599,12 +1630,13 @@ ORDER BY index_advantage DESC OPTION (RECOMPILE); -- Look at index advantage, last user seek time, number of user seeks to help determine source and importance -- SQL Server is overly eager to add included columns, so beware -- Do not just blindly add indexes that show up from this query!!! +-- Hkan Winther has given me some great suggestions for this query --- Find missing index warnings for cached plans in the current database (Query 67) (Missing Index Warnings) +-- Find missing index warnings for cached plans in the current database (Query 66) (Missing Index Warnings) -- Note: This query could take some time on a busy instance SELECT TOP(25) OBJECT_NAME(objectid) AS [ObjectName], - cp.objtype, cp.usecounts, cp.size_in_bytes, query_plan + cp.objtype, cp.usecounts, cp.size_in_bytes, qp.query_plan FROM sys.dm_exec_cached_plans AS cp WITH (NOLOCK) CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) AS qp WHERE CAST(query_plan AS NVARCHAR(MAX)) LIKE N'%MissingIndex%' @@ -1616,9 +1648,9 @@ ORDER BY cp.usecounts DESC OPTION (RECOMPILE); -- This can help you decide whether to add them or not --- Breaks down buffers used by current database by object (table, index) in the buffer cache (Query 68) (Buffer Usage) +-- Breaks down buffers used by current database by object (table, index) in the buffer cache (Query 67) (Buffer Usage) -- Note: This query could take some time on a busy instance -SELECT SCHEMA_NAME(o.Schema_ID) AS [Schema Name], +SELECT fg.name AS [Filegroup Name], SCHEMA_NAME(o.Schema_ID) AS [Schema Name], OBJECT_NAME(p.[object_id]) AS [Object Name], p.index_id, CAST(COUNT(*)/128.0 AS DECIMAL(10, 2)) AS [Buffer size(MB)], COUNT(*) AS [BufferCount], p.[Rows] AS [Row Count], @@ -1630,12 +1662,17 @@ INNER JOIN sys.partitions AS p WITH (NOLOCK) ON a.container_id = p.hobt_id INNER JOIN sys.objects AS o WITH (NOLOCK) ON p.object_id = o.object_id +INNER JOIN sys.database_files AS f WITH (NOLOCK) +ON b.file_id = f.file_id +INNER JOIN sys.filegroups AS fg WITH (NOLOCK) +ON f.data_space_id = fg.data_space_id WHERE b.database_id = CONVERT(int, DB_ID()) AND p.[object_id] > 100 AND OBJECT_NAME(p.[object_id]) NOT LIKE N'plan_%' AND OBJECT_NAME(p.[object_id]) NOT LIKE N'sys%' AND OBJECT_NAME(p.[object_id]) NOT LIKE N'xml_index_nodes%' -GROUP BY o.Schema_ID, p.[object_id], p.index_id, p.data_compression_desc, p.[Rows] +GROUP BY fg.name, o.Schema_ID, p.[object_id], p.index_id, + p.data_compression_desc, p.[Rows] ORDER BY [BufferCount] DESC OPTION (RECOMPILE); ------ @@ -1643,9 +1680,9 @@ ORDER BY [BufferCount] DESC OPTION (RECOMPILE); -- It can help identify possible candidates for data compression --- Get Table names, row counts, and compression status for clustered index or heap (Query 69) (Table Sizes) +-- Get Table names, row counts, and compression status for clustered index or heap (Query 68) (Table Sizes) SELECT SCHEMA_NAME(o.Schema_ID) AS [Schema Name], OBJECT_NAME(p.object_id) AS [ObjectName], -SUM(p.Rows) AS [RowCount], data_compression_desc AS [CompressionType] +SUM(p.Rows) AS [RowCount], p.data_compression_desc AS [Compression Type] FROM sys.partitions AS p WITH (NOLOCK) INNER JOIN sys.objects AS o WITH (NOLOCK) ON p.object_id = o.object_id @@ -1668,7 +1705,7 @@ ORDER BY SUM(p.Rows) DESC OPTION (RECOMPILE); --- Get some key table properties (Query 70) (Table Properties) +-- Get some key table properties (Query 69) (Table Properties) SELECT OBJECT_NAME(t.[object_id]) AS [ObjectName], p.[rows] AS [Table Rows], p.index_id, p.data_compression_desc AS [Index Data Compression], t.create_date, t.lock_on_bulk_load, t.is_replicated, t.has_replication_filter, @@ -1691,7 +1728,7 @@ ORDER BY OBJECT_NAME(t.[object_id]), p.index_id OPTION (RECOMPILE); --- When were Statistics last updated on all indexes? (Query 71) (Statistics Update) +-- When were Statistics last updated on all indexes? (Query 70) (Statistics Update) SELECT SCHEMA_NAME(o.Schema_ID) + N'.' + o.[NAME] AS [Object Name], o.[type_desc] AS [Object Type], i.[name] AS [Index Name], STATS_DATE(i.[object_id], i.index_id) AS [Statistics Date], s.auto_created, s.no_recompute, s.user_created, s.is_incremental, s.is_temporary, @@ -1722,7 +1759,7 @@ ORDER BY STATS_DATE(i.[object_id], i.index_id) DESC OPTION (RECOMPILE); --- Look at most frequently modified indexes and statistics (Query 72) (Volatile Indexes) +-- Look at most frequently modified indexes and statistics (Query 71) (Volatile Indexes) SELECT o.[name] AS [Object Name], o.[object_id], o.[type_desc], s.[name] AS [Statistics Name], s.stats_id, s.no_recompute, s.auto_created, s.is_incremental, s.is_temporary, sp.modification_counter, sp.[rows], sp.rows_sampled, sp.last_updated @@ -1740,7 +1777,7 @@ ORDER BY sp.modification_counter DESC, o.name OPTION (RECOMPILE); --- Get fragmentation info for all indexes above a certain size in the current database (Query 73) (Index Fragmentation) +-- Get fragmentation info for all indexes above a certain size in the current database (Query 72) (Index Fragmentation) -- Note: This query could take some time on a very large database SELECT DB_NAME(ps.database_id) AS [Database Name], SCHEMA_NAME(o.[schema_id]) AS [Schema Name], OBJECT_NAME(ps.OBJECT_ID) AS [Object Name], i.[name] AS [Index Name], ps.index_id, @@ -1762,8 +1799,9 @@ ORDER BY ps.avg_fragmentation_in_percent DESC OPTION (RECOMPILE); -- and how effective your index maintenance strategy is ---- Index Read/Write stats (all tables in current DB) ordered by Reads (Query 74) (Overall Index Usage - Reads) -SELECT OBJECT_NAME(i.[object_id]) AS [ObjectName], i.[name] AS [IndexName], i.index_id, +--- Index Read/Write stats (all tables in current DB) ordered by Reads (Query 73) (Overall Index Usage - Reads) +SELECT SCHEMA_NAME(t.[schema_id]) AS [SchemaName], OBJECT_NAME(i.[object_id]) AS [ObjectName], + i.[name] AS [IndexName], i.index_id, s.user_seeks, s.user_scans, s.user_lookups, s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], s.user_updates AS [Writes], @@ -1774,6 +1812,8 @@ LEFT OUTER JOIN sys.dm_db_index_usage_stats AS s WITH (NOLOCK) ON i.[object_id] = s.[object_id] AND i.index_id = s.index_id AND s.database_id = DB_ID() +LEFT OUTER JOIN sys.tables AS t WITH (NOLOCK) +ON t.[object_id] = i.[object_id] WHERE OBJECTPROPERTY(i.[object_id],'IsUserTable') = 1 ORDER BY s.user_seeks + s.user_scans + s.user_lookups DESC OPTION (RECOMPILE); -- Order by reads ------ @@ -1781,8 +1821,9 @@ ORDER BY s.user_seeks + s.user_scans + s.user_lookups DESC OPTION (RECOMPILE); - -- Show which indexes in the current database are most active for Reads ---- Index Read/Write stats (all tables in current DB) ordered by Writes (Query 75) (Overall Index Usage - Writes) -SELECT OBJECT_NAME(i.[object_id]) AS [ObjectName], i.[name] AS [IndexName], i.index_id, +--- Index Read/Write stats (all tables in current DB) ordered by Writes (Query 74) (Overall Index Usage - Writes) +SELECT SCHEMA_NAME(t.[schema_id]) AS [SchemaName],OBJECT_NAME(i.[object_id]) AS [ObjectName], + i.[name] AS [IndexName], i.index_id, s.user_updates AS [Writes], s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], i.[type_desc] AS [Index Type], i.fill_factor AS [Fill Factor], i.has_filter, i.filter_definition, s.last_system_update, s.last_user_update @@ -1791,6 +1832,8 @@ LEFT OUTER JOIN sys.dm_db_index_usage_stats AS s WITH (NOLOCK) ON i.[object_id] = s.[object_id] AND i.index_id = s.index_id AND s.database_id = DB_ID() +LEFT OUTER JOIN sys.tables AS t WITH (NOLOCK) +ON t.[object_id] = i.[object_id] WHERE OBJECTPROPERTY(i.[object_id],'IsUserTable') = 1 ORDER BY s.user_updates DESC OPTION (RECOMPILE); -- Order by writes ------ @@ -1798,7 +1841,7 @@ ORDER BY s.user_updates DESC OPTION (RECOMPILE); -- Order by writes -- Show which indexes in the current database are most active for Writes --- Get in-memory OLTP index usage (Query 76) (XTP Index Usage) +-- Get in-memory OLTP index usage (Query 75) (XTP Index Usage) SELECT OBJECT_NAME(i.[object_id]) AS [Object Name], i.index_id, i.[name] AS [Index Name], i.[type_desc], xis.scans_started, xis.scans_retries, xis.rows_touched, xis.rows_returned @@ -1817,7 +1860,7 @@ ORDER BY OBJECT_NAME(i.[object_id]) OPTION (RECOMPILE); --- Look at Columnstore index physical statistics (Query 77) (Columnstore Index Physical Stat) +-- Look at Columnstore index physical statistics (Query 76) (Columnstore Index Physical Stat) SELECT OBJECT_NAME(ps.object_id) AS [TableName], i.[name] AS [IndexName], ps.index_id, ps.partition_number, ps.delta_store_hobt_id, ps.state_desc, ps.total_rows, ps.size_in_bytes, @@ -1836,7 +1879,7 @@ ORDER BY ps.object_id, ps.partition_number, ps.row_group_id OPTION (RECOMPILE); --- Get lock waits for current database (Query 78) (Lock Waits) +-- Get lock waits for current database (Query 77) (Lock Waits) SELECT o.name AS [table_name], i.name AS [index_name], ios.index_id, ios.partition_number, SUM(ios.row_lock_wait_count) AS [total_row_lock_waits], SUM(ios.row_lock_wait_in_ms) AS [total_row_lock_wait_in_ms], @@ -1859,7 +1902,7 @@ ORDER BY total_lock_wait_in_ms DESC OPTION (RECOMPILE); --- Look at UDF execution statistics (Query 79) (UDF Statistics) +-- Look at UDF execution statistics (Query 78) (UDF Statistics) SELECT OBJECT_NAME(object_id) AS [Function Name], execution_count, total_worker_time, total_logical_reads, total_physical_reads, total_elapsed_time, total_elapsed_time/execution_count AS [avg_elapsed_time], @@ -1877,7 +1920,7 @@ ORDER BY total_worker_time DESC OPTION (RECOMPILE); -- https://bit.ly/2q1Q6BM --- Get QueryStore Options for this database (Query 80) (QueryStore Options) +-- Get QueryStore Options for this database (Query 79) (QueryStore Options) SELECT actual_state_desc, desired_state_desc, [interval_length_minutes], current_storage_size_mb, [max_storage_size_mb], query_capture_mode_desc, size_based_cleanup_mode_desc @@ -1887,14 +1930,15 @@ FROM sys.database_query_store_options WITH (NOLOCK) OPTION (RECOMPILE); -- New for SQL Server 2016 -- Requires that Query Store is enabled for this database +-- Make sure that the actual_state_desc is the same as desired_state_desc +-- Make sure that the current_storage_size_mb is less than the max_storage_size_mb + -- Tuning Workload Performance with Query Store -- https://bit.ly/1kHSl7w - - --- Get input buffer information for the current database (Query 81) (Input Buffer) +-- Get input buffer information for the current database (Query 80) (Input Buffer) SELECT es.session_id, DB_NAME(es.database_id) AS [Database Name], es.login_time, es.cpu_time, es.logical_reads, es.memory_usage, es.[status], ib.event_info AS [Input Buffer] @@ -1916,7 +1960,7 @@ AND es.session_id <> @@SPID OPTION (RECOMPILE); --- Look at recent Full backups for the current database (Query 82) (Recent Full Backups) +-- Look at recent Full backups for the current database (Query 81) (Recent Full Backups) SELECT TOP (30) bs.machine_name, bs.server_name, bs.database_name AS [Database Name], bs.recovery_model, CONVERT (BIGINT, bs.backup_size / 1048576 ) AS [Uncompressed Backup Size (MB)], CONVERT (BIGINT, bs.compressed_backup_size / 1048576 ) AS [Compressed Backup Size (MB)], @@ -1944,36 +1988,10 @@ ORDER BY bs.backup_finish_date DESC OPTION (RECOMPILE); -- https://bit.ly/28Rpb2x --- These five Pluralsight Courses go into more detail about how to run these queries and interpret the results - --- SQL Server 2017: Diagnosing Performance Issues with DMVs --- https://bit.ly/2FqCeti - --- SQL Server 2017: Diagnosing Configuration Issues with DMVs --- https://bit.ly/2MSUDUL - --- SQL Server 2014 DMV Diagnostic Queries Part 1 --- https://bit.ly/2plxCer - --- SQL Server 2014 DMV Diagnostic Queries Part 2 --- https://bit.ly/2IuJpzI - --- SQL Server 2014 DMV Diagnostic Queries Part 3 --- https://bit.ly/2FIlCPb - - - --- Sign up for Microsoft Visual Studio Dev Essentials and get a free three month pass to Pluralsight - -- Microsoft Visual Studio Dev Essentials --- http://bit.ly/1q6xbDL - - --- Sign up for Microsoft Azure Essentials and get lots of free Azure usage credits, MCP exam voucher, three month Pluralsight subscription +-- https://bit.ly/2qjNRxi --- Microsoft Azure Essentials --- https://bit.ly/2JMWe8x +-- Microsoft Azure Learn +-- https://bit.ly/2O0Hacc --- August 2017 blog series about upgrading and migrating to SQL Server 2016/2017 --- https://bit.ly/2ftKVrX diff --git a/Scripts/SQL Server 2017 Diagnostic Information Queries.sql b/Scripts/SQL Server 2017 Diagnostic Information Queries.sql index 22a99b46..f86f3537 100644 --- a/Scripts/SQL Server 2017 Diagnostic Information Queries.sql +++ b/Scripts/SQL Server 2017 Diagnostic Information Queries.sql @@ -1,15 +1,14 @@ -- SQL Server 2017 Diagnostic Information Queries -- Glenn Berry --- Last Modified: July 9, 2019 --- https://www.sqlskills.com/blogs/glenn/ --- http://sqlserverperformance.wordpress.com/ +-- Last Modified: December 3, 2020 +-- https://glennsqlperformance.com/ +-- https://sqlserverperformance.wordpress.com/ +-- YouTube: https://bit.ly/2PkoAM1 -- Twitter: GlennAlanBerry --- Please listen to my Pluralsight courses --- https://www.pluralsight.com/author/glenn-berry - --- If you want to find all of our SQLskills SQL101 blog posts, check out https://bit.ly/2qLwfXW +-- Diagnostic Queries are available here +-- https://glennsqlperformance.com/resources/ -- Please make sure you are using the correct version of these diagnostic queries for your version of SQL Server @@ -23,11 +22,9 @@ --****************************************************************************** ---* Copyright (C) 2019 Glenn Berry, SQLskills.com +--* Copyright (C) 2020 Glenn Berry --* All rights reserved. --* ---* For more scripts and sample code, check out ---* https://www.sqlskills.com/blogs/glenn --* --* You may alter this code for your own *non-commercial* purposes. You may --* republish altered code as long as you include this copyright and give due credit. @@ -85,8 +82,14 @@ SELECT @@SERVERNAME AS [Server Name], @@VERSION AS [SQL Server and OS Version In -- 14.0.3076.1 CU14 3/25/2019 https://support.microsoft.com/en-us/help/4484710/cumulative-update-14-for-sql-server-2017 -- 14.0.3103.1 CU14 + Security Update 5/14/2019 https://support.microsoft.com/en-us/help/4494352/security-update-for-sql-server-2017-cu-14-gdr-may-14-2019 -- 14.0.3162.1 CU15 5/23/2019 https://support.microsoft.com/en-us/help/4498951/cumulative-update-15-for-sql-server-2017 --- 14.0.3192.2 CU15 + Security Update 7/9/2019 https://support.microsoft.com/en-us/help/4505225/security-update-for-sql-server-2017-cu15-gdr-july-9-2019 - +-- 14.0.3192.2 CU15 + Security Update 7/9/2019 https://support.microsoft.com/en-us/help/4505225/security-update-for-sql-server-2017-cu15-gdr-july-9-2019 +-- 14.0.3223.3 CU16 8/1/2019 https://support.microsoft.com/en-us/help/4508218/cumulative-update-16-for-sql-server-2017 +-- 14.0.3238.1 CU17 10/8/2019 https://support.microsoft.com/en-us/help/4515579/cumulative-update-17-for-sql-server-2017 +-- 14.0.3257.3 CU18 12/9/2019 https://support.microsoft.com/en-us/help/4527377/cumulative-update-18-for-sql-server-2017 +-- 14.0.3281.6 CU19 2/5/2020 https://support.microsoft.com/en-us/help/4535007/cumulative-update-19-for-sql-server-2017 +-- 14.0.3294.2 CU20 4/7/2020 https://support.microsoft.com/en-us/help/4541283/cumulative-update-20-for-sql-server-2017 +-- 14.0.3335.7 CU21 7/1/2020 https://support.microsoft.com/en-us/help/4557397/cumulative-update-21-for-sql-server-2017 +-- 14.0.3356.20 CU22 9/10/2020 https://support.microsoft.com/en-us/help/4577467/cumulative-update-22-for-sql-server-2017 -- How to determine the version, edition and update level of SQL Server and its components @@ -162,10 +165,11 @@ SERVERPROPERTY('IsHadrEnabled') AS [IsHadrEnabled], SERVERPROPERTY('HadrManagerStatus') AS [HadrManagerStatus], SERVERPROPERTY('InstanceDefaultDataPath') AS [InstanceDefaultDataPath], SERVERPROPERTY('InstanceDefaultLogPath') AS [InstanceDefaultLogPath], +SERVERPROPERTY('ErrorLogFileName') AS [ErrorLogFileName], SERVERPROPERTY('BuildClrVersion') AS [Build CLR Version], SERVERPROPERTY('IsXTPSupported') AS [IsXTPSupported], -SERVERPROPERTY('IsPolybaseInstalled') AS [IsPolybaseInstalled], -- New for SQL Server 2016 -SERVERPROPERTY('IsAdvancedAnalyticsInstalled') AS [IsRServicesInstalled]; -- New for SQL Server 2016 +SERVERPROPERTY('IsPolybaseInstalled') AS [IsPolybaseInstalled], +SERVERPROPERTY('IsAdvancedAnalyticsInstalled') AS [IsRServicesInstalled]; ------ -- This gives you a lot of useful information about your instance of SQL Server, @@ -215,11 +219,18 @@ DBCC TRACESTATUS (-1); -- https://bit.ly/2sboMli (added in CU12) -- TF 3226 - Supresses logging of successful database backup messages to the SQL Server Error Log --- https://bit.ly/2p6MTjS +-- https://bit.ly/38zDNAK -- TF 6534 - Enables use of native code to improve performance with spatial data -- https://bit.ly/2HrQUpU +-- TF 7745 - Prevents Query Store data from being written to disk in case of a failover or shutdown command +-- https://bit.ly/2GU69Km + +-- TF 7752 - Enables asynchronous load of Query Store +-- This allows a database to become online and queries to be executed before the Query Store has been fully recovered + + -- The behavior of TF 1117, 1118 are enabled for tempdb in SQL Server 2016 by default -- SQL 2016 It Just Runs Faster: -T1117 and -T1118 changes for TEMPDB and user databases -- https://bit.ly/2lbNWxK @@ -233,23 +244,8 @@ DBCC TRACESTATUS (-1); -- https://bit.ly/2VVRGTY --- Returns status of instant file initialization (Query 6) (IFI Status) -EXEC sys.xp_readerrorlog 0, 1, N'Database Instant File Initialization'; ------- - --- Lets you determine whether Instant File Initialization (IFI) is enabled for the instance --- This should be enabled in the vast majority of cases --- SQL Server 2016 and newer lets you enable this during the SQL server installation process - --- Database Instant File Initialization --- https://bit.ly/2nTX74y - --- Misconceptions around instant file initialization --- https://bit.ly/2oBSKgZ - - --- SQL Server Process Address space info (Query 7) (Process Memory) +-- SQL Server Process Address space info (Query 6) (Process Memory) -- (shows whether locked pages is enabled, among other things) SELECT physical_memory_in_use_kb/1024 AS [SQL Server Memory Usage (MB)], locked_page_allocations_kb/1024 AS [SQL Server Locked Pages Allocation (MB)], @@ -272,7 +268,7 @@ FROM sys.dm_os_process_memory WITH (NOLOCK) OPTION (RECOMPILE); --- SQL Server Services information (Query 8) (SQL Server Services Info) +-- SQL Server Services information (Query 7) (SQL Server Services Info) SELECT servicename, process_id, startup_type_desc, status_desc, last_startup_time, service_account, is_clustered, cluster_nodename, [filename], instant_file_initialization_enabled @@ -288,15 +284,20 @@ FROM sys.dm_server_services WITH (NOLOCK) OPTION (RECOMPILE); -- https://bit.ly/2oKa1Un --- Last backup information by database (Query 9) (Last Backup By Database) +-- Last backup information by database (Query 8) (Last Backup By Database) SELECT ISNULL(d.[name], bs.[database_name]) AS [Database], d.recovery_model_desc AS [Recovery Model], d.log_reuse_wait_desc AS [Log Reuse Wait Desc], MAX(CASE WHEN [type] = 'D' THEN bs.backup_finish_date ELSE NULL END) AS [Last Full Backup], + MAX(CASE WHEN [type] = 'D' THEN bmf.physical_device_name ELSE NULL END) AS [Last Full Backup Location], MAX(CASE WHEN [type] = 'I' THEN bs.backup_finish_date ELSE NULL END) AS [Last Differential Backup], - MAX(CASE WHEN [type] = 'L' THEN bs.backup_finish_date ELSE NULL END) AS [Last Log Backup] + MAX(CASE WHEN [type] = 'I' THEN bmf.physical_device_name ELSE NULL END) AS [Last Differential Backup Location], + MAX(CASE WHEN [type] = 'L' THEN bs.backup_finish_date ELSE NULL END) AS [Last Log Backup], + MAX(CASE WHEN [type] = 'L' THEN bmf.physical_device_name ELSE NULL END) AS [Last Log Backup Location] FROM sys.databases AS d WITH (NOLOCK) LEFT OUTER JOIN msdb.dbo.backupset AS bs WITH (NOLOCK) -ON bs.[database_name] = d.[name] +ON bs.[database_name] = d.[name] +LEFT OUTER JOIN msdb.dbo.backupmediafamily AS bmf WITH (NOLOCK) +ON bs.media_set_id = bmf.media_set_id AND bs.backup_finish_date > GETDATE()- 30 WHERE d.name <> N'tempdb' GROUP BY ISNULL(d.[name], bs.[database_name]), d.recovery_model_desc, d.log_reuse_wait_desc, d.[name] @@ -306,7 +307,7 @@ ORDER BY d.recovery_model_desc, d.[name] OPTION (RECOMPILE); -- This helps you spot runaway transaction logs and other issues with your backup schedule --- Get SQL Server Agent jobs and Category information (Query 10) (SQL Server Agent Jobs) +-- Get SQL Server Agent jobs and Category information (Query 9) (SQL Server Agent Jobs) SELECT sj.name AS [Job Name], sj.[description] AS [Job Description], SUSER_SNAME(sj.owner_sid) AS [Job Owner], sj.date_created AS [Date Created], sj.[enabled] AS [Job Enabled], sj.notify_email_operator_id, sj.notify_level_email, sc.name AS [CategoryName], @@ -329,11 +330,14 @@ ORDER BY sj.name OPTION (RECOMPILE); -- MSDN sysjobs documentation -- https://bit.ly/2paDEOP --- SQL Server Maintenance Solution +-- SQL Server Maintenance Solution (Ola Hallengren) -- https://bit.ly/1pgchQu +-- You can use this script to add default schedules to the standard Ola Hallengren Maintenance Solution jobs +-- https://bit.ly/3ane0gN + --- Get SQL Server Agent Alert Information (Query 11) (SQL Server Agent Alerts) +-- Get SQL Server Agent Alert Information (Query 10) (SQL Server Agent Alerts) SELECT name, event_source, message_id, severity, [enabled], has_notification, delay_between_responses, occurrence_count, last_occurrence_date, last_occurrence_time FROM msdb.dbo.sysalerts WITH (NOLOCK) @@ -342,11 +346,11 @@ ORDER BY name OPTION (RECOMPILE); -- Gives you some basic information about your SQL Server Agent Alerts -- (which are different from SQL Server Agent jobs) --- Read more about Agent Alerts here: https://bit.ly/2Giz0Xf +-- Read more about Agent Alerts here: https://bit.ly/2v5YR37 --- Host information (Query 12) (Host Info) +-- Host information (Query 11) (Host Info) SELECT host_platform, host_distribution, host_release, host_service_pack_level, host_sku, os_language_version FROM sys.dm_os_host_info WITH (NOLOCK) OPTION (RECOMPILE); @@ -377,7 +381,7 @@ FROM sys.dm_os_host_info WITH (NOLOCK) OPTION (RECOMPILE); -- https://bit.ly/2F7Ax0P --- SQL Server NUMA Node information (Query 13) (SQL Server NUMA Info) +-- SQL Server NUMA Node information (Query 12) (SQL Server NUMA Info) SELECT node_id, node_state_desc, memory_node_id, processor_group, cpu_count, online_scheduler_count, idle_scheduler_count, active_worker_count, avg_load_balance, resource_monitor_state FROM sys.dm_os_nodes WITH (NOLOCK) @@ -392,15 +396,16 @@ WHERE node_state_desc <> N'ONLINE DAC' OPTION (RECOMPILE); -- sys.dm_os_nodes (Transact-SQL) -- https://bit.ly/2pn5Mw8 --- Balancing Your Available SQL Server Core Licenses Evenly Across NUMA Nodes --- https://bit.ly/2vfC4Rq +-- How to Balance SQL Server Core Licenses Across NUMA Nodes +-- https://bit.ly/3i4TyVR --- Good basic information about OS memory amounts and state (Query 14) (System Memory) +-- Good basic information about OS memory amounts and state (Query 13) (System Memory) SELECT total_physical_memory_kb/1024 AS [Physical Memory (MB)], available_physical_memory_kb/1024 AS [Available Memory (MB)], - total_page_file_kb/1024 AS [Total Page File (MB)], + total_page_file_kb/1024 AS [Page File Commit Limit (MB)], + total_page_file_kb/1024 - total_physical_memory_kb/1024 AS [Physical Page File Size (MB)], available_page_file_kb/1024 AS [Available Page File (MB)], system_cache_kb/1024 AS [System Cache (MB)], system_memory_state_desc AS [System Memory State] @@ -425,7 +430,7 @@ FROM sys.dm_os_sys_memory WITH (NOLOCK) OPTION (RECOMPILE); -- You can skip the next two queries if you know you don't have a clustered instance --- Get information about your cluster nodes and their status (Query 15) (Cluster Node Properties) +-- Get information about your cluster nodes and their status (Query 14) (Cluster Node Properties) -- (if your database server is in a failover cluster) SELECT NodeName, status_description, is_current_owner FROM sys.dm_os_cluster_nodes WITH (NOLOCK) OPTION (RECOMPILE); @@ -439,7 +444,7 @@ FROM sys.dm_os_cluster_nodes WITH (NOLOCK) OPTION (RECOMPILE); -- https://bit.ly/1z5BfCw --- Get information about any AlwaysOn AG cluster this instance is a part of (Query 16) (AlwaysOn AG Cluster) +-- Get information about any AlwaysOn AG cluster this instance is a part of (Query 15) (AlwaysOn AG Cluster) SELECT cluster_name, quorum_type_desc, quorum_state_desc FROM sys.dm_hadr_cluster WITH (NOLOCK) OPTION (RECOMPILE); ------ @@ -447,7 +452,7 @@ FROM sys.dm_hadr_cluster WITH (NOLOCK) OPTION (RECOMPILE); -- You will see no results if your instance is not using AlwaysOn AGs --- Good overview of AG health and status (Query 17) (AlwaysOn AG Status) +-- Good overview of AG health and status (Query 16) (AG Status) SELECT ag.name AS [AG Name], ar.replica_server_name, ar.availability_mode_desc, adc.[database_name], drs.is_local, drs.is_primary_replica, drs.synchronization_state_desc, drs.is_commit_participant, drs.synchronization_health_desc, drs.recovery_lsn, drs.truncation_lsn, drs.last_sent_lsn, @@ -472,7 +477,7 @@ ORDER BY ag.name, ar.replica_server_name, adc.[database_name] OPTION (RECOMPILE) -- https://bit.ly/2dn1H6r --- Hardware information from SQL Server 2017 (Query 18) (Hardware Info) +-- Hardware information from SQL Server 2017 (Query 17) (Hardware Info) SELECT cpu_count AS [Logical CPU Count], scheduler_count, (socket_count * cores_per_socket) AS [Physical Core Count], socket_count AS [Socket Count], cores_per_socket, numa_node_count, @@ -508,7 +513,7 @@ FROM sys.dm_os_sys_info WITH (NOLOCK) OPTION (RECOMPILE); -- LARGE_PAGES --- Get System Manufacturer and model number from SQL Server Error log (Query 19) (System Manufacturer) +-- Get System Manufacturer and model number from SQL Server Error log (Query 18) (System Manufacturer) EXEC sys.xp_readerrorlog 0, 1, N'Manufacturer'; ------ @@ -518,18 +523,7 @@ EXEC sys.xp_readerrorlog 0, 1, N'Manufacturer'; -- This query will return no results if your error log has been recycled since the instance was started --- Get pvscsi info from Windows Registry (Query 20) (PVSCSI Driver Parameters) -EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SYSTEM\CurrentControlSet\services\pvscsi\Parameters\Device', N'DriverParameter'; ------- - --- This is valid for VMware VMs --- Recommended value for intensive I/O patterns from VMware is: RequestRingPages=32,MaxQueueDepth=254 --- https://kb.vmware.com/s/article/2053145 --- Does not work on Linux - - - --- Get BIOS date from Windows Registry (Query 21) (BIOS Date) +-- Get BIOS date from Windows Registry (Query 19) (BIOS Date) EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\System\BIOS', N'BiosReleaseDate'; ------ @@ -538,7 +532,7 @@ EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\Syste -- Does not work on Linux --- Get processor description from Windows Registry (Query 22) (Processor Description) +-- Get processor description from Windows Registry (Query 20) (Processor Description) EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\System\CentralProcessor\0', N'ProcessorNameString'; ------ @@ -556,7 +550,7 @@ EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\Syste --- Get information on location, time and size of any memory dumps from SQL Server (Query 23) (Memory Dump Info) +-- Get information on location, time and size of any memory dumps from SQL Server (Query 21) (Memory Dump Info) SELECT [filename], creation_time, size_in_bytes/1048576.0 AS [Size (MB)] FROM sys.dm_server_memory_dumps WITH (NOLOCK) ORDER BY creation_time DESC OPTION (RECOMPILE); @@ -570,7 +564,7 @@ ORDER BY creation_time DESC OPTION (RECOMPILE); --- Look at Suspect Pages table (Query 24) (Suspect Pages) +-- Look at Suspect Pages table (Query 22) (Suspect Pages) SELECT DB_NAME(database_id) AS [Database Name], [file_id], page_id, event_type, error_count, last_update_date FROM msdb.dbo.suspect_pages WITH (NOLOCK) @@ -593,7 +587,7 @@ ORDER BY database_id OPTION (RECOMPILE); -- https://bit.ly/2Fvr1c9 --- Get number of data files in tempdb database (Query 25) (TempDB Data Files) +-- Get number of data files in tempdb database (Query 23) (TempDB Data Files) EXEC sys.xp_readerrorlog 0, 1, N'The tempdb database has'; ------ @@ -602,7 +596,7 @@ EXEC sys.xp_readerrorlog 0, 1, N'The tempdb database has'; -- This query will return no results if your error log has been recycled since the instance was last started --- File names and paths for all user and system databases on instance (Query 26) (Database Filenames and Paths) +-- File names and paths for all user and system databases on instance (Query 24) (Database Filenames and Paths) SELECT DB_NAME([database_id]) AS [Database Name], [file_id], [name], physical_name, [type_desc], state_desc, is_percent_growth, growth, @@ -622,17 +616,21 @@ ORDER BY DB_NAME([database_id]), [file_id] OPTION (RECOMPILE); -- Is percent growth enabled for any files (which is bad)? --- Drive information for all fixed drives visible to the operating system (Query 27) (Fixed Drives) +-- Drive information for all fixed drives visible to the operating system (Query 25) (Fixed Drives) SELECT fixed_drive_path, drive_type_desc, CONVERT(DECIMAL(18,2), free_space_in_bytes/1073741824.0) AS [Available Space (GB)] FROM sys.dm_os_enumerate_fixed_drives WITH (NOLOCK) OPTION (RECOMPILE); ------ --- This shows all of your fixed drives, not just LUNs with SQL Server database files +-- This shows all of your drives, not just LUNs with SQL Server database files +-- New in SQL Server 2017 + +-- sys.dm_os_enumerate_fixed_drives (Transact-SQL) +-- https://bit.ly/2EZoHLj --- Volume info for all LUNS that have database files on the current instance (Query 28) (Volume Info) +-- Volume info for all LUNS that have database files on the current instance (Query 26) (Volume Info) SELECT DISTINCT vs.volume_mount_point, vs.file_system_type, vs.logical_volume_name, CONVERT(DECIMAL(18,2), vs.total_bytes/1073741824.0) AS [Total Size (GB)], CONVERT(DECIMAL(18,2), vs.available_bytes/1073741824.0) AS [Available Size (GB)], @@ -652,8 +650,7 @@ ORDER BY vs.volume_mount_point OPTION (RECOMPILE); --- Drive level latency information (Query 29) (Drive Level Latency) --- Based on code from Jimmy May +-- Drive level latency information (Query 27) (Drive Level Latency) SELECT tab.[Drive], tab.volume_mount_point AS [Volume Mount Point], CASE WHEN num_of_reads = 0 THEN 0 @@ -696,8 +693,14 @@ ORDER BY [Overall Latency] OPTION (RECOMPILE); -- These latency numbers include all file activity against all SQL Server -- database files on each drive since SQL Server was last started +-- sys.dm_io_virtual_file_stats (Transact-SQL) +-- https://bit.ly/3bRWUc0 + +-- sys.dm_os_volume_stats (Transact-SQL) +-- https://bit.ly/33thz2j + --- Calculates average stalls per read, per write, and per total input/output for each database file (Query 30) (IO Latency by File) +-- Calculates average stalls per read, per write, and per total input/output for each database file (Query 28) (IO Latency by File) SELECT DB_NAME(fs.database_id) AS [Database Name], CAST(fs.io_stall_read_ms/(1.0 + fs.num_of_reads) AS NUMERIC(10,1)) AS [avg_read_latency_ms], CAST(fs.io_stall_write_ms/(1.0 + fs.num_of_writes) AS NUMERIC(10,1)) AS [avg_write_latency_ms], CAST((fs.io_stall_read_ms + fs.io_stall_write_ms)/(1.0 + fs.num_of_reads + fs.num_of_writes) AS NUMERIC(10,1)) AS [avg_io_latency_ms], @@ -717,8 +720,11 @@ ORDER BY avg_io_latency_ms DESC OPTION (RECOMPILE); -- These latency numbers include all file activity against each SQL Server -- database file since SQL Server was last started +-- sys.dm_io_virtual_file_stats (Transact-SQL) +-- https://bit.ly/3bRWUc0 + --- Look for I/O requests taking longer than 15 seconds in the six most recent SQL Server Error Logs (Query 31) (IO Warnings) +-- Look for I/O requests taking longer than 15 seconds in the six most recent SQL Server Error Logs (Query 29) (IO Warnings) CREATE TABLE #IOWarningResults(LogDate datetime, ProcessInfo sysname, LogText nvarchar(1000)); INSERT INTO #IOWarningResults @@ -754,7 +760,7 @@ DROP TABLE #IOWarningResults; -- https://bit.ly/2qtaw73 --- Resource Governor Resource Pool information (Query 32) (RG Resource Pools) +-- Resource Governor Resource Pool information (Query 30) (RG Resource Pools) SELECT pool_id, [Name], statistics_start_time, min_memory_percent, max_memory_percent, max_memory_kb/1024 AS [max_memory_mb], @@ -770,7 +776,7 @@ OPTION (RECOMPILE); --- Recovery model, log reuse wait description, log file size, log usage size (Query 33) (Database Properties) +-- Recovery model, log reuse wait description, log file size, log usage size (Query 31) (Database Properties) -- and compatibility level for all databases on instance SELECT db.[name] AS [Database Name], SUSER_SNAME(db.owner_sid) AS [Database Owner], db.recovery_model_desc AS [Recovery Model], db.state_desc, db.containment_desc, db.log_reuse_wait_desc AS [Log Reuse Wait Description], @@ -784,8 +790,8 @@ db.target_recovery_time_in_seconds, db.is_cdc_enabled, db.is_published, db.is_di db.group_database_id, db.replica_id,db.is_memory_optimized_elevate_to_snapshot_on, db.delayed_durability_desc, db.is_auto_create_stats_incremental_on, db.is_query_store_on, db.is_sync_with_backup, db.is_temporal_history_retention_enabled, -db.is_supplemental_logging_enabled, db.is_remote_data_archive_enabled, -db.is_encrypted, de.encryption_state, de.percent_complete, de.key_algorithm, de.key_length, db.resource_pool_id +db.is_remote_data_archive_enabled, +db.is_encrypted, de.encryption_state, de.percent_complete, de.key_algorithm, de.key_length FROM sys.databases AS db WITH (NOLOCK) INNER JOIN sys.dm_os_performance_counters AS lu WITH (NOLOCK) ON db.name = lu.instance_name @@ -799,6 +805,16 @@ AND ls.cntr_value > 0 ORDER BY db.[name] OPTION (RECOMPILE); ------ +-- sys.databases (Transact-SQL) +-- https://bit.ly/2G5wqaX + +-- sys.dm_os_performance_counters (Transact-SQL) +-- https://bit.ly/3kEO2JR + +-- sys.dm_database_encryption_keys (Transact-SQL) +-- https://bit.ly/3mE7kkx + + -- Things to look at: -- How many databases are on the instance? -- What recovery models are they using? @@ -821,14 +837,12 @@ ORDER BY db.[name] OPTION (RECOMPILE); -- https://bit.ly/2pdggk3 --- Missing Indexes for all databases by Index Advantage (Query 34) (Missing Indexes All Databases) -SELECT CONVERT(decimal(18,2), user_seeks * avg_total_user_cost * (avg_user_impact * 0.01)) AS [index_advantage], -FORMAT(migs.last_user_seek, 'yyyy-MM-dd HH:mm:ss') AS [last_user_seek], -mid.[statement] AS [Database.Schema.Table], +-- Missing Indexes for all databases by Index Advantage (Query 32) (Missing Indexes All Databases) +SELECT CONVERT(decimal(18,2), migs.user_seeks * migs.avg_total_user_cost * (migs.avg_user_impact * 0.01)) AS [index_advantage], +FORMAT(migs.last_user_seek, 'yyyy-MM-dd HH:mm:ss') AS [last_user_seek], mid.[statement] AS [Database.Schema.Table], COUNT(1) OVER(PARTITION BY mid.[statement]) AS [missing_indexes_for_table], -COUNT(1) OVER(PARTITION BY mid.[statement], equality_columns) AS [similar_missing_indexes_for_table], -mid.equality_columns, mid.inequality_columns, mid.included_columns, -migs.unique_compiles, migs.user_seeks, +COUNT(1) OVER(PARTITION BY mid.[statement], mid.equality_columns) AS [similar_missing_indexes_for_table], +mid.equality_columns, mid.inequality_columns, mid.included_columns, migs.user_seeks, CONVERT(decimal(18,2), migs.avg_total_user_cost) AS [avg_total_user_cost], migs.avg_user_impact FROM sys.dm_db_missing_index_group_stats AS migs WITH (NOLOCK) INNER JOIN sys.dm_db_missing_index_groups AS mig WITH (NOLOCK) @@ -843,13 +857,14 @@ ORDER BY index_advantage DESC OPTION (RECOMPILE); -- Also look at avg_user_impact and avg_total_user_cost to help determine importance -- SQL Server is overly eager to add included columns, so beware -- Do not just blindly add indexes that show up from this query!!! +-- Hkan Winther has given me some great suggestions for this query -- SQL Server Index Design Guide -- https://bit.ly/2qtZr4N --- Get VLF Counts for all databases on the instance (Query 35) (VLF Counts) +-- Get VLF Counts for all databases on the instance (Query 33) (VLF Counts) SELECT [name] AS [Database Name], [VLF Count] FROM sys.databases AS db WITH (NOLOCK) CROSS APPLY (SELECT file_id, COUNT(*) AS [VLF Count] @@ -870,7 +885,7 @@ ORDER BY [VLF Count] DESC OPTION (RECOMPILE); --- Get CPU utilization by database (Query 36) (CPU Usage by Database) +-- Get CPU utilization by database (Query 34) (CPU Usage by Database) WITH DB_CPU_Stats AS (SELECT pa.DatabaseID, DB_Name(pa.DatabaseID) AS [Database Name], SUM(qs.total_worker_time/1000) AS [CPU_Time_Ms] @@ -891,7 +906,7 @@ ORDER BY [CPU Rank] OPTION (RECOMPILE); -- Note: This only reflects CPU usage from the currently cached query plans --- Get I/O utilization by database (Query 37) (IO Usage By Database) +-- Get I/O utilization by database (Query 35) (IO Usage By Database) WITH Aggregate_IO_Statistics AS (SELECT DB_NAME(database_id) AS [Database Name], CAST(SUM(num_of_bytes_read + num_of_bytes_written) / 1048576 AS DECIMAL(12, 2)) AS [ioTotalMB], @@ -915,7 +930,7 @@ ORDER BY [I/O Rank] OPTION (RECOMPILE); -- They include all I/O activity, not just the nominal I/O workload --- Get total buffer usage by database for current instance (Query 38) (Total Buffer Usage by Database) +-- Get total buffer usage by database for current instance (Query 36) (Total Buffer Usage by Database) -- This make take some time to run on a busy instance WITH AggregateBufferPoolUsage AS @@ -934,7 +949,7 @@ ORDER BY [Buffer Pool Rank] OPTION (RECOMPILE); -- is being used by each database on the instance --- Get tempdb version store space usage by database (Query 39) (Version Store Space Usage) +-- Get tempdb version store space usage by database (Query 37) (Version Store Space Usage) SELECT DB_NAME(database_id) AS [Database Name], reserved_page_count AS [Version Store Reserved Page Count], reserved_space_kb/1024 AS [Version Store Reserved Space (MB)] @@ -951,7 +966,7 @@ ORDER BY reserved_space_kb/1024 DESC OPTION (RECOMPILE); -- Clear Wait Stats with this command -- DBCC SQLPERF('sys.dm_os_wait_stats', CLEAR); --- Isolate top waits for server instance since last restart or wait statistics clear (Query 40) (Top Waits) +-- Isolate top waits for server instance since last restart or wait statistics clear (Query 38) (Top Waits) WITH [Waits] AS (SELECT wait_type, wait_time_ms/ 1000.0 AS [WaitS], (wait_time_ms - signal_wait_time_ms) / 1000.0 AS [ResourceS], @@ -1017,7 +1032,7 @@ OPTION (RECOMPILE); -- Cumulative wait stats are not as useful on an idle instance that is not under load or performance pressure --- SQL Server Wait Types Library (Paul Randal) +-- SQL Server Wait Types Library -- https://bit.ly/2ePzYO2 -- The SQL Server Wait Type Repository @@ -1034,7 +1049,7 @@ OPTION (RECOMPILE); --- Get a count of SQL connections by IP address (Query 41) (Connection Counts by IP Address) +-- Get a count of SQL connections by IP address (Query 39) (Connection Counts by IP Address) SELECT ec.client_net_address, es.[program_name], es.[host_name], es.login_name, COUNT(ec.session_id) AS [connection count] FROM sys.dm_exec_sessions AS es WITH (NOLOCK) @@ -1052,7 +1067,7 @@ ORDER BY ec.client_net_address, es.[program_name] OPTION (RECOMPILE); --- Get Average Task Counts (run multiple times) (Query 42) (Avg Task Counts) +-- Get Average Task Counts (run multiple times) (Query 40) (Avg Task Counts) SELECT AVG(current_tasks_count) AS [Avg Task Count], AVG(work_queue_count) AS [Avg Work Queue Count], AVG(runnable_tasks_count) AS [Avg Runnable Task Count], @@ -1069,11 +1084,11 @@ WHERE scheduler_id < 255 OPTION (RECOMPILE); -- High Avg Pending DiskIO Counts are a sign of disk pressure -- How to Do Some Very Basic SQL Server Monitoring --- https://bit.ly/2q3Btgt +-- https://bit.ly/30IRla0 --- Detect blocking (run multiple times) (Query 43) (Detect Blocking) +-- Detect blocking (run multiple times) (Query 41) (Detect Blocking) SELECT t1.resource_type AS [lock type], DB_NAME(resource_database_id) AS [database], t1.resource_associated_entity_id AS [blk object],t1.request_mode AS [lock req], -- lock requested t1.request_session_id AS [waiter sid], t2.wait_duration_ms AS [wait time], -- spid of waiter @@ -1102,22 +1117,22 @@ ON t1.lock_owner_address = t2.resource_address OPTION (RECOMPILE); --- Get CPU Utilization History for last 256 minutes (in one minute intervals) (Query 44) (CPU Utilization History) -DECLARE @ts_now bigint = (SELECT cpu_ticks/(cpu_ticks/ms_ticks) FROM sys.dm_os_sys_info WITH (NOLOCK)); +-- Get CPU Utilization History for last 256 minutes (in one minute intervals) (Query 42) (CPU Utilization History) +DECLARE @ts_now bigint = (SELECT ms_ticks FROM sys.dm_os_sys_info WITH (NOLOCK)); SELECT TOP(256) SQLProcessUtilization AS [SQL Server Process CPU Utilization], SystemIdle AS [System Idle Process], 100 - SystemIdle - SQLProcessUtilization AS [Other Process CPU Utilization], DATEADD(ms, -1 * (@ts_now - [timestamp]), GETDATE()) AS [Event Time] FROM (SELECT record.value('(./Record/@id)[1]', 'int') AS record_id, - record.value('(./Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int') - AS [SystemIdle], - record.value('(./Record/SchedulerMonitorEvent/SystemHealth/ProcessUtilization)[1]', 'int') - AS [SQLProcessUtilization], [timestamp] - FROM (SELECT [timestamp], CONVERT(xml, record) AS [record] - FROM sys.dm_os_ring_buffers WITH (NOLOCK) - WHERE ring_buffer_type = N'RING_BUFFER_SCHEDULER_MONITOR' - AND record LIKE N'%%') AS x) AS y + record.value('(./Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int') + AS [SystemIdle], + record.value('(./Record/SchedulerMonitorEvent/SystemHealth/ProcessUtilization)[1]', 'int') + AS [SQLProcessUtilization], [timestamp] + FROM (SELECT [timestamp], CONVERT(xml, record) AS [record] + FROM sys.dm_os_ring_buffers WITH (NOLOCK) + WHERE ring_buffer_type = N'RING_BUFFER_SCHEDULER_MONITOR' + AND record LIKE N'%%') AS x) AS y ORDER BY record_id DESC OPTION (RECOMPILE); ------ @@ -1127,7 +1142,7 @@ ORDER BY record_id DESC OPTION (RECOMPILE); -- on high core count (> 64 cores) systems --- Get top total worker time queries for entire instance (Query 45) (Top Worker Time Queries) +-- Get top total worker time queries for entire instance (Query 43) (Top Worker Time Queries) SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], REPLACE(REPLACE(LEFT(t.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text], qs.total_worker_time AS [Total Worker Time], qs.min_worker_time AS [Min Worker Time], @@ -1140,7 +1155,7 @@ qs.min_logical_reads AS [Min Logical Reads], qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], qs.max_logical_reads AS [Max Logical Reads], qs.execution_count AS [Execution Count], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], qs.creation_time AS [Creation Time] --,t.[text] AS [Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) @@ -1155,7 +1170,7 @@ ORDER BY qs.total_worker_time DESC OPTION (RECOMPILE); --- Page Life Expectancy (PLE) value for each NUMA node in current instance (Query 46) (PLE by NUMA Node) +-- Page Life Expectancy (PLE) value for each NUMA node in current instance (Query 44) (PLE by NUMA Node) SELECT @@SERVERNAME AS [Server Name], RTRIM([object_name]) AS [Object Name], instance_name, cntr_value AS [Page Life Expectancy] FROM sys.dm_os_performance_counters WITH (NOLOCK) @@ -1171,7 +1186,7 @@ AND counter_name = N'Page life expectancy' OPTION (RECOMPILE); -- https://bit.ly/2EgynLa --- Memory Grants Pending value for current instance (Query 47) (Memory Grants Pending) +-- Memory Grants Pending value for current instance (Query 45) (Memory Grants Pending) SELECT @@SERVERNAME AS [Server Name], RTRIM([object_name]) AS [Object Name], cntr_value AS [Memory Grants Pending] FROM sys.dm_os_performance_counters WITH (NOLOCK) WHERE [object_name] LIKE N'%Memory Manager%' -- Handles named instances @@ -1182,7 +1197,7 @@ AND counter_name = N'Memory Grants Pending' OPTION (RECOMPILE); -- Memory Grants Pending above zero for a sustained period is a very strong indicator of internal memory pressure --- Memory Clerk Usage for instance (Query 48) (Memory Clerk Usage) +-- Memory Clerk Usage for instance (Query 46) (Memory Clerk Usage) -- Look for high value for CACHESTORE_SQLCP (Ad-hoc query plans) SELECT TOP(10) mc.[type] AS [Memory Clerk Type], CAST((SUM(mc.pages_kb)/1024.0) AS DECIMAL (15,2)) AS [Memory Usage (MB)] @@ -1207,7 +1222,7 @@ ORDER BY SUM(mc.pages_kb) DESC OPTION (RECOMPILE); --- Find single-use, ad-hoc and prepared queries that are bloating the plan cache (Query 49) (Ad hoc Queries) +-- Find single-use, ad-hoc and prepared queries that are bloating the plan cache (Query 47) (Ad hoc Queries) SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], t.[text] AS [Query Text], cp.objtype AS [Object Type], cp.cacheobjtype AS [Cache Object Type], cp.size_in_bytes/1024 AS [Plan Size in KB] @@ -1228,7 +1243,7 @@ ORDER BY cp.size_in_bytes DESC, DB_NAME(t.[dbid]) OPTION (RECOMPILE); -- https://bit.ly/2EfYOkl --- Get top total logical reads queries for entire instance (Query 50) (Top Logical Reads Queries) +-- Get top total logical reads queries for entire instance (Query 48) (Top Logical Reads Queries) SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], REPLACE(REPLACE(LEFT(t.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text], qs.total_logical_reads AS [Total Logical Reads], @@ -1242,7 +1257,7 @@ qs.min_elapsed_time AS [Min Elapsed Time], qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], qs.max_elapsed_time AS [Max Elapsed Time], qs.execution_count AS [Execution Count], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], qs.creation_time AS [Creation Time] --,t.[text] AS [Complete Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) @@ -1256,7 +1271,7 @@ ORDER BY qs.total_logical_reads DESC OPTION (RECOMPILE); -- Can also help track down parameter sniffing issues --- Get top average elapsed time queries for entire instance (Query 51) (Top Avg Elapsed Time Queries) +-- Get top average elapsed time queries for entire instance (Query 49) (Top Avg Elapsed Time Queries) SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], REPLACE(REPLACE(LEFT(t.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text], qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], @@ -1265,7 +1280,7 @@ qs.execution_count AS [Execution Count], qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], qs.total_physical_reads/qs.execution_count AS [Avg Physical Reads], qs.total_worker_time/qs.execution_count AS [Avg Worker Time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], qs.creation_time AS [Creation Time] --,t.[text] AS [Complete Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) @@ -1278,7 +1293,7 @@ ORDER BY qs.total_elapsed_time/qs.execution_count DESC OPTION (RECOMPILE); -- Can also help track down parameter sniffing issues --- Look at UDF execution statistics (Query 52) (UDF Stats by DB) +-- Look at UDF execution statistics (Query 50) (UDF Stats by DB) SELECT TOP (25) DB_NAME(database_id) AS [Database Name], OBJECT_NAME(object_id, database_id) AS [Function Name], total_worker_time, execution_count, total_elapsed_time, @@ -1301,11 +1316,14 @@ ORDER BY total_worker_time DESC OPTION (RECOMPILE); --USE YourDatabaseName; -- make sure to change to an actual database on your instance, not the master system database --GO --- Individual File Sizes and space available for current database (Query 53) (File Sizes and Space) +-- Individual File Sizes and space available for current database (Query 51) (File Sizes and Space) SELECT f.name AS [File Name] , f.physical_name AS [Physical Name], CAST((f.size/128.0) AS DECIMAL(15,2)) AS [Total Size in MB], CAST(f.size/128.0 - CAST(FILEPROPERTY(f.name, 'SpaceUsed') AS int)/128.0 AS DECIMAL(15,2)) -AS [Available Space In MB], f.[file_id], fg.name AS [Filegroup Name], +AS [Available Space In MB], +CAST((f.size/128.0) AS DECIMAL(15,2)) - +CAST(f.size/128.0 - CAST(FILEPROPERTY(f.name, 'SpaceUsed') AS int)/128.0 AS DECIMAL(15,2)) AS [Used Space in MB], +f.[file_id], fg.name AS [Filegroup Name], f.is_percent_growth, f.growth, fg.is_default, fg.is_read_only, fg.is_autogrow_all_files FROM sys.database_files AS f WITH (NOLOCK) @@ -1323,7 +1341,7 @@ ORDER BY f.[file_id] OPTION (RECOMPILE); -- https://bit.ly/2evRZSR --- Log space usage for current database (Query 54) (Log Space Usage) +-- Log space usage for current database (Query 52) (Log Space Usage) SELECT DB_NAME(lsu.database_id) AS [Database Name], db.recovery_model_desc AS [Recovery Model], CAST(lsu.total_log_size_in_bytes/1048576.0 AS DECIMAL(10, 2)) AS [Total Log Space (MB)], CAST(lsu.used_log_space_in_bytes/1048576.0 AS DECIMAL(10, 2)) AS [Used Log Space (MB)], @@ -1342,7 +1360,7 @@ OPTION (RECOMPILE); -- https://bit.ly/2H4MQw9 --- Status of last VLF for current database (Query 55) (Last VLF Status) +-- Status of last VLF for current database (Query 53) (Last VLF Status) SELECT TOP(1) DB_NAME(li.database_id) AS [Database Name], li.[file_id], li.vlf_size_mb, li.vlf_sequence_number, li.vlf_active, li.vlf_status FROM sys.dm_db_log_info(DB_ID()) AS li @@ -1361,7 +1379,7 @@ ORDER BY vlf_sequence_number DESC OPTION (RECOMPILE); --- Get database scoped configuration values for current database (Query 56) (Database-scoped Configurations) +-- Get database scoped configuration values for current database (Query 54) (Database-scoped Configurations) SELECT configuration_id, name, [value] AS [value_for_primary], value_for_secondary FROM sys.database_scoped_configurations WITH (NOLOCK) OPTION (RECOMPILE); ------ @@ -1375,7 +1393,7 @@ FROM sys.database_scoped_configurations WITH (NOLOCK) OPTION (RECOMPILE); -- https://bit.ly/2sOH7nb --- I/O Statistics by file for the current database (Query 57) (IO Stats By File) +-- I/O Statistics by file for the current database (Query 55) (IO Stats By File) SELECT DB_NAME(DB_ID()) AS [Database Name], df.name AS [Logical Name], vfs.[file_id], df.type_desc, df.physical_name AS [Physical Name], CAST(vfs.size_on_disk_bytes/1048576.0 AS DECIMAL(16, 2)) AS [Size on Disk (MB)], vfs.num_of_reads, vfs.num_of_writes, vfs.io_stall_read_ms, vfs.io_stall_write_ms, @@ -1398,7 +1416,7 @@ ON vfs.[file_id]= df.[file_id] OPTION (RECOMPILE); --- Get most frequently executed queries for this database (Query 58) (Query Execution Counts) +-- Get most frequently executed queries for this database (Query 56) (Query Execution Counts) SELECT TOP(50) LEFT(t.[text], 50) AS [Short Query Text], qs.execution_count AS [Execution Count], qs.total_logical_reads AS [Total Logical Reads], qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], @@ -1406,7 +1424,7 @@ qs.total_worker_time AS [Total Worker Time], qs.total_worker_time/qs.execution_count AS [Avg Worker Time], qs.total_elapsed_time AS [Total Elapsed Time], qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], qs.creation_time AS [Creation Time] --,t.[text] AS [Complete Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) @@ -1417,15 +1435,15 @@ ORDER BY qs.execution_count DESC OPTION (RECOMPILE); ------ --- Queries 59 through 64 are the "Bad Man List" for stored procedures +-- Queries 57 through 63 are the "Bad Man List" for stored procedures --- Top Cached SPs By Execution Count (Query 59) (SP Execution Counts) +-- Top Cached SPs By Execution Count (Query 57) (SP Execution Counts) SELECT TOP(100) p.name AS [SP Name], qs.execution_count AS [Execution Count], ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], qs.total_worker_time/qs.execution_count AS [Avg Worker Time], qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1440,15 +1458,16 @@ ORDER BY qs.execution_count DESC OPTION (RECOMPILE); -- Tells you which cached stored procedures are called the most often -- This helps you characterize and baseline your workload +-- It also helps you find possible caching opportunities --- Top Cached SPs By Avg Elapsed Time (Query 60) (SP Avg Elapsed Time) +-- Top Cached SPs By Avg Elapsed Time (Query 58) (SP Avg Elapsed Time) SELECT TOP(25) p.name AS [SP Name], qs.min_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], qs.max_elapsed_time, qs.last_elapsed_time, qs.total_elapsed_time, qs.execution_count, ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_worker_time/qs.execution_count AS [AvgWorkerTime], qs.total_worker_time AS [TotalWorkerTime], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1466,12 +1485,12 @@ ORDER BY avg_elapsed_time DESC OPTION (RECOMPILE); --- Top Cached SPs By Total Worker time. Worker time relates to CPU cost (Query 61) (SP Worker Time) +-- Top Cached SPs By Total Worker time. Worker time relates to CPU cost (Query 59) (SP Worker Time) SELECT TOP(25) p.name AS [SP Name], qs.total_worker_time AS [TotalWorkerTime], qs.total_worker_time/qs.execution_count AS [AvgWorkerTime], qs.execution_count, ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1488,12 +1507,12 @@ ORDER BY qs.total_worker_time DESC OPTION (RECOMPILE); -- You should look at this if you see signs of CPU pressure --- Top Cached SPs By Total Logical Reads. Logical reads relate to memory pressure (Query 62) (SP Logical Reads) +-- Top Cached SPs By Total Logical Reads. Logical reads relate to memory pressure (Query 60) (SP Logical Reads) SELECT TOP(25) p.name AS [SP Name], qs.total_logical_reads AS [TotalLogicalReads], qs.total_logical_reads/qs.execution_count AS [AvgLogicalReads],qs.execution_count, ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1510,11 +1529,11 @@ ORDER BY qs.total_logical_reads DESC OPTION (RECOMPILE); -- You should look at this if you see signs of memory pressure --- Top Cached SPs By Total Physical Reads. Physical reads relate to disk read I/O pressure (Query 63) (SP Physical Reads) +-- Top Cached SPs By Total Physical Reads. Physical reads relate to disk read I/O pressure (Query 61) (SP Physical Reads) SELECT TOP(25) p.name AS [SP Name],qs.total_physical_reads AS [TotalPhysicalReads], qs.total_physical_reads/qs.execution_count AS [AvgPhysicalReads], qs.execution_count, qs.total_logical_reads,qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1532,13 +1551,13 @@ ORDER BY qs.total_physical_reads DESC, qs.total_logical_reads DESC OPTION (RECOM --- Top Cached SPs By Total Logical Writes (Query 64) (SP Logical Writes) +-- Top Cached SPs By Total Logical Writes (Query 62) (SP Logical Writes) -- Logical writes relate to both memory and disk I/O pressure SELECT TOP(25) p.name AS [SP Name], qs.total_logical_writes AS [TotalLogicalWrites], qs.total_logical_writes/qs.execution_count AS [AvgLogicalWrites], qs.execution_count, ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1556,7 +1575,32 @@ ORDER BY qs.total_logical_writes DESC OPTION (RECOMPILE); -- You should look at this if you see signs of I/O pressure or of memory pressure --- Lists the top statements by average input/output usage for the current database (Query 65) (Top IO Statements) + +-- Cached SPs Missing Indexes by Execution Count (Query 63) (SP Missing Index) +SELECT TOP(25) p.name AS [SP Name], qs.execution_count AS [Execution Count], +ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], +qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], +qs.total_worker_time/qs.execution_count AS [Avg Worker Time], +qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], +FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], +FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] +-- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan +FROM sys.procedures AS p WITH (NOLOCK) +INNER JOIN sys.dm_exec_procedure_stats AS qs WITH (NOLOCK) +ON p.[object_id] = qs.[object_id] +CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) AS qp +WHERE qs.database_id = DB_ID() +AND DATEDIFF(Minute, qs.cached_time, GETDATE()) > 0 +AND CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' +ORDER BY qs.execution_count DESC OPTION (RECOMPILE); +------ + +-- This helps you find the most frequently executed cached stored procedures that have missing index warnings +-- This can often help you find index tuning candidates + + + +-- Lists the top statements by average input/output usage for the current database (Query 64) (Top IO Statements) SELECT TOP(50) OBJECT_NAME(qt.objectid, dbid) AS [SP Name], (qs.total_logical_reads + qs.total_logical_writes) /qs.execution_count AS [Avg IO], qs.execution_count AS [Execution Count], SUBSTRING(qt.[text],qs.statement_start_offset/2, @@ -1575,7 +1619,7 @@ ORDER BY [Avg IO] DESC OPTION (RECOMPILE); --- Possible Bad NC Indexes (writes > reads) (Query 66) (Bad NC Indexes) +-- Possible Bad NC Indexes (writes > reads) (Query 65) (Bad NC Indexes) SELECT SCHEMA_NAME(o.[schema_id]) AS [Schema Name], OBJECT_NAME(s.[object_id]) AS [Table Name], i.name AS [Index Name], i.index_id, @@ -1601,11 +1645,11 @@ ORDER BY [Difference] DESC, [Total Writes] DESC, [Total Reads] ASC OPTION (RECOM -- Investigate further before dropping an index! --- Missing Indexes for current database by Index Advantage (Query 67) (Missing Indexes) -SELECT DISTINCT CONVERT(decimal(18,2), user_seeks * avg_total_user_cost * (avg_user_impact * 0.01)) AS [index_advantage], +-- Missing Indexes for current database by Index Advantage (Query 66) (Missing Indexes) +SELECT DISTINCT CONVERT(decimal(18,2), migs.user_seeks * migs.avg_total_user_cost * (migs.avg_user_impact * 0.01)) AS [index_advantage], migs.last_user_seek, mid.[statement] AS [Database.Schema.Table], mid.equality_columns, mid.inequality_columns, mid.included_columns, -migs.unique_compiles, migs.user_seeks, migs.avg_total_user_cost, migs.avg_user_impact, +migs.user_seeks, migs.avg_total_user_cost, migs.avg_user_impact, OBJECT_NAME(mid.[object_id]) AS [Table Name], p.rows AS [Table Rows] FROM sys.dm_db_missing_index_group_stats AS migs WITH (NOLOCK) INNER JOIN sys.dm_db_missing_index_groups AS mig WITH (NOLOCK) @@ -1622,12 +1666,13 @@ ORDER BY index_advantage DESC OPTION (RECOMPILE); -- Look at index advantage, last user seek time, number of user seeks to help determine source and importance -- SQL Server is overly eager to add included columns, so beware -- Do not just blindly add indexes that show up from this query!!! +-- Hkan Winther has given me some great suggestions for this query --- Find missing index warnings for cached plans in the current database (Query 68) (Missing Index Warnings) +-- Find missing index warnings for cached plans in the current database (Query 67) (Missing Index Warnings) -- Note: This query could take some time on a busy instance SELECT TOP(25) OBJECT_NAME(objectid) AS [ObjectName], - cp.objtype, cp.usecounts, cp.size_in_bytes, query_plan + cp.objtype, cp.usecounts, cp.size_in_bytes, qp.query_plan FROM sys.dm_exec_cached_plans AS cp WITH (NOLOCK) CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) AS qp WHERE CAST(query_plan AS NVARCHAR(MAX)) LIKE N'%MissingIndex%' @@ -1639,9 +1684,9 @@ ORDER BY cp.usecounts DESC OPTION (RECOMPILE); -- This can help you decide whether to add them or not --- Breaks down buffers used by current database by object (table, index) in the buffer cache (Query 69) (Buffer Usage) +-- Breaks down buffers used by current database by object (table, index) in the buffer cache (Query 68) (Buffer Usage) -- Note: This query could take some time on a busy instance -SELECT SCHEMA_NAME(o.Schema_ID) AS [Schema Name], +SELECT fg.name AS [Filegroup Name], SCHEMA_NAME(o.Schema_ID) AS [Schema Name], OBJECT_NAME(p.[object_id]) AS [Object Name], p.index_id, CAST(COUNT(*)/128.0 AS DECIMAL(10, 2)) AS [Buffer size(MB)], COUNT(*) AS [BufferCount], p.[Rows] AS [Row Count], @@ -1653,12 +1698,17 @@ INNER JOIN sys.partitions AS p WITH (NOLOCK) ON a.container_id = p.hobt_id INNER JOIN sys.objects AS o WITH (NOLOCK) ON p.object_id = o.object_id +INNER JOIN sys.database_files AS f WITH (NOLOCK) +ON b.file_id = f.file_id +INNER JOIN sys.filegroups AS fg WITH (NOLOCK) +ON f.data_space_id = fg.data_space_id WHERE b.database_id = CONVERT(int, DB_ID()) AND p.[object_id] > 100 AND OBJECT_NAME(p.[object_id]) NOT LIKE N'plan_%' AND OBJECT_NAME(p.[object_id]) NOT LIKE N'sys%' AND OBJECT_NAME(p.[object_id]) NOT LIKE N'xml_index_nodes%' -GROUP BY o.Schema_ID, p.[object_id], p.index_id, p.data_compression_desc, p.[Rows] +GROUP BY fg.name, o.Schema_ID, p.[object_id], p.index_id, + p.data_compression_desc, p.[Rows] ORDER BY [BufferCount] DESC OPTION (RECOMPILE); ------ @@ -1666,9 +1716,9 @@ ORDER BY [BufferCount] DESC OPTION (RECOMPILE); -- It can help identify possible candidates for data compression --- Get Table names, row counts, and compression status for clustered index or heap (Query 70) (Table Sizes) +-- Get Table names, row counts, and compression status for clustered index or heap (Query 69) (Table Sizes) SELECT SCHEMA_NAME(o.Schema_ID) AS [Schema Name], OBJECT_NAME(p.object_id) AS [ObjectName], -SUM(p.Rows) AS [RowCount], data_compression_desc AS [CompressionType] +SUM(p.Rows) AS [RowCount], p.data_compression_desc AS [Compression Type] FROM sys.partitions AS p WITH (NOLOCK) INNER JOIN sys.objects AS o WITH (NOLOCK) ON p.object_id = o.object_id @@ -1691,7 +1741,7 @@ ORDER BY SUM(p.Rows) DESC OPTION (RECOMPILE); --- Get some key table properties (Query 71) (Table Properties) +-- Get some key table properties (Query 70) (Table Properties) SELECT OBJECT_NAME(t.[object_id]) AS [ObjectName], p.[rows] AS [Table Rows], p.index_id, p.data_compression_desc AS [Index Data Compression], t.create_date, t.lock_on_bulk_load, t.is_replicated, t.has_replication_filter, @@ -1714,7 +1764,7 @@ ORDER BY OBJECT_NAME(t.[object_id]), p.index_id OPTION (RECOMPILE); --- When were Statistics last updated on all indexes? (Query 72) (Statistics Update) +-- When were Statistics last updated on all indexes? (Query 71) (Statistics Update) SELECT SCHEMA_NAME(o.Schema_ID) + N'.' + o.[NAME] AS [Object Name], o.[type_desc] AS [Object Type], i.[name] AS [Index Name], STATS_DATE(i.[object_id], i.index_id) AS [Statistics Date], s.auto_created, s.no_recompute, s.user_created, s.is_incremental, s.is_temporary, @@ -1745,7 +1795,7 @@ ORDER BY STATS_DATE(i.[object_id], i.index_id) DESC OPTION (RECOMPILE); --- Look at most frequently modified indexes and statistics (Query 73) (Volatile Indexes) +-- Look at most frequently modified indexes and statistics (Query 72) (Volatile Indexes) SELECT o.[name] AS [Object Name], o.[object_id], o.[type_desc], s.[name] AS [Statistics Name], s.stats_id, s.no_recompute, s.auto_created, s.is_incremental, s.is_temporary, sp.modification_counter, sp.[rows], sp.rows_sampled, sp.last_updated @@ -1763,7 +1813,7 @@ ORDER BY sp.modification_counter DESC, o.name OPTION (RECOMPILE); --- Get fragmentation info for all indexes above a certain size in the current database (Query 74) (Index Fragmentation) +-- Get fragmentation info for all indexes above a certain size in the current database (Query 73) (Index Fragmentation) -- Note: This query could take some time on a very large database SELECT DB_NAME(ps.database_id) AS [Database Name], SCHEMA_NAME(o.[schema_id]) AS [Schema Name], OBJECT_NAME(ps.OBJECT_ID) AS [Object Name], i.[name] AS [Index Name], ps.index_id, @@ -1785,8 +1835,9 @@ ORDER BY ps.avg_fragmentation_in_percent DESC OPTION (RECOMPILE); -- and how effective your index maintenance strategy is ---- Index Read/Write stats (all tables in current DB) ordered by Reads (Query 75) (Overall Index Usage - Reads) -SELECT OBJECT_NAME(i.[object_id]) AS [ObjectName], i.[name] AS [IndexName], i.index_id, +--- Index Read/Write stats (all tables in current DB) ordered by Reads (Query 74) (Overall Index Usage - Reads) +SELECT SCHEMA_NAME(t.[schema_id]) AS [SchemaName], OBJECT_NAME(i.[object_id]) AS [ObjectName], + i.[name] AS [IndexName], i.index_id, s.user_seeks, s.user_scans, s.user_lookups, s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], s.user_updates AS [Writes], @@ -1797,6 +1848,8 @@ LEFT OUTER JOIN sys.dm_db_index_usage_stats AS s WITH (NOLOCK) ON i.[object_id] = s.[object_id] AND i.index_id = s.index_id AND s.database_id = DB_ID() +LEFT OUTER JOIN sys.tables AS t WITH (NOLOCK) +ON t.[object_id] = i.[object_id] WHERE OBJECTPROPERTY(i.[object_id],'IsUserTable') = 1 ORDER BY s.user_seeks + s.user_scans + s.user_lookups DESC OPTION (RECOMPILE); -- Order by reads ------ @@ -1804,8 +1857,9 @@ ORDER BY s.user_seeks + s.user_scans + s.user_lookups DESC OPTION (RECOMPILE); - -- Show which indexes in the current database are most active for Reads ---- Index Read/Write stats (all tables in current DB) ordered by Writes (Query 76) (Overall Index Usage - Writes) -SELECT OBJECT_NAME(i.[object_id]) AS [ObjectName], i.[name] AS [IndexName], i.index_id, +--- Index Read/Write stats (all tables in current DB) ordered by Writes (Query 75) (Overall Index Usage - Writes) +SELECT SCHEMA_NAME(t.[schema_id]) AS [SchemaName],OBJECT_NAME(i.[object_id]) AS [ObjectName], + i.[name] AS [IndexName], i.index_id, s.user_updates AS [Writes], s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], i.[type_desc] AS [Index Type], i.fill_factor AS [Fill Factor], i.has_filter, i.filter_definition, s.last_system_update, s.last_user_update @@ -1814,6 +1868,8 @@ LEFT OUTER JOIN sys.dm_db_index_usage_stats AS s WITH (NOLOCK) ON i.[object_id] = s.[object_id] AND i.index_id = s.index_id AND s.database_id = DB_ID() +LEFT OUTER JOIN sys.tables AS t WITH (NOLOCK) +ON t.[object_id] = i.[object_id] WHERE OBJECTPROPERTY(i.[object_id],'IsUserTable') = 1 ORDER BY s.user_updates DESC OPTION (RECOMPILE); -- Order by writes ------ @@ -1821,7 +1877,7 @@ ORDER BY s.user_updates DESC OPTION (RECOMPILE); -- Order by writes -- Show which indexes in the current database are most active for Writes --- Get in-memory OLTP index usage (Query 77) (XTP Index Usage) +-- Get in-memory OLTP index usage (Query 76) (XTP Index Usage) SELECT OBJECT_NAME(i.[object_id]) AS [Object Name], i.index_id, i.[name] AS [Index Name], i.[type_desc], xis.scans_started, xis.scans_retries, xis.rows_touched, xis.rows_returned @@ -1840,7 +1896,7 @@ ORDER BY OBJECT_NAME(i.[object_id]) OPTION (RECOMPILE); --- Look at Columnstore index physical statistics (Query 78) (Columnstore Index Physical Stat) +-- Look at Columnstore index physical statistics (Query 77) (Columnstore Index Physical Stat) SELECT OBJECT_NAME(ps.object_id) AS [TableName], i.[name] AS [IndexName], ps.index_id, ps.partition_number, ps.delta_store_hobt_id, ps.state_desc, ps.total_rows, ps.size_in_bytes, @@ -1859,7 +1915,7 @@ ORDER BY ps.object_id, ps.partition_number, ps.row_group_id OPTION (RECOMPILE); --- Get lock waits for current database (Query 79) (Lock Waits) +-- Get lock waits for current database (Query 78) (Lock Waits) SELECT o.name AS [table_name], i.name AS [index_name], ios.index_id, ios.partition_number, SUM(ios.row_lock_wait_count) AS [total_row_lock_waits], SUM(ios.row_lock_wait_in_ms) AS [total_row_lock_wait_in_ms], @@ -1882,7 +1938,7 @@ ORDER BY total_lock_wait_in_ms DESC OPTION (RECOMPILE); --- Look at UDF execution statistics (Query 80) (UDF Statistics) +-- Look at UDF execution statistics (Query 79) (UDF Statistics) SELECT OBJECT_NAME(object_id) AS [Function Name], execution_count, total_worker_time, total_logical_reads, total_physical_reads, total_elapsed_time, total_elapsed_time/execution_count AS [avg_elapsed_time], @@ -1900,7 +1956,7 @@ ORDER BY total_worker_time DESC OPTION (RECOMPILE); -- https://bit.ly/2q1Q6BM --- Get QueryStore Options for this database (Query 81) (QueryStore Options) +-- Get QueryStore Options for this database (Query 80) (QueryStore Options) SELECT actual_state_desc, desired_state_desc, [interval_length_minutes], current_storage_size_mb, [max_storage_size_mb], query_capture_mode_desc, size_based_cleanup_mode_desc @@ -1918,7 +1974,7 @@ FROM sys.database_query_store_options WITH (NOLOCK) OPTION (RECOMPILE); --- Get input buffer information for the current database (Query 82) (Input Buffer) +-- Get input buffer information for the current database (Query 81) (Input Buffer) SELECT es.session_id, DB_NAME(es.database_id) AS [Database Name], es.login_time, es.cpu_time, es.logical_reads, es.memory_usage, es.[status], ib.event_info AS [Input Buffer] @@ -1940,7 +1996,7 @@ AND es.session_id <> @@SPID OPTION (RECOMPILE); --- Get any resumable index rebuild operation information (Query 83) (Resumable Index Rebuild) +-- Get any resumable index rebuild operation information (Query 82) (Resumable Index Rebuild) SELECT OBJECT_NAME(iro.object_id) AS [Object Name], iro.index_id, iro.name AS [Index Name], iro.sql_text, iro.last_max_dop_used, iro.partition_number, iro.state_desc, iro.start_time, iro.percent_complete @@ -1952,7 +2008,7 @@ OPTION (RECOMPILE); -- https://bit.ly/2pYSWqq --- Get database automatic tuning options (Query 84) (Automatic Tuning Options) +-- Get database automatic tuning options (Query 83) (Automatic Tuning Options) SELECT [name], desired_state_desc, actual_state_desc, reason_desc FROM sys.database_automatic_tuning_options WITH (NOLOCK) OPTION (RECOMPILE); @@ -1963,7 +2019,7 @@ OPTION (RECOMPILE); --- Look at recent Full backups for the current database (Query 85) (Recent Full Backups) +-- Look at recent Full backups for the current database (Query 84) (Recent Full Backups) SELECT TOP (30) bs.machine_name, bs.server_name, bs.database_name AS [Database Name], bs.recovery_model, CONVERT (BIGINT, bs.backup_size / 1048576 ) AS [Uncompressed Backup Size (MB)], CONVERT (BIGINT, bs.compressed_backup_size / 1048576 ) AS [Compressed Backup Size (MB)], @@ -1991,37 +2047,10 @@ ORDER BY bs.backup_finish_date DESC OPTION (RECOMPILE); -- https://bit.ly/28Rpb2x --- These five Pluralsight Courses go into more detail about how to run these queries and interpret the results - --- SQL Server 2017: Diagnosing Performance Issues with DMVs --- https://bit.ly/2FqCeti - --- SQL Server 2017: Diagnosing Configuration Issues with DMVs --- https://bit.ly/2MSUDUL - - --- SQL Server 2014 DMV Diagnostic Queries Part 1 --- https://bit.ly/2plxCer - --- SQL Server 2014 DMV Diagnostic Queries Part 2 --- https://bit.ly/2IuJpzI - --- SQL Server 2014 DMV Diagnostic Queries Part 3 --- https://bit.ly/2FIlCPb - - - --- Sign up for Microsoft Visual Studio Dev Essentials and get a free three month pass to Pluralsight - -- Microsoft Visual Studio Dev Essentials --- http://bit.ly/1q6xbDL - - --- Sign up for Microsoft Azure Essentials and get lots of free Azure usage credits, MCP exam voucher, three month Pluralsight subscription +-- https://bit.ly/2qjNRxi --- Microsoft Azure Essentials --- https://bit.ly/2JMWe8x +-- Microsoft Azure Learn +-- https://bit.ly/2O0Hacc --- August 2017 blog series about upgrading and migrating to SQL Server 2016/2017 --- https://bit.ly/2ftKVrX diff --git a/Scripts/SQL Server 2019 Diagnostic Information Queries.sql b/Scripts/SQL Server 2019 Diagnostic Information Queries.sql index 44262b62..ec3ec91a 100644 --- a/Scripts/SQL Server 2019 Diagnostic Information Queries.sql +++ b/Scripts/SQL Server 2019 Diagnostic Information Queries.sql @@ -1,15 +1,14 @@ -- SQL Server 2019 Diagnostic Information Queries -- Glenn Berry --- Last Modified: April 11, 2019 --- https://www.sqlskills.com/blogs/glenn/ --- http://sqlserverperformance.wordpress.com/ +-- Last Modified: December 3, 2020 +-- https://glennsqlperformance.com/ +-- https://sqlserverperformance.wordpress.com/ +-- YouTube: https://bit.ly/2PkoAM1 -- Twitter: GlennAlanBerry --- Please listen to my Pluralsight courses --- https://www.pluralsight.com/author/glenn-berry - --- If you want to find all of our SQLskills SQL101 blog posts, check out https://bit.ly/2qLwfXW +-- Diagnostic Queries are available here +-- https://glennsqlperformance.com/resources/ -- Please make sure you are using the correct version of these diagnostic queries for your version of SQL Server @@ -23,11 +22,9 @@ --****************************************************************************** ---* Copyright (C) 2019 Glenn Berry, SQLskills.com +--* Copyright (C) 2020 Glenn Berry --* All rights reserved. --* ---* For more scripts and sample code, check out ---* https://www.sqlskills.com/blogs/glenn --* --* You may alter this code for your own *non-commercial* purposes. You may --* republish altered code as long as you include this copyright and give due credit. @@ -62,13 +59,25 @@ SELECT @@SERVERNAME AS [Server Name], @@VERSION AS [SQL Server and OS Version In -- 15.0.1100.94 CTP 2.1 11/7/2018 -- 15.0.1200.24 CTP 2.2 12/6/2018 -- 15.0.1300.359 CTP 2.3 3/1/2019 --- 15.0.1400.75 CTP 2.4 3/27/2019 - - - - --- How to determine the version, edition and update level of SQL Server and its components --- https://bit.ly/2oAjKgW +-- 15.0.1400.75 CTP 2.4 3/26/2019 +-- 15.0.1500.28 CTP 2.5 4/23/2019 +-- 15.0.1600.8 CTP 3.0 5/22/2019 +-- 15.0.1700.37 CTP 3.1 6/26/2019 +-- 15.0.1800.32 CTP 3.2 7/24/2019 +-- 15.0.1900.25 RC1/RC1 Refresh 8/29/2019 +-- 15.0.2000.5 RTM 11/4/2019 +-- 15.0.2070.41 GDR1 11/4/2019 https://support.microsoft.com/en-us/help/4517790/servicing-update-for-sql-server-2019-rtm +-- 15.0.4003.23 CU1 1/7/2020 https://support.microsoft.com/en-us/help/4527376/cumulative-update-1-for-sql-server-2019 +-- 15.0.4013.40 CU2 2/13/2020 https://support.microsoft.com/en-us/help/4536075/cumulative-update-2-for-sql-server-2019 +-- 15.0.4023.6 CU3 3/12/2020 https://support.microsoft.com/en-us/help/4538853/cumulative-update-3-for-sql-server-2019 +-- 15.0.4033.1 CU4 3/31/2020 https://support.microsoft.com/en-us/help/4548597/cumulative-update-4-for-sql-server-2019 +-- 15.0.4043.16 CU5 6/22/2020 https://support.microsoft.com/en-us/help/4552255/cumulative-update-5-for-sql-server-2019 +-- 15.0.4053.23 CU6 8/4/2020 https://support.microsoft.com/en-us/help/4563110/cumulative-update-6-for-sql-server-2019 +-- 15.0.4063.15 CU7 9/2/2020 -- CU7 was removed by Microsoft +-- 15.0.4073.23 CU8 10/1/2020 https://support.microsoft.com/en-in/help/4577194/cumulative-update-8-for-sql-server-2019 + +-- Performance and Stability Fixes in SQL Server 2019 CU Builds +-- https://bit.ly/3712NQQ -- What's New in SQL Server 2019 (Database Engine) -- https://bit.ly/2Q29fhz @@ -79,9 +88,6 @@ SELECT @@SERVERNAME AS [Server Name], @@VERSION AS [SQL Server and OS Version In -- Announcing the Modern Servicing Model for SQL Server -- https://bit.ly/2KtJ8SS --- SQL Server Service Packs are discontinued starting from SQL Server 2017 --- https://bit.ly/2GTkbgt - -- Update Center for Microsoft SQL Server -- https://bit.ly/2pZptuQ @@ -131,16 +137,20 @@ SERVERPROPERTY('IsHadrEnabled') AS [IsHadrEnabled], SERVERPROPERTY('HadrManagerStatus') AS [HadrManagerStatus], SERVERPROPERTY('InstanceDefaultDataPath') AS [InstanceDefaultDataPath], SERVERPROPERTY('InstanceDefaultLogPath') AS [InstanceDefaultLogPath], +SERVERPROPERTY('ErrorLogFileName') AS [ErrorLogFileName], SERVERPROPERTY('BuildClrVersion') AS [Build CLR Version], SERVERPROPERTY('IsXTPSupported') AS [IsXTPSupported], -SERVERPROPERTY('IsPolybaseInstalled') AS [IsPolybaseInstalled], -- New for SQL Server 2016 -SERVERPROPERTY('IsAdvancedAnalyticsInstalled') AS [IsRServicesInstalled]; -- New for SQL Server 2016 +SERVERPROPERTY('IsPolybaseInstalled') AS [IsPolybaseInstalled], +SERVERPROPERTY('IsAdvancedAnalyticsInstalled') AS [IsRServicesInstalled], +SERVERPROPERTY('IsTempdbMetadataMemoryOptimized') AS [IsTempdbMetadataMemoryOptimized]; ------ -- This gives you a lot of useful information about your instance of SQL Server, -- such as the ProcessID for SQL Server and your collation -- Note: Some columns will be NULL on older SQL Server builds +-- SERVERPROPERTY('IsTempdbMetadataMemoryOptimized') is a new option for SQL Server 2019 + -- SERVERPROPERTY (Transact-SQL) -- https://bit.ly/2eeaXeI @@ -164,6 +174,7 @@ ORDER BY name OPTION (RECOMPILE); -- optimize for ad hoc workloads (should be 1) -- priority boost (should be zero) -- remote admin connections (should be 1) +-- tempdb metadata memory-optimized (0 by default, some workloads may benefit by enabling) -- sys.configurations (Transact-SQL) -- https://bit.ly/2HsyDZI @@ -178,41 +189,21 @@ DBCC TRACESTATUS (-1); -- Common trace flags that should be enabled in most cases -- TF 3226 - Supresses logging of successful database backup messages to the SQL Server Error Log --- https://bit.ly/2p6MTjS +-- https://bit.ly/38zDNAK -- TF 6534 - Enables use of native code to improve performance with spatial data -- https://bit.ly/2HrQUpU --- The behavior of TF 1117, 1118 are enabled for tempdb in SQL Server 2016 by default --- SQL 2016 It Just Runs Faster: -T1117 and -T1118 changes for TEMPDB and user databases --- https://bit.ly/2lbNWxK +-- TF 7745 - Prevents Query Store data from being written to disk in case of a failover or shutdown command +-- https://bit.ly/2GU69Km --- The behavior of TF 2371 is enabled by default in SQL Server 2016 and newer (in compat level 130 and higher) -- DBCC TRACEON - Trace Flags (Transact-SQL) -- https://bit.ly/2FuSvPg - - --- Returns status of instant file initialization (Query 6) (IFI Status) -EXEC sys.xp_readerrorlog 0, 1, N'Database Instant File Initialization'; ------- - --- Lets you determine whether Instant File Initialization (IFI) is enabled for the instance --- This should be enabled in the vast majority of cases --- SQL Server 2016 and newer lets you enable this during the SQL server installation process - --- Database Instant File Initialization --- https://bit.ly/2nTX74y - --- Misconceptions around instant file initialization --- https://bit.ly/2oBSKgZ - - - --- SQL Server Process Address space info (Query 7) (Process Memory) +-- SQL Server Process Address space info (Query 6) (Process Memory) -- (shows whether locked pages is enabled, among other things) SELECT physical_memory_in_use_kb/1024 AS [SQL Server Memory Usage (MB)], locked_page_allocations_kb/1024 AS [SQL Server Locked Pages Allocation (MB)], @@ -227,6 +218,9 @@ FROM sys.dm_os_process_memory WITH (NOLOCK) OPTION (RECOMPILE); -- This indicates that you are not under internal memory pressure -- If locked_page_allocations_kb > 0, then LPIM is enabled +-- sys.dm_os_process_memory (Transact-SQL) +-- https://bit.ly/3iUgQgC + -- How to enable the "locked pages" feature in SQL Server 2012 -- https://bit.ly/2F5UjOA @@ -235,7 +229,7 @@ FROM sys.dm_os_process_memory WITH (NOLOCK) OPTION (RECOMPILE); --- SQL Server Services information (Query 8) (SQL Server Services Info) +-- SQL Server Services information (Query 7) (SQL Server Services Info) SELECT servicename, process_id, startup_type_desc, status_desc, last_startup_time, service_account, is_clustered, cluster_nodename, [filename], instant_file_initialization_enabled @@ -251,15 +245,20 @@ FROM sys.dm_server_services WITH (NOLOCK) OPTION (RECOMPILE); -- https://bit.ly/2oKa1Un --- Last backup information by database (Query 9) (Last Backup By Database) +-- Last backup information by database (Query 8) (Last Backup By Database) SELECT ISNULL(d.[name], bs.[database_name]) AS [Database], d.recovery_model_desc AS [Recovery Model], d.log_reuse_wait_desc AS [Log Reuse Wait Desc], MAX(CASE WHEN [type] = 'D' THEN bs.backup_finish_date ELSE NULL END) AS [Last Full Backup], + MAX(CASE WHEN [type] = 'D' THEN bmf.physical_device_name ELSE NULL END) AS [Last Full Backup Location], MAX(CASE WHEN [type] = 'I' THEN bs.backup_finish_date ELSE NULL END) AS [Last Differential Backup], - MAX(CASE WHEN [type] = 'L' THEN bs.backup_finish_date ELSE NULL END) AS [Last Log Backup] + MAX(CASE WHEN [type] = 'I' THEN bmf.physical_device_name ELSE NULL END) AS [Last Differential Backup Location], + MAX(CASE WHEN [type] = 'L' THEN bs.backup_finish_date ELSE NULL END) AS [Last Log Backup], + MAX(CASE WHEN [type] = 'L' THEN bmf.physical_device_name ELSE NULL END) AS [Last Log Backup Location] FROM sys.databases AS d WITH (NOLOCK) LEFT OUTER JOIN msdb.dbo.backupset AS bs WITH (NOLOCK) -ON bs.[database_name] = d.[name] +ON bs.[database_name] = d.[name] +LEFT OUTER JOIN msdb.dbo.backupmediafamily AS bmf WITH (NOLOCK) +ON bs.media_set_id = bmf.media_set_id AND bs.backup_finish_date > GETDATE()- 30 WHERE d.name <> N'tempdb' GROUP BY ISNULL(d.[name], bs.[database_name]), d.recovery_model_desc, d.log_reuse_wait_desc, d.[name] @@ -269,7 +268,7 @@ ORDER BY d.recovery_model_desc, d.[name] OPTION (RECOMPILE); -- This helps you spot runaway transaction logs and other issues with your backup schedule --- Get SQL Server Agent jobs and Category information (Query 10) (SQL Server Agent Jobs) +-- Get SQL Server Agent jobs and Category information (Query 9) (SQL Server Agent Jobs) SELECT sj.name AS [Job Name], sj.[description] AS [Job Description], SUSER_SNAME(sj.owner_sid) AS [Job Owner], sj.date_created AS [Date Created], sj.[enabled] AS [Job Enabled], sj.notify_email_operator_id, sj.notify_level_email, sc.name AS [CategoryName], @@ -292,11 +291,14 @@ ORDER BY sj.name OPTION (RECOMPILE); -- MSDN sysjobs documentation -- https://bit.ly/2paDEOP --- SQL Server Maintenance Solution +-- SQL Server Maintenance Solution (Ola Hallengren) -- https://bit.ly/1pgchQu +-- You can use this script to add default schedules to the standard Ola Hallengren Maintenance Solution jobs +-- https://bit.ly/3ane0gN --- Get SQL Server Agent Alert Information (Query 11) (SQL Server Agent Alerts) + +-- Get SQL Server Agent Alert Information (Query 10) (SQL Server Agent Alerts) SELECT name, event_source, message_id, severity, [enabled], has_notification, delay_between_responses, occurrence_count, last_occurrence_date, last_occurrence_time FROM msdb.dbo.sysalerts WITH (NOLOCK) @@ -305,11 +307,11 @@ ORDER BY name OPTION (RECOMPILE); -- Gives you some basic information about your SQL Server Agent Alerts -- (which are different from SQL Server Agent jobs) --- Read more about Agent Alerts here: https://bit.ly/2Giz0Xf +-- Read more about Agent Alerts here: https://bit.ly/2v5YR37 --- Host information (Query 12) (Host Info) +-- Host information (Query 11) (Host Info) SELECT host_platform, host_distribution, host_release, host_service_pack_level, host_sku, os_language_version FROM sys.dm_os_host_info WITH (NOLOCK) OPTION (RECOMPILE); @@ -331,7 +333,7 @@ FROM sys.dm_os_host_info WITH (NOLOCK) OPTION (RECOMPILE); -- 1033 for os_language_version is US-English --- SQL Server 2019 requires Windows Server 2012 or newer (may change by RTM) +-- SQL Server 2019 requires Windows Server 2016 or newer -- Hardware and Software Requirements for Installing SQL Server -- https://bit.ly/2y3ka5L @@ -340,7 +342,7 @@ FROM sys.dm_os_host_info WITH (NOLOCK) OPTION (RECOMPILE); -- https://bit.ly/2F7Ax0P --- SQL Server NUMA Node information (Query 13) (SQL Server NUMA Info) +-- SQL Server NUMA Node information (Query 12) (SQL Server NUMA Info) SELECT node_id, node_state_desc, memory_node_id, processor_group, cpu_count, online_scheduler_count, idle_scheduler_count, active_worker_count, avg_load_balance, resource_monitor_state FROM sys.dm_os_nodes WITH (NOLOCK) @@ -355,15 +357,16 @@ WHERE node_state_desc <> N'ONLINE DAC' OPTION (RECOMPILE); -- sys.dm_os_nodes (Transact-SQL) -- https://bit.ly/2pn5Mw8 --- Balancing Your Available SQL Server Core Licenses Evenly Across NUMA Nodes --- https://bit.ly/2vfC4Rq +-- How to Balance SQL Server Core Licenses Across NUMA Nodes +-- https://bit.ly/3i4TyVR --- Good basic information about OS memory amounts and state (Query 14) (System Memory) +-- Good basic information about OS memory amounts and state (Query 13) (System Memory) SELECT total_physical_memory_kb/1024 AS [Physical Memory (MB)], available_physical_memory_kb/1024 AS [Available Memory (MB)], - total_page_file_kb/1024 AS [Total Page File (MB)], + total_page_file_kb/1024 AS [Page File Commit Limit (MB)], + total_page_file_kb/1024 - total_physical_memory_kb/1024 AS [Physical Page File Size (MB)], available_page_file_kb/1024 AS [Available Page File (MB)], system_cache_kb/1024 AS [System Cache (MB)], system_memory_state_desc AS [System Memory State] @@ -388,7 +391,7 @@ FROM sys.dm_os_sys_memory WITH (NOLOCK) OPTION (RECOMPILE); -- You can skip the next two queries if you know you don't have a clustered instance --- Get information about your cluster nodes and their status (Query 15) (Cluster Node Properties) +-- Get information about your cluster nodes and their status (Query 14) (Cluster Node Properties) -- (if your database server is in a failover cluster) SELECT NodeName, status_description, is_current_owner FROM sys.dm_os_cluster_nodes WITH (NOLOCK) OPTION (RECOMPILE); @@ -402,7 +405,7 @@ FROM sys.dm_os_cluster_nodes WITH (NOLOCK) OPTION (RECOMPILE); -- https://bit.ly/1z5BfCw --- Get information about any AlwaysOn AG cluster this instance is a part of (Query 16) (AlwaysOn AG Cluster) +-- Get information about any AlwaysOn AG cluster this instance is a part of (Query 15) (AlwaysOn AG Cluster) SELECT cluster_name, quorum_type_desc, quorum_state_desc FROM sys.dm_hadr_cluster WITH (NOLOCK) OPTION (RECOMPILE); ------ @@ -410,7 +413,7 @@ FROM sys.dm_hadr_cluster WITH (NOLOCK) OPTION (RECOMPILE); -- You will see no results if your instance is not using AlwaysOn AGs --- Good overview of AG health and status (Query 17) (AlwaysOn AG Status) +-- Good overview of AG health and status (Query 16) (AG Status) SELECT ag.name AS [AG Name], ar.replica_server_name, ar.availability_mode_desc, adc.[database_name], drs.is_local, drs.is_primary_replica, drs.synchronization_state_desc, drs.is_commit_participant, drs.synchronization_health_desc, drs.recovery_lsn, drs.truncation_lsn, drs.last_sent_lsn, @@ -435,7 +438,7 @@ ORDER BY ag.name, ar.replica_server_name, adc.[database_name] OPTION (RECOMPILE) -- https://bit.ly/2dn1H6r --- Hardware information from SQL Server 2019 (Query 18) (Hardware Info) +-- Hardware information from SQL Server 2019 (Query 17) (Hardware Info) SELECT cpu_count AS [Logical CPU Count], scheduler_count, (socket_count * cores_per_socket) AS [Physical Core Count], socket_count AS [Socket Count], cores_per_socket, numa_node_count, @@ -446,7 +449,8 @@ SELECT cpu_count AS [Logical CPU Count], scheduler_count, DATEDIFF(hour, sqlserver_start_time, GETDATE()) AS [SQL Server Up Time (hrs)], virtual_machine_type_desc AS [Virtual Machine Type], softnuma_configuration_desc AS [Soft NUMA Configuration], - sql_memory_model_desc, container_type_desc -- New in SQL Server 2019 + sql_memory_model_desc, + container_type_desc -- New in SQL Server 2019 FROM sys.dm_os_sys_info WITH (NOLOCK) OPTION (RECOMPILE); ------ @@ -471,7 +475,7 @@ FROM sys.dm_os_sys_info WITH (NOLOCK) OPTION (RECOMPILE); -- LARGE_PAGES --- Get System Manufacturer and model number from SQL Server Error log (Query 19) (System Manufacturer) +-- Get System Manufacturer and model number from SQL Server Error log (Query 18) (System Manufacturer) EXEC sys.xp_readerrorlog 0, 1, N'Manufacturer'; ------ @@ -481,17 +485,7 @@ EXEC sys.xp_readerrorlog 0, 1, N'Manufacturer'; -- This query will return no results if your error log has been recycled since the instance was started --- Get pvscsi info from Windows Registry (Query 20) (PVSCSI Driver Parameters) -EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'SYSTEM\CurrentControlSet\services\pvscsi\Parameters\Device', N'DriverParameter'; ------- - --- This is valid for VMware VMs --- Recommended value for intensive I/O patterns from VMware is: RequestRingPages=32,MaxQueueDepth=254 --- https://kb.vmware.com/s/article/2053145 --- Does not work on Linux - - --- Get BIOS date from Windows Registry (Query 21) (BIOS Date) +-- Get BIOS date from Windows Registry (Query 19) (BIOS Date) EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\System\BIOS', N'BiosReleaseDate'; ------ @@ -500,7 +494,7 @@ EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\Syste -- Does not work on Linux --- Get processor description from Windows Registry (Query 22) (Processor Description) +-- Get processor description from Windows Registry (Query 20) (Processor Description) EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\System\CentralProcessor\0', N'ProcessorNameString'; ------ @@ -518,7 +512,7 @@ EXEC sys.xp_instance_regread N'HKEY_LOCAL_MACHINE', N'HARDWARE\DESCRIPTION\Syste --- Get information on location, time and size of any memory dumps from SQL Server (Query 23) (Memory Dump Info) +-- Get information on location, time and size of any memory dumps from SQL Server (Query 21) (Memory Dump Info) SELECT [filename], creation_time, size_in_bytes/1048576.0 AS [Size (MB)] FROM sys.dm_server_memory_dumps WITH (NOLOCK) ORDER BY creation_time DESC OPTION (RECOMPILE); @@ -532,7 +526,7 @@ ORDER BY creation_time DESC OPTION (RECOMPILE); --- Look at Suspect Pages table (Query 24) (Suspect Pages) +-- Look at Suspect Pages table (Query 22) (Suspect Pages) SELECT DB_NAME(database_id) AS [Database Name], [file_id], page_id, event_type, error_count, last_update_date FROM msdb.dbo.suspect_pages WITH (NOLOCK) @@ -555,7 +549,42 @@ ORDER BY database_id OPTION (RECOMPILE); -- https://bit.ly/2Fvr1c9 --- Get number of data files in tempdb database (Query 25) (TempDB Data Files) +-- Read most recent entries from all SQL Server Error Logs (Query 23) (Error Log Entries) +DROP TABLE IF EXISTS #ErrorLogFiles; + CREATE TABLE #ErrorLogFiles + ([Archive #] INT,[Date] NVARCHAR(25),[Log File Size (Byte)]INT) + +INSERT INTO #ErrorLogFiles +([Archive #],[Date],[Log File Size (Byte)]) +EXEC master.sys.xp_enumerrorlogs; + +DROP TABLE IF EXISTS #SQLErrorLog_AllLogs; + CREATE TABLE #SQLErrorLog_AllLogs + (LogDate DATETIME ,ProcessInfo NVARCHAR(12), LogText NVARCHAR(4000)) + +DECLARE @i INT = 0; +DECLARE @sql NVARCHAR(200) = N''; +DECLARE @logCount INT = (SELECT COUNT(*) FROM #ErrorLogFiles); + +WHILE (@i < @logCount) + BEGIN + SET @sql = 'INSERT INTO #SQLErrorLog_AllLogs + (LogDate, ProcessInfo, LogText) + EXEC master.sys.sp_readerrorlog ' + CAST(@i AS NVARCHAR(2)) + N';' + EXEC master.sys.sp_executesql @sql; + SET @i += 1; + END + +SELECT TOP(1000)LogDate, ProcessInfo, LogText +FROM #SQLErrorLog_AllLogs WITH (NOLOCK) +ORDER BY LogDate DESC OPTION (RECOMPILE); + +DROP TABLE IF EXISTS #ErrorLogFiles; +DROP TABLE IF EXISTS #SQLErrorLog_AllLogs; +GO + + +-- Get number of data files in tempdb database (Query 24) (TempDB Data Files) EXEC sys.xp_readerrorlog 0, 1, N'The tempdb database has'; ------ @@ -564,12 +593,12 @@ EXEC sys.xp_readerrorlog 0, 1, N'The tempdb database has'; -- This query will return no results if your error log has been recycled since the instance was last started --- File names and paths for all user and system databases on instance (Query 26) (Database Filenames and Paths) +-- File names and paths for all user and system databases on instance (Query 25) (Database Filenames and Paths) SELECT DB_NAME([database_id]) AS [Database Name], [file_id], [name], physical_name, [type_desc], state_desc, - is_percent_growth, growth, + is_percent_growth, growth, CONVERT(bigint, growth/128.0) AS [Growth in MB], - CONVERT(bigint, size/128.0) AS [Total Size in MB] + CONVERT(bigint, size/128.0) AS [Total Size in MB], max_size FROM sys.master_files WITH (NOLOCK) ORDER BY DB_NAME([database_id]), [file_id] OPTION (RECOMPILE); ------ @@ -584,17 +613,21 @@ ORDER BY DB_NAME([database_id]), [file_id] OPTION (RECOMPILE); -- Is percent growth enabled for any files (which is bad)? --- Drive information for all fixed drives visible to the operating system (Query 27) (Fixed Drives) +-- Drive information for all fixed drives visible to the operating system (Query 26) (Fixed Drives) SELECT fixed_drive_path, drive_type_desc, CONVERT(DECIMAL(18,2), free_space_in_bytes/1073741824.0) AS [Available Space (GB)] FROM sys.dm_os_enumerate_fixed_drives WITH (NOLOCK) OPTION (RECOMPILE); ------ --- This shows all of your fixed drives, not just LUNs with SQL Server database files +-- This shows all of your drives, not just LUNs with SQL Server database files +-- New in SQL Server 2017 + +-- sys.dm_os_enumerate_fixed_drives (Transact-SQL) +-- https://bit.ly/2EZoHLj --- Volume info for all LUNS that have database files on the current instance (Query 28) (Volume Info) +-- Volume info for all LUNS that have database files on the current instance (Query 27) (Volume Info) SELECT DISTINCT vs.volume_mount_point, vs.file_system_type, vs.logical_volume_name, CONVERT(DECIMAL(18,2), vs.total_bytes/1073741824.0) AS [Total Size (GB)], CONVERT(DECIMAL(18,2), vs.available_bytes/1073741824.0) AS [Available Size (GB)], @@ -614,8 +647,7 @@ ORDER BY vs.volume_mount_point OPTION (RECOMPILE); --- Drive level latency information (Query 29) (Drive Level Latency) --- Based on code from Jimmy May +-- Drive level latency information (Query 28) (Drive Level Latency) SELECT tab.[Drive], tab.volume_mount_point AS [Volume Mount Point], CASE WHEN num_of_reads = 0 THEN 0 @@ -658,8 +690,14 @@ ORDER BY [Overall Latency] OPTION (RECOMPILE); -- These latency numbers include all file activity against all SQL Server -- database files on each drive since SQL Server was last started +-- sys.dm_io_virtual_file_stats (Transact-SQL) +-- https://bit.ly/3bRWUc0 --- Calculates average latency per read, per write, and per total input/output for each database file (Query 30) (IO Latency by File) +-- sys.dm_os_volume_stats (Transact-SQL) +-- https://bit.ly/33thz2j + + +-- Calculates average latency per read, per write, and per total input/output for each database file (Query 29) (IO Latency by File) SELECT DB_NAME(fs.database_id) AS [Database Name], CAST(fs.io_stall_read_ms/(1.0 + fs.num_of_reads) AS NUMERIC(10,1)) AS [avg_read_latency_ms], CAST(fs.io_stall_write_ms/(1.0 + fs.num_of_writes) AS NUMERIC(10,1)) AS [avg_write_latency_ms], CAST((fs.io_stall_read_ms + fs.io_stall_write_ms)/(1.0 + fs.num_of_reads + fs.num_of_writes) AS NUMERIC(10,1)) AS [avg_io_latency_ms], @@ -679,8 +717,11 @@ ORDER BY avg_io_latency_ms DESC OPTION (RECOMPILE); -- These latency numbers include all file activity against each SQL Server -- database file since SQL Server was last started +-- sys.dm_io_virtual_file_stats (Transact-SQL) +-- https://bit.ly/3bRWUc0 + --- Look for I/O requests taking longer than 15 seconds in the six most recent SQL Server Error Logs (Query 31) (IO Warnings) +-- Look for I/O requests taking longer than 15 seconds in the six most recent SQL Server Error Logs (Query 30) (IO Warnings) CREATE TABLE #IOWarningResults(LogDate datetime, ProcessInfo sysname, LogText nvarchar(1000)); INSERT INTO #IOWarningResults @@ -716,8 +757,7 @@ DROP TABLE #IOWarningResults; -- https://bit.ly/2qtaw73 - --- Resource Governor Resource Pool information (Query 32) (RG Resource Pools) +-- Resource Governor Resource Pool information (Query 31) (RG Resource Pools) SELECT pool_id, [Name], statistics_start_time, min_memory_percent, max_memory_percent, max_memory_kb/1024 AS [max_memory_mb], @@ -733,7 +773,7 @@ OPTION (RECOMPILE); --- Recovery model, log reuse wait description, log file size, log usage size (Query 33) (Database Properties) +-- Recovery model, log reuse wait description, log file size, log usage size (Query 32) (Database Properties) -- and compatibility level for all databases on instance SELECT db.[name] AS [Database Name], SUSER_SNAME(db.owner_sid) AS [Database Owner], db.recovery_model_desc AS [Recovery Model], db.state_desc, db.containment_desc, db.log_reuse_wait_desc AS [Log Reuse Wait Description], @@ -745,11 +785,10 @@ db.is_auto_create_stats_on, db.is_auto_update_stats_on, db.is_auto_update_stats_ db.snapshot_isolation_state_desc, db.is_read_committed_snapshot_on, db.is_auto_close_on, db.is_auto_shrink_on, db.target_recovery_time_in_seconds, db.is_cdc_enabled, db.is_published, db.is_distributor, db.group_database_id, db.replica_id,db.is_memory_optimized_elevate_to_snapshot_on, -db.delayed_durability_desc, db.is_auto_create_stats_incremental_on, -db.is_query_store_on, db.is_sync_with_backup, db.is_temporal_history_retention_enabled, -db.is_supplemental_logging_enabled, db.is_remote_data_archive_enabled, -db.is_encrypted, de.encryption_state, de.percent_complete, de.key_algorithm, de.key_length, db.resource_pool_id, -db.is_tempdb_spill_to_remote_store, db.is_result_set_caching_on, db.is_accelerated_database_recovery_on +db.delayed_durability_desc, db.is_query_store_on, db.is_sync_with_backup, +db.is_temporal_history_retention_enabled, db.is_remote_data_archive_enabled, +db.is_encrypted, de.encryption_state, de.percent_complete, de.key_algorithm, de.key_length, +db.is_accelerated_database_recovery_on FROM sys.databases AS db WITH (NOLOCK) INNER JOIN sys.dm_os_performance_counters AS lu WITH (NOLOCK) ON db.name = lu.instance_name @@ -763,6 +802,16 @@ AND ls.cntr_value > 0 ORDER BY db.[name] OPTION (RECOMPILE); ------ +-- sys.databases (Transact-SQL) +-- https://bit.ly/2G5wqaX + +-- sys.dm_os_performance_counters (Transact-SQL) +-- https://bit.ly/3kEO2JR + +-- sys.dm_database_encryption_keys (Transact-SQL) +-- https://bit.ly/3mE7kkx + + -- Things to look at: -- How many databases are on the instance? -- What recovery models are they using? @@ -771,7 +820,8 @@ ORDER BY db.[name] OPTION (RECOMPILE); -- What compatibility level are the databases on? -- What is the Page Verify Option? (should be CHECKSUM) -- Is Auto Update Statistics Asynchronously enabled? --- Is Delayed Durability enabled +-- What is target_recovery_time_in_seconds? +-- Is Delayed Durability enabled? -- Make sure auto_shrink and auto_close are not enabled! -- is_mixed_page_allocation_on is a new property for SQL Server 2016. Equivalent to TF 1118 for a user database @@ -785,20 +835,20 @@ ORDER BY db.[name] OPTION (RECOMPILE); -- https://bit.ly/2pdggk3 --- Missing Indexes for all databases by Index Advantage (Query 34) (Missing Indexes All Databases) -SELECT CONVERT(decimal(18,2), user_seeks * avg_total_user_cost * (avg_user_impact * 0.01)) AS [index_advantage], -FORMAT(migs.last_user_seek, 'yyyy-MM-dd HH:mm:ss') AS [last_user_seek], -mid.[statement] AS [Database.Schema.Table], -COUNT(1) OVER(PARTITION BY mid.[statement]) AS [missing_indexes_for_table], -COUNT(1) OVER(PARTITION BY mid.[statement], equality_columns) AS [similar_missing_indexes_for_table], -mid.equality_columns, mid.inequality_columns, mid.included_columns, -migs.unique_compiles, migs.user_seeks, -CONVERT(decimal(18,2), migs.avg_total_user_cost) AS [avg_total_user_cost], migs.avg_user_impact -FROM sys.dm_db_missing_index_group_stats AS migs WITH (NOLOCK) -INNER JOIN sys.dm_db_missing_index_groups AS mig WITH (NOLOCK) -ON migs.group_handle = mig.index_group_handle -INNER JOIN sys.dm_db_missing_index_details AS mid WITH (NOLOCK) -ON mig.index_handle = mid.index_handle +-- Missing Indexes for all databases by Index Advantage (Query 33) (Missing Indexes All Databases) +SELECT CONVERT(decimal(18,2), migs.user_seeks * migs.avg_total_user_cost * (migs.avg_user_impact * 0.01)) AS [index_advantage], +FORMAT(migs.last_user_seek, 'yyyy-MM-dd HH:mm:ss') AS [last_user_seek], mid.[statement] AS [Database.Schema.Table], +COUNT(1) OVER(PARTITION BY mid.[statement]) AS [missing_indexes_for_table], +COUNT(1) OVER(PARTITION BY mid.[statement], mid.equality_columns) AS [similar_missing_indexes_for_table], +mid.equality_columns, mid.inequality_columns, mid.included_columns, migs.user_seeks, +CONVERT(decimal(18,2), migs.avg_total_user_cost) AS [avg_total_user_,cost], migs.avg_user_impact, +REPLACE(REPLACE(LEFT(st.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text] +FROM sys.dm_db_missing_index_groups AS mig WITH (NOLOCK) +INNER JOIN sys.dm_db_missing_index_group_stats_query AS migs WITH(NOLOCK) +ON mig.index_group_handle = migs.group_handle +CROSS APPLY sys.dm_exec_sql_text(migs.last_sql_handle) AS st +INNER JOIN sys.dm_db_missing_index_details AS mid WITH (NOLOCK) +ON mig.index_handle = mid.index_handle ORDER BY index_advantage DESC OPTION (RECOMPILE); ------ @@ -807,13 +857,14 @@ ORDER BY index_advantage DESC OPTION (RECOMPILE); -- Also look at avg_user_impact and avg_total_user_cost to help determine importance -- SQL Server is overly eager to add included columns, so beware -- Do not just blindly add indexes that show up from this query!!! +-- Hkan Winther has given me some great suggestions for this query -- SQL Server Index Design Guide -- https://bit.ly/2qtZr4N --- Get VLF Counts for all databases on the instance (Query 35) (VLF Counts) +-- Get VLF Counts for all databases on the instance (Query 34) (VLF Counts) SELECT [name] AS [Database Name], [VLF Count] FROM sys.databases AS db WITH (NOLOCK) CROSS APPLY (SELECT file_id, COUNT(*) AS [VLF Count] @@ -826,15 +877,26 @@ ORDER BY [VLF Count] DESC OPTION (RECOMPILE); -- and they can make full database restores and crash recovery take much longer -- Try to keep your VLF counts under 200 in most cases (depending on log file size) --- Important change to VLF creation algorithm in SQL Server 2014 --- https://bit.ly/2Hsjbg4 +-- sys.dm_db_log_info (Transact-SQL) +-- https://bit.ly/3jpmqsd + +-- sys.databases (Transact-SQL) +-- https://bit.ly/2G5wqaX -- SQL Server Transaction Log Architecture and Management Guide -- https://bit.ly/2JjmQRZ +-- VLF Growth Formula (SQL Server 2014 and newer) +-- If the log growth increment is less than 1/8th the current size of the log +-- Then: 1 new VLF +-- Otherwise: +-- Up to 64MB: 4 new VLFs +-- 64MB to 1GB: 8 new VLFs +-- More than 1GB: 16 new VLFs + --- Get CPU utilization by database (Query 36) (CPU Usage by Database) +-- Get CPU utilization by database (Query 35) (CPU Usage by Database) WITH DB_CPU_Stats AS (SELECT pa.DatabaseID, DB_Name(pa.DatabaseID) AS [Database Name], SUM(qs.total_worker_time/1000) AS [CPU_Time_Ms] @@ -854,8 +916,14 @@ ORDER BY [CPU Rank] OPTION (RECOMPILE); -- Helps determine which database is using the most CPU resources on the instance -- Note: This only reflects CPU usage from the currently cached query plans +-- sys.dm_exec_query_stats (Transact-SQL) +-- https://bit.ly/32tHCGH + +-- sys.dm_exec_plan_attributes (Transact-SQL) +-- https://bit.ly/35iP2hV --- Get I/O utilization by database (Query 37) (IO Usage By Database) + +-- Get I/O utilization by database (Query 36) (IO Usage By Database) WITH Aggregate_IO_Statistics AS (SELECT DB_NAME(database_id) AS [Database Name], CAST(SUM(num_of_bytes_read + num_of_bytes_written) / 1048576 AS DECIMAL(12, 2)) AS [ioTotalMB], @@ -878,8 +946,11 @@ ORDER BY [I/O Rank] OPTION (RECOMPILE); -- These numbers are cumulative since the last service restart -- They include all I/O activity, not just the nominal I/O workload +-- sys.dm_io_virtual_file_stats (Transact-SQL) +-- https://bit.ly/3bRWUc0 + --- Get total buffer usage by database for current instance (Query 38) (Total Buffer Usage by Database) +-- Get total buffer usage by database for current instance (Query 37) (Total Buffer Usage by Database) -- This make take some time to run on a busy instance WITH AggregateBufferPoolUsage AS @@ -897,8 +968,11 @@ ORDER BY [Buffer Pool Rank] OPTION (RECOMPILE); -- Tells you how much memory (in the buffer pool) -- is being used by each database on the instance +-- sys.dm_os_buffer_descriptors (Transact-SQL) +-- https://bit.ly/36s7aFo + --- Get tempdb version store space usage by database (Query 39) (Version Store Space Usage) +-- Get tempdb version store space usage by database (Query 38) (Version Store Space Usage) SELECT DB_NAME(database_id) AS [Database Name], reserved_page_count AS [Version Store Reserved Page Count], reserved_space_kb/1024 AS [Version Store Reserved Space (MB)] @@ -915,7 +989,7 @@ ORDER BY reserved_space_kb/1024 DESC OPTION (RECOMPILE); -- Clear Wait Stats with this command -- DBCC SQLPERF('sys.dm_os_wait_stats', CLEAR); --- Isolate top waits for server instance since last restart or wait statistics clear (Query 40) (Top Waits) +-- Isolate top waits for server instance since last restart or wait statistics clear (Query 39) (Top Waits) WITH [Waits] AS (SELECT wait_type, wait_time_ms/ 1000.0 AS [WaitS], (wait_time_ms - signal_wait_time_ms) / 1000.0 AS [ResourceS], @@ -942,7 +1016,7 @@ AS (SELECT wait_type, wait_time_ms/ 1000.0 AS [WaitS], N'PREEMPTIVE_OS_PIPEOPS', N'PREEMPTIVE_OS_AUTHENTICATIONOPS', N'PREEMPTIVE_OS_GENERICOPS', N'PREEMPTIVE_OS_VERIFYTRUST', N'PREEMPTIVE_OS_FILEOPS', N'PREEMPTIVE_OS_DEVICEOPS', N'PREEMPTIVE_OS_QUERYREGISTRY', - N'PREEMPTIVE_OS_WRITEFILE', + N'PREEMPTIVE_OS_WRITEFILE', N'PREEMPTIVE_OS_WRITEFILEGATHER', N'PREEMPTIVE_XE_CALLBACKEXECUTE', N'PREEMPTIVE_XE_DISPATCHER', N'PREEMPTIVE_XE_GETTARGETSTATE', N'PREEMPTIVE_XE_SESSIONCOMMIT', N'PREEMPTIVE_XE_TARGETINIT', N'PREEMPTIVE_XE_TARGETFINALIZE', @@ -983,7 +1057,7 @@ OPTION (RECOMPILE); -- Cumulative wait stats are not as useful on an idle instance that is not under load or performance pressure --- SQL Server Wait Types Library (Paul Randal) +-- SQL Server Wait Types Library -- https://bit.ly/2ePzYO2 -- The SQL Server Wait Type Repository @@ -1000,7 +1074,7 @@ OPTION (RECOMPILE); --- Get a count of SQL connections by IP address (Query 41) (Connection Counts by IP Address) +-- Get a count of SQL connections by IP address (Query 40) (Connection Counts by IP Address) SELECT ec.client_net_address, es.[program_name], es.[host_name], es.login_name, COUNT(ec.session_id) AS [connection count] FROM sys.dm_exec_sessions AS es WITH (NOLOCK) @@ -1018,7 +1092,7 @@ ORDER BY ec.client_net_address, es.[program_name] OPTION (RECOMPILE); --- Get Average Task Counts (run multiple times) (Query 42) (Avg Task Counts) +-- Get Average Task Counts (run multiple times) (Query 41) (Avg Task Counts) SELECT AVG(current_tasks_count) AS [Avg Task Count], AVG(work_queue_count) AS [Avg Work Queue Count], AVG(runnable_tasks_count) AS [Avg Runnable Task Count], @@ -1035,11 +1109,11 @@ WHERE scheduler_id < 255 OPTION (RECOMPILE); -- High Avg Pending DiskIO Counts are a sign of disk pressure -- How to Do Some Very Basic SQL Server Monitoring --- https://bit.ly/2q3Btgt +-- https://bit.ly/30IRla0 --- Detect blocking (run multiple times) (Query 43) (Detect Blocking) +-- Detect blocking (run multiple times) (Query 42) (Detect Blocking) SELECT t1.resource_type AS [lock type], DB_NAME(resource_database_id) AS [database], t1.resource_associated_entity_id AS [blk object],t1.request_mode AS [lock req], -- lock requested t1.request_session_id AS [waiter sid], t2.wait_duration_ms AS [wait time], -- spid of waiter @@ -1068,22 +1142,22 @@ ON t1.lock_owner_address = t2.resource_address OPTION (RECOMPILE); --- Get CPU Utilization History for last 256 minutes (in one minute intervals) (Query 44) (CPU Utilization History) -DECLARE @ts_now bigint = (SELECT cpu_ticks/(cpu_ticks/ms_ticks) FROM sys.dm_os_sys_info WITH (NOLOCK)); +-- Get CPU Utilization History for last 256 minutes (in one minute intervals) (Query 43) (CPU Utilization History) +DECLARE @ts_now bigint = (SELECT ms_ticks FROM sys.dm_os_sys_info WITH (NOLOCK)); SELECT TOP(256) SQLProcessUtilization AS [SQL Server Process CPU Utilization], SystemIdle AS [System Idle Process], 100 - SystemIdle - SQLProcessUtilization AS [Other Process CPU Utilization], DATEADD(ms, -1 * (@ts_now - [timestamp]), GETDATE()) AS [Event Time] FROM (SELECT record.value('(./Record/@id)[1]', 'int') AS record_id, - record.value('(./Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int') - AS [SystemIdle], - record.value('(./Record/SchedulerMonitorEvent/SystemHealth/ProcessUtilization)[1]', 'int') - AS [SQLProcessUtilization], [timestamp] - FROM (SELECT [timestamp], CONVERT(xml, record) AS [record] - FROM sys.dm_os_ring_buffers WITH (NOLOCK) - WHERE ring_buffer_type = N'RING_BUFFER_SCHEDULER_MONITOR' - AND record LIKE N'%%') AS x) AS y + record.value('(./Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int') + AS [SystemIdle], + record.value('(./Record/SchedulerMonitorEvent/SystemHealth/ProcessUtilization)[1]', 'int') + AS [SQLProcessUtilization], [timestamp] + FROM (SELECT [timestamp], CONVERT(xml, record) AS [record] + FROM sys.dm_os_ring_buffers WITH (NOLOCK) + WHERE ring_buffer_type = N'RING_BUFFER_SCHEDULER_MONITOR' + AND record LIKE N'%%') AS x) AS y ORDER BY record_id DESC OPTION (RECOMPILE); ------ @@ -1093,7 +1167,7 @@ ORDER BY record_id DESC OPTION (RECOMPILE); -- on high core count (> 64 cores) systems --- Get top total worker time queries for entire instance (Query 45) (Top Worker Time Queries) +-- Get top total worker time queries for entire instance (Query 44) (Top Worker Time Queries) SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], REPLACE(REPLACE(LEFT(t.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text], qs.total_worker_time AS [Total Worker Time], qs.min_worker_time AS [Min Worker Time], @@ -1106,7 +1180,7 @@ qs.min_logical_reads AS [Min Logical Reads], qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], qs.max_logical_reads AS [Max Logical Reads], qs.execution_count AS [Execution Count], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], qs.creation_time AS [Creation Time] --,t.[text] AS [Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) @@ -1121,8 +1195,9 @@ ORDER BY qs.total_worker_time DESC OPTION (RECOMPILE); --- Page Life Expectancy (PLE) value for each NUMA node in current instance (Query 46) (PLE by NUMA Node) -SELECT @@SERVERNAME AS [Server Name], RTRIM([object_name]) AS [Object Name], instance_name, cntr_value AS [Page Life Expectancy] +-- Page Life Expectancy (PLE) value for each NUMA node in current instance (Query 45) (PLE by NUMA Node) +SELECT @@SERVERNAME AS [Server Name], RTRIM([object_name]) AS [Object Name], + instance_name, cntr_value AS [Page Life Expectancy] FROM sys.dm_os_performance_counters WITH (NOLOCK) WHERE [object_name] LIKE N'%Buffer Node%' -- Handles named instances AND counter_name = N'Page life expectancy' OPTION (RECOMPILE); @@ -1136,7 +1211,7 @@ AND counter_name = N'Page life expectancy' OPTION (RECOMPILE); -- https://bit.ly/2EgynLa --- Memory Grants Pending value for current instance (Query 47) (Memory Grants Pending) +-- Memory Grants Pending value for current instance (Query 46) (Memory Grants Pending) SELECT @@SERVERNAME AS [Server Name], RTRIM([object_name]) AS [Object Name], cntr_value AS [Memory Grants Pending] FROM sys.dm_os_performance_counters WITH (NOLOCK) WHERE [object_name] LIKE N'%Memory Manager%' -- Handles named instances @@ -1147,7 +1222,7 @@ AND counter_name = N'Memory Grants Pending' OPTION (RECOMPILE); -- Memory Grants Pending above zero for a sustained period is a very strong indicator of internal memory pressure --- Memory Clerk Usage for instance (Query 48) (Memory Clerk Usage) +-- Memory Clerk Usage for instance (Query 47) (Memory Clerk Usage) -- Look for high value for CACHESTORE_SQLCP (Ad-hoc query plans) SELECT TOP(10) mc.[type] AS [Memory Clerk Type], CAST((SUM(mc.pages_kb)/1024.0) AS DECIMAL (15,2)) AS [Memory Usage (MB)] @@ -1158,13 +1233,13 @@ ORDER BY SUM(mc.pages_kb) DESC OPTION (RECOMPILE); -- MEMORYCLERK_SQLBUFFERPOOL was new for SQL Server 2012. It should be your highest consumer of memory --- CACHESTORE_SQLCP SQL Plans +-- CACHESTORE_SQLCP - SQL Plans -- These are cached SQL statements or batches that aren't in stored procedures, functions and triggers -- Watch out for high values for CACHESTORE_SQLCP -- Enabling 'optimize for ad hoc workloads' at the instance level can help reduce this -- Running DBCC FREESYSTEMCACHE ('SQL Plans') periodically may be required to better control this --- CACHESTORE_OBJCP Object Plans +-- CACHESTORE_OBJCP - Object Plans -- These are compiled plans for stored procedures, functions and triggers -- sys.dm_os_memory_clerks (Transact-SQL) @@ -1172,7 +1247,7 @@ ORDER BY SUM(mc.pages_kb) DESC OPTION (RECOMPILE); --- Find single-use, ad-hoc and prepared queries that are bloating the plan cache (Query 49) (Ad hoc Queries) +-- Find single-use, ad-hoc and prepared queries that are bloating the plan cache (Query 48) (Ad hoc Queries) SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], t.[text] AS [Query Text], cp.objtype AS [Object Type], cp.cacheobjtype AS [Cache Object Type], cp.size_in_bytes/1024 AS [Plan Size in KB] @@ -1193,7 +1268,7 @@ ORDER BY cp.size_in_bytes DESC, DB_NAME(t.[dbid]) OPTION (RECOMPILE); -- https://bit.ly/2EfYOkl --- Get top total logical reads queries for entire instance (Query 50) (Top Logical Reads Queries) +-- Get top total logical reads queries for entire instance (Query 49) (Top Logical Reads Queries) SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], REPLACE(REPLACE(LEFT(t.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text], qs.total_logical_reads AS [Total Logical Reads], @@ -1207,7 +1282,7 @@ qs.min_elapsed_time AS [Min Elapsed Time], qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], qs.max_elapsed_time AS [Max Elapsed Time], qs.execution_count AS [Execution Count], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], qs.creation_time AS [Creation Time] --,t.[text] AS [Complete Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) @@ -1221,7 +1296,7 @@ ORDER BY qs.total_logical_reads DESC OPTION (RECOMPILE); -- Can also help track down parameter sniffing issues --- Get top average elapsed time queries for entire instance (Query 51) (Top Avg Elapsed Time Queries) +-- Get top average elapsed time queries for entire instance (Query 50) (Top Avg Elapsed Time Queries) SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name], REPLACE(REPLACE(LEFT(t.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text], qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], @@ -1230,7 +1305,7 @@ qs.execution_count AS [Execution Count], qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], qs.total_physical_reads/qs.execution_count AS [Avg Physical Reads], qs.total_worker_time/qs.execution_count AS [Avg Worker Time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], qs.creation_time AS [Creation Time] --,t.[text] AS [Complete Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) @@ -1243,7 +1318,7 @@ ORDER BY qs.total_elapsed_time/qs.execution_count DESC OPTION (RECOMPILE); -- Can also help track down parameter sniffing issues --- Look at UDF execution statistics (Query 52) (UDF Stats by DB) +-- Look at UDF execution statistics (Query 51) (UDF Stats by DB) SELECT TOP (25) DB_NAME(database_id) AS [Database Name], OBJECT_NAME(object_id, database_id) AS [Function Name], total_worker_time, execution_count, total_elapsed_time, @@ -1266,17 +1341,20 @@ ORDER BY total_worker_time DESC OPTION (RECOMPILE); --USE YourDatabaseName; -- make sure to change to an actual database on your instance, not the master system database --GO --- Individual File Sizes and space available for current database (Query 53) (File Sizes and Space) -SELECT f.name AS [File Name] , f.physical_name AS [Physical Name], +-- Individual File Sizes and space available for current database (Query 52) (File Sizes and Space) +SELECT f.[name] AS [File Name] , f.physical_name AS [Physical Name], CAST((f.size/128.0) AS DECIMAL(15,2)) AS [Total Size in MB], +CAST((f.size/128.0) AS DECIMAL(15,2)) - CAST(f.size/128.0 - CAST(FILEPROPERTY(f.name, 'SpaceUsed') AS int)/128.0 AS DECIMAL(15,2)) -AS [Available Space In MB], f.[file_id], fg.name AS [Filegroup Name], -f.is_percent_growth, f.growth, fg.is_default, fg.is_read_only, -fg.is_autogrow_all_files +AS [Used Space in MB], +CAST(f.size/128.0 - CAST(FILEPROPERTY(f.name, 'SpaceUsed') AS int)/128.0 AS DECIMAL(15,2)) +AS [Available Space In MB], +f.[file_id], fg.name AS [Filegroup Name], +f.is_percent_growth, f.growth, fg.is_default, fg.is_read_only, fg.is_autogrow_all_files FROM sys.database_files AS f WITH (NOLOCK) LEFT OUTER JOIN sys.filegroups AS fg WITH (NOLOCK) ON f.data_space_id = fg.data_space_id -ORDER BY f.[file_id] OPTION (RECOMPILE); +ORDER BY f.[type], f.[file_id] OPTION (RECOMPILE); ------ -- Look at how large and how full the files are and where they are located @@ -1288,7 +1366,7 @@ ORDER BY f.[file_id] OPTION (RECOMPILE); -- https://bit.ly/2evRZSR --- Log space usage for current database (Query 54) (Log Space Usage) +-- Log space usage for current database (Query 53) (Log Space Usage) SELECT DB_NAME(lsu.database_id) AS [Database Name], db.recovery_model_desc AS [Recovery Model], CAST(lsu.total_log_size_in_bytes/1048576.0 AS DECIMAL(10, 2)) AS [Total Log Space (MB)], CAST(lsu.used_log_space_in_bytes/1048576.0 AS DECIMAL(10, 2)) AS [Used Log Space (MB)], @@ -1307,7 +1385,7 @@ OPTION (RECOMPILE); -- https://bit.ly/2H4MQw9 --- Status of last VLF for current database (Query 55) (Last VLF Status) +-- Status of last VLF for current database (Query 54) (Last VLF Status) SELECT TOP(1) DB_NAME(li.database_id) AS [Database Name], li.[file_id], li.vlf_size_mb, li.vlf_sequence_number, li.vlf_active, li.vlf_status FROM sys.dm_db_log_info(DB_ID()) AS li @@ -1326,7 +1404,7 @@ ORDER BY vlf_sequence_number DESC OPTION (RECOMPILE); --- Get database scoped configuration values for current database (Query 56) (Database-scoped Configurations) +-- Get database scoped configuration values for current database (Query 55) (Database-scoped Configurations) SELECT configuration_id, name, [value] AS [value_for_primary], value_for_secondary FROM sys.database_scoped_configurations WITH (NOLOCK) OPTION (RECOMPILE); ------ @@ -1340,7 +1418,7 @@ FROM sys.database_scoped_configurations WITH (NOLOCK) OPTION (RECOMPILE); -- https://bit.ly/2sOH7nb --- I/O Statistics by file for the current database (Query 57) (IO Stats By File) +-- I/O Statistics by file for the current database (Query 56) (IO Stats By File) SELECT DB_NAME(DB_ID()) AS [Database Name], df.name AS [Logical Name], vfs.[file_id], df.type_desc, df.physical_name AS [Physical Name], CAST(vfs.size_on_disk_bytes/1048576.0 AS DECIMAL(10, 2)) AS [Size on Disk (MB)], vfs.num_of_reads, vfs.num_of_writes, vfs.io_stall_read_ms, vfs.io_stall_write_ms, @@ -1359,11 +1437,11 @@ ON vfs.[file_id]= df.[file_id] OPTION (RECOMPILE); ------ -- This helps you characterize your workload better from an I/O perspective for this database --- It helps you determine whether you has an OLTP or DW/DSS type of workload +-- It helps you determine whether you have an OLTP or DW/DSS type of workload --- Get most frequently executed queries for this database (Query 58) (Query Execution Counts) +-- Get most frequently executed queries for this database (Query 57) (Query Execution Counts) SELECT TOP(50) LEFT(t.[text], 50) AS [Short Query Text], qs.execution_count AS [Execution Count], qs.total_logical_reads AS [Total Logical Reads], qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], @@ -1371,7 +1449,7 @@ qs.total_worker_time AS [Total Worker Time], qs.total_worker_time/qs.execution_count AS [Avg Worker Time], qs.total_elapsed_time AS [Total Elapsed Time], qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], qs.creation_time AS [Creation Time] --,t.[text] AS [Complete Query Text], qp.query_plan AS [Query Plan] -- uncomment out these columns if not copying results to Excel FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK) @@ -1381,16 +1459,20 @@ WHERE t.dbid = DB_ID() ORDER BY qs.execution_count DESC OPTION (RECOMPILE); ------ +-- Tells you which cached queries are called the most often +-- This helps you characterize and baseline your workload +-- It also helps you find possible caching opportunities + --- Queries 59 through 64 are the "Bad Man List" for stored procedures +-- Queries 58 through 64 are the "Bad Man List" for stored procedures --- Top Cached SPs By Execution Count (Query 59) (SP Execution Counts) +-- Top Cached SPs By Execution Count (Query 58) (SP Execution Counts) SELECT TOP(100) p.name AS [SP Name], qs.execution_count AS [Execution Count], ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], qs.total_worker_time/qs.execution_count AS [Avg Worker Time], qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1405,15 +1487,16 @@ ORDER BY qs.execution_count DESC OPTION (RECOMPILE); -- Tells you which cached stored procedures are called the most often -- This helps you characterize and baseline your workload +-- It also helps you find possible caching opportunities --- Top Cached SPs By Avg Elapsed Time (Query 60) (SP Avg Elapsed Time) +-- Top Cached SPs By Avg Elapsed Time (Query 59) (SP Avg Elapsed Time) SELECT TOP(25) p.name AS [SP Name], qs.min_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], qs.max_elapsed_time, qs.last_elapsed_time, qs.total_elapsed_time, qs.execution_count, ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_worker_time/qs.execution_count AS [AvgWorkerTime], qs.total_worker_time AS [TotalWorkerTime], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1431,12 +1514,12 @@ ORDER BY avg_elapsed_time DESC OPTION (RECOMPILE); --- Top Cached SPs By Total Worker time. Worker time relates to CPU cost (Query 61) (SP Worker Time) +-- Top Cached SPs By Total Worker time. Worker time relates to CPU cost (Query 60) (SP Worker Time) SELECT TOP(25) p.name AS [SP Name], qs.total_worker_time AS [TotalWorkerTime], qs.total_worker_time/qs.execution_count AS [AvgWorkerTime], qs.execution_count, ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1453,12 +1536,12 @@ ORDER BY qs.total_worker_time DESC OPTION (RECOMPILE); -- You should look at this if you see signs of CPU pressure --- Top Cached SPs By Total Logical Reads. Logical reads relate to memory pressure (Query 62) (SP Logical Reads) +-- Top Cached SPs By Total Logical Reads. Logical reads relate to memory pressure (Query 61) (SP Logical Reads) SELECT TOP(25) p.name AS [SP Name], qs.total_logical_reads AS [TotalLogicalReads], qs.total_logical_reads/qs.execution_count AS [AvgLogicalReads],qs.execution_count, ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1475,11 +1558,11 @@ ORDER BY qs.total_logical_reads DESC OPTION (RECOMPILE); -- You should look at this if you see signs of memory pressure --- Top Cached SPs By Total Physical Reads. Physical reads relate to disk read I/O pressure (Query 63) (SP Physical Reads) +-- Top Cached SPs By Total Physical Reads. Physical reads relate to disk read I/O pressure (Query 62) (SP Physical Reads) SELECT TOP(25) p.name AS [SP Name],qs.total_physical_reads AS [TotalPhysicalReads], qs.total_physical_reads/qs.execution_count AS [AvgPhysicalReads], qs.execution_count, qs.total_logical_reads,qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1497,13 +1580,13 @@ ORDER BY qs.total_physical_reads DESC, qs.total_logical_reads DESC OPTION (RECOM --- Top Cached SPs By Total Logical Writes (Query 64) (SP Logical Writes) +-- Top Cached SPs By Total Logical Writes (Query 63) (SP Logical Writes) -- Logical writes relate to both memory and disk I/O pressure SELECT TOP(25) p.name AS [SP Name], qs.total_logical_writes AS [TotalLogicalWrites], qs.total_logical_writes/qs.execution_count AS [AvgLogicalWrites], qs.execution_count, ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], qs.total_elapsed_time, qs.total_elapsed_time/qs.execution_count AS [avg_elapsed_time], -CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], +CASE WHEN CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' THEN 1 ELSE 0 END AS [Has Missing Index], FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] -- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan @@ -1521,6 +1604,31 @@ ORDER BY qs.total_logical_writes DESC OPTION (RECOMPILE); -- You should look at this if you see signs of I/O pressure or of memory pressure + +-- Cached SPs Missing Indexes by Execution Count (Query 64) (SP Missing Index) +SELECT TOP(25) p.name AS [SP Name], qs.execution_count AS [Execution Count], +ISNULL(qs.execution_count/DATEDIFF(Minute, qs.cached_time, GETDATE()), 0) AS [Calls/Minute], +qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time], +qs.total_worker_time/qs.execution_count AS [Avg Worker Time], +qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads], +FORMAT(qs.last_execution_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Last Execution Time], +FORMAT(qs.cached_time, 'yyyy-MM-dd HH:mm:ss', 'en-US') AS [Plan Cached Time] +-- ,qp.query_plan AS [Query Plan] -- Uncomment if you want the Query Plan +FROM sys.procedures AS p WITH (NOLOCK) +INNER JOIN sys.dm_exec_procedure_stats AS qs WITH (NOLOCK) +ON p.[object_id] = qs.[object_id] +CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle) AS qp +WHERE qs.database_id = DB_ID() +AND DATEDIFF(Minute, qs.cached_time, GETDATE()) > 0 +AND CONVERT(nvarchar(max), qp.query_plan) COLLATE Latin1_General_BIN2 LIKE N'%%' +ORDER BY qs.execution_count DESC OPTION (RECOMPILE); +------ + +-- This helps you find the most frequently executed cached stored procedures that have missing index warnings +-- This can often help you find index tuning candidates + + + -- Lists the top statements by average input/output usage for the current database (Query 65) (Top IO Statements) SELECT TOP(50) OBJECT_NAME(qt.objectid, dbid) AS [SP Name], (qs.total_logical_reads + qs.total_logical_writes) /qs.execution_count AS [Avg IO], qs.execution_count AS [Execution Count], @@ -1541,7 +1649,9 @@ ORDER BY [Avg IO] DESC OPTION (RECOMPILE); -- Possible Bad NC Indexes (writes > reads) (Query 66) (Bad NC Indexes) -SELECT OBJECT_NAME(s.[object_id]) AS [Table Name], i.name AS [Index Name], i.index_id, +SELECT SCHEMA_NAME(o.[schema_id]) AS [Schema Name], +OBJECT_NAME(s.[object_id]) AS [Table Name], +i.name AS [Index Name], i.index_id, i.is_disabled, i.is_hypothetical, i.has_filter, i.fill_factor, s.user_updates AS [Total Writes], s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], s.user_updates - (s.user_seeks + s.user_scans + s.user_lookups) AS [Difference] @@ -1549,6 +1659,8 @@ FROM sys.dm_db_index_usage_stats AS s WITH (NOLOCK) INNER JOIN sys.indexes AS i WITH (NOLOCK) ON s.[object_id] = i.[object_id] AND i.index_id = s.index_id +INNER JOIN sys.objects AS o WITH (NOLOCK) +ON i.[object_id] = o.[object_id] WHERE OBJECTPROPERTY(s.[object_id],'IsUserTable') = 1 AND s.database_id = DB_ID() AND s.user_updates > (s.user_seeks + s.user_scans + s.user_lookups) @@ -1563,15 +1675,19 @@ ORDER BY [Difference] DESC, [Total Writes] DESC, [Total Reads] ASC OPTION (RECOM -- Missing Indexes for current database by Index Advantage (Query 67) (Missing Indexes) -SELECT DISTINCT CONVERT(decimal(18,2), user_seeks * avg_total_user_cost * (avg_user_impact * 0.01)) AS [index_advantage], -migs.last_user_seek, mid.[statement] AS [Database.Schema.Table], -mid.equality_columns, mid.inequality_columns, mid.included_columns, -migs.unique_compiles, migs.user_seeks, migs.avg_total_user_cost, migs.avg_user_impact, +SELECT CONVERT(decimal(18,2), migs.user_seeks * migs.avg_total_user_cost * (migs.avg_user_impact * 0.01)) AS [index_advantage], +FORMAT(migs.last_user_seek, 'yyyy-MM-dd HH:mm:ss') AS [last_user_seek], mid.[statement] AS [Database.Schema.Table], +COUNT(1) OVER(PARTITION BY mid.[statement]) AS [missing_indexes_for_table], +COUNT(1) OVER(PARTITION BY mid.[statement], mid.equality_columns) AS [similar_missing_indexes_for_table], +mid.equality_columns, mid.inequality_columns, mid.included_columns, migs.user_seeks, +CONVERT(decimal(18,2), migs.avg_total_user_cost) AS [avg_total_user_,cost], migs.avg_user_impact, +REPLACE(REPLACE(LEFT(st.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text], OBJECT_NAME(mid.[object_id]) AS [Table Name], p.rows AS [Table Rows] -FROM sys.dm_db_missing_index_group_stats AS migs WITH (NOLOCK) -INNER JOIN sys.dm_db_missing_index_groups AS mig WITH (NOLOCK) -ON migs.group_handle = mig.index_group_handle -INNER JOIN sys.dm_db_missing_index_details AS mid WITH (NOLOCK) +FROM sys.dm_db_missing_index_groups AS mig WITH (NOLOCK) +INNER JOIN sys.dm_db_missing_index_group_stats_query AS migs WITH(NOLOCK) +ON mig.index_group_handle = migs.group_handle +CROSS APPLY sys.dm_exec_sql_text(migs.last_sql_handle) AS st +INNER JOIN sys.dm_db_missing_index_details AS mid WITH (NOLOCK) ON mig.index_handle = mid.index_handle INNER JOIN sys.partitions AS p WITH (NOLOCK) ON p.[object_id] = mid.[object_id] @@ -1583,12 +1699,13 @@ ORDER BY index_advantage DESC OPTION (RECOMPILE); -- Look at index advantage, last user seek time, number of user seeks to help determine source and importance -- SQL Server is overly eager to add included columns, so beware -- Do not just blindly add indexes that show up from this query!!! +-- Hkan Winther has given me some great suggestions for this query --- Find missing index warnings for cached plans in the current database (Query 60) (Missing Index Warnings) +-- Find missing index warnings for cached plans in the current database (Query 68) (Missing Index Warnings) -- Note: This query could take some time on a busy instance SELECT TOP(25) OBJECT_NAME(objectid) AS [ObjectName], - cp.objtype, cp.usecounts, cp.size_in_bytes, query_plan + cp.objtype, cp.usecounts, cp.size_in_bytes, qp.query_plan FROM sys.dm_exec_cached_plans AS cp WITH (NOLOCK) CROSS APPLY sys.dm_exec_query_plan(cp.plan_handle) AS qp WHERE CAST(query_plan AS NVARCHAR(MAX)) LIKE N'%MissingIndex%' @@ -1602,7 +1719,8 @@ ORDER BY cp.usecounts DESC OPTION (RECOMPILE); -- Breaks down buffers used by current database by object (table, index) in the buffer cache (Query 69) (Buffer Usage) -- Note: This query could take some time on a busy instance -SELECT OBJECT_NAME(p.[object_id]) AS [Object Name], p.index_id, +SELECT fg.name AS [Filegroup Name], SCHEMA_NAME(o.Schema_ID) AS [Schema Name], +OBJECT_NAME(p.[object_id]) AS [Object Name], p.index_id, CAST(COUNT(*)/128.0 AS DECIMAL(10, 2)) AS [Buffer size(MB)], COUNT(*) AS [BufferCount], p.[Rows] AS [Row Count], p.data_compression_desc AS [Compression Type] @@ -1611,12 +1729,19 @@ INNER JOIN sys.dm_os_buffer_descriptors AS b WITH (NOLOCK) ON a.allocation_unit_id = b.allocation_unit_id INNER JOIN sys.partitions AS p WITH (NOLOCK) ON a.container_id = p.hobt_id +INNER JOIN sys.objects AS o WITH (NOLOCK) +ON p.object_id = o.object_id +INNER JOIN sys.database_files AS f WITH (NOLOCK) +ON b.file_id = f.file_id +INNER JOIN sys.filegroups AS fg WITH (NOLOCK) +ON f.data_space_id = fg.data_space_id WHERE b.database_id = CONVERT(int, DB_ID()) AND p.[object_id] > 100 AND OBJECT_NAME(p.[object_id]) NOT LIKE N'plan_%' AND OBJECT_NAME(p.[object_id]) NOT LIKE N'sys%' AND OBJECT_NAME(p.[object_id]) NOT LIKE N'xml_index_nodes%' -GROUP BY p.[object_id], p.index_id, p.data_compression_desc, p.[Rows] +GROUP BY fg.name, o.Schema_ID, p.[object_id], p.index_id, + p.data_compression_desc, p.[Rows] ORDER BY [BufferCount] DESC OPTION (RECOMPILE); ------ @@ -1626,7 +1751,7 @@ ORDER BY [BufferCount] DESC OPTION (RECOMPILE); -- Get Table names, row counts, and compression status for clustered index or heap (Query 70) (Table Sizes) SELECT SCHEMA_NAME(o.Schema_ID) AS [Schema Name], OBJECT_NAME(p.object_id) AS [ObjectName], -SUM(p.Rows) AS [RowCount], data_compression_desc AS [CompressionType] +SUM(p.Rows) AS [RowCount], p.data_compression_desc AS [Compression Type] FROM sys.partitions AS p WITH (NOLOCK) INNER JOIN sys.objects AS o WITH (NOLOCK) ON p.object_id = o.object_id @@ -1744,7 +1869,8 @@ ORDER BY ps.avg_fragmentation_in_percent DESC OPTION (RECOMPILE); --- Index Read/Write stats (all tables in current DB) ordered by Reads (Query 75) (Overall Index Usage - Reads) -SELECT OBJECT_NAME(i.[object_id]) AS [ObjectName], i.[name] AS [IndexName], i.index_id, +SELECT SCHEMA_NAME(t.[schema_id]) AS [SchemaName], OBJECT_NAME(i.[object_id]) AS [ObjectName], + i.[name] AS [IndexName], i.index_id, s.user_seeks, s.user_scans, s.user_lookups, s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], s.user_updates AS [Writes], @@ -1755,6 +1881,8 @@ LEFT OUTER JOIN sys.dm_db_index_usage_stats AS s WITH (NOLOCK) ON i.[object_id] = s.[object_id] AND i.index_id = s.index_id AND s.database_id = DB_ID() +LEFT OUTER JOIN sys.tables AS t WITH (NOLOCK) +ON t.[object_id] = i.[object_id] WHERE OBJECTPROPERTY(i.[object_id],'IsUserTable') = 1 ORDER BY s.user_seeks + s.user_scans + s.user_lookups DESC OPTION (RECOMPILE); -- Order by reads ------ @@ -1763,7 +1891,8 @@ ORDER BY s.user_seeks + s.user_scans + s.user_lookups DESC OPTION (RECOMPILE); - --- Index Read/Write stats (all tables in current DB) ordered by Writes (Query 76) (Overall Index Usage - Writes) -SELECT OBJECT_NAME(i.[object_id]) AS [ObjectName], i.[name] AS [IndexName], i.index_id, +SELECT SCHEMA_NAME(t.[schema_id]) AS [SchemaName],OBJECT_NAME(i.[object_id]) AS [ObjectName], + i.[name] AS [IndexName], i.index_id, s.user_updates AS [Writes], s.user_seeks + s.user_scans + s.user_lookups AS [Total Reads], i.[type_desc] AS [Index Type], i.fill_factor AS [Fill Factor], i.has_filter, i.filter_definition, s.last_system_update, s.last_user_update @@ -1772,6 +1901,8 @@ LEFT OUTER JOIN sys.dm_db_index_usage_stats AS s WITH (NOLOCK) ON i.[object_id] = s.[object_id] AND i.index_id = s.index_id AND s.database_id = DB_ID() +LEFT OUTER JOIN sys.tables AS t WITH (NOLOCK) +ON t.[object_id] = i.[object_id] WHERE OBJECTPROPERTY(i.[object_id],'IsUserTable') = 1 ORDER BY s.user_updates DESC OPTION (RECOMPILE); -- Order by writes ------ @@ -1779,45 +1910,8 @@ ORDER BY s.user_updates DESC OPTION (RECOMPILE); -- Order by writes -- Show which indexes in the current database are most active for Writes --- Get in-memory OLTP index usage (Query 77) (XTP Index Usage) -SELECT OBJECT_NAME(i.[object_id]) AS [Object Name], i.index_id, i.[name] AS [Index Name], - i.[type_desc], xis.scans_started, xis.scans_retries, - xis.rows_touched, xis.rows_returned -FROM sys.dm_db_xtp_index_stats AS xis WITH (NOLOCK) -INNER JOIN sys.indexes AS i WITH (NOLOCK) -ON i.[object_id] = xis.[object_id] -AND i.index_id = xis.index_id -ORDER BY OBJECT_NAME(i.[object_id]) OPTION (RECOMPILE); ------- - --- This gives you some index usage statistics for in-memory OLTP --- Returns no data if you are not using in-memory OLTP - --- Guidelines for Using Indexes on Memory-Optimized Tables --- https://bit.ly/2GCP8lF - - --- Look at Columnstore index physical statistics (Query 78) (Columnstore Index Physical Stat) -SELECT OBJECT_NAME(ps.object_id) AS [TableName], - i.[name] AS [IndexName], ps.index_id, ps.partition_number, - ps.delta_store_hobt_id, ps.state_desc, ps.total_rows, ps.size_in_bytes, - ps.trim_reason_desc, ps.generation, ps.transition_to_compressed_state_desc, - ps.has_vertipaq_optimization, ps.deleted_rows, - 100 * (ISNULL(ps.deleted_rows, 0))/ps.total_rows AS [Fragmentation] -FROM sys.dm_db_column_store_row_group_physical_stats AS ps WITH (NOLOCK) -INNER JOIN sys.indexes AS i WITH (NOLOCK) -ON ps.object_id = i.object_id -AND ps.index_id = i.index_id -ORDER BY ps.object_id, ps.partition_number, ps.row_group_id OPTION (RECOMPILE); ------- - --- sys.dm_db_column_store_row_group_physical_stats (Transact-SQL) --- https://bit.ly/2q276XQ - - - --- Get lock waits for current database (Query 79) (Lock Waits) +-- Get lock waits for current database (Query 77) (Lock Waits) SELECT o.name AS [table_name], i.name AS [index_name], ios.index_id, ios.partition_number, SUM(ios.row_lock_wait_count) AS [total_row_lock_waits], SUM(ios.row_lock_wait_in_ms) AS [total_row_lock_wait_in_ms], @@ -1840,7 +1934,7 @@ ORDER BY total_lock_wait_in_ms DESC OPTION (RECOMPILE); --- Look at UDF execution statistics (Query 80) (UDF Statistics) +-- Look at UDF execution statistics (Query 78) (UDF Statistics) SELECT OBJECT_NAME(object_id) AS [Function Name], execution_count, total_worker_time, total_logical_reads, total_physical_reads, total_elapsed_time, total_elapsed_time/execution_count AS [avg_elapsed_time], @@ -1858,7 +1952,7 @@ ORDER BY total_worker_time DESC OPTION (RECOMPILE); -- https://bit.ly/2q1Q6BM --- Determine which scalar UDFs are in-lineable (Query 81) (Inlineable UDFs) +-- Determine which scalar UDFs are in-lineable (Query 79) (Inlineable UDFs) SELECT OBJECT_NAME(m.object_id) AS [Function Name], is_inlineable, inline_type FROM sys.sql_modules AS m WITH (NOLOCK) LEFT OUTER JOIN sys.dm_exec_function_stats AS efs WITH (NOLOCK) @@ -1874,7 +1968,7 @@ OPTION (RECOMPILE); -- https://bit.ly/2Qt216S --- Get QueryStore Options for this database (Query 82) (QueryStore Options) +-- Get QueryStore Options for this database (Query 80) (QueryStore Options) SELECT actual_state_desc, desired_state_desc, [interval_length_minutes], current_storage_size_mb, [max_storage_size_mb], query_capture_mode_desc, size_based_cleanup_mode_desc @@ -1892,7 +1986,7 @@ FROM sys.database_query_store_options WITH (NOLOCK) OPTION (RECOMPILE); --- Get input buffer information for the current database (Query 83) (Input Buffer) +-- Get input buffer information for the current database (Query 81) (Input Buffer) SELECT es.session_id, DB_NAME(es.database_id) AS [Database Name], es.login_time, es.cpu_time, es.logical_reads, es.memory_usage, es.[status], ib.event_info AS [Input Buffer] @@ -1914,9 +2008,10 @@ AND es.session_id <> @@SPID OPTION (RECOMPILE); --- Get any resumable index rebuild operation information (Query 84) (Resumable Index Rebuild) +-- Get any resumable index rebuild operation information (Query 82) (Resumable Index Rebuild) SELECT OBJECT_NAME(iro.object_id) AS [Object Name], iro.index_id, iro.name AS [Index Name], - iro.sql_text, iro.last_max_dop_used, iro.partition_number, iro.state_desc, iro.start_time, iro.percent_complete + iro.sql_text, iro.last_max_dop_used, iro.partition_number, iro.state_desc, + iro.start_time, iro.percent_complete FROM sys.index_resumable_operations AS iro WITH (NOLOCK) OPTION (RECOMPILE); ------ @@ -1925,7 +2020,7 @@ OPTION (RECOMPILE); -- https://bit.ly/2pYSWqq --- Get database automatic tuning options (Query 85) (Automatic Tuning Options) +-- Get database automatic tuning options (Query 83) (Automatic Tuning Options) SELECT [name], desired_state_desc, actual_state_desc, reason_desc FROM sys.database_automatic_tuning_options WITH (NOLOCK) OPTION (RECOMPILE); @@ -1936,7 +2031,7 @@ OPTION (RECOMPILE); --- Look at recent Full backups for the current database (Query 86) (Recent Full Backups) +-- Look at recent Full backups for the current database (Query 84) (Recent Full Backups) SELECT TOP (30) bs.machine_name, bs.server_name, bs.database_name AS [Database Name], bs.recovery_model, CONVERT (BIGINT, bs.backup_size / 1048576 ) AS [Uncompressed Backup Size (MB)], CONVERT (BIGINT, bs.compressed_backup_size / 1048576 ) AS [Compressed Backup Size (MB)], @@ -1952,48 +2047,23 @@ AND bs.[type] = 'D' -- Change to L if you want Log backups ORDER BY bs.backup_finish_date DESC OPTION (RECOMPILE); ------ +-- Things to look at: -- Are your backup sizes and times changing over time? -- Are you using backup compression? -- Are you using backup checksums? -- Are you doing copy_only backups? -- Are you doing encrypted backups? -- Have you done any backup tuning with striped backups, or changing the parameters of the backup command? +-- Where are the backups going to? -- In SQL Server 2016, native SQL Server backup compression actually works -- much better with databases that are using TDE than in previous versions -- https://bit.ly/28Rpb2x --- These five Pluralsight Courses go into more detail about how to run these queries and interpret the results - --- SQL Server 2017: Diagnosing Performance Issues with DMVs --- https://bit.ly/2FqCeti - --- SQL Server 2017: Diagnosing Configuration Issues with DMVs --- https://bit.ly/2MSUDUL - --- SQL Server 2014 DMV Diagnostic Queries Part 1 --- https://bit.ly/2plxCer - --- SQL Server 2014 DMV Diagnostic Queries Part 2 --- https://bit.ly/2IuJpzI - --- SQL Server 2014 DMV Diagnostic Queries Part 3 --- https://bit.ly/2FIlCPb - - - --- Sign up for Microsoft Visual Studio Dev Essentials and get a free three month pass to Pluralsight - -- Microsoft Visual Studio Dev Essentials --- http://bit.ly/1q6xbDL - - --- Sign up for Microsoft Azure Essentials and get lots of free Azure usage credits, MCP exam voucher, three month Pluralsight subscription - --- Microsoft Azure Essentials --- https://bit.ly/2JMWe8x +-- https://bit.ly/2qjNRxi +-- Microsoft Azure Learn +-- https://bit.ly/2O0Hacc --- August 2017 blog series about upgrading and migrating to SQL Server 2016/2017 --- https://bit.ly/2ftKVrX diff --git a/Scripts/SQLServer_Memory_Information.sql b/Scripts/SQLServer_Memory_Information.sql index 33c58250..10753f37 100644 --- a/Scripts/SQLServer_Memory_Information.sql +++ b/Scripts/SQLServer_Memory_Information.sql @@ -1,13 +1,25 @@ -SET NOCOUNT ON; +/* + + Get SQL Server memory detailed information. + 3 row sets: 1 - countes info; 2 - min, max, target memory info; 3 - detailed tree memory info. + ? + 2020-02-04 by Konstantin Taranov + 1.0 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/SQLServer_Memory_Information.sql + +*/ + + +SET NOCOUNT ON; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; SET LOCK_TIMEOUT 10000; -DECLARE @ServiceName nvarchar(100) +DECLARE @ServiceName nvarchar(100); SET @ServiceName = CASE WHEN @@SERVICENAME = 'MSSQLSERVER' THEN 'SQLServer:' ELSE 'MSSQL$' + @@SERVICENAME + ':' - END + END; DECLARE @Perf TABLE ( object_name nvarchar(20), @@ -16,7 +28,7 @@ DECLARE @Perf TABLE ( cntr_value bigint, formatted_value numeric(20, 2), shortname nvarchar(20) -) +); INSERT INTO @Perf (object_name, counter_name, instance_name, cntr_value, formatted_value, shortname) SELECT CASE @@ -55,12 +67,12 @@ INSERT INTO @Perf (object_name, counter_name, instance_name, cntr_value, formatt OR (object_name LIKE @ServiceName + 'Cursor Manager by Type%' AND counter_name = 'Cursor memory usage' AND instance_name = '_Total' - ) + ); -- Add unit to 'Cursor memory usage' UPDATE @Perf SET counter_name = counter_name + ' (KB)' -WHERE counter_name = 'Cursor memory usage' +WHERE counter_name = 'Cursor memory usage'; -- Convert values from pages and KB to MB and rename counters accordingly UPDATE @Perf @@ -70,7 +82,7 @@ SET counter_name = REPLACE(REPLACE(REPLACE(counter_name, ' pages', ''), ' (KB)', WHEN counter_name LIKE '%pages' THEN cntr_value / 128. WHEN counter_name LIKE '%(KB)' THEN cntr_value / 1024. ELSE cntr_value - END + END; -- Delete some pre 2012 counters for 2012 in order to remove duplicates DELETE P2008 @@ -78,7 +90,7 @@ DELETE P2008 INNER JOIN @Perf P2012 ON REPLACE(P2008.object_name, 'Buffer', 'Memory') = P2012.object_name AND P2008.shortname = P2012.shortname -WHERE P2008.object_name IN ('Buffer Manager', 'Buffer Node') +WHERE P2008.object_name IN ('Buffer Manager', 'Buffer Node'); -- Update counter/object names so they look like in 2012 UPDATE PC @@ -109,7 +121,7 @@ SELECT counter_name FROM @Perf WHERE object_name = 'Memory Manager') -WHERE object_name IN ('Buffer Manager', 'Buffer Node') +WHERE object_name IN ('Buffer Manager', 'Buffer Node'); -- Build Memory Tree @@ -119,7 +131,7 @@ DECLARE @MemTree TABLE ( counter_name nvarchar(128), formatted_value numeric(20, 2), shortname nvarchar(20) -) +); -- Level 5 INSERT @MemTree (Id, ParentId, counter_name, formatted_value, shortname) @@ -132,7 +144,7 @@ INSERT @MemTree (Id, ParentId, counter_name, formatted_value, shortname) FROM @Perf WHERE object_name = 'Plan Cache' AND counter_name IN ('Cache') - AND instance_name <> '_Total' + AND instance_name <> '_Total'; -- Level 4 INSERT @MemTree (Id, ParentId, counter_name, formatted_value, shortname) @@ -184,7 +196,7 @@ INSERT @MemTree (Id, ParentId, counter_name, formatted_value, shortname) UNION ALL SELECT 1110) P - GROUP BY P.ParentID + GROUP BY P.ParentID; -- Level 3 INSERT @MemTree (Id, ParentId, counter_name, formatted_value, shortname) @@ -205,7 +217,7 @@ INSERT @MemTree (Id, ParentId, counter_name, formatted_value, shortname) shortname FROM @Perf WHERE object_name = 'Memory Manager' - AND counter_name IN ('Stolen Server Memory', 'Database Cache Memory', 'Free Memory', 'Granted Workspace Memory') + AND counter_name IN ('Stolen Server Memory', 'Database Cache Memory', 'Free Memory', 'Granted Workspace Memory'); -- Level 2 INSERT @MemTree (Id, ParentId, counter_name, formatted_value, shortname) @@ -221,7 +233,7 @@ INSERT @MemTree (Id, ParentId, counter_name, formatted_value, shortname) shortname FROM @Perf WHERE object_name = 'Memory Manager' - AND counter_name IN ('Total Server Memory', 'Maximum Workspace Memory') + AND counter_name IN ('Total Server Memory', 'Maximum Workspace Memory'); -- Level 1 INSERT @MemTree (Id, ParentId, counter_name, formatted_value, shortname) @@ -233,7 +245,7 @@ INSERT @MemTree (Id, ParentId, counter_name, formatted_value, shortname) shortname FROM @Perf WHERE object_name = 'Memory Manager' - AND counter_name IN ('Target Server Memory') + AND counter_name IN ('Target Server Memory'); -- Level 4 -- 'Other Stolen Server Memory' = 'Stolen Server Memory' - SUM(Children of 'Stolen Server Memory') INSERT @MemTree (Id, ParentId, counter_name, formatted_value, shortname) @@ -248,7 +260,7 @@ INSERT @MemTree (Id, ParentId, counter_name, formatted_value, shortname) - SUM(formatted_value), shortname = 'Other Stolen' FROM @MemTree - WHERE ParentId = 1220 + WHERE ParentId = 1220; -- Results: @@ -289,7 +301,7 @@ FROM @Perf WHERE object_name = 'Memory Node') > 1 ) -ORDER BY P.counter_name DESC, P.instance_name +ORDER BY P.counter_name DESC, P.instance_name; -- Get physical memory -- You can also extract this information from sys.dm_os_sys_info but the column names have changed starting from 2012 @@ -300,8 +312,8 @@ CREATE TABLE #msver ( Name sysname, Internal_Value int, Value nvarchar(512) -) -INSERT #msver EXEC master.dbo.xp_msver 'PhysicalMemory' +); +INSERT #msver EXEC master.dbo.xp_msver 'PhysicalMemory'; -- Physical memory, config parameters and Target memory SELECT @@ -319,7 +331,7 @@ SELECT WHERE object_name = 'Memory Manager' AND counter_name IN ('Target Server Memory')), physical_mb = CAST(Internal_Value AS decimal(20, 2)) -FROM #msver +FROM #msver; -- Memory tree ; diff --git a/Scripts/Sort_UID_Demo.sql b/Scripts/Sort_UID_Demo.sql new file mode 100644 index 00000000..aef7e815 --- /dev/null +++ b/Scripts/Sort_UID_Demo.sql @@ -0,0 +1,36 @@ +/* + + uniqueidentifier (UID) sorting demo + Sorted UID CTE + 2007-08-31 by Alberto Ferrari + 2020-04-14 by Konstantin Taranov + 1.0 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Sort_UID_Demo.sql + https://web.archive.org/web/20181129024526/http://sqlblog.com:80/blogs/alberto_ferrari/archive/2007/08/31/how-are-guids-sorted-by-sql-server.aspx + +*/ + + +WITH CTE_UID AS (/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */ + SELECT ID = 1, UID = CAST('00000000-0000-0000-0000-010000000000' AS uniqueidentifier) + UNION ALL SELECT ID = 2, UID = CAST('00000000-0000-0000-0000-000100000000' AS uniqueidentifier) + UNION ALL SELECT ID = 3, UID = CAST('00000000-0000-0000-0000-000001000000' AS uniqueidentifier) + UNION ALL SELECT ID = 4, UID = CAST('00000000-0000-0000-0000-000000010000' AS uniqueidentifier) + UNION ALL SELECT ID = 5, UID = CAST('00000000-0000-0000-0000-000000000100' AS uniqueidentifier) + UNION ALL SELECT ID = 6, UID = CAST('00000000-0000-0000-0000-000000000001' AS uniqueidentifier) + UNION ALL SELECT ID = 7, UID = CAST('00000000-0000-0000-0100-000000000000' AS uniqueidentifier) + UNION ALL SELECT ID = 8, UID = CAST('00000000-0000-0000-0010-000000000000' AS uniqueidentifier) + UNION ALL SELECT ID = 9, UID = CAST('00000000-0000-0001-0000-000000000000' AS uniqueidentifier) + UNION ALL SELECT ID = 10, UID = CAST('00000000-0000-0100-0000-000000000000' AS uniqueidentifier) + UNION ALL SELECT ID = 11, UID = CAST('00000000-0001-0000-0000-000000000000' AS uniqueidentifier) + UNION ALL SELECT ID = 12, UID = CAST('00000000-0100-0000-0000-000000000000' AS uniqueidentifier) + UNION ALL SELECT ID = 13, UID = CAST('00000001-0000-0000-0000-000000000000' AS uniqueidentifier) + UNION ALL SELECT ID = 14, UID = CAST('00000100-0000-0000-0000-000000000000' AS uniqueidentifier) + UNION ALL SELECT ID = 15, UID = CAST('00010000-0000-0000-0000-000000000000' AS uniqueidentifier) + UNION ALL SELECT ID = 16, UID = CAST('01000000-0000-0000-0000-000000000000' AS uniqueidentifier) +) +SELECT + ID + , UID +FROM CTE_UID +ORDER BY UID, ID; diff --git a/Scripts/Table_and_Index_Storage_Size.sql b/Scripts/Table_and_Index_Storage_Size.sql deleted file mode 100644 index 7a6209ed..00000000 --- a/Scripts/Table_and_Index_Storage_Size.sql +++ /dev/null @@ -1,47 +0,0 @@ -/* -Created by: Muhmud -Modified: 2019-03-26 by Konstantin Taranov -Original link: - -Source link: https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Table_and_Index_Storage_Size.sql -Note: Takes into account internal tables, such as those used for XML storage. -If you divide the DataKb and IndexAllKb values by 1024.0, you will get the numbers you see in the SSMS. -*/ - - -WITH TablePages AS ( - SELECT s.[object_id] - , SUM(s.reserved_page_count) as reserved_pages - , SUM(s.used_page_count) as used_pages - , SUM(CASE WHEN index_id < 2 THEN in_row_data_page_count + lob_used_page_count + row_overflow_used_page_count - ELSE lob_used_page_count + row_overflow_used_page_count - END) AS pages - , (SELECT COUNT(i.[object_id]) FROM sys.indexes AS i WHERE s.[object_id] = i.[object_id] AND i.[type] <> 0) AS IndexCount - FROM sys.dm_db_partition_stats AS s - GROUP BY [object_id] -) -, ExtraData as ( - SELECT p.[object_id] - , COUNT(*) AS IndexCount - , SUM(reserved_page_count) AS reserved_pages - , SUM(used_page_count) as used_pages - FROM sys.dm_db_partition_stats AS p - LEFT JOIN sys.internal_tables AS it ON p.[object_id] = it.[object_id] - WHERE it.internal_type IN (202, 204, 211, 212, 213, 214, 215, 216) - GROUP BY p.[object_id] -) -SELECT p.[object_id] - , OBJECT_SCHEMA_NAME(p.[object_id]) AS ShemaName - , OBJECT_NAME(p.[object_id]) AS TableName - , (p.reserved_pages + ISNULL(e.reserved_pages, 0)) * 8 AS ReservedKb - , p.pages * 8 AS DataKb - , p.IndexCount - , (CASE WHEN p.IndexCount <> 0 AND p.used_pages + ISNULL(e.used_pages, 0) >= p.pages - THEN p.used_pages + ISNULL(e.used_pages, 0) - p.pages - ELSE 0 - END) * 8 AS IndexAllKb - , (CASE WHEN p.reserved_pages + ISNULL(e.reserved_pages, 0) > p.used_pages + ISNULL(e.used_pages, 0) - THEN p.reserved_pages + ISNULL(e.reserved_pages, 0) - p.used_pages + ISNULL(e.used_pages, 0) - ELSE 0 - END) * 8 AS UnusedKb -FROM TablePages AS p -LEFT JOIN ExtraData AS e ON p.[object_id] = e.[object_id]; diff --git a/Scripts/Table_upload_order.sql b/Scripts/Table_upload_order.sql deleted file mode 100644 index 5122aa6a..00000000 --- a/Scripts/Table_upload_order.sql +++ /dev/null @@ -1,76 +0,0 @@ -/* -Author: -Link: -*/ - -WITH fk_tables AS - (SELECT s1.name AS from_schema - , o1.name AS from_table - , s2.name AS to_schema - , o2.name AS to_table - FROM sys.foreign_keys fk - INNER JOIN sys.objects o1 ON fk.parent_object_id = o1.object_id - INNER JOIN sys.schemas s1 ON o1.schema_id = s1.schema_id - INNER JOIN sys.objects o2 ON fk.referenced_object_id = o2.object_id - INNER JOIN sys.schemas s2 ON o2.schema_id = s2.schema_id - INNER JOIN (SELECT object_id, SUM(row_count) AS row_count - FROM sys.dm_db_partition_stats - WHERE index_id < 2 - GROUP BY object_id - ) AS rc ON o1.object_id = rc.object_id - /*For the purposes of finding dependency hierarchy - we're not worried about self-referencing tables*/ - WHERE NOT - (s1.name = s2.name - AND o1.name = o2.name - ) - ) - , ordered_tables AS - (SELECT s.name AS schemaName - , t.name AS tableName - , 0 AS TableLevel - FROM(SELECT * - FROM sys.tables - ) t - INNER JOIN sys.schemas s ON t.schema_id = s.schema_id - LEFT OUTER JOIN fk_tables fk ON s.name = fk.from_schema AND t.name = fk.from_table - WHERE fk.from_schema IS NULL - UNION ALL - SELECT fk.from_schema - , fk.from_table - , ot.TableLevel + 1 - FROM fk_tables fk - INNER JOIN ordered_tables ot ON fk.to_schema = ot.schemaName AND fk.to_table = ot.tableName - ) - , final AS - (SELECT DISTINCT ot.schemaName - , ot.tableName - , ot.TableLevel - FROM ordered_tables ot - INNER JOIN - (SELECT schemaName - , tableName - , MAX(TableLevel) maxTableLevel - FROM ordered_tables - GROUP BY schemaName - , tableName - ) mx ON ot.schemaName = mx.schemaName AND ot.tableName = mx.tableName AND mx.maxTableLevel = ot.TableLevel - ) -SELECT QUOTENAME(final.schemaName) + '.' + QUOTENAME(final.tableName) - , TableLevel -FROM final -WHERE( - -- exclude some schemes by IN - final.schemaName NOT IN('dbo' - , 'consumption') - -- exclude some tables by IN - AND final.tableName NOT IN('TP6' - , 'WorldScenarioResult') - -- exclude some tables by mask - AND final.tableName NOT LIKE '%Temp' - ) - -- add some tables by mask and with IN - OR final.tableName IN('IPAdmin') - OR final.tableName LIKE 'AspNet%' - OR final.tableName LIKE 'Application%' -ORDER BY TableLevel; \ No newline at end of file diff --git a/Scripts/Trace_Flag/Trace_Flag_1165.sql b/Scripts/Trace_Flag/Trace_Flag_1165.sql new file mode 100644 index 00000000..6abbf4e6 --- /dev/null +++ b/Scripts/Trace_Flag/Trace_Flag_1165.sql @@ -0,0 +1,63 @@ +/* +https://www.sqlshack.com/understanding-sql-server-proportional-fill-algorithm/ +*/ + +DBCC TRACEON (1165, 3605); +GO + +EXEC sp_cycle_errorlog; +GO + +CREATE DATABASE PropFillDemo +ON PRIMARY +( NAME = N'PropFillDemo', FILENAME = N'g:\MSSQL19\MSSQL15.MSSQL19\MSSQL\DATA\PropFillDemo2.mdf', SIZE = 10MB , MAXSIZE = 1GB, FILEGROWTH = 10MB), +( NAME = N'PropFillDemo_1', FILENAME = N'g:\MSSQL19\MSSQL15.MSSQL19\MSSQL\DATA\PropFillDemo2_1.ndf', SIZE = 10MB , MAXSIZE = 1GB, FILEGROWTH = 10MB), +( NAME = N'PropFillDemo_2', FILENAME = N'g:\MSSQL19\MSSQL15.MSSQL19\MSSQL\DATA\PropFillDemo2_2.ndf', SIZE = 10MB , MAXSIZE = 1GB, FILEGROWTH = 10MB), +( NAME = N'PropFillDemo_3', FILENAME = N'g:\MSSQL19\MSSQL15.MSSQL19\MSSQL\DATA\PropFillDemo2_3.ndf', SIZE = 10MB , MAXSIZE = 1GB, FILEGROWTH = 10MB) + LOG ON ( NAME = N'PropFillDemo_log', FILENAME = N'g:\MSSQL19\MSSQL15.MSSQL19\MSSQL\DATA\PropFillDemo_log.ldf',SIZE = 10MB , MAXSIZE = 2GB , FILEGROWTH = 10%); + +EXEC xp_readerrorlog; +GO + +USE PropFillDemo; +GO + +SELECT [name] AS DBFileName + , [file_id] AS DBFileID + , [physical_name] AS PathAndPhysicalName + , (size * 8.0/1024) AS FileSizeMB + , ((size * 8.0/1024) - (FILEPROPERTY(name, 'SpaceUsed') * 8.0/1024)) AS FileFreeSpaceMB + , CAST((((size * 8.0/1024) - (FILEPROPERTY(name, 'SpaceUsed') * 8.0/1024))/(size * 8.0/1024))*100 AS decimal(6,2)) AS FreeSpacePercent + FROM sys.database_files; + + +DBCC showfilestats; + +CREATE TABLE PropFillTest( + ID int IDENTITY (1,1) + , First_Name nvarchar(50) NOT NULL + , Last_Name nvarchar(50) NOT NULL +); + +INSERT INTO PropFillTest VALUES('Ahmad', 'Yaseen'), ('John', 'Mikel'); +GO 500 + + +INSERT INTO PropFillTest VALUES('Ahmad', 'Yaseen'), ('John', 'Mikel'); +GO 15000 + +DBCC showfilestats; + +DBCC IND ('PropFillDemo', 'PropFillTest', -1); + + +INSERT INTO [PropFillTest] VALUES('Ahmad','Yaseen'),('John','Mikel') +GO 15000000 + +USE [master] +GO +ALTER DATABASE [PropFillDemo] ADD FILE ( NAME = N'PropFillDemo_4', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\PropFillDemo_4.ndf' , SIZE = 15360KB , FILEGROWTH = 10240KB ) TO FILEGROUP [PRIMARY]; +GO + +EXEC xp_readerrorlog; +GO diff --git a/Scripts/Trace_Flag/Trace_Flag_2371.sql b/Scripts/Trace_Flag/Trace_Flag_2371.sql new file mode 100644 index 00000000..2b499c5d --- /dev/null +++ b/Scripts/Trace_Flag/Trace_Flag_2371.sql @@ -0,0 +1,111 @@ +/* +https://www.sqlservergeeks.com/sql-server-trace-flag-2371/ +*/ + +USE master; +GO + +--Drop this database if alreay exist +IF DB_ID('StatsDemo2014') > 0 +BEGIN + ALTER DATABASE StatsDemo2014 SET single_user; + + DROP DATABASE StatsDemo2014; +END +GO + +--Create a database for Demo at default files location +CREATE DATABASE StatsDemo2014; +GO + +USE StatsDemo2014; +GO + +--Create table +CREATE TABLE xtstatsdemo ( + id int NOT NULL + , balance int NOT NULL + , name varchar(25) NULL + ); +GO + +-- Now I am inserting 50000 rows in the table. +-- Here id and balance both are having same values for demo purpose +SET NOCOUNT ON; + +DECLARE @counter INT = 1; +DECLARE @balance INT = 1; + +WHILE (@counter <= 50000) +BEGIN + IF (@counter % 2 = 0) + BEGIN + INSERT INTO xtstatsdemo + VALUES ( + @counter + , @balance + , 'data1' + ); + END + ELSE + BEGIN + INSERT INTO xtstatsdemo + VALUES ( + @counter + , @balance + , 'data2' + ); + END + + SET @counter = @counter + 1; + SET @balance = @balance + 1; +END +GO + +--You can check number of rows inside the table +SELECT count(*) FROM xtstatsdemo; +GO + + +/* Now run the below code, here select statement will create a statistic on id column. */ +USE master +GO + +DBCC TRACEON (2371, - 1) +GO + +USE StatsDemo2014; +GO + +SELECT * FROM xtstatsdemo WHERE id > 8000; +GO + + +/* Now check the auto created statistic on id column from SSMS. +Change the name of stats _WA_Sys_00000001_21B6055D as per your environment */ +DBCC Show_Statistics('xtstatsdemo','_WA_Sys_00000001_21B6055D') with stat_header; + + +/* Now I am going to delete 8000 rows */ +DELETE FROM xtstatsdemo WHERE id < 8001; +GO +/* Statement to update the stats automatically */ +SELECT name FROM xtstatsdemo WHERE id > 8000; +GO + +DBCC TRACEOFF(2371,-1) +GO +/* Now check the stats details and change the name of stats _WA_Sys_00000001_21B6055D as per your environment */ +DBCC Show_Statistics('xtstatsdemo','_WA_Sys_00000001_21B6055D') with stat_header; + + +/* Now I am going to delete 8000 rows */ +DELETE FROM xtstatsdemo where id < 8001; +GO +/* Statement to update the stats automatically */ +SELECT name FROM xtstatsdemo WHERE id > 8000; +GO +DBCC TRACEOFF(2371,-1) +GO +/* Now check the stats details and change the name of stats _WA_Sys_00000001_21B6055D as per your environment */ +DBCC Show_Statistics('xtstatsdemo','_WA_Sys_00000001_21B6055D') with stat_header; diff --git a/Scripts/Trace_Flag/Trace_Flag_3895.sql b/Scripts/Trace_Flag/Trace_Flag_3895.sql new file mode 100644 index 00000000..abc9dd86 --- /dev/null +++ b/Scripts/Trace_Flag/Trace_Flag_3895.sql @@ -0,0 +1,53 @@ +/* +Trace Flag Demo: 3895 +!!! Undocumented trace flag !!! +Function: In SQL Server 2019, when you enable the [Memory-Optimized TempDB Metadata](https://docs.microsoft.com/en-us/sql/relational-databases/databases/tempdb-database) feature, this trace flag is automatically enabled after the next restart. +When you disable that feature, the trace flag is automatically removed after the next restart. +Also if you add race flag 3895 to startup parameters after restarting SQL Server option `IsTempdbMetadataMemoryOptimized` will be enabled. +SQL Server Version: 2019 +Information link: https://github.com/ktaranov/sqlserver-kit/blob/master/SQL%20Server%20Trace%20Flag.md#3895 +*/ + +/* Check is it session trace flag? */ +DBCC TRACEON (3895); +GO +/* Answer - NO +Ignoring trace flag 3895. It is either an invalid trace flag or a trace flag that can only be specified during server startup. +DBCC execution completed. If DBCC printed error messages, contact your system administrator. +*/ + +/* Check current working flags */ +DBCC TRACESTATUS(-1); +GO + +/* https://docs.microsoft.com/en-us/sql/relational-databases/databases/tempdb-database */ +ALTER SERVER CONFIGURATION SET MEMORY_OPTIMIZED TEMPDB_METADATA = ON; + +/* RESTART SQL SERVER */ +DBCC TRACESTATUS(-1); +GO +/* Return that 3895 trace flag is enabled */ + +SELECT SERVERPROPERTY('IsTempdbMetadataMemoryOptimized') AS IsTempdbMetadataMemoryOptimized; +/* Return 1 (enabled) */ + +ALTER SERVER CONFIGURATION SET MEMORY_OPTIMIZED TEMPDB_METADATA = OFF; + +/* RESTART SQL SERVER */ + +SELECT SERVERPROPERTY('IsTempdbMetadataMemoryOptimized') AS IsTempdbMetadataMemoryOptimized; +/* Return 0 (disabled) */ + + +/* Add trace flag 3894 in SQL Server startup parameteres using SQL Server Configuration Manager +RESTART SQL SERVER +*/ + +SELECT SERVERPROPERTY('IsTempdbMetadataMemoryOptimized') AS IsTempdbMetadataMemoryOptimized; +/* Return 1 (enabled) */ + +/* Remoce trace flag 3894 in SQL Server startup parameteres using SQL Server Configuration Manager +RESTART SQL SERVER +*/ +SELECT SERVERPROPERTY('IsTempdbMetadataMemoryOptimized') AS IsTempdbMetadataMemoryOptimized; +/* Return 0 (disabled) */ diff --git a/Scripts/Trace_Flag/Trace_Flag_8726.sql b/Scripts/Trace_Flag/Trace_Flag_8726.sql new file mode 100644 index 00000000..452a3e41 --- /dev/null +++ b/Scripts/Trace_Flag/Trace_Flag_8726.sql @@ -0,0 +1,28 @@ +/* +Trace Flag Demo: 8726 +!!! Undocumented trace flag !!! +Function: Disables the heuristic that discourages the optimizer from producing an index union plan. +SQL Server Version: ? +Information link: https://github.com/ktaranov/sqlserver-kit/blob/master/SQL%20Server%20Trace%20Flag.md#8726 +*/ + +USE StackOverflow2010; +GO + +/* Execution Plan: https://www.brentozar.com/pastetheplan/?id=B1mSzXGv8 */ +/* No index union (seek on Users, multiple scans on Comments) */ +SELECT * +FROM Users u + LEFT JOIN Comments c + ON u.Id = c.UserId + OR u.Id = c.PostId +WHERE u.DisplayName = 'alex'; + +/* Gets the index union plan */ +SELECT * +FROM Users u + LEFT JOIN Comments c + ON u.Id = c.UserId + OR u.Id = c.PostId +WHERE u.DisplayName = 'alex' +OPTION (QUERYTRACEON 8726); diff --git a/Scripts/Trace_Flag/Trace_Flag_8727.sql b/Scripts/Trace_Flag/Trace_Flag_8727.sql new file mode 100644 index 00000000..2e0d73ad --- /dev/null +++ b/Scripts/Trace_Flag/Trace_Flag_8727.sql @@ -0,0 +1,38 @@ +/* +Trace Flag Demo: 8727 +!!! Undocumented trace flag !!! +Function: Can be used to prevent unwanted index union plans. +SQL Server Version: ? +Information link: https://github.com/ktaranov/sqlserver-kit/blob/master/SQL%20Server%20Trace%20Flag.md#8727 +*/ + +USE StackOverflow2010; +GO + +/* Execution Plan: https://www.brentozar.com/pastetheplan/?id=HkwhlQGwL */ +/* Gets an index union plan normally */ +SELECT * +FROM dbo.Users u +OUTER APPLY +( + SELECT * + FROM dbo.Comments c + WHERE + u.Id = c.UserId + OR u.Id = c.PostId +) c +WHERE u.DisplayName = 'alex'; + +/* No index union (seek on Users, multiple scans on Comments) */ +SELECT * +FROM dbo.Users u +OUTER APPLY +( + SELECT * + FROM dbo.Comments c + WHERE + u.Id = c.UserId + OR u.Id = c.PostId +) c +WHERE u.DisplayName = 'alex' +OPTION (QUERYTRACEON 8727); diff --git a/Scripts/Using_OPENROWSET_to_Query_Excel.sql b/Scripts/Using_OPENROWSET_to_Query_Excel.sql new file mode 100644 index 00000000..dfe27c34 --- /dev/null +++ b/Scripts/Using_OPENROWSET_to_Query_Excel.sql @@ -0,0 +1,31 @@ +/* +https://www.mssqltips.com/sqlservertip/6178/read-excel-file-in-sql-server-with-openrowset-or-opendatasource/ +*/ + +CREATE TABLE #Provider ( + ProviderName varchar(100) NOT NULL + , [ParseName] varchar(100) NOT NULL + , ProviderDescription varchar(100) NOT NULL + ); + +INSERT INTO #Provider EXEC sys.sp_enum_oledb_providers; + +IF NOT EXISTS (SELECT 1 FROM #Provider WHERE ProviderName LIKE 'Microsoft.ACE.OLEDB%') +PRINT('Please install Microsoft.ACE.OLEDB driver: 16 - https://www.microsoft.com/en-us/download/details.aspx?id=54920 or 12 - https://www.microsoft.com/en-US/download/details.aspx?id=13255'); +ELSE PRINT('Microsoft.ACE.OLEDB is installed. Go next.'); + +IF (SELECT "value" FROM sys.configurations WHERE "name" = 'Ad Hoc Distributed Queries') <> 1 +BEGIN + EXEC sp_configure 'show advanced option', '1'; + RECONFIGURE; + EXEC sp_configure 'Ad Hoc Distributed Queries', 1; + RECONFIGURE; +END; + +EXEC master.[sys].[sp_MSset_oledb_prop] N'Microsoft.ACE.OLEDB.16.0', N'AllowInProcess', 0; + +SELECT * + FROM OPENROWSET( + 'Microsoft.ACE.OLEDB.16.0' + , 'Excel 12.0;Database=g:\MSSQL17\Instagram_Statistics.xlsx' + , 'SELECT * FROM [decoupagpro$]') AS op; diff --git a/Scripts/Wait_Statistics.sql b/Scripts/Wait_Statistics.sql index 671aff84..bd24871c 100644 --- a/Scripts/Wait_Statistics.sql +++ b/Scripts/Wait_Statistics.sql @@ -1,8 +1,13 @@ /* -Author: Paul Randal -Original link: https://www.sqlskills.com/blogs/paul/wait-statistics-or-please-tell-me-where-it-hurts/ -Created Date: 2010-12-09 -Modified Date: 2018-06-13 + + Generate complex query plan + Reads and writes per database. + 2010-12-09 by Paul Randal + 2019-02-26 by Paul Randal + 1.1 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Wait_Statistics.sql + https://www.sqlskills.com/blogs/paul/wait-statistics-or-please-tell-me-where-it-hurts/ + */ WITH [Waits] AS @@ -62,6 +67,7 @@ WITH [Waits] AS N'PARALLEL_REDO_TRAN_LIST', -- https://www.sqlskills.com/help/waits/PARALLEL_REDO_TRAN_LIST N'PARALLEL_REDO_WORKER_SYNC', -- https://www.sqlskills.com/help/waits/PARALLEL_REDO_WORKER_SYNC N'PARALLEL_REDO_WORKER_WAIT_WORK', -- https://www.sqlskills.com/help/waits/PARALLEL_REDO_WORKER_WAIT_WORK + N'PREEMPTIVE_OS_FLUSHFILEBUFFERS', -- https://www.sqlskills.com/help/waits/PREEMPTIVE_OS_FLUSHFILEBUFFERS N'PREEMPTIVE_XE_GETTARGETSTATE', -- https://www.sqlskills.com/help/waits/PREEMPTIVE_XE_GETTARGETSTATE N'PWAIT_ALL_COMPONENTS_INITIALIZED', -- https://www.sqlskills.com/help/waits/PWAIT_ALL_COMPONENTS_INITIALIZED N'PWAIT_DIRECTLOGCONSUMER_GETNEXT', -- https://www.sqlskills.com/help/waits/PWAIT_DIRECTLOGCONSUMER_GETNEXT @@ -85,10 +91,12 @@ WITH [Waits] AS N'SLEEP_TASK', -- https://www.sqlskills.com/help/waits/SLEEP_TASK N'SLEEP_TEMPDBSTARTUP', -- https://www.sqlskills.com/help/waits/SLEEP_TEMPDBSTARTUP N'SNI_HTTP_ACCEPT', -- https://www.sqlskills.com/help/waits/SNI_HTTP_ACCEPT + N'SOS_WORK_DISPATCHER', -- https://www.sqlskills.com/help/waits/SOS_WORK_DISPATCHER N'SP_SERVER_DIAGNOSTICS_SLEEP', -- https://www.sqlskills.com/help/waits/SP_SERVER_DIAGNOSTICS_SLEEP N'SQLTRACE_BUFFER_FLUSH', -- https://www.sqlskills.com/help/waits/SQLTRACE_BUFFER_FLUSH N'SQLTRACE_INCREMENTAL_FLUSH_SLEEP', -- https://www.sqlskills.com/help/waits/SQLTRACE_INCREMENTAL_FLUSH_SLEEP N'SQLTRACE_WAIT_ENTRIES', -- https://www.sqlskills.com/help/waits/SQLTRACE_WAIT_ENTRIES + N'VDI_CLIENT_OTHER', -- https://www.sqlskills.com/help/waits/VDI_CLIENT_OTHER N'WAIT_FOR_RESULTS', -- https://www.sqlskills.com/help/waits/WAIT_FOR_RESULTS N'WAITFOR', -- https://www.sqlskills.com/help/waits/WAITFOR N'WAITFOR_TASKSHUTDOWN', -- https://www.sqlskills.com/help/waits/WAITFOR_TASKSHUTDOWN @@ -117,4 +125,4 @@ FROM [Waits] AS [W1] INNER JOIN [Waits] AS [W2] ON [W2].[RowNum] <= [W1].[RowNum] GROUP BY [W1].[RowNum] HAVING SUM ([W2].[Percentage]) - MAX( [W1].[Percentage] ) < 95; -- percentage threshold -GO \ No newline at end of file +GO diff --git a/Scripts/Wait_Statistics_Snapshot.sql b/Scripts/Wait_Statistics_Snapshot.sql new file mode 100644 index 00000000..a03f8006 --- /dev/null +++ b/Scripts/Wait_Statistics_Snapshot.sql @@ -0,0 +1,74 @@ +/* + + Generate complex query plan + Reads and writes per database. + 2010-12-09 by Paul Randal + 2019-02-26 by Paul Randal + 1.1 + https://github.com/ktaranov/sqlserver-kit/blob/master/Scripts/Wait_Statistics_Snapshot.sql + https://www.sqlskills.com/blogs/paul/wait-statistics-or-please-tell-me-where-it-hurts/ + + + File: WaitingTasks.sql + + Summary: Snapshot of waiting tasks + + SQL Server Versions: 2005 onward +------------------------------------------------------------------------------ + Written by Paul S. Randal, SQLskills.com + + (c) 2019, SQLskills.com. All rights reserved. + + For more scripts and sample code, check out + http://www.SQLskills.com + + You may alter this code for your own *non-commercial* purposes. You may + republish altered code as long as you include this copyright and give due + credit, but you must obtain prior permission before blogging this code. + + THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF + ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED + TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A + PARTICULAR PURPOSE. +*/ + +SELECT + [owt].[session_id] AS [SPID], + [owt].[exec_context_id] AS [Thread], + [ot].[scheduler_id] AS [Scheduler], + [owt].[wait_duration_ms] AS [wait_ms], + [owt].[wait_type], + [owt].[blocking_session_id] AS [Blocking SPID], + [owt].[resource_description], + CASE [owt].[wait_type] + WHEN N'CXPACKET' THEN + SUBSTRING ( -- earlier versions don't have anything after the nodeID... + [owt].[resource_description], + CHARINDEX (N'nodeId=', [owt].[resource_description]) + 7, + CHARINDEX (N' tid=', [owt].[resource_description] + ' tid=') - + CHARINDEX (N'nodeId=', [owt].[resource_description]) - 7 + ) + ELSE NULL + END AS [Node ID], + [eqmg].[dop] AS [DOP], + [er].[database_id] AS [DBID], + CAST ('https://www.sqlskills.com/help/waits/' + [owt].[wait_type] as XML) AS [Help/Info URL], + [eqp].[query_plan], + [est].text +FROM sys.dm_os_waiting_tasks [owt] +INNER JOIN sys.dm_os_tasks [ot] ON + [owt].[waiting_task_address] = [ot].[task_address] +INNER JOIN sys.dm_exec_sessions [es] ON + [owt].[session_id] = [es].[session_id] +INNER JOIN sys.dm_exec_requests [er] ON + [es].[session_id] = [er].[session_id] +FULL JOIN sys.dm_exec_query_memory_grants [eqmg] ON + [owt].[session_id] = [eqmg].[session_id] +OUTER APPLY sys.dm_exec_sql_text ([er].[sql_handle]) [est] +OUTER APPLY sys.dm_exec_query_plan ([er].[plan_handle]) [eqp] +WHERE + [es].[is_user_process] = 1 +ORDER BY + [owt].[session_id], + [owt].[exec_context_id]; +GO diff --git a/Scripts/glen_berry_diagnostic_queries_links.txt b/Scripts/glen_berry_diagnostic_queries_links.txt new file mode 100644 index 00000000..61ed9804 --- /dev/null +++ b/Scripts/glen_berry_diagnostic_queries_links.txt @@ -0,0 +1,9 @@ +https://www.dropbox.com/s/k1vauzxxhyh1fnb/SQL%20Server%202019%20Diagnostic%20Information%20Queries.sql?dl=1 +https://www.dropbox.com/s/3ix2lqhry34c5wy/SQL%20Server%202017%20Diagnostic%20Information%20Queries.sql?dl=1 +https://www.dropbox.com/s/pkpxihdkq3odgbj/SQL%20Server%202016%20SP2%20Diagnostic%20Information%20Queries.sql?dl=1 +https://www.dropbox.com/s/w6gi8j76k64fgbg/SQL%20Server%202016%20SP1%20Diagnostic%20Information%20Queries.sql?dl=1 +https://www.dropbox.com/s/uttp0843e5078vs/SQL%20Server%202014%20Diagnostic%20Information%20Queries.sql?dl=1 +https://www.dropbox.com/s/3l4yotzedk45xeh/SQL%20Server%202012%20Diagnostic%20Information%20Queries.sql?dl=1 +https://www.dropbox.com/s/fq6hyw899fe3crv/SQL%20Server%202008%20R2%20Diagnostic%20Information%20Queries.sql?dl=1 +https://www.dropbox.com/s/mjxw1w9tgw7eo6g/SQL%20Server%202008%20Diagnostic%20Information%20Queries.sql?dl=1 +https://www.dropbox.com/s/3kkskuheyzauih9/SQL%20Server%202005%20Diagnostic%20Information%20Queries.sql?dl=1 diff --git a/Scripts/mssql2csv.R b/Scripts/mssql2csv.R new file mode 100644 index 00000000..229945d3 --- /dev/null +++ b/Scripts/mssql2csv.R @@ -0,0 +1,118 @@ +options(stringsAsFactors = FALSE) + +library("data.table") +library("RODBC") +library("logging") + +loggerName <- "mmssql2csv" +addHandler(writeToConsole, logger = loggerName) + +loginfo(msg = "Start", logger = loggerName) + +rodbcSQLQeuryToDF <- function(connectionString, sqlQuery) { + ch <- odbcDriverConnect(connection = connectionString) + df <- sqlQuery(ch, sqlQuery, errors = TRUE) + odbcClose(ch) + return(as.data.table(df)) +} + +outputFolder <- "e:/333/" +numberOfProcess <- as.integer(Sys.getenv("NUMBER_OF_PROCESSORS")) +connectionString <- + "Driver=ODBC Driver 11 for SQL Server;Server=.;Database=NIIGAZ;Uid=asp_niigaz;pwd=;" + +pass <- readline(prompt = "Enter a SQL Server user password: ") + +connectionString <- + gsub("pwd=", paste0("pwd=", pass), connectionString) + + +listTables <- rodbcSQLQeuryToDF( + connectionString = connectionString, + sqlQuery = " + WITH TablePages AS ( + SELECT s.[object_id] + , SUM(s.reserved_page_count) AS reserved_pages + , SUM(s.used_page_count) AS used_pages + , SUM(CASE WHEN index_id < 2 THEN in_row_data_page_count + lob_used_page_count + row_overflow_used_page_count + ELSE lob_used_page_count + row_overflow_used_page_count + END) AS pages + , (SELECT COUNT(i.[object_id]) FROM sys.indexes AS i WHERE s.[object_id] = i.[object_id] AND i.[type] <> 0) AS IndexCount + , SUM(row_count) AS NumberOfRows + FROM sys.dm_db_partition_stats AS s + GROUP BY [object_id] + ) + , ExtraData AS ( + SELECT p.[object_id] + , COUNT(*) AS IndexCount + , SUM(reserved_page_count) AS reserved_pages + , SUM(used_page_count) AS used_pages + FROM sys.dm_db_partition_stats AS p + LEFT JOIN sys.internal_tables AS it ON p.[object_id] = it.[object_id] + WHERE it.internal_type IN (202, 204, 211, 212, 213, 214, 215, 216) + GROUP BY p.[object_id] + ) + SELECT --TOP(50) + p.[object_id] + , OBJECT_SCHEMA_NAME(p.[object_id]) AS ShemaName + , OBJECT_NAME(p.[object_id]) AS TableName + , QUOTENAME(OBJECT_SCHEMA_NAME(p.[object_id])) + N'.' + QUOTENAME(OBJECT_NAME(p.[object_id])) AS FullTableName + , p.NumberOfRows + , (p.reserved_pages + ISNULL(e.reserved_pages, 0)) * 8 AS ReservedKb + , p.pages * 8 AS DataKb + , p.IndexCount + , CASE WHEN p.IndexCount <> 0 AND p.used_pages + ISNULL(e.used_pages, 0) >= p.pages + THEN p.used_pages + ISNULL(e.used_pages, 0) - p.pages + ELSE 0 + END * 8 AS IndexAllKb + , CASE WHEN p.reserved_pages + ISNULL(e.reserved_pages, 0) > p.used_pages + ISNULL(e.used_pages, 0) + THEN p.reserved_pages + ISNULL(e.reserved_pages, 0) - p.used_pages + ISNULL(e.used_pages, 0) + ELSE 0 + END * 8 AS UnusedKb + FROM TablePages AS p + LEFT JOIN ExtraData AS e ON p.[object_id] = e.[object_id] + WHERE OBJECT_SCHEMA_NAME(p.[object_id]) <> 'sys' AND p.pages > 0 + ORDER BY DataKb ASC; + " + ) + +# GRANT VIEW DATABASE STATE TO asp_niigaz; + +for (n in listTables$FullTableName) { + tryCatch({ + loginfo(msg = paste0("Start reading: ", n)) + + dt <- rodbcSQLQeuryToDF( + connectionString = connectionString, + sqlQuery = + paste0("SELECT * FROM ", n, ";") + ) + + loginfo(msg = paste0("End reading: ", n)) + + fwrite(x = dt, file = paste0(outputFolder, n, ".csv")) + + }, + error = function(e) + logerror(paste(e, + n, + sep = "\t"), logger = loggerName), + finally = next) + +} + + +# Remove password, connection string and latest largest data.table object #### +rm(dt, pass, connectionString) +gc() + + +# Compare number of files with number of tables #### +csvFiles <- as.data.table(list.files(path = outputFolder, pattern = "*.csv")) +setnames(csvFiles, c("V1"), c("FullTableName")) +csvFiles[, FullTableName := gsub(".csv", "", FullTableName)] + +print("List of tables not exported from SQL Server:") +print(fsetdiff(listTables[, "FullTableName"], csvFiles)) + +loginfo(msg = "End", logger = loggerName) diff --git a/Stored_Procedure/Recover_Deleted_Data_Proc.sql b/Stored_Procedure/Recover_Deleted_Data_Proc.sql new file mode 100644 index 00000000..6ca21da0 --- /dev/null +++ b/Stored_Procedure/Recover_Deleted_Data_Proc.sql @@ -0,0 +1,708 @@ +-- Script Name: Recover_Deleted_Data_Proc +-- Script Type : Recovery Procedure +-- Develop By: Muhammad Imran +-- Date Created: 15 Oct 2011 +-- Modify Date: 22 Aug 2012 +-- Version : 3.1 +-- Notes : Included BLOB data types for recovery.& Compatibile with Default , CS collation , Arabic_CI_AS. + +--DROP PROCEDURE Recover_Deleted_Data_Proc +--GO +Create PROCEDURE Recover_Deleted_Data_Proc +@Database_Name NVARCHAR(MAX), +@SchemaName_n_TableName NVARCHAR(Max), +@Date_From DATETIME='1900/01/01', +@Date_To DATETIME ='9999/12/31' +AS + +DECLARE @RowLogContents VARBINARY(8000) +DECLARE @TransactionID NVARCHAR(Max) +DECLARE @AllocUnitID BIGINT +DECLARE @AllocUnitName NVARCHAR(Max) +DECLARE @SQL NVARCHAR(Max) +DECLARE @Compatibility_Level INT + + +SELECT @Compatibility_Level=dtb.compatibility_level +FROM +master.sys.databases AS dtb WHERE dtb.name=@Database_Name + +IF ISNULL(@Compatibility_Level,0)<=80 +BEGIN + RAISERROR('The compatibility level should be equal to or greater SQL SERVER 2005 (90)',16,1) + RETURN +END + +IF (SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE [TABLE_SCHEMA]+'.'+[TABLE_NAME]=@SchemaName_n_TableName)=0 +BEGIN + RAISERROR('Could not found the table in the defined database',16,1) + RETURN +END + +DECLARE @bitTable TABLE +( + [ID] INT, + [Bitvalue] INT +) +--Create table to set the bit position of one byte. + +INSERT INTO @bitTable +SELECT 0,2 UNION ALL +SELECT 1,2 UNION ALL +SELECT 2,4 UNION ALL +SELECT 3,8 UNION ALL +SELECT 4,16 UNION ALL +SELECT 5,32 UNION ALL +SELECT 6,64 UNION ALL +SELECT 7,128 + +--Create table to collect the row data. +DECLARE @DeletedRecords TABLE +( + [Row ID] INT IDENTITY(1,1), + [RowLogContents] VARBINARY(8000), + [AllocUnitID] BIGINT, + [Transaction ID] NVARCHAR(Max), + [FixedLengthData] SMALLINT, + [TotalNoOfCols] SMALLINT, + [NullBitMapLength] SMALLINT, + [NullBytes] VARBINARY(8000), + [TotalNoofVarCols] SMALLINT, + [ColumnOffsetArray] VARBINARY(8000), + [VarColumnStart] SMALLINT, + [Slot ID] INT, + [NullBitMap] VARCHAR(MAX) + +) +--Create a common table expression to get all the row data plus how many bytes we have for each row. +;WITH RowData AS ( +SELECT + +[RowLog Contents 0] AS [RowLogContents] + +,[AllocUnitID] AS [AllocUnitID] + +,[Transaction ID] AS [Transaction ID] + +--[Fixed Length Data] = Substring (RowLog content 0, Status Bit A+ Status Bit B + 1,2 bytes) +,CONVERT(SMALLINT, CONVERT(BINARY(2), REVERSE(SUBSTRING([RowLog Contents 0], 2 + 1, 2)))) AS [FixedLengthData] --@FixedLengthData + +-- [TotalnoOfCols] = Substring (RowLog content 0, [Fixed Length Data] + 1,2 bytes) +,CONVERT(INT, CONVERT(BINARY(2), REVERSE(SUBSTRING([RowLog Contents 0], CONVERT(SMALLINT, CONVERT(BINARY(2) +,REVERSE(SUBSTRING([RowLog Contents 0], 2 + 1, 2)))) + 1, 2)))) as [TotalNoOfCols] + +--[NullBitMapLength]=ceiling([Total No of Columns] /8.0) +,CONVERT(INT, ceiling(CONVERT(INT, CONVERT(BINARY(2), REVERSE(SUBSTRING([RowLog Contents 0], CONVERT(SMALLINT, CONVERT(BINARY(2) +,REVERSE(SUBSTRING([RowLog Contents 0], 2 + 1, 2)))) + 1, 2))))/8.0)) as [NullBitMapLength] + +--[Null Bytes] = Substring (RowLog content 0, Status Bit A+ Status Bit B + [Fixed Length Data] +1, [NullBitMapLength] ) +,SUBSTRING([RowLog Contents 0], CONVERT(SMALLINT, CONVERT(BINARY(2), REVERSE(SUBSTRING([RowLog Contents 0], 2 + 1, 2)))) + 3, +CONVERT(INT, ceiling(CONVERT(INT, CONVERT(BINARY(2), REVERSE(SUBSTRING([RowLog Contents 0], CONVERT(SMALLINT, CONVERT(BINARY(2) +,REVERSE(SUBSTRING([RowLog Contents 0], 2 + 1, 2)))) + 1, 2))))/8.0))) as [NullBytes] + +--[TotalNoofVarCols] = Substring (RowLog content 0, Status Bit A+ Status Bit B + [Fixed Length Data] +1, [Null Bitmap length] + 2 ) +,(CASE WHEN SUBSTRING([RowLog Contents 0], 1, 1) In (0x10,0x30,0x70) THEN +CONVERT(INT, CONVERT(BINARY(2), REVERSE(SUBSTRING([RowLog Contents 0], +CONVERT(SMALLINT, CONVERT(BINARY(2), REVERSE(SUBSTRING([RowLog Contents 0], 2 + 1, 2)))) + 3 ++ CONVERT(INT, ceiling(CONVERT(INT, CONVERT(BINARY(2), REVERSE(SUBSTRING([RowLog Contents 0], CONVERT(SMALLINT, CONVERT(BINARY(2) +,REVERSE(SUBSTRING([RowLog Contents 0], 2 + 1, 2)))) + 1, 2))))/8.0)), 2)))) ELSE null END) AS [TotalNoofVarCols] + +--[ColumnOffsetArray]= Substring (RowLog content 0, Status Bit A+ Status Bit B + [Fixed Length Data] +1, [Null Bitmap length] + 2 , [TotalNoofVarCols]*2 ) +,(CASE WHEN SUBSTRING([RowLog Contents 0], 1, 1) In (0x10,0x30,0x70) THEN +SUBSTRING([RowLog Contents 0] +, CONVERT(SMALLINT, CONVERT(BINARY(2), REVERSE(SUBSTRING([RowLog Contents 0], 2 + 1, 2)))) + 3 ++ CONVERT(INT, ceiling(CONVERT(INT, CONVERT(BINARY(2), REVERSE(SUBSTRING([RowLog Contents 0], CONVERT(SMALLINT, CONVERT(BINARY(2) +,REVERSE(SUBSTRING([RowLog Contents 0], 2 + 1, 2)))) + 1, 2))))/8.0)) + 2 +, (CASE WHEN SUBSTRING([RowLog Contents 0], 1, 1) In (0x10,0x30,0x70) THEN +CONVERT(INT, CONVERT(BINARY(2), REVERSE(SUBSTRING([RowLog Contents 0], +CONVERT(SMALLINT, CONVERT(BINARY(2), REVERSE(SUBSTRING([RowLog Contents 0], 2 + 1, 2)))) + 3 ++ CONVERT(INT, ceiling(CONVERT(INT, CONVERT(BINARY(2), REVERSE(SUBSTRING([RowLog Contents 0], CONVERT(SMALLINT, CONVERT(BINARY(2) +,REVERSE(SUBSTRING([RowLog Contents 0], 2 + 1, 2)))) + 1, 2))))/8.0)), 2)))) ELSE null END) +* 2) ELSE null END) AS [ColumnOffsetArray] + +-- Variable column Start = Status Bit A+ Status Bit B + [Fixed Length Data] + [Null Bitmap length] + 2+([TotalNoofVarCols]*2) +,CASE WHEN SUBSTRING([RowLog Contents 0], 1, 1)In (0x10,0x30,0x70) +THEN ( +CONVERT(SMALLINT, CONVERT(BINARY(2), REVERSE(SUBSTRING([RowLog Contents 0], 2 + 1, 2)))) + 4 + ++ CONVERT(INT, ceiling(CONVERT(INT, CONVERT(BINARY(2), REVERSE(SUBSTRING([RowLog Contents 0], CONVERT(SMALLINT, CONVERT(BINARY(2) +,REVERSE(SUBSTRING([RowLog Contents 0], 2 + 1, 2)))) + 1, 2))))/8.0)) + ++ ((CASE WHEN SUBSTRING([RowLog Contents 0], 1, 1) In (0x10,0x30,0x70) THEN +CONVERT(INT, CONVERT(BINARY(2), REVERSE(SUBSTRING([RowLog Contents 0], +CONVERT(SMALLINT, CONVERT(BINARY(2), REVERSE(SUBSTRING([RowLog Contents 0], 2 + 1, 2)))) + 3 ++ CONVERT(INT, ceiling(CONVERT(INT, CONVERT(BINARY(2), REVERSE(SUBSTRING([RowLog Contents 0], CONVERT(SMALLINT, CONVERT(BINARY(2) +,REVERSE(SUBSTRING([RowLog Contents 0], 2 + 1, 2)))) + 1, 2))))/8.0)), 2)))) ELSE null END) * 2)) + +ELSE null End AS [VarColumnStart] +,[Slot ID] +FROM sys.fn_dblog(NULL, NULL) +WHERE +AllocUnitId IN +(SELECT [Allocation_unit_id] FROM sys.allocation_units allocunits +INNER JOIN sys.partitions partitions ON (allocunits.type IN (1, 3) +AND partitions.hobt_id = allocunits.container_id) OR (allocunits.type = 2 +AND partitions.partition_id = allocunits.container_id) +WHERE object_id=object_ID('' + @SchemaName_n_TableName + '')) + +AND Context IN ('LCX_MARK_AS_GHOST', 'LCX_HEAP') AND Operation in ('LOP_DELETE_ROWS') +And SUBSTRING([RowLog Contents 0], 1, 1)In (0x10,0x30,0x70) + +/*Use this subquery to filter the date*/ +AND [TRANSACTION ID] IN (SELECT DISTINCT [TRANSACTION ID] FROM sys.fn_dblog(NULL, NULL) +WHERE Context IN ('LCX_NULL') AND Operation in ('LOP_BEGIN_XACT') +And [Transaction Name] In ('DELETE','user_transaction') +And CONVERT(NVARCHAR(11),[Begin Time]) BETWEEN @Date_From AND @Date_To)), + +--Use this technique to repeate the row till the no of bytes of the row. +N1 (n) AS (SELECT 1 UNION ALL SELECT 1), +N2 (n) AS (SELECT 1 FROM N1 AS X, N1 AS Y), +N3 (n) AS (SELECT 1 FROM N2 AS X, N2 AS Y), +N4 (n) AS (SELECT ROW_NUMBER() OVER(ORDER BY X.n) + FROM N3 AS X, N3 AS Y) + + + +INSERT INTO @DeletedRecords +SELECT RowLogContents + ,[AllocUnitID] + ,[Transaction ID] + ,[FixedLengthData] + ,[TotalNoOfCols] + ,[NullBitMapLength] + ,[NullBytes] + ,[TotalNoofVarCols] + ,[ColumnOffsetArray] + ,[VarColumnStart] + ,[Slot ID] + ---Get the Null value against each column (1 means null zero means not null) + ,[NullBitMap]=(REPLACE(STUFF((SELECT ',' + + (CASE WHEN [ID]=0 THEN CONVERT(NVARCHAR(1),(SUBSTRING(NullBytes, n, 1) % 2)) ELSE CONVERT(NVARCHAR(1),((SUBSTRING(NullBytes, n, 1) / [Bitvalue]) % 2)) END) --as [nullBitMap] + +FROM +N4 AS Nums +Join RowData AS C ON n<=NullBitMapLength +Cross Join @bitTable WHERE C.[RowLogContents]=D.[RowLogContents] ORDER BY [RowLogContents],n ASC FOR XML PATH('')),1,1,''),',','')) +FROM RowData D + +IF (SELECT COUNT(*) FROM @DeletedRecords)=0 +BEGIN + RAISERROR('There is no data in the log as per the search criteria',16,1) + RETURN +END + +DECLARE @ColumnNameAndData TABLE +( + [Row ID] int, + [Rowlogcontents] varbinary(Max), + [NAME] sysname, + [nullbit] smallint, + [leaf_offset] smallint, + [length] smallint, + [system_type_id] tinyint, + [bitpos] tinyint, + [xprec] tinyint, + [xscale] tinyint, + [is_null] int, + [Column value Size]int, + [Column Length] int, + [hex_Value] varbinary(max), + [Slot ID] int, + [Update] int +) + +--Create common table expression and join it with the rowdata table +-- to get each column details +/*This part is for variable data columns*/ +--@RowLogContents, +--(col.columnOffValue - col.columnLength) + 1, +--col.columnLength +--) +INSERT INTO @ColumnNameAndData +SELECT +[Row ID], +Rowlogcontents, +NAME , +cols.leaf_null_bit AS nullbit, +leaf_offset, +ISNULL(syscolumns.length, cols.max_length) AS [length], +cols.system_type_id, +cols.leaf_bit_position AS bitpos, +ISNULL(syscolumns.xprec, cols.precision) AS xprec, +ISNULL(syscolumns.xscale, cols.scale) AS xscale, +SUBSTRING([nullBitMap], cols.leaf_null_bit, 1) AS is_null, +(CASE WHEN leaf_offset<1 and SUBSTRING([nullBitMap], cols.leaf_null_bit, 1)=0 +THEN +(Case When CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) >30000 +THEN +CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) - POWER(2, 15) +ELSE +CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) +END) +END) AS [Column value Size], + +(CASE WHEN leaf_offset<1 and SUBSTRING([nullBitMap], cols.leaf_null_bit, 1)=0 THEN +(Case + +When CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) >30000 And +ISNULL(NULLIF(CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * ((leaf_offset*-1) - 1)) - 1, 2)))), 0), [varColumnStart])<30000 +THEN (Case When [System_type_id]In (35,34,99) Then 16 else 24 end) + +When CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) >30000 And +ISNULL(NULLIF(CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * ((leaf_offset*-1) - 1)) - 1, 2)))), 0), [varColumnStart])>30000 +THEN (Case When [System_type_id]In (35,34,99) Then 16 else 24 end) --24 + +When CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) <30000 And +ISNULL(NULLIF(CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * ((leaf_offset*-1) - 1)) - 1, 2)))), 0), [varColumnStart])<30000 +THEN (CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) +- ISNULL(NULLIF(CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * ((leaf_offset*-1) - 1)) - 1, 2)))), 0), [varColumnStart])) + +When CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) <30000 And +ISNULL(NULLIF(CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * ((leaf_offset*-1) - 1)) - 1, 2)))), 0), [varColumnStart])>30000 + +THEN POWER(2, 15) +CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) +- ISNULL(NULLIF(CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * ((leaf_offset*-1) - 1)) - 1, 2)))), 0), [varColumnStart]) + +END) + +END) AS [Column Length] + +,(CASE WHEN SUBSTRING([nullBitMap], cols.leaf_null_bit, 1)=1 THEN NULL ELSE + SUBSTRING + ( + Rowlogcontents, + ( + +(Case When CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) >30000 +THEN +CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) - POWER(2, 15) +ELSE +CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) +END) + + - +(Case When CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) >30000 And +ISNULL(NULLIF(CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * ((leaf_offset*-1) - 1)) - 1, 2)))), 0), [varColumnStart])<30000 + +THEN (Case When [System_type_id]In (35,34,99) Then 16 else 24 end) --24 +When CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) >30000 And +ISNULL(NULLIF(CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * ((leaf_offset*-1) - 1)) - 1, 2)))), 0), [varColumnStart])>30000 + +THEN (Case When [System_type_id]In (35,34,99) Then 16 else 24 end) --24 +When CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) <30000 And +ISNULL(NULLIF(CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * ((leaf_offset*-1) - 1)) - 1, 2)))), 0), [varColumnStart])<30000 + +THEN CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) +- ISNULL(NULLIF(CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * ((leaf_offset*-1) - 1)) - 1, 2)))), 0), [varColumnStart]) + +When CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) <30000 And +ISNULL(NULLIF(CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * ((leaf_offset*-1) - 1)) - 1, 2)))), 0), [varColumnStart])>30000 + +THEN POWER(2, 15) +CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) +- ISNULL(NULLIF(CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * ((leaf_offset*-1) - 1)) - 1, 2)))), 0), [varColumnStart]) + +END) + +) + 1, +(Case When CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) >30000 And +ISNULL(NULLIF(CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * ((leaf_offset*-1) - 1)) - 1, 2)))), 0), [varColumnStart])<30000 + +THEN (Case When [System_type_id] In (35,34,99) Then 16 else 24 end) --24 +When CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) >30000 And +ISNULL(NULLIF(CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * ((leaf_offset*-1) - 1)) - 1, 2)))), 0), [varColumnStart])>30000 + +THEN (Case When [System_type_id] In (35,34,99) Then 16 else 24 end) --24 +When CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) <30000 And +ISNULL(NULLIF(CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * ((leaf_offset*-1) - 1)) - 1, 2)))), 0), [varColumnStart])<30000 + +THEN ABS(CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) +- ISNULL(NULLIF(CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * ((leaf_offset*-1) - 1)) - 1, 2)))), 0), [varColumnStart])) + +When CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) <30000 And +ISNULL(NULLIF(CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * ((leaf_offset*-1) - 1)) - 1, 2)))), 0), [varColumnStart])>30000 + +THEN POWER(2, 15) +CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * leaf_offset*-1) - 1, 2)))) +- ISNULL(NULLIF(CONVERT(INT, CONVERT(BINARY(2), REVERSE (SUBSTRING ([ColumnOffsetArray], (2 * ((leaf_offset*-1) - 1)) - 1, 2)))), 0), [varColumnStart]) + +END) +) + +END) AS hex_Value +,[Slot ID] +,0 +FROM @DeletedRecords A +Inner Join sys.allocation_units allocunits On A.[AllocUnitId]=allocunits.[Allocation_Unit_Id] +INNER JOIN sys.partitions partitions ON (allocunits.type IN (1, 3) +AND partitions.hobt_id = allocunits.container_id) OR (allocunits.type = 2 AND partitions.partition_id = allocunits.container_id) +INNER JOIN sys.system_internals_partition_columns cols ON cols.partition_id = partitions.partition_id +LEFT OUTER JOIN syscolumns ON syscolumns.id = partitions.object_id AND syscolumns.colid = cols.partition_column_id +WHERE leaf_offset<0 +UNION +/*This part is for fixed data columns*/ +SELECT +[Row ID], +Rowlogcontents, +NAME , +cols.leaf_null_bit AS nullbit, +leaf_offset, +ISNULL(syscolumns.length, cols.max_length) AS [length], +cols.system_type_id, +cols.leaf_bit_position AS bitpos, +ISNULL(syscolumns.xprec, cols.precision) AS xprec, +ISNULL(syscolumns.xscale, cols.scale) AS xscale, +SUBSTRING([nullBitMap], cols.leaf_null_bit, 1) AS is_null, +(SELECT TOP 1 ISNULL(SUM(CASE WHEN C.leaf_offset >1 THEN max_length ELSE 0 END),0) FROM +sys.system_internals_partition_columns C WHERE cols.partition_id =C.partition_id And C.leaf_null_bit1 And C.leaf_bit_position=0 THEN max_length ELSE 0 END),0) FROM +sys.system_internals_partition_columns C where cols.partition_id =C.partition_id And C.leaf_null_bit0 +Order By nullbit + +Declare @BitColumnByte as int +Select @BitColumnByte=CONVERT(INT, ceiling( Count(*)/8.0)) from @ColumnNameAndData Where [System_Type_id]=104 + +;With N1 (n) AS (SELECT 1 UNION ALL SELECT 1), +N2 (n) AS (SELECT 1 FROM N1 AS X, N1 AS Y), +N3 (n) AS (SELECT 1 FROM N2 AS X, N2 AS Y), +N4 (n) AS (SELECT ROW_NUMBER() OVER(ORDER BY X.n) + FROM N3 AS X, N3 AS Y), +CTE As( +Select RowLogContents,[nullbit] + ,[BitMap]=Convert(varbinary(1),Convert(int,Substring((REPLACE(STUFF((SELECT ',' + + (CASE WHEN [ID]=0 THEN CONVERT(NVARCHAR(1),(SUBSTRING(hex_Value, n, 1) % 2)) ELSE CONVERT(NVARCHAR(1),((SUBSTRING(hex_Value, n, 1) / [Bitvalue]) % 2)) END) --as [nullBitMap] + +from N4 AS Nums +Join @ColumnNameAndData AS C ON n<=@BitColumnByte And [System_Type_id]=104 And bitpos=0 +Cross Join @bitTable WHERE C.[RowLogContents]=D.[RowLogContents] ORDER BY [RowLogContents],n ASC FOR XML PATH('')),1,1,''),',','')),bitpos+1,1))) +FROM @ColumnNameAndData D Where [System_Type_id]=104) + +Update A Set [hex_Value]=[BitMap] +from @ColumnNameAndData A +Inner Join CTE B On A.[RowLogContents]=B.[RowLogContents] +And A.[nullbit]=B.[nullbit] + + +/**************Check for BLOB DATA TYPES******************************/ +DECLARE @Fileid INT +DECLARE @Pageid INT +DECLARE @Slotid INT +DECLARE @CurrentLSN INT +DECLARE @LinkID INT +DECLARE @Context VARCHAR(50) +DECLARE @ConsolidatedPageID VARCHAR(MAX) +DECLARE @LCX_TEXT_MIX VARBINARY(MAX) + +declare @temppagedata table +( +[ParentObject] sysname, +[Object] sysname, +[Field] sysname, +[Value] sysname) + +declare @pagedata table +( +[Page ID] sysname, +[File IDS] int, +[Page IDS] int, +[AllocUnitId] bigint, +[ParentObject] sysname, +[Object] sysname, +[Field] sysname, +[Value] sysname) + +DECLARE @ModifiedRawData TABLE +( + [ID] INT IDENTITY(1,1), + [PAGE ID] VARCHAR(MAX), + [FILE IDS] INT, + [PAGE IDS] INT, + [Slot ID] INT, + [AllocUnitId] BIGINT, + [RowLog Contents 0_var] VARCHAR(Max), + [RowLog Length] VARCHAR(50), + [RowLog Len] INT, + [RowLog Contents 0] VARBINARY(Max), + [Link ID] INT default (0), + [Update] INT +) + + DECLARE Page_Data_Cursor CURSOR FOR + /*We need to filter LOP_MODIFY_ROW,LOP_MODIFY_COLUMNS from log for deleted records of BLOB data type& Get its Slot No, Page ID & AllocUnit ID*/ + SELECT LTRIM(RTRIM(Replace([Description],'Deallocated',''))) AS [PAGE ID] + ,[Slot ID],[AllocUnitId],NULL AS [RowLog Contents 0],NULL AS [RowLog Contents 0],Context + FROM sys.fn_dblog(NULL, NULL) + WHERE + AllocUnitId IN + (SELECT [Allocation_unit_id] FROM sys.allocation_units allocunits + INNER JOIN sys.partitions partitions ON (allocunits.type IN (1, 3) + AND partitions.hobt_id = allocunits.container_id) OR (allocunits.type = 2 + AND partitions.partition_id = allocunits.container_id) + WHERE object_id=object_ID('' + @SchemaName_n_TableName + '')) + AND Operation IN ('LOP_MODIFY_ROW') AND [Context] IN ('LCX_PFS') + AND Description Like '%Deallocated%' + /*Use this subquery to filter the date*/ + AND [TRANSACTION ID] IN (SELECT DISTINCT [TRANSACTION ID] FROM sys.fn_dblog(NULL, NULL) + WHERE Context IN ('LCX_NULL') AND Operation in ('LOP_BEGIN_XACT') + AND [Transaction Name]='DELETE' + AND CONVERT(NVARCHAR(11),[Begin Time]) BETWEEN @Date_From AND @Date_To) + GROUP BY [Description],[Slot ID],[AllocUnitId],Context + + UNION + + SELECT [PAGE ID],[Slot ID],[AllocUnitId] + ,Substring([RowLog Contents 0],15,LEN([RowLog Contents 0])) AS [RowLog Contents 0] + ,CONVERT(INT,Substring([RowLog Contents 0],7,2)),Context --,CAST(RIGHT([Current LSN],4) AS INT) AS [Current LSN] + FROM sys.fn_dblog(NULL, NULL) + WHERE + AllocUnitId IN + (SELECT [Allocation_unit_id] FROM sys.allocation_units allocunits + INNER JOIN sys.partitions partitions ON (allocunits.type IN (1, 3) + AND partitions.hobt_id = allocunits.container_id) OR (allocunits.type = 2 + AND partitions.partition_id = allocunits.container_id) + WHERE object_id=object_ID('' + @SchemaName_n_TableName + '')) + AND Context IN ('LCX_TEXT_MIX') AND Operation in ('LOP_DELETE_ROWS') + /*Use this subquery to filter the date*/ + AND [TRANSACTION ID] IN (SELECT DISTINCT [TRANSACTION ID] FROM sys.fn_dblog(NULL, NULL) + WHERE Context IN ('LCX_NULL') AND Operation in ('LOP_BEGIN_XACT') + And [Transaction Name]='DELETE' + And CONVERT(NVARCHAR(11),[Begin Time]) BETWEEN @Date_From AND @Date_To) + + /****************************************/ + + OPEN Page_Data_Cursor + + FETCH NEXT FROM Page_Data_Cursor INTO @ConsolidatedPageID, @Slotid,@AllocUnitID,@LCX_TEXT_MIX,@LinkID,@Context + + WHILE @@FETCH_STATUS = 0 + BEGIN + DECLARE @hex_pageid AS VARCHAR(Max) + /*Page ID contains File Number and page number It looks like 0001:00000130. + In this example 0001 is file Number & 00000130 is Page Number & These numbers are in Hex format*/ + SET @Fileid=SUBSTRING(@ConsolidatedPageID,0,CHARINDEX(':',@ConsolidatedPageID)) -- Seperate File ID from Page ID + + SET @hex_pageid ='0x'+ SUBSTRING(@ConsolidatedPageID,CHARINDEX(':',@ConsolidatedPageID)+1,Len(@ConsolidatedPageID)) ---Seperate the page ID + SELECT @Pageid=Convert(INT,cast('' AS XML).value('xs:hexBinary(substring(sql:variable("@hex_pageid"),sql:column("t.pos")) )', 'varbinary(max)')) -- Convert Page ID from hex to integer + FROM (SELECT CASE substring(@hex_pageid, 1, 2) WHEN '0x' THEN 3 ELSE 0 END) AS t(pos) + + IF @Context='LCX_PFS' + BEGIN + DELETE @temppagedata + INSERT INTO @temppagedata EXEC( 'DBCC PAGE(' + @DataBase_Name + ', ' + @fileid + ', ' + @pageid + ', 1) with tableresults,no_infomsgs;'); + INSERT INTO @pagedata SELECT @ConsolidatedPageID,@fileid,@pageid,@AllocUnitID,[ParentObject],[Object],[Field] ,[Value] FROM @temppagedata + END + ELSE IF @Context='LCX_TEXT_MIX' + BEGIN + INSERT INTO @ModifiedRawData SELECT @ConsolidatedPageID,@fileid,@pageid,@Slotid,@AllocUnitID,NULL,0,CONVERT(INT,CONVERT(VARBINARY,REVERSE(SUBSTRING(@LCX_TEXT_MIX,11,2)))),@LCX_TEXT_MIX,@LinkID,0 + END + FETCH NEXT FROM Page_Data_Cursor INTO @ConsolidatedPageID, @Slotid,@AllocUnitID,@LCX_TEXT_MIX,@LinkID,@Context + END + + CLOSE Page_Data_Cursor + DEALLOCATE Page_Data_Cursor + + DECLARE @Newhexstring VARCHAR(MAX); + + --The data is in multiple rows in the page, so we need to convert it into one row as a single hex value. + --This hex value is in string format + INSERT INTO @ModifiedRawData ([PAGE ID],[FILE IDS],[PAGE IDS],[Slot ID],[AllocUnitId] + ,[RowLog Contents 0_var] + , [RowLog Length]) + SELECT [Page ID],[FILE IDS],[PAGE IDS],Substring([ParentObject],CHARINDEX('Slot', [ParentObject])+4, (CHARINDEX('Offset', [ParentObject])-(CHARINDEX('Slot', [ParentObject])+4))-2 ) as [Slot ID] + ,[AllocUnitId] + ,Substring(( + SELECT + REPLACE(STUFF((SELECT REPLACE(SUBSTRING([Value],CHARINDEX(':',[Value])+1,CHARINDEX('',[Value])-CHARINDEX(':',[Value])),'','') + FROM @pagedata C WHERE B.[Page ID]= C.[Page ID] And Substring(B.[ParentObject],CHARINDEX('Slot', B.[ParentObject])+4, (CHARINDEX('Offset', B.[ParentObject])-(CHARINDEX('Slot', B.[ParentObject])+4)) )=Substring(C.[ParentObject],CHARINDEX('Slot', C.[ParentObject])+4, (CHARINDEX('Offset', C.[ParentObject])-(CHARINDEX('Slot', C.[ParentObject])+4)) ) And + [Object] Like '%Memory Dump%' Order By '0x'+ LEFT([Value],CHARINDEX(':',[Value])-1) + FOR XML PATH('') ),1,1,'') ,' ','') + ),1,20000) AS [Value] + + , + Substring(( + SELECT '0x' +REPLACE(STUFF((SELECT REPLACE(SUBSTRING([Value],CHARINDEX(':',[Value])+1,CHARINDEX('',[Value])-CHARINDEX(':',[Value])),'','') + FROM @pagedata C WHERE B.[Page ID]= C.[Page ID] And Substring(B.[ParentObject],CHARINDEX('Slot', B.[ParentObject])+4, (CHARINDEX('Offset', B.[ParentObject])-(CHARINDEX('Slot', B.[ParentObject])+4)) )=Substring(C.[ParentObject],CHARINDEX('Slot', C.[ParentObject])+4, (CHARINDEX('Offset', C.[ParentObject])-(CHARINDEX('Slot', C.[ParentObject])+4)) ) And + [Object] Like '%Memory Dump%' Order By '0x'+ LEFT([Value],CHARINDEX(':',[Value])-1) + FOR XML PATH('') ),1,1,'') ,' ','') + ),7,4) AS [Length] + + From @pagedata B + Where [Object] Like '%Memory Dump%' + Group By [Page ID],[FILE IDS],[PAGE IDS],[ParentObject],[AllocUnitId]--,[Current LSN] + Order By [Slot ID] + + UPDATE @ModifiedRawData SET [RowLog Len] = CONVERT(VARBINARY(8000),REVERSE(cast('' AS XML).value('xs:hexBinary(substring(sql:column("[RowLog Length]"),0))', 'varbinary(Max)'))) + FROM @ModifiedRawData Where [LINK ID]=0 + + UPDATE @ModifiedRawData SET [RowLog Contents 0] =cast('' AS XML).value('xs:hexBinary(substring(sql:column("[RowLog Contents 0_var]"),0))', 'varbinary(Max)') + FROM @ModifiedRawData Where [LINK ID]=0 + + Update B Set B.[RowLog Contents 0] = + (CASE WHEN A.[RowLog Contents 0] IS NOT NULL AND C.[RowLog Contents 0] IS NOT NULL THEN A.[RowLog Contents 0]+C.[RowLog Contents 0] + WHEN A.[RowLog Contents 0] IS NULL AND C.[RowLog Contents 0] IS NOT NULL THEN C.[RowLog Contents 0] + WHEN A.[RowLog Contents 0] IS NOT NULL AND C.[RowLog Contents 0] IS NULL THEN A.[RowLog Contents 0] + END) + ,B.[Update]=ISNULL(B.[Update],0)+1 + from @ModifiedRawData B + LEFT Join @ModifiedRawData A On A.[Page IDS]=Convert(int,Convert(Varbinary(Max),Reverse(Substring(B.[RowLog Contents 0],15+14,2)))) + And A.[File IDS]=Convert(int,Convert(Varbinary(Max),Reverse(Substring(B.[RowLog Contents 0],19+14,2)))) + And A.[Link ID]=B.[Link ID] + LEFT Join @ModifiedRawData C On C.[Page IDS]=Convert(int,Convert(Varbinary(Max),Reverse(Substring(B.[RowLog Contents 0],27+14,2)))) + And C.[File IDS]=Convert(int,Convert(Varbinary(Max),Reverse(Substring(B.[RowLog Contents 0],31+14,2)))) + And C.[Link ID]=B.[Link ID] + Where (A.[RowLog Contents 0] IS NOT NULL OR C.[RowLog Contents 0] IS NOT NULL) + + + Update B Set B.[RowLog Contents 0] = + (CASE WHEN A.[RowLog Contents 0] IS NOT NULL AND C.[RowLog Contents 0] IS NOT NULL THEN A.[RowLog Contents 0]+C.[RowLog Contents 0] + WHEN A.[RowLog Contents 0] IS NULL AND C.[RowLog Contents 0] IS NOT NULL THEN C.[RowLog Contents 0] + WHEN A.[RowLog Contents 0] IS NOT NULL AND C.[RowLog Contents 0] IS NULL THEN A.[RowLog Contents 0] + END) + --,B.[Update]=ISNULL(B.[Update],0)+1 + from @ModifiedRawData B + LEFT Join @ModifiedRawData A On A.[Page IDS]=Convert(int,Convert(Varbinary(Max),Reverse(Substring(B.[RowLog Contents 0],15+14,2)))) + And A.[File IDS]=Convert(int,Convert(Varbinary(Max),Reverse(Substring(B.[RowLog Contents 0],19+14,2)))) + And A.[Link ID]<>B.[Link ID] And B.[Update]=0 + LEFT Join @ModifiedRawData C On C.[Page IDS]=Convert(int,Convert(Varbinary(Max),Reverse(Substring(B.[RowLog Contents 0],27+14,2)))) + And C.[File IDS]=Convert(int,Convert(Varbinary(Max),Reverse(Substring(B.[RowLog Contents 0],31+14,2)))) + And C.[Link ID]<>B.[Link ID] And B.[Update]=0 + Where (A.[RowLog Contents 0] IS NOT NULL OR C.[RowLog Contents 0] IS NOT NULL) + + UPDATE @ModifiedRawData SET [RowLog Contents 0] = + (Case When [RowLog Len]>=8000 Then + Substring([RowLog Contents 0] ,15,[RowLog Len]) + When [RowLog Len]<8000 Then + SUBSTRING([RowLog Contents 0],15+6,Convert(int,Convert(varbinary(max),REVERSE(Substring([RowLog Contents 0],15,6))))) + End) + FROM @ModifiedRawData Where [LINK ID]=0 + + UPDATE @ColumnNameAndData SET [hex_Value]=[RowLog Contents 0] + --,A.[Update]=A.[Update]+1 + FROM @ColumnNameAndData A + INNER JOIN @ModifiedRawData B ON + Convert(int,Convert(Varbinary(Max),Reverse(Substring([hex_value],17,4))))=[PAGE IDS] + AND Convert(int,Substring([hex_value],9,2)) =B.[Link ID] + Where [System_Type_Id] In (99,167,175,231,239,241,165,98) And [Link ID] <>0 + + UPDATE @ColumnNameAndData SET [hex_Value]= + (CASE WHEN B.[RowLog Contents 0] IS NOT NULL AND C.[RowLog Contents 0] IS NOT NULL THEN B.[RowLog Contents 0]+C.[RowLog Contents 0] + WHEN B.[RowLog Contents 0] IS NULL AND C.[RowLog Contents 0] IS NOT NULL THEN C.[RowLog Contents 0] + WHEN B.[RowLog Contents 0] IS NOT NULL AND C.[RowLog Contents 0] IS NULL THEN B.[RowLog Contents 0] + END) + --,A.[Update]=A.[Update]+1 + FROM @ColumnNameAndData A + LEFT JOIN @ModifiedRawData B ON + Convert(int,Convert(Varbinary(Max),Reverse(Substring([hex_value],5,4))))=B.[PAGE IDS] And B.[Link ID] =0 + LEFT JOIN @ModifiedRawData C ON + Convert(int,Convert(Varbinary(Max),Reverse(Substring([hex_value],17,4))))=C.[PAGE IDS] And C.[Link ID] =0 + Where [System_Type_Id] In (99,167,175,231,239,241,165,98) And (B.[RowLog Contents 0] IS NOT NULL OR C.[RowLog Contents 0] IS NOT NULL) + + UPDATE @ColumnNameAndData SET [hex_Value]=[RowLog Contents 0] + --,A.[Update]=A.[Update]+1 + FROM @ColumnNameAndData A + INNER JOIN @ModifiedRawData B ON + Convert(int,Convert(Varbinary(Max),Reverse(Substring([hex_value],9,4))))=[PAGE IDS] + And Convert(int,Substring([hex_value],3,2))=[Link ID] + Where [System_Type_Id] In (35,34,99) And [Link ID] <>0 + + UPDATE @ColumnNameAndData SET [hex_Value]=[RowLog Contents 0] + --,A.[Update]=A.[Update]+10 + FROM @ColumnNameAndData A + INNER JOIN @ModifiedRawData B ON + Convert(int,Convert(Varbinary(Max),Reverse(Substring([hex_value],9,4))))=[PAGE IDS] + Where [System_Type_Id] In (35,34,99) And [Link ID] =0 + + UPDATE @ColumnNameAndData SET [hex_Value]=[RowLog Contents 0] + --,A.[Update]=A.[Update]+1 + FROM @ColumnNameAndData A + INNER JOIN @ModifiedRawData B ON + Convert(int,Convert(Varbinary(Max),Reverse(Substring([hex_value],15,4))))=[PAGE IDS] + Where [System_Type_Id] In (35,34,99) And [Link ID] =0 + + Update @ColumnNameAndData set [hex_value]= 0xFFFE + Substring([hex_value],9,LEN([hex_value])) + --,[Update]=[Update]+1 + Where [system_type_id]=241 + +CREATE TABLE [#temp_Data] +( + [FieldName] VARCHAR(MAX), + [FieldValue] NVARCHAR(MAX), + [Rowlogcontents] VARBINARY(8000), + [Row ID] int +) + +INSERT INTO #temp_Data +SELECT NAME, +CASE + WHEN system_type_id IN (231, 239) THEN LTRIM(RTRIM(CONVERT(NVARCHAR(max),hex_Value))) --NVARCHAR ,NCHAR + WHEN system_type_id IN (167,175) THEN LTRIM(RTRIM(CONVERT(VARCHAR(max),hex_Value))) --VARCHAR,CHAR + WHEN system_type_id IN (35) THEN LTRIM(RTRIM(CONVERT(VARCHAR(max),hex_Value))) --Text + WHEN system_type_id IN (99) THEN LTRIM(RTRIM(CONVERT(NVARCHAR(max),hex_Value))) --nText + WHEN system_type_id = 48 THEN CONVERT(VARCHAR(MAX), CONVERT(TINYINT, CONVERT(BINARY(1), REVERSE (hex_Value)))) --TINY INTEGER + WHEN system_type_id = 52 THEN CONVERT(VARCHAR(MAX), CONVERT(SMALLINT, CONVERT(BINARY(2), REVERSE (hex_Value)))) --SMALL INTEGER + WHEN system_type_id = 56 THEN CONVERT(VARCHAR(MAX), CONVERT(INT, CONVERT(BINARY(4), REVERSE(hex_Value)))) -- INTEGER + WHEN system_type_id = 127 THEN CONVERT(VARCHAR(MAX), CONVERT(BIGINT, CONVERT(BINARY(8), REVERSE(hex_Value))))-- BIG INTEGER + WHEN system_type_id = 61 Then CONVERT(VARCHAR(MAX),CONVERT(DATETIME,CONVERT(VARBINARY(8000),REVERSE (hex_Value))),100) --DATETIME + WHEN system_type_id =58 Then CONVERT(VARCHAR(MAX),CONVERT(SMALLDATETIME,CONVERT(VARBINARY(8000),REVERSE(hex_Value))),100) --SMALL DATETIME + WHEN system_type_id = 108 THEN CONVERT(VARCHAR(MAX),CONVERT(NUMERIC(38,20), CONVERT(VARBINARY,CONVERT(VARBINARY(1),xprec)+CONVERT(VARBINARY(1),xscale))+CONVERT(VARBINARY(1),0) + hex_Value)) --- NUMERIC + WHEN system_type_id =106 THEN CONVERT(VARCHAR(MAX), CONVERT(DECIMAL(38,20), CONVERT(VARBINARY,Convert(VARBINARY(1),xprec)+CONVERT(VARBINARY(1),xscale))+CONVERT(VARBINARY(1),0) + hex_Value)) --- DECIMAL + WHEN system_type_id In(60,122) THEN CONVERT(VARCHAR(MAX),Convert(MONEY,Convert(VARBINARY(8000),Reverse(hex_Value))),2) --MONEY,SMALLMONEY + WHEN system_type_id = 104 THEN CONVERT(VARCHAR(MAX),CONVERT (BIT,CONVERT(BINARY(1), hex_Value)%2)) -- BIT + WHEN system_type_id =62 THEN RTRIM(LTRIM(STR(CONVERT(FLOAT,SIGN(CAST(CONVERT(VARBINARY(8000),Reverse(hex_Value)) AS BIGINT)) * (1.0 + (CAST(CONVERT(VARBINARY(8000),Reverse(hex_Value)) AS BIGINT) & 0x000FFFFFFFFFFFFF) * POWER(CAST(2 AS FLOAT), -52)) * POWER(CAST(2 AS FLOAT),((CAST(CONVERT(VARBINARY(8000),Reverse(hex_Value)) AS BIGINT) & 0x7ff0000000000000) / EXP(52 * LOG(2))-1023))),53,LEN(hex_Value)))) --- FLOAT + When system_type_id =59 THEN Left(LTRIM(STR(CAST(SIGN(CAST(Convert(VARBINARY(8000),REVERSE(hex_Value)) AS BIGINT))* (1.0 + (CAST(CONVERT(VARBINARY(8000),Reverse(hex_Value)) AS BIGINT) & 0x007FFFFF) * POWER(CAST(2 AS Real), -23)) * POWER(CAST(2 AS Real),(((CAST(CONVERT(VARBINARY(8000),Reverse(hex_Value)) AS INT) )& 0x7f800000)/ EXP(23 * LOG(2))-127))AS REAL),23,23)),8) --Real + WHEN system_type_id In (165,173) THEN (CASE WHEN CHARINDEX(0x,cast('' AS XML).value('xs:hexBinary(sql:column("hex_Value"))', 'VARBINARY(8000)')) = 0 THEN '0x' ELSE '' END) +cast('' AS XML).value('xs:hexBinary(sql:column("hex_Value"))', 'varchar(max)') -- BINARY,VARBINARY + WHEN system_type_id =34 THEN (CASE WHEN CHARINDEX(0x,cast('' AS XML).value('xs:hexBinary(sql:column("hex_Value"))', 'VARBINARY(8000)')) = 0 THEN '0x' ELSE '' END) +cast('' AS XML).value('xs:hexBinary(sql:column("hex_Value"))', 'varchar(max)') --IMAGE + WHEN system_type_id =36 THEN CONVERT(VARCHAR(MAX),CONVERT(UNIQUEIDENTIFIER,hex_Value)) --UNIQUEIDENTIFIER + WHEN system_type_id =231 THEN CONVERT(VARCHAR(MAX),CONVERT(sysname,hex_Value)) --SYSNAME + WHEN system_type_id =241 THEN CONVERT(VARCHAR(MAX),CONVERT(xml,hex_Value)) --XML + + WHEN system_type_id =189 THEN (CASE WHEN CHARINDEX(0x,cast('' AS XML).value('xs:hexBinary(sql:column("hex_Value"))', 'VARBINARY(8000)')) = 0 THEN '0x' ELSE '' END) +cast('' AS XML).value('xs:hexBinary(sql:column("hex_Value"))', 'varchar(max)') --TIMESTAMP + WHEN system_type_id=98 THEN (CASE + WHEN CONVERT(INT,SUBSTRING(hex_Value,1,1))=56 THEN CONVERT(VARCHAR(MAX), CONVERT(INT, CONVERT(BINARY(4), REVERSE(Substring(hex_Value,3,Len(hex_Value)))))) -- INTEGER + WHEN CONVERT(INT,SUBSTRING(hex_Value,1,1))=108 THEN CONVERT(VARCHAR(MAX),CONVERT(numeric(38,20),CONVERT(VARBINARY(1),Substring(hex_Value,3,1)) +CONVERT(VARBINARY(1),Substring(hex_Value,4,1))+CONVERT(VARBINARY(1),0) + Substring(hex_Value,5,Len(hex_Value)))) --- NUMERIC + WHEN CONVERT(INT,SUBSTRING(hex_Value,1,1))=167 THEN LTRIM(RTRIM(CONVERT(VARCHAR(max),Substring(hex_Value,9,Len(hex_Value))))) --VARCHAR,CHAR + WHEN CONVERT(INT,SUBSTRING(hex_Value,1,1))=36 THEN CONVERT(VARCHAR(MAX),CONVERT(UNIQUEIDENTIFIER,Substring((hex_Value),3,20))) --UNIQUEIDENTIFIER + WHEN CONVERT(INT,SUBSTRING(hex_Value,1,1))=61 THEN CONVERT(VARCHAR(MAX),CONVERT(DATETIME,CONVERT(VARBINARY(8000),REVERSE (Substring(hex_Value,3,LEN(hex_Value)) ))),100) --DATETIME + WHEN CONVERT(INT,SUBSTRING(hex_Value,1,1))=165 THEN '0x'+ SUBSTRING((CASE WHEN CHARINDEX(0x,cast('' AS XML).value('xs:hexBinary(sql:column("hex_Value"))', 'VARBINARY(8000)')) = 0 THEN '0x' ELSE '' END) +cast('' AS XML).value('xs:hexBinary(sql:column("hex_Value"))', 'varchar(max)'),11,LEN(hex_Value)) -- BINARY,VARBINARY + END) + +END AS FieldValue +,[Rowlogcontents] +,[Row ID] +FROM @ColumnNameAndData ORDER BY nullbit + +--Create the column name in the same order to do pivot table. + +DECLARE @FieldName VARCHAR(max) +SET @FieldName = STUFF( +( + SELECT ',' + CAST(QUOTENAME([Name]) AS VARCHAR(MAX)) FROM syscolumns WHERE id=object_id('' + @SchemaName_n_TableName + '') + FOR XML PATH('')), 1, 1, '') + +--Finally did pivot table and get the data back in the same format. + +SET @sql = 'SELECT ' + @FieldName + ' FROM #temp_Data PIVOT (Min([FieldValue]) FOR FieldName IN (' + @FieldName + ')) AS pvt' +EXEC sp_executesql @sql + +GO +--Execute the procedure like +--Recover_Deleted_Data_Proc 'Database Name','Schema.table name' +--EXAMPLE #1 : FOR ALL DELETED RECORDS +EXEC Recover_Deleted_Data_Proc 'test','dbo.Test_table' +GO +--EXAMPLE #2 : FOR ANY SPECIFIC DATE RANGE +EXEC Recover_Deleted_Data_Proc 'test','dbo.Test_Table' ,'2011/12/01','2012/01/30' +--It will give you the result of all deleted records. \ No newline at end of file diff --git a/Stored_Procedure/dbo.PerformanceGraph.sql b/Stored_Procedure/dbo.PerformanceGraph.sql new file mode 100644 index 00000000..1e8890f0 --- /dev/null +++ b/Stored_Procedure/dbo.PerformanceGraph.sql @@ -0,0 +1,256 @@ +IF OBJECT_ID('dbo.PerformanceGraph', 'P') IS NULL +BEGIN + EXEC ('CREATE PROCEDURE dbo.PerformanceGraph AS BEGIN SELECT 1 END'); +END; +GO + + +ALTER PROCEDURE PerformanceGraph + @ShowCPUAsLines BIT = 1, + @ShowDeadlock BIT = 1, + @DeadlockBlobRadius TINYINT = 1, + @OutputDeadlockTable BIT = 1, + @ShowEndBar BIT = 1, + @EndBarWidth TINYINT = 1 +AS +/* +https://thelonedba.wordpress.com/2019/09/27/wrapping-up-cpu-load-graphs-in-a-stored-procedure/ + +EXEC dbo.PerformanceGraph; +*/ +BEGIN + SET NOCOUNT ON; + + DECLARE @ts_now BIGINT = + ( + SELECT TOP (1) + cpu_ticks / (cpu_ticks / ms_ticks) + FROM sys.dm_os_sys_info WITH (NOLOCK) + ORDER BY cpu_ticks DESC + ); + DECLARE @CPUSQLOut AS VARCHAR(8000), + @CPUIdleOut AS VARCHAR(8000), + @CPUOtherOut AS VARCHAR(8000); + DECLARE @CPURecords AS INT; + DECLARE @DeadlockPoints AS VARCHAR(8000), + @DeadlockBlobs AS VARCHAR(8000), + @DeadlockRecords AS INT; + + DECLARE @OutputGeometry TABLE (ShapeInfo GEOMETRY, Caption VARCHAR(20)); + + WITH + CPULoad AS + ( + SELECT TOP (256) + y.SQLProcessUtilization AS [SQL Server Process CPU Utilization], + y.SystemIdle AS [System Idle Process], + 100 - (y.SystemIdle + y.SQLProcessUtilization) AS [Other Process CPU Utilization], + DATEADD(ms, -1 * (@ts_now - y.timestamp), GETDATE()) AS [Event Time] + FROM + ( + SELECT x.record.value('(./Record/@id)[1]', 'int') AS record_id, + x.record.value('(./Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int') AS SystemIdle, + x.record.value('(./Record/SchedulerMonitorEvent/SystemHealth/ProcessUtilization)[1]', 'int') AS SQLProcessUtilization, + x.timestamp + FROM + ( + SELECT timestamp, + CONVERT(XML, record) AS record + FROM sys.dm_os_ring_buffers WITH (NOLOCK) + WHERE + ring_buffer_type = N'RING_BUFFER_SCHEDULER_MONITOR' + AND record LIKE N'%%' + ) AS x + ) AS y + ORDER BY y.timestamp DESC + ) + SELECT @CPUSQLOut + = STUFF( + ( + SELECT ',' + + CAST(ROW_NUMBER() OVER (ORDER BY CPULoad.[Event Time]) - COUNT(*) OVER (PARTITION BY 1) AS VARCHAR(10)) + + ' ' + CAST(CPULoad.[SQL Server Process CPU Utilization] AS VARCHAR(20)) + FROM CPULoad + ORDER BY CPULoad.[Event Time] + FOR XML PATH('') + ), + 1, + 1, + '' + ), + @CPUIdleOut + = STUFF( + ( + SELECT ',' + + CAST(ROW_NUMBER() OVER (ORDER BY CPULoad.[Event Time]) - COUNT(*) OVER (PARTITION BY 1) AS VARCHAR(10)) + + ' ' + CAST(CPULoad.[System Idle Process] AS VARCHAR(20)) + FROM CPULoad + ORDER BY CPULoad.[Event Time] + FOR XML PATH('') + ), + 1, + 1, + '' + ), + @CPUOtherOut + = STUFF( + ( + SELECT ',' + + CAST(ROW_NUMBER() OVER (ORDER BY CPULoad.[Event Time]) + - COUNT(*) OVER (PARTITION BY 1) AS VARCHAR(10)) + ' ' + + CAST(CPULoad.[Other Process CPU Utilization] AS VARCHAR(20)) + FROM CPULoad + ORDER BY CPULoad.[Event Time] + FOR XML PATH('') + ), + 1, + 1, + '' + ), + @CPURecords = (SELECT COUNT(*) FROM CPULoad); + + IF @ShowCPUAsLines = 1 + BEGIN + INSERT INTO @OutputGeometry (ShapeInfo, Caption) + VALUES + (geometry::Parse('LINESTRING(' + @CPUSQLOut + ')'), 'CPU-SQL'), + (geometry::Parse('LINESTRING(' + @CPUOtherOut + ')'), 'CPU-Other'), + (geometry::Parse('LINESTRING(' + @CPUIdleOut + ')'), 'CPU-Idle'); + END; + ELSE + BEGIN + INSERT INTO @OutputGeometry (ShapeInfo, Caption) + VALUES + (geometry::STGeomFromText( + 'POLYGON((' + CAST(0 - @CPURecords AS CHAR(5)) + ' 0, ' + @CPUSQLOut + ', ' + + '0 0, ' + CAST(0 - @CPURecords AS CHAR(5)) + ' 0 ))', + 0 + ), 'CPU-SQL'), + (geometry::STGeomFromText( + 'POLYGON((' + CAST(0 - @CPURecords AS CHAR(5)) + ' 0, ' + @CPUOtherOut + ', ' + + '0 0, ' + CAST(0 - @CPURecords AS CHAR(5)) + ' 0 ))', + 0 + ), 'CPU-Other'), + (geometry::STGeomFromText( + 'POLYGON((' + CAST(0 - @CPURecords AS CHAR(5)) + ' 0, ' + @CPUIdleOut + ', ' + + '0 0, ' + CAST(0 - @CPURecords AS CHAR(5)) + ' 0 ))', + 0 + ), 'CPU-Idle'); + END; + + DECLARE @XMLDeadlocks TABLE ([XML] XML, UTCTime DATETIME, LocalTime DATETIME, MinutesAgo INT); + + IF @ShowDeadlock = 1 + BEGIN; + WITH + xmlsource AS + ( + SELECT CONVERT(XML, event_data) AS deadlock_xml + FROM sys.fn_xe_file_target_read_file('system_health*.xel', NULL, NULL, NULL) + ), + xmldates AS + ( + SELECT xmlsource.deadlock_xml, + xmlsource.deadlock_xml.value('(/event/@timestamp)[1]', 'datetime') AS deadlock_UTCtime, -- this is UTC. + DATEADD( + mi, + DATEDIFF(mi, GETUTCDATE(), GETDATE()), + xmlsource.deadlock_xml.value('(/event/@timestamp)[1]', 'datetime') + ) AS deadlock_LocalTime + FROM xmlsource + WHERE xmlsource.deadlock_xml.value('(/event/@name)[1]', 'VARCHAR(256)') = 'xml_deadlock_report' + ) + INSERT INTO @XMLDeadlocks ([XML], UTCTime, LocalTime, MinutesAgo) + SELECT xmldates.deadlock_xml, + xmldates.deadlock_UTCtime, + xmldates.deadlock_LocalTime, + DATEDIFF(MINUTE, xmldates.deadlock_LocalTime, GETDATE()) AS MinutesAgo + FROM xmldates; + + SELECT @DeadlockPoints = STUFF( + ( + SELECT DISTINCT + ', (' + CAST((0 - xml.MinutesAgo) AS CHAR(5)) + ' 0)' + FROM @XMLDeadlocks xml + WHERE xml.MinutesAgo <= @CPURecords + FOR XML PATH('') + ), + 1, + 2, + '' + ), + @DeadlockBlobs + = STUFF( + ( +-- SQL Prompt formatting off + SELECT DISTINCT ', CURVEPOLYGON(CIRCULARSTRING(' + + CAST((0-xml.MinutesAgo) + @DeadlockBlobRadius AS CHAR(5)) + ' 0, ' + + CAST((0-xml.MinutesAgo) AS CHAR(5)) + ' ' + CAST(@DeadlockBlobRadius AS CHAR(5)) + ', ' + + CAST((0-xml.MinutesAgo) - @DeadlockBlobRadius AS CHAR(5)) + ' 0, ' + + CAST((0-xml.MinutesAgo) AS CHAR(5)) + ' ' + CAST((0 - @DeadlockBlobRadius) AS CHAR(5)) + ', ' + + CAST((0-xml.MinutesAgo) + @DeadlockBlobRadius AS CHAR(5)) + ' 0' + + '))' +-- SQL Prompt formatting on + FROM @XMLDeadlocks xml + WHERE xml.MinutesAgo <= @CPURecords + FOR XML PATH('') + ), + 1, + 2, + '' + ), + @DeadlockRecords = + ( + SELECT COUNT(*) FROM @XMLDeadlocks xml WHERE xml.MinutesAgo <= @CPURecords + ); + + IF @DeadlockBlobRadius = 0 + BEGIN -- show points + INSERT INTO @OutputGeometry (ShapeInfo, Caption) + VALUES + ( geometry::Parse('MULTIPOINT(' + @DeadlockPoints + ')'), -- ShapeInfo - geometry + 'Deadlocks' -- Caption - varchar(20) + ); + END; + ELSE + BEGIN -- show blobs + INSERT INTO @OutputGeometry (ShapeInfo, Caption) + VALUES + ( geometry::Parse('GEOMETRYCOLLECTION(' + @DeadlockBlobs + ')'), -- ShapeInfo - geometry + 'Deadlocks' -- Caption - varchar(20) + ); + END; + + IF @OutputDeadlockTable = 1 + BEGIN + SELECT UTCTime, LocalTime, MinutesAgo, XML FROM @XMLDeadlocks xd ORDER BY xd.MinutesAgo; + END; + END; + + --End Bar + IF @ShowEndBar = 1 + BEGIN + IF @EndBarWidth = 0 + BEGIN + INSERT INTO @OutputGeometry (ShapeInfo, Caption) + VALUES + ( geometry::Parse('LINESTRING(0 0,0 100)'), -- ShapeInfo - geometry + 'Now' -- Caption - varchar(100) + ); + END; + ELSE + BEGIN + INSERT INTO @OutputGeometry (ShapeInfo, Caption) + VALUES + ( geometry::Parse('POLYGON((0 0,0 100, ' + CAST(@EndBarWidth AS CHAR(3)) + ' 100, ' + + CAST(@EndBarWidth AS CHAR(3)) + ' 0, 0 0))' + ), -- ShapeInfo - geometry + 'Now' -- Caption - varchar(100) + ); + END; + END; + + -- Final Output + SELECT ShapeInfo, Caption FROM @OutputGeometry; +END; +GO diff --git a/Stored_Procedure/dbo.sp_BenchmarkTSQL.sql b/Stored_Procedure/dbo.sp_BenchmarkTSQL.sql index 1a0e1268..4315c75d 100644 --- a/Stored_Procedure/dbo.sp_BenchmarkTSQL.sql +++ b/Stored_Procedure/dbo.sp_BenchmarkTSQL.sql @@ -1,7 +1,7 @@ USE master; GO -IF OBJECT_ID('dbo.sp_BenchmarkTSQL', 'P') IS NULL EXEC('CREATE PROCEDURE dbo.sp_BenchmarkTSQL AS SELECT 1;'); +IF OBJECT_ID('dbo.sp_BenchmarkTSQL', 'P') IS NULL EXEC('CREATE PROC dbo.sp_BenchmarkTSQL AS SELECT 1;'); GO @@ -24,57 +24,71 @@ ALTER PROCEDURE dbo.sp_BenchmarkTSQL( Run TSQL statement @numberOfExecution times and calculate each execution time, save results if needed or print it. .DESCRIPTION - Run SQL statement specified times, show results, insert execution details into log table master.dbo.BenchmarkTSQL. + Run TSQL statement specified times with sp_executesql, print step results, insert execution details into log table master.dbo.BenchmarkTSQL. .PARAMETER @tsqlStatementBefore TSQL statement that executed before tested main TSQL statement - not taken into account when measuring @tsqlStatement. - Default value is NULL. + Possible values: any TSQL statements. + Default value: NULL. .PARAMETER @tsqlStatement TSQL statement for benchmarking. Mandatory parameter. + Possible values: any TSQL statements. No defaults. .PARAMETER @tsqlStatementAfter TSQL statement that executed after tested TSQL statement - not taken into account when measuring @tsqlStatement. - Default value is NULL. + Possible values: any TSQL statements. + Default value: NULL. .PARAMETER @numberOfExecution Number of execution TSQL statement. - Default value is 10. + Possible values: 1 or 32000. + Default value: 10. .PARAMETER @saveResults Save benchmark details to master.dbo.BenchmarkTSQL table if @saveResults = 1. - Create table if not exists (see 301 line: CREATE TABLE master.dbo.BenchmarkTSQL …). - Default value is 0 - not saved. + Create table if not exists (see 335 line: CREATE TABLE master.dbo.BenchmarkTSQL …). + Possible values: 0 or 1. + Default value: 0 - not saved. .PARAMETER @skipTSQLCheck - Checking for valid TSQL statement. - Default value is 1 (true) - skip checking. + Checking for valid TSQL statement using sys.dm_exec_describe_first_result_set. + Possible values: 0 or 1. + Default value: 1 - skip checking. + See https://docs.microsoft.com/sql/relational-databases/system-dynamic-management-views/sys-dm-exec-describe-first-result-set-transact-sql .PARAMETER @clearCache Clear cached plan for TSQL statement before each run using DBCC FREEPROCCACHE(@planHandle). - Default value is 0 (false) - not clear. + Possible values: 0 or 1. + Default value: 0 - not clear. .PARAMETER @calcMedian Calculate pseudo median of all execution times. - Default value is 0 (false) - not calculated. + Possible values: 0 or 1. + Default value: 0 - not calculated. .PARAMETER @printStepInfo - PRINT detailed step information: step count, start time, end time, duration. - Default value is 0 - not printed. + PRINT detailed step information: step count, start step time, end step time, duration. + Default value: 0 - not printed. .PARAMETER @durationAccuracy - Duration accuracy calculation, possible values for this stored procedure parameter: ns, mcs, ms, ss, mi, hh, dd, wk. - Default value is ss - seconds. - See DATEDIFF https://docs.microsoft.com/en-us/sql/t-sql/functions/datediff-transact-sql + Duration accuracy calculation. + Possible values: ns, mcs, ms, ss, mi, hh, dd, wk. + Default value: ss - seconds. + See DATEDIFF https://docs.microsoft.com/sql/t-sql/functions/datediff-transact-sql .PARAMETER @dateTimeFunction - Define using datetime function, possible values of functions: SYSDATETIME, SYSUTCDATETIME. Default value is SYSDATETIME. - See https://docs.microsoft.com/en-us/sql/t-sql/functions/date-and-time-data-types-and-functions-transact-sql + Define using datetime function. + Possible values: SYSDATETIME, SYSUTCDATETIME. + Default value: SYSDATETIME. + See https://docs.microsoft.com/sql/t-sql/functions/date-and-time-data-types-and-functions-transact-sql .PARAMETER @additionalInfo - Save additional session parameteres (ANSI_WARNINGS, XACT_ABORT and etc) to XML column AdditionalInfo in log table master.dbo.BenchmarkTSQL. Default value is 0. + Save additional session parameteres (ANSI_WARNINGS, XACT_ABORT and etc) to XML column AdditionalInfo in log table master.dbo.BenchmarkTSQL. + Possible values: 0 or 1. + Default value: 0 - not saved. .EXAMPLE EXEC sp_BenchmarkTSQL @@ -125,7 +139,7 @@ ALTER PROCEDURE dbo.sp_BenchmarkTSQL( DECLARE @tsql nvarchar(max) = N'SET NOCOUNT OFF; DECLARE @tsql nvarchar(max) = N''BACKUP DATABASE [master] TO DISK = N''''C:\master'' + REPLACE(CAST(CAST(GETDATE() AS datetime2(7)) AS nvarchar(max)), '':'', '' '') + ''.bak'''' WITH NOFORMAT, NOINIT;'' - EXECUTE sp_executesql @tsql;'; + EXEC sp_executesql @tsql;'; EXEC sp_BenchmarkTSQL @tsqlStatement = @tsql , @numberOfExecution = 3 @@ -204,9 +218,9 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. .NOTE - Version: 5.7 + Version: 5.9 Created: 2017-12-14 by Konstantin Taranov - Modified: 2019-04-18 by Konstantin Taranov + Modified: 2019-08-26 by Konstantin Taranov Main contributors: Konstantin Taranov, Aleksei Nagorskii Source: https://rebrand.ly/sp_BenchmarkTSQL */ @@ -216,15 +230,15 @@ BEGIN TRY SET NOCOUNT ON; DECLARE @startBenchmark datetime2(7) = CASE WHEN @dateTimeFunction = 'SYSDATETIME' THEN SYSDATETIME() - WHEN @dateTimeFunction = 'SYSUTCDATETIME' THEN SYSUTCDATETIME() - END; + WHEN @dateTimeFunction = 'SYSUTCDATETIME' THEN SYSUTCDATETIME() + END; DECLARE @originalLogin sysname = QUOTENAME(ORIGINAL_LOGIN()); /* https://sqlstudies.com/2015/06/24/which-user-function-do-i-use/ */ DECLARE @err_msg nvarchar(max); DECLARE @raiseError nvarchar(2000); /* Using RAISEEROR for interactive step printing http://sqlity.net/en/984/print-vs-raiserror/ */ - SET @raiseError = 'Benchmark started at ' + CONVERT(varchar(27), @startBenchmark, 121) + ' by ' + @originalLogin; + SET @raiseError = 'Benchmark started at ' + CONVERT(varchar(27), @startBenchmark, 121) + ' by ' + @originalLogin; RAISERROR(@raiseError, 0, 1) WITH NOWAIT; DECLARE @productMajorVersion sql_variant = SERVERPROPERTY('ProductMajorVersion'); @@ -251,13 +265,13 @@ BEGIN TRY , 'dd' /* day */ , 'wk' /* week */ ) - THROW 55004, '@durationAccuracy accept only this values: ns, mcs, ms, ss, mi, hh, wk, dd. Default value is ss. See DATEDIFF https://docs.microsoft.com/en-us/sql/t-sql/functions/datediff-transact-sql' , 1; + THROW 55004, '@durationAccuracy accept only this values: ns, mcs, ms, ss, mi, hh, wk, dd. Default value is ss. See DATEDIFF https://docs.microsoft.com/sql/t-sql/functions/datediff-transact-sql' , 1; IF @dateTimeFunction NOT IN ('SYSDATETIME', 'SYSUTCDATETIME') - THROW 55005, '@dateTimeFunction accept only SYSDATETIME and SYSUTCDATETIME. Default value is SYSDATETIME. See https://docs.microsoft.com/en-us/sql/t-sql/functions/date-and-time-data-types-and-functions-transact-sql', 1; + THROW 55005, '@dateTimeFunction accept only SYSDATETIME and SYSUTCDATETIME. Default value is SYSDATETIME. See https://docs.microsoft.com/sql/t-sql/functions/date-and-time-data-types-and-functions-transact-sql', 1; - IF @numberOfExecution <= 0 OR @numberOfExecution >= 32000 - THROW 55006, '@numberOfExecution must be > 0 and < 32000. If you want more execution then comment 183 and 184 lines.', 1; + IF @numberOfExecution <= 0 OR @numberOfExecution > 32000 + THROW 55006, '@numberOfExecution must be > 0 and <= 32000. If you want more execution then comment 273 and 274 lines.', 1; IF @skipTSQLCheck = 0 BEGIN @@ -337,7 +351,7 @@ BEGIN TRY , AdditionalInfo xml NULL );', 1; - DECLARE @crlf nvarchar(10) = CHAR(10); + DECLARE @crlf nvarchar(10) = CHAR(13) + CHAR(10); DECLARE @stepNumber int = 0; DECLARE @min bigint; DECLARE @avg bigint; @@ -389,7 +403,7 @@ BEGIN TRY IF @saveResults = 1 BEGIN DECLARE @TSQLStatementGUID varchar(36) = NEWID(); - PRINT(N'TSQLStatementGUID in log table is: ' + @TSQLStatementGUID + @crlf); + PRINT(N'TSQLStatementGUID in log table is: ' + @TSQLStatementGUID + @crlf + @crlf); END; WHILE @stepNumber < @numberOfExecution @@ -407,7 +421,7 @@ BEGIN TRY END; IF @tsqlStatementBefore IS NOT NULL AND @tsqlStatementBefore <> '' - EXECUTE sp_executesql @tsqlStatementBefore; + EXEC sp_executesql @tsqlStatementBefore; BEGIN /* Run bencmark step and calculate it duration */ SET @startStep = CASE WHEN @dateTimeFunction = 'SYSDATETIME' THEN SYSDATETIME() @@ -525,21 +539,22 @@ BEGIN TRY IF @printStepInfo = 1 BEGIN /* Using RAISEEROR for interactive step printing http://sqlity.net/en/984/print-vs-raiserror/ */ - SET @raiseError = 'Run ' + CASE WHEN @stepNumber < 10 THEN ' ' + CAST(@stepNumber AS varchar(30)) - WHEN @stepNumber < 100 THEN ' ' + CAST(@stepNumber AS varchar(30)) - WHEN @stepNumber < 1000 THEN ' ' + CAST(@stepNumber AS varchar(30)) + SET @raiseError = 'Run ' + CASE WHEN @stepNumber < 10 THEN ' ' + CAST(@stepNumber AS varchar(30)) + WHEN @stepNumber < 100 THEN ' ' + CAST(@stepNumber AS varchar(30)) + WHEN @stepNumber < 1000 THEN ' ' + CAST(@stepNumber AS varchar(30)) + WHEN @stepNumber < 10000 THEN ' ' + CAST(@stepNumber AS varchar(30)) ELSE CAST(@stepNumber AS varchar(30)) END + ', start: ' + CONVERT(varchar(27), @startStep, 121) + ', finish: ' + CONVERT(varchar(27), CASE WHEN @dateTimeFunction = 'SYSDATETIME' THEN SYSDATETIME() WHEN @dateTimeFunction = 'SYSUTCDATETIME' THEN SYSUTCDATETIME() END, 121) + - ', step duration: ' + CAST(@stepDuration AS varchar(100)) + @durationAccuracy + '.'; + ', step duration: ' + REPLACE(CONVERT(varchar(30), CONVERT(money, @stepDuration), 1), '.00', '') + ' ' + @durationAccuracy + @crlf; RAISERROR(@raiseError, 0, 1) WITH NOWAIT; END; IF @tsqlStatementAfter IS NOT NULL AND @tsqlStatementAfter <> '' - EXECUTE sp_executesql @tsqlStatementAfter; + EXEC sp_executesql @tsqlStatementAfter; END; @@ -603,13 +618,14 @@ BEGIN TRY /* Using RAISEEROR for interactive step printing http://sqlity.net/en/984/print-vs-raiserror/ */ SET @raiseError = @crlf + - 'Min: ' + CAST(@min AS varchar(30)) + @durationAccuracy + - ', Max: ' + CAST(@max AS varchar(30)) + @durationAccuracy + - ', Average: ' + CAST(@avg AS varchar(30)) + @durationAccuracy + - CASE WHEN @calcMedian = 1 THEN ', Median: ' + CAST(@median AS varchar(30)) + @durationAccuracy ELSE '' END + - @crlf + - 'Benchmark ended at ' + CONVERT(varchar(23), @endTime, 121) + - ' by ' + @originalLogin; + 'Min: ' + REPLACE(CONVERT(varchar(30), CONVERT(money, @min), 1), '.00', '') + ' ' + @durationAccuracy + @crlf + + 'Average: ' + REPLACE(CONVERT(varchar(30), CONVERT(money, @avg), 1), '.00', '') + ' ' + @durationAccuracy + @crlf + + CASE WHEN @calcMedian = 1 THEN + 'Median: ' + REPLACE(CONVERT(varchar(30), CONVERT(money, @median) ,1), '.00', '') + ' ' + @durationAccuracy + ELSE '' + END + @crlf + + 'Max: ' + REPLACE(CONVERT(varchar(30), CONVERT(money, @max), 1), '.00', '') + ' ' + @durationAccuracy + @crlf + @crlf + + 'Benchmark ended at ' + CONVERT(varchar(23), @endTime, 121) + ' by ' + @originalLogin; RAISERROR(@raiseError, 0, 1) WITH NOWAIT; DECLARE @benchmarkDuration bigint = CASE WHEN @durationAccuracy = 'ns' THEN DATEDIFF(ns, @startBenchmark, @endBenchmark) @@ -624,27 +640,28 @@ BEGIN TRY END; /* Using RAISEEROR for interactive step printing http://sqlity.net/en/984/print-vs-raiserror/ */ - SET @raiseError = @crlf + 'Duration of benchmark: ' + CAST(@benchmarkDuration AS varchar(30)) + @durationAccuracy + '.' + @crlf + + @crlf; + SET @raiseError = @crlf + 'Duration of benchmark: ' + REPLACE(CONVERT(varchar(30), CONVERT(money, @benchmarkDuration), 1), '.00', '') + ' ' + @durationAccuracy + @crlf; RAISERROR(@raiseError, 0, 1) WITH NOWAIT; END TRY BEGIN CATCH - PRINT('Error: ' + CONVERT(varchar(50), ERROR_NUMBER()) + + PRINT(@crlf + + 'Error: ' + CONVERT(varchar(50), ERROR_NUMBER()) + ', Severity: ' + CONVERT(varchar(5), ERROR_SEVERITY()) + ', State: ' + CONVERT(varchar(5), ERROR_STATE()) + ', Procedure: ' + ISNULL(ERROR_PROCEDURE(), '-') + ', Line: ' + CONVERT(varchar(5), ERROR_LINE()) + ', User name: ' + CONVERT(sysname, ORIGINAL_LOGIN()) ); - PRINT(ERROR_MESSAGE()); + PRINT(ERROR_MESSAGE() + @crlf + @crlf); IF ERROR_NUMBER() = 535 PRINT('Your @durationAccuracy = ' + @durationAccuracy + - '. Try to use @durationAccuracy with a less precise datepart - seconds (ss) or minutes (mm) or days (dd).' + @crlf + + '. Try to use @durationAccuracy with a less precise datepart - seconds (ss) or minutes (mm) or hours (hh).' + @crlf + 'But in log table master.dbo.BenchmarkTSQL (if you run stored procedure with @saveResult = 1) all times saving with datetime2(7) precise!' + @crlf + 'You can manualy calculate difference after decreasing precise datepart.' + @crlf + - 'For analyze log table see latest example in document section.') + @crlf + + @crlf; + 'For analyze log table see latest example in document section.') + @crlf + @crlf; END CATCH; GO diff --git a/Stored_Procedure/dbo.sp_PerfSQ.sql b/Stored_Procedure/dbo.sp_PerfSQ.sql new file mode 100644 index 00000000..dab242ee --- /dev/null +++ b/Stored_Procedure/dbo.sp_PerfSQ.sql @@ -0,0 +1,529 @@ +IF OBJECT_ID('dbo.sp_PerfSQ', 'P') IS NULL EXECUTE('CREATE PROCEDURE dbo.sp_PerfSQ AS SELECT 1'); +GO + +ALTER PROCEDURE dbo.sp_PerfSQ( + @ParamSniff float = NULL + , @SessionLocks bit = NULL +) +AS +/* +----------------------------------------------------------------------------------------- +https://www.sqlservercentral.com/articles/query-performance-diagnostics-with-sp_perfsq +-- sp_PerfSQ: Query Shaping tool identifying Performance features of active SQL Queries +-- Copyright (C) 2018, 2019 Edward Haynes +-- +-- This program is free software: you can redistribute it and/or modify +-- it under the terms of the GNU Lesser General Public License as published +-- by the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU Lesser General Public License for more details. +-- +-- You should have received a copy of the GNU Lesser General Public License +-- along with this program. If not, see . +-- +-- +-- Stored procedure designed to work with SQL Server 2008 R2 and higher +-- providing on-demand performance detail from DMVs for queries with executing requests +-- +-- Optional Parameters: +-- @ParamSniff = Parameter Sniffing sensitivity multiplier +-- < 1.0 (more hits); 1 or NULL (DEFAULT); > 1.0 (less hits) +-- Must be within the range of 0 to 2.0 otherwise will default to 1.0 +-- +-- @SessionLocks = 0 or NULL -- No locking detail (DEFAULT) +-- = 1 -- Detailed locking (performance overhead) +-- +-- Example Usage: +-- EXEC dbo.sp_PerfSQ +-- GO +-- +-- EXEC dbo.sp_PerfSQ @ParamSniff=0.75, @SessionLocks=1 +-- GO +-- +-- Email: QueryShape@gmail.com +-- +*/ +BEGIN +SET NOCOUNT ON; + +DECLARE @Version nvarchar(20); +SET @Version = N'4.5.17'; + +DECLARE @tmpSchedulers TABLE (RunnableCountAvg int NULL, PendingIOCountAvg int NULL, ThreadShortageAvg int NULL, CPUAllocation nvarchar(50) NULL); + +DECLARE @ProcessMemLow int, + @SystemMemLow int, + @MaxServerMemory int, + @PhysicalMemory bigint, + @PhysicalMemInUse bigint, + @KernelNonPaged bigint, + @RunnableCountAvg int, + @PendingIOCountAvg int, + @ThreadShortageAvg int, + @CPUAllocation nvarchar(50), + @VerCleanupRatio float, + @Runtime datetime, + @CmdLine nvarchar(100), + @SQLVersion nvarchar(500) ; + +SET @ParamSniff = (CASE WHEN @ParamSniff < CONVERT(float,0.0) OR @ParamSniff > CONVERT(float,2.0) THEN CONVERT(float,1.0) ELSE ISNULL(@ParamSniff,CONVERT(float,1.0)) END); +SET @SessionLocks = ISNULL(@SessionLocks,CONVERT(bit,0)) ; +SET @CmdLine = N'EXEC sp_PerfSQ ' + N'@ParamSniff=' + CONVERT(nvarchar(20),@ParamSniff) + N', @SessionLocks=' + CONVERT(nvarchar(1),@SessionLocks) + N' --v' + @Version; +SET @Runtime = GETDATE(); + +SET @SQLVersion = CONVERT(nvarchar(500),@@Version); +SET @SQLVersion = LEFT(@SQLVersion,CHARINDEX(N'COPY',UPPER(@SQLVersion)) - 1); + +SET @ProcessMemLow = + (SELECT COUNT(1) + FROM sys.dm_os_process_memory WITH (NOLOCK) + WHERE process_physical_memory_low = CONVERT(bit,1)) ; + +SET @SystemMemLow = + (SELECT COUNT(1) + FROM sys.dm_os_sys_memory WITH (NOLOCK) + WHERE system_high_memory_signal_state = CONVERT(bit,0) + AND system_low_memory_signal_state = CONVERT(bit,1)) ; + +SET @MaxServerMemory = + (SELECT top 1 CONVERT(int,value_in_use) + FROM sys.configurations WITH (NOLOCK) + WHERE [name] = 'max server memory (MB)') ; + +SET @PhysicalMemory = + (SELECT top 1 total_physical_memory_kb / 1024 + FROM sys.dm_os_sys_memory WITH (NOLOCK)) ; + +SET @PhysicalMemInUse = + (SELECT top 1 physical_memory_in_use_kb / 1024 + FROM sys.dm_os_process_memory WITH (NOLOCK)) ; + +SET @KernelNonPaged = + (SELECT top 1 kernel_nonpaged_pool_kb / 1024 + FROM sys.dm_os_sys_memory WITH (NOLOCK)) ; + +INSERT INTO @tmpSchedulers (RunnableCountAvg, PendingIOCountAvg, ThreadShortageAvg, CPUAllocation) +SELECT AVG(os.runnable_tasks_count) as RunnableCountAvg, + AVG(os.pending_disk_io_count) as PendingIOCountAvg, + AVG(os.work_queue_count) as ThreadShortageAvg, + CONVERT(nvarchar(20),COUNT(1)) + N' of ' + CONVERT(nvarchar(20),SUM(CONVERT(int,os.is_online))) + as CPUAllocation + FROM sys.dm_os_schedulers os WITH (NOLOCK) + WHERE os.scheduler_id < 1048576 ; + +SET @RunnableCountAvg = + (SELECT top 1 RunnableCountAvg + FROM @tmpSchedulers) ; + +SET @PendingIOCountAvg = + (SELECT top 1 PendingIOCountAvg + FROM @tmpSchedulers) ; + +SET @ThreadShortageAvg = + (SELECT top 1 ThreadShortageAvg + FROM @tmpSchedulers) ; + +SET @CPUAllocation = + (SELECT top 1 CPUAllocation + FROM @tmpSchedulers) ; + +SET @VerCleanupRatio = + (SELECT top 1 CONVERT(float,(cntr_value/1024.0) * 100.0) + FROM sys.dm_os_performance_counters WITH (NOLOCK) + WHERE counter_name = N'Version Cleanup rate (KB/s)' + AND 0 < CHARINDEX(N'Transactions',[object_name])) / (SELECT top 1 CONVERT(float,cntr_value/1024.0) + FROM sys.dm_os_performance_counters WITH (NOLOCK) + WHERE counter_name = N'Version Generation rate (KB/s)' + AND 0 < CONVERT(float,cntr_value/1024.0) + AND 0 < CHARINDEX(N'Transactions',[object_name])) ; + +PRINT @CmdLine ; +PRINT N'' +PRINT @SQLVersion +PRINT N'Memory' +PRINT N' Total Physical Memory : ' + CONVERT(nvarchar(20),@PhysicalMemory) + N' MB' +PRINT N' Max SQL Server Memory : ' + CONVERT(nvarchar(20),@MaxServerMemory) + N' MB' +PRINT N' Physical Memory In Use: ' + CONVERT(nvarchar(20),@PhysicalMemInUse) + N' MB' + (CASE WHEN (@ProcessMemLow + @SystemMemLow) > 0 THEN N' (memory pressure)' ELSE N'' END) +PRINT N' Kernel Non-Paged Pool : ' + CONVERT(nvarchar(20),@KernelNonPaged) + N' MB' +PRINT N'Schedulers' +PRINT N' Avg CPU Queue Length : ' + CONVERT(nvarchar(20),@RunnableCountAvg) +PRINT N' Avg IO Pending Count : ' + CONVERT(nvarchar(20),@PendingIOCountAvg) +PRINT N' Avg Thread Shortage : ' + CONVERT(nvarchar(20),@ThreadShortageAvg) +PRINT N' CPU Allocation : ' + @CPUAllocation +PRINT N'Version Store' +PRINT N' Version Cleanup Ratio : ' + ISNULL(CONVERT(nvarchar(20),CONVERT(numeric(16,2),@VerCleanupRatio)) + N'%',N'NA') +PRINT N'' + +;WITH XMLNAMESPACES(DEFAULT N'http://schemas.microsoft.com/sqlserver/2004/07/showplan'), + cteQRequests (SPID,DatabaseName,[Status],RuntimeSec,BlockedBy,DatabaseMaint,EstFinishTime,MemRequestMB,MemGrantMB,MemGrantWait,DOP,query_cost,PAGEIOLATCHms,PAGELATCHms,RunnableCount,SpinLoopFlag,ThreadShortageFlag,ProgramName,OriginalLogin,sql_handle,statement_start_offset,statement_end_offset,plan_handle) + AS (SELECT r.session_id as SPID, + DB_NAME(s.database_id) as DatabaseName, + (CASE UPPER(r.[status]) + WHEN N'BACKGROUND' THEN CONVERT(int,1) + WHEN N'RUNNING' THEN CONVERT(int,2) + WHEN N'RUNNABLE' THEN CONVERT(int,3) + WHEN N'SLEEPING' THEN CONVERT(int,4) + WHEN N'SUSPENDED' THEN CONVERT(int,5) + ELSE CONVERT(int,NULL) + END) as [Status], + CONVERT(int,r.total_elapsed_time / 1000) + as RuntimeSec, + (CASE WHEN r.blocking_session_id = 0 THEN CONVERT(smallint,NULL) ELSE r.blocking_session_id END) + as BlockedBy, + r.command as DatabaseMaint, + r.estimated_completion_time as EstFinishTime, + CONVERT(float,m.requested_memory_kb / 1024.0) + as MemRequestMB, + CONVERT(float,m.granted_memory_kb / 1024.0) + as MemGrantMB, + (CASE WHEN m.session_id = r.session_id AND m.request_id = r.request_id AND m.grant_time IS NULL THEN CONVERT(int,1) ELSE CONVERT(int,0) END) + as MemGrantWait, + m.dop as DOP, + m.query_cost as query_cost, + (CASE WHEN r.wait_type LIKE N'PAGEIOLATCH_%' THEN r.wait_time ELSE CONVERT(int,NULL) END) + as PAGEIOLATCHms, + (CASE WHEN r.wait_type LIKE N'PAGELATCH_%' THEN r.wait_time ELSE CONVERT(int,NULL) END) + as PAGELATCHms, + st.RunnableCount as RunnableCount, + st.SpinLoopFlag as SpinLoopFlag, + st.ThreadShortageFlag as ThreadShortageFlag, + s.[program_name] as ProgramName, + s.original_login_name as OriginalLogin, + r.sql_handle, + r.statement_start_offset, + r.statement_end_offset, + r.plan_handle + FROM sys.dm_exec_requests r + LEFT JOIN sys.dm_exec_sessions s WITH (NOLOCK) + ON s.session_id = r.session_id + LEFT JOIN sys.dm_exec_query_memory_grants m WITH (NOLOCK) + ON m.session_id = r.session_id + AND m.request_id = r.request_id + LEFT JOIN (SELECT ot.session_id, + MAX((CASE WHEN ot.task_state = N'RUNNABLE' + THEN os.runnable_tasks_count + ELSE CONVERT(int,0) + END)) as RunnableCount, + MAX((CASE WHEN ot.task_state = N'SPINLOOP' + THEN CONVERT(int,1) + ELSE CONVERT(int,0) + END)) as SpinLoopFlag, + MAX((CASE WHEN ot.task_state = N'PENDING' + THEN CONVERT(int,1) + ELSE CONVERT(int,0) + END)) as ThreadShortageFlag + FROM sys.dm_os_schedulers os WITH (NOLOCK) + INNER JOIN sys.dm_os_tasks ot WITH (NOLOCK) + ON ot.scheduler_id = os.scheduler_id + AND ot.task_state IN (N'RUNNABLE',N'SPINLOOP',N'PENDING') + AND ot.scheduler_id < 1048576 + GROUP BY ot.session_id) st + ON st.session_id = r.session_id + WHERE r.database_id <> 32767 + AND r.session_id > 0 + AND r.session_id <> @@SPID + AND r.sql_handle = (SELECT top 1 r2.sql_handle + FROM sys.dm_exec_requests r2 WITH (NOLOCK) + WHERE r2.session_id = r.session_id + ORDER BY r2.start_time DESC) + AND r.statement_start_offset = (SELECT top 1 r3.statement_start_offset + FROM sys.dm_exec_requests r3 WITH (NOLOCK) + WHERE r3.session_id = r.session_id + AND r3.sql_handle = r.sql_handle + ORDER BY r3.start_time DESC) + ), + cteSLocks (SPID,SessionLocks) + AS (SELECT qr.SPID, + CONVERT(nvarchar(max),ISNULL( + STUFF((SELECT N',' + ISNULL(CONVERT(nvarchar(200),tl.request_mode + N' (' + tl.request_status + N':' + tl.resource_type + + (CASE tl.resource_type + WHEN N'DATABASE' THEN N':' + ISNULL(DB_NAME(tl.resource_database_id),N'') + WHEN N'OBJECT' THEN N':' + ISNULL(OBJECT_NAME(tl.resource_associated_entity_id,tl.resource_database_id),N'') + ISNULL(N'[' + CONVERT(nvarchar(10),i.UnusedIndexCount) + N']',N'') + ELSE N'' + END) + N')') + N'x' + CONVERT(nvarchar(10),COUNT(1)),N'') + FROM sys.dm_tran_locks tl WITH (NOLOCK) + OUTER APPLY (SELECT ius.database_id, + ius.[object_id], + COUNT(1) as UnusedIndexCount + FROM sys.dm_db_index_usage_stats ius WITH (NOLOCK) + WHERE ius.database_id = tl.resource_database_id + AND ius.[object_id] = tl.resource_associated_entity_id + AND ius.user_updates > (ius.user_seeks + ius.user_lookups + ius.user_scans) + AND tl.resource_type = N'OBJECT' + GROUP BY ius.database_id, + ius.[object_id]) i + WHERE tl.request_session_id = qr.SPID + AND N'NULL' <> ISNULL(tl.request_mode,N'NULL') + GROUP BY CONVERT(nvarchar(200),tl.request_mode + N' (' + tl.request_status + N':' + tl.resource_type + + (CASE tl.resource_type + WHEN N'DATABASE' THEN N':' + ISNULL(DB_NAME(tl.resource_database_id),N'') + WHEN N'OBJECT' THEN N':' + ISNULL(OBJECT_NAME(tl.resource_associated_entity_id,tl.resource_database_id),N'') + ISNULL(N'[' + CONVERT(nvarchar(10),i.UnusedIndexCount) + N']',N'') + ELSE N'' + END) + N')') + FOR XML PATH('')),1,1,N''),N'')) + as SessionLocks + FROM (SELECT SPID FROM cteQRequests WHERE @SessionLocks = CONVERT(bit,1) GROUP BY SPID) qr + ), + cteTempdb (SPID,TempdbWaitms,CursorOpen,CursorDormantms,TempdbDeallocMB,TempdbAllocMB,VerActive,VerDuration) + AS (SELECT qr.SPID, + (SELECT MAX(wt.wait_duration_ms) + FROM sys.dm_os_waiting_tasks wt WITH (NOLOCK) + WHERE wt.session_id = qr.SPID + AND wt.wait_type LIKE 'PAGE%LATCH_%' + AND wt.resource_description LIKE CONVERT(nvarchar(10),DB_ID(N'tempdb')) + N':%') + as TempdbWaitms, + (SELECT COUNT(1) + FROM sys.dm_exec_cursors (qr.SPID) + WHERE is_open = CONVERT(bit,1)) + as CursorOpen, + (SELECT MAX(dormant_duration) + FROM sys.dm_exec_cursors (qr.SPID) + WHERE is_open = CONVERT(bit,1)) + as CursorDormantms, + (SELECT CONVERT(float,SUM(tsu.internal_objects_dealloc_page_count + tsu.user_objects_dealloc_page_count) / 128.0) + FROM tempdb.sys.dm_db_task_space_usage tsu WITH (NOLOCK) + WHERE tsu.session_id = qr.SPID) + as TempdbDeallocMB, + (SELECT CONVERT(float,SUM(tsu.internal_objects_alloc_page_count + tsu.user_objects_alloc_page_count) / 128.0) + FROM tempdb.sys.dm_db_task_space_usage tsu WITH (NOLOCK) + WHERE tsu.session_id = qr.SPID) + as TempdbAllocMB, + (SELECT COUNT(1) + FROM sys.dm_tran_active_snapshot_database_transactions v WITH (NOLOCK) + WHERE v.session_id = qr.SPID + AND v.commit_sequence_num IS NULL) + as VerActive, + (SELECT MAX(v.elapsed_time_seconds) + FROM sys.dm_tran_active_snapshot_database_transactions v WITH (NOLOCK) + WHERE v.session_id = qr.SPID + AND v.commit_sequence_num IS NULL) + as VerDuration + FROM cteQRequests qr + GROUP BY qr.SPID + ), + cteQPlan (plan_handle,PlanType,ObjectName,ParameterList,Cardinality,[AvgMissingIndex%],SortRows,TableScanRows,MissingJoin) + AS (SELECT qr.plan_handle, + (SELECT top 1 RTRIM(cp.objtype) + FROM sys.dm_exec_cached_plans cp WITH (NOLOCK) + WHERE cp.plan_handle = qr.plan_handle) + as PlanType, + CONVERT(nvarchar(129),ISNULL(N':' + OBJECT_NAME(qp.objectid,qp.dbid),N'')) + as ObjectName, + CONVERT(nvarchar(max), + STUFF((SELECT N',' + l.value('@Column', 'nvarchar(128)') + N'=' + l.value('@ParameterCompiledValue', 'nvarchar(4000)') + FROM qp.query_plan.nodes('//ParameterList/ColumnReference') AS prm(l) + FOR XML PATH('')),1,1,N'')) + as ParameterList, + (SELECT CONVERT(float,MAX(s.value('@StatementEstRows', 'float'))) + FROM qp.query_plan.nodes('//StmtSimple') stmt(s)) + as Cardinality, + (SELECT CONVERT(float,AVG(i.value('@Impact', 'float'))) + FROM qp.query_plan.nodes('.//MissingIndexGroup') midx(i)) + as [AvgMissingIndex%], + (SELECT CONVERT(float,SUM(op.value('@EstimateRows', 'float'))) + FROM qp.query_plan.nodes('//RelOp') rel(op) + WHERE N'Sort' = op.value('@PhysicalOp','nvarchar(60)')) + as SortRows, + (SELECT CONVERT(float,SUM(op.value('@EstimateRows', 'float'))) + FROM qp.query_plan.nodes('//RelOp') rel(op) + WHERE N'Table Scan' = op.value('@PhysicalOp','nvarchar(60)')) + as TableScanRows, + (SELECT COUNT(1) + FROM qp.query_plan.nodes('//Warnings[(@NoJoinPredicate[.="1"])]') nojoin(p)) + as MissingJoin + FROM (SELECT plan_handle FROM cteQRequests WHERE plan_handle IS NOT NULL GROUP BY plan_handle) qr + CROSS APPLY sys.dm_exec_query_plan(qr.plan_handle) qp + ), + cteQStats (sql_handle,plan_handle,RunCount,MinTimeSec,MaxTimeSec,MinRows,MaxRows,AvgCpuLowms,CpuHighms,AvgLogicalReadsMB,[PhyReads%]) + AS (SELECT qr.sql_handle, + qr.plan_handle, + MAX(qs.execution_count) as RunCount, + CONVERT(bigint,(MIN(qs.min_elapsed_time) / 1000) / 1000) + as MinTimeSec, + CONVERT(bigint,(MAX(qs.max_elapsed_time) / 1000) / 1000) + as MaxTimeSec, + MIN(qs.min_rows) as MinRows, + MAX(qs.max_rows) as MaxRows, + CONVERT(bigint,AVG(qs.min_worker_time) / 1000) + as AvgCpuLowms, + CONVERT(bigint,MAX(qs.max_worker_time) / 1000) + as CpuHighms, + CONVERT(float,(MAX(qs.total_logical_reads) / MAX(qs.execution_count)) / 128.0) + as AvgLogicalReadsMB, + (CASE WHEN MAX(qs.total_logical_reads) >= CONVERT(bigint,1) + THEN CONVERT(float,MAX(qs.total_physical_reads) * 100.0) / CONVERT(float,MAX(qs.total_logical_reads)) + ELSE CONVERT(float,0.0) + END) as [PhyReads%] + FROM (SELECT sql_handle, plan_handle FROM cteQRequests GROUP BY sql_handle, plan_handle) qr + LEFT JOIN sys.dm_exec_query_stats qs WITH (NOLOCK) + ON qs.sql_handle = qr.sql_handle + AND qs.plan_handle = qr.plan_handle + GROUP BY qr.sql_handle, + qr.plan_handle + ) +SELECT qr.SPID, + MAX(qr.DatabaseName) as DatabaseName, + (CASE MIN(qr.[Status]) + WHEN 1 THEN CONVERT(nvarchar(10),N'Background') + WHEN 2 THEN CONVERT(nvarchar(10),N'Running') + WHEN 3 THEN CONVERT(nvarchar(10),N'Runnable') + WHEN 4 THEN CONVERT(nvarchar(10),N'Sleeping') + WHEN 5 THEN CONVERT(nvarchar(10),N'Suspended') + ELSE CONVERT(nvarchar(10),NULL) + END) as [Status], + (CASE WHEN UPPER(MAX(qp.PlanType)) = N'PROC' + THEN CONVERT(nvarchar(133),N'Proc' + MAX(qp.ObjectName)) + ELSE CONVERT(nvarchar(133),MAX(qp.PlanType)) + END) as PlanType, + (CASE WHEN MAX(qr.query_cost) < 10 THEN CONVERT(nvarchar(10),N'Low') + WHEN MAX(qr.query_cost) < 100 THEN CONVERT(nvarchar(10),N'Medium') + WHEN MAX(qr.query_cost) < 1000 THEN CONVERT(nvarchar(10),N'Med-High') + WHEN MAX(qr.query_cost) < 10000 THEN CONVERT(nvarchar(10),N'High') + WHEN MAX(qr.query_cost) >= 10000 THEN CONVERT(nvarchar(10),N'VHigh') + ELSE CONVERT(nvarchar(10),NULL) + END) as QueryCost, + CONVERT(nvarchar(200),REPLACE(REPLACE(RTRIM( + (CASE WHEN MIN(qr.[Status]) <> 2 AND MAX(qr.RunnableCount) > 2 AND @RunnableCountAvg > 1 + THEN CONVERT(nvarchar(8),N'CPUWait ') + ELSE N'' END + + CASE WHEN MAX(t.CursorOpen) > 0 AND MAX(t.CursorDormantms) >= 1 + THEN CONVERT(nvarchar(27),N'Cursor(' + CONVERT(nvarchar(16),MAX(t.CursorDormantms)) + N'ms) ') + ELSE N'' END + + CASE WHEN MAX(qr.EstFinishTime) >= 1 + THEN CONVERT(nvarchar(41),REPLACE(MAX(qr.DatabaseMaint),N' ',N'~')) + N'(' + + (CASE WHEN (MAX(qr.EstFinishTime) / 60000) > 600 + THEN N'>10hr) ' + ELSE CONVERT(nvarchar(3),MAX(qr.EstFinishTime) / 60000) + N'min) ' + END) + ELSE N'' END + + CASE WHEN MAX(qr.query_cost) >= 10 AND MAX(qp.[AvgMissingIndex%]) > 20 + THEN CONVERT(nvarchar(7),N'IdxGap ') + ELSE N'' END + + CASE WHEN CHARINDEX(N'[',MAX(sl.SessionLocks)) > 0 + THEN CONVERT(nvarchar(8),N'IdxIdle ') + ELSE N'' END + + CASE WHEN SUM(qr.MemGrantMB) > CONVERT(float,SUM(qr.MemRequestMB) + 0.00001) + THEN CONVERT(nvarchar(32),N'InitialMem(') + CONVERT(nvarchar(17),CONVERT(numeric(16,2),SUM(qr.MemRequestMB))) + N'MB) ' + ELSE N'' END + + CASE WHEN MAX([PhyReads%]) > CONVERT(float,20.0) + OR (MAX(qr.query_cost) >= 10 AND @PendingIOCountAvg > 1 AND (MAX([PhyReads%]) > CONVERT(float,5.0) OR MAX(qr.PAGEIOLATCHms) > 50)) + THEN (CASE WHEN (@ProcessMemLow + @SystemMemLow) > 0 + THEN CONVERT(nvarchar(9),N'IO(MemP) ') + ELSE CONVERT(nvarchar(9),N'IO ') + END) + ELSE N'' END + + CASE WHEN 0 < CHARINDEX(N'(WAIT',MAX(sl.SessionLocks)) + THEN CONVERT(nvarchar(9),N'LockWait ') + ELSE N'' END + + CASE WHEN MAX(qr.MemGrantWait) = 1 + THEN CONVERT(nvarchar(8),N'MemWait ') + ELSE N'' END + + CASE WHEN MAX(qp.MissingJoin) > 0 + THEN CONVERT(nvarchar(9),N'MissJoin ') + ELSE N'' END + + CASE WHEN MAX(qr.PAGELATCHms) >= 1 + THEN CONVERT(nvarchar(23),N'PageWait(' + CONVERT(nvarchar(10),MAX(qr.PAGELATCHms)) + N'ms) ') + ELSE N'' END + + CASE WHEN MAX(qp.ParameterList) <> N'' AND UPPER(MAX(qp.PlanType)) IN (N'PROC',N'ADHOC') AND MAX(qs.RunCount) > 1 + AND ( CONVERT(float,MAX(qs.MaxRows) / 10.0) > CONVERT(float,((MAX(qs.MinRows) / 10.0) * (4.0 * @ParamSniff)) + POWER(CONVERT(float,10.0),@ParamSniff)) + OR (MAX([PhyReads%]) > CONVERT(float,20.0) + OR (MAX(qr.query_cost) >= 10 AND @PendingIOCountAvg > 1 AND (MAX([PhyReads%]) > CONVERT(float,5.0) OR MAX(qr.PAGEIOLATCHms) > 50))) + OR ((MAX(t.TempdbAllocMB) - MAX(t.TempdbDeallocMB)) + > (CASE WHEN CONVERT(int,(SUM(qr.MemGrantMB) / 10) * ((100 - ISNULL(MAX(qp.[AvgMissingIndex%]),0)) / 100)) > 49 + THEN CONVERT(int,50) + ELSE 1 + CONVERT(int,(SUM(qr.MemGrantMB) / 10) * ((100 - ISNULL(MAX(qp.[AvgMissingIndex%]),0)) / 100)) + END))) + AND CONVERT(float,MAX(qs.CpuHighms) / 10.0) > CONVERT(float,((MAX(qs.AvgCpuLowms) / 10.0) * (4.0 * @ParamSniff)) + POWER(CONVERT(float,10.0),@ParamSniff)) + AND ((CASE WHEN MAX(qr.RuntimeSec) > MAX(qs.MaxTimeSec) THEN MAX(qr.RuntimeSec) ELSE MAX(qs.MaxTimeSec) END) - MAX(qs.MinTimeSec)) + > ((MAX(qs.MinTimeSec) / 10) + POWER(CONVERT(bigint,10),@ParamSniff)) + THEN CONVERT(nvarchar(37),N'ParamSniff(') + CONVERT(nvarchar(10),MAX(qs.MinTimeSec)) + N'-' + + CONVERT(nvarchar(10),(CASE WHEN MAX(qr.RuntimeSec) > MAX(qs.MaxTimeSec) THEN MAX(qr.RuntimeSec) ELSE MAX(qs.MaxTimeSec) END)) + N'Sec) ' + ELSE N'' END + + CASE WHEN MAX(qr.SpinLoopFlag) = 1 + THEN CONVERT(nvarchar(9),N'SpinLoop ') + ELSE N'' END + + CASE WHEN (MAX(t.TempdbAllocMB) - MAX(t.TempdbDeallocMB)) + > (CASE WHEN CONVERT(int,(SUM(qr.MemGrantMB) / 10) * ((100 - ISNULL(MAX(qp.[AvgMissingIndex%]),0)) / 100)) > 49 + THEN CONVERT(int,50) + ELSE 1 + CONVERT(int,(SUM(qr.MemGrantMB) / 10) * ((100 - ISNULL(MAX(qp.[AvgMissingIndex%]),0)) / 100)) + END) + THEN CONVERT(nvarchar(27),N'Tempdb') + + (CASE WHEN MAX(t.TempdbWaitms) >= 1 THEN N'(' + CONVERT(nvarchar(16),MAX(t.TempdbWaitms)) + N'ms) ' ELSE N' ' END) + ELSE N'' END + + CASE WHEN MAX(qr.ThreadShortageFlag) = 1 AND @ThreadShortageAvg > 0 + THEN CONVERT(nvarchar(15),N'ThreadShortage ') + ELSE N'' END + + CASE WHEN @VerCleanupRatio < CONVERT(float,80.0) AND MAX(t.VerDuration) >= 1 + THEN CONVERT(nvarchar(25),N'Ver(') + CONVERT(nvarchar(16),MAX(t.VerDuration)) + N'sec) ' + ELSE N'' END + )),N' ',N','),N'~',N' ')) as ThrottlePotential, + MAX(qr.RuntimeSec) as RuntimeSec, + CONVERT(nvarchar(50), + STUFF((SELECT N',' + CONVERT(nvarchar(50),qr2.BlockedBy) + FROM cteQRequests qr2 + WHERE qr2.SPID = qr.SPID + AND qr2.BlockedBy IS NOT NULL + GROUP BY CONVERT(nvarchar(50),qr2.BlockedBy) + FOR XML PATH('')),1,1,N'')) + as BlockedBy, + (SELECT CONVERT(nvarchar(max), + SUBSTRING(qt.text+' ',(MAX(qr.statement_start_offset) / 2) + 1, + ((CASE WHEN MAX(qr.statement_end_offset) = -1 + THEN DATALENGTH(qt.text) + ELSE MAX(qr.statement_end_offset) + END - MAX(qr.statement_start_offset)) / 2) + 1)) + FROM sys.dm_exec_sql_text(qr.sql_handle) qt) + as Query, + MAX(qr.MemGrantMB) as MemGrantMB, + MAX(qs.RunCount) as RunCount, + MAX(qs.MinRows) as MinRows, + MAX(qs.MaxRows) as MaxRows, + MAX(qs.AvgCpuLowms) as AvgCpuLowms, + MAX(qs.CpuHighms) as CpuHighms, + MAX(qr.DOP) as DOP, + MAX(qs.AvgLogicalReadsMB) as AvgLogicalReadsMB, + (CASE WHEN MAX(qs.RunCount) IS NOT NULL THEN MAX(qs.[PhyReads%]) ELSE CONVERT(float,NULL) END) + as [PhyReads%], + MAX(qr.PAGEIOLATCHms) as PAGEIOLATCHms, + MAX(sl.SessionLocks) as SessionLocks, + MAX(t.VerActive) as VerActive, + MAX(t.TempdbAllocMB) as TempdbAllocMB, + MAX(t.TempdbDeallocMB) as TempdbDeallocMB, + MAX(qp.Cardinality) as Cardinality, + MAX(qp.[AvgMissingIndex%]) as [AvgMissingIndex%], + MAX(qp.SortRows) as SortRows, + MAX(qp.TableScanRows) as TableScanRows, + MAX(qp.ParameterList) as CachedParam, + (SELECT top 1 query_plan FROM sys.dm_exec_query_plan(qr.plan_handle)) + as CachedPlan, + MAX(qr.ProgramName) as ProgramName, + MAX(qr.OriginalLogin) as OriginalLogin, + @Runtime as LogDateTime + FROM cteQRequests qr + LEFT JOIN cteQPlan qp + ON qp.plan_handle = qr.plan_handle + LEFT JOIN cteQStats qs + ON qs.sql_handle = qr.sql_handle + AND qs.plan_handle = qr.plan_handle + LEFT JOIN cteSLocks sl + ON sl.SPID = qr.SPID + LEFT JOIN cteTempdb t + ON t.SPID = qr.SPID + GROUP BY qr.SPID, + qr.sql_handle, + qr.plan_handle +HAVING (SELECT CONVERT(nvarchar(max), + SUBSTRING(qt.text+' ',(MAX(qr.statement_start_offset) / 2) + 1, + ((CASE WHEN MAX(qr.statement_end_offset) = -1 + THEN DATALENGTH(qt.text) + ELSE MAX(qr.statement_end_offset) + END - MAX(qr.statement_start_offset)) / 2) + 1)) + FROM sys.dm_exec_sql_text(qr.sql_handle) qt) IS NOT NULL + ORDER BY qr.SPID +END; + +GO \ No newline at end of file diff --git a/Stored_Procedure/dbo.sp_PrintString.sql b/Stored_Procedure/dbo.sp_PrintString.sql index 7fe8ccae..6633031c 100644 --- a/Stored_Procedure/dbo.sp_PrintString.sql +++ b/Stored_Procedure/dbo.sp_PrintString.sql @@ -2,93 +2,69 @@ IF OBJECT_ID('dbo.sp_PrintString', 'P') IS NULL EXEC ('CREATE PROCEDURE dbo.sp_PrintString AS SELECT 1'); GO -ALTER PROCEDURE dbo.sp_PrintString( - @str NVARCHAR(MAX) +ALTER PROCEDURE dbo.sp_PrintString ( + @str NVARCHAR(MAX) ) AS -/* -DECLARE @longStr NVARCHAR(MAX) = REPLICATE(N'R', 5000) + CAST(CHAR(13) AS NVARCHAR(MAX)) + REPLICATE(N'Я', 5000) + CAST(CHAR(13) + N'ё' AS NVARCHAR(MAX)); -PRINT('Microsoft PRINT with string truncating:'); -PRINT(@longStr); -PRINT('Right PRINT using dbo.sp_PrintString without string truncating:'); -EXEC dbo.sp_PrintString @str = @longStr; -*/ BEGIN - DECLARE @line NVARCHAR(MAX) - , @startLocation INT - , @length INT - , @totalLength INT - , @current INT; - - SELECT @startLocation = 1 - ,@totalLength = DATALENGTH(@str) - ,@current = 1 - ,@length = 0 + DECLARE @line NVARCHAR(MAX), + @startLocation INT = 1, + @length INT = 0, + @totalLength INT = DATALENGTH(@str), + @current INT = 1; DECLARE @PrintLine NVARCHAR(MAX) = - N'DECLARE @pos int = 1 - WHILE @pos <= LEN(@line) - BEGIN - PRINT SUBSTRING(@line, @pos, 4000); - SET @pos = @pos + 4000; - END;' + N' + DECLARE @pos INT = 1 + WHILE @pos <= LEN(@line) + BEGIN + PRINT SUBSTRING(@line, @pos, 4000); + SET @pos = @pos + 4000; + END;'; WHILE @current <= @totalLength BEGIN - IF ( - SUBSTRING(@str, @current, 2) IN ( - CHAR(0x0D) + CHAR(0x0A) - ,CHAR(0x0A) + CHAR(0x0D) - ) - ) + IF SUBSTRING(@str, @current, 2) IN ( + CHAR(0x0D) + CHAR(0x0A), + CHAR(0x0A) + CHAR(0x0D) + ) BEGIN IF @length <= 0 PRINT ''; ELSE - BEGIN -- line + BEGIN SELECT @line = SUBSTRING(@str, @startLocation, @length); - - EXEC sp_executesql @PrintLine - ,N'@line NVARCHAR(max)' - ,@line; + EXEC sp_executesql @PrintLine, N'@line NVARCHAR(MAX)', @line; END - SELECT @startLocation = @current + 2 - , @current = @current + 2 - , @length = 0; + SELECT @startLocation = @current + 2, + @current = @current + 2, + @length = 0; CONTINUE; END - ELSE IF ( - SUBSTRING(@str, @current, 1) IN ( - CHAR(0x0D) - ,CHAR(0x0A) - ) - ) + ELSE IF SUBSTRING(@str, @current, 1) IN (CHAR(0x0D), CHAR(0x0A)) BEGIN IF @length <= 0 PRINT ''; ELSE BEGIN SELECT @line = SUBSTRING(@str, @startLocation, @length); - - EXEC sp_executesql @PrintLine - ,N'@line NVARCHAR(max)' - ,@line; + EXEC sp_executesql @PrintLine, N'@line NVARCHAR(MAX)', @line; END - SELECT @startLocation = @current + 1 - ,@current = @current + 1 - ,@length = 0; + SELECT @startLocation = @current + 1, + @current = @current + 1, + @length = 0; CONTINUE; END - SELECT @current = @current + 1 - , @length = @length + 1; + SELECT @current = @current + 1, + @length = @length + 1; END - IF (@startLocation <= DATALENGTH(@str)) + IF @startLocation <= DATALENGTH(@str) PRINT SUBSTRING(@str, @startLocation, DATALENGTH(@str)); END; GO diff --git a/Stored_Procedure/dbo.sp_RestoreGene.sql b/Stored_Procedure/dbo.sp_RestoreGene.sql index 7bea9b5d..f9a3051e 100644 --- a/Stored_Procedure/dbo.sp_RestoreGene.sql +++ b/Stored_Procedure/dbo.sp_RestoreGene.sql @@ -1,26 +1,61 @@ USE [master] GO IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_NAME = 'sp_RestoreGene') -EXEC ('CREATE PROC dbo.sp_RestoreGene AS SELECT 1') +EXEC ('CREATE PROC dbo.sp_RestoreGene AS SELECT ''stub version, to be replaced''') GO - + /********************************************************************************************* -Restore Generator v4.3 (2014-10-03) +Restore Generator v8.3 (2022-04-11) (C) 2012, Paul Brewer - + Feedback: paulbrewer@yahoo.co.uk -Updates: https://paulbrewer.wordpress.com/ - +User Guide: https://restoregene.com + This procedure queries msdb database backup history and database file details in master. -It builds and returns RESTORE DATABASE commands as it's result set, it does not execute the commands. - +It builds and returns RESTORE DATABASE commands as its result set, it does not execute the commands. + +---------------------------------------------------------------------------------------------- +PARAMETERS: + +@Database - Default NULL, Restore a specific database or a list of comma seperated database names, NULL which restores all user databases. +@TargetDatabase - Defaults to NULL, override restored database name, only possible if restoring one specific database, if supplied will rename database files and log file too. +@WithMoveDataFiles - Defaults to the actual data file paths, overrides WITH MOVE for data file folder +@WithMoveLogFile - Defaults to the actual log file path, overrides WITH MOVE for log file folder +@WithMoveFileStreamFile - Defaults to the actual file stream file path, overrides WITH MOVE for file stream file folder +@FromFileFullUNC - Defaults to actual backup file drive and folder, UNC path to full backup file +@FromFileDiffUNC - Defaults to actual drive and folder, UNC path to differential backup file +@FromFileLogUNC - Defaults to actual drive and folder, UNC path to log backup files +@StopAt - Defaults to current (datetime2), Stop At a specific date time +@StandbyMode - Defaults to 0, Leave database in standby mode +@IncludeSystemDBs - Defaults to 0, include master, model and msdb database restores +@WithRecovery - Defaults to 0, Recover database(s) after restore +@WithCHECKDB - Defaults to 0, Include a CHECKDB after recovery +@WithReplace - Defaults to 0, replace existing database when no tail log backup exists +@LogShippingStartTime - Only used by ps_RestoreGene +@LogShippingLastLSN - Only used by ps_RestoreGene +@BlobCredential - Defaults to NULL, SQL Credential for Azure Blog Storage Account +@RestoreScriptReplaceThis - Defaults to NULL, Restore Script String Find +@RestoreScriptWithThis - Defaults to NULL, Restore Script String Replace +@SuppressWithMove - Default 1, Exclude WITH MOVE statements from the Restore Script +@PivotWithMove - Default 0, If SuppressWithMove = 0, pivot secondary files to new rows in the result set +@RestoreScriptOnly - Default 0, Return just the RESTORE DATABASE commands +@DropDatabaseAfterRestore - Default 0, Drops the database after the restore, use with check db +@SetSingleUser - Default 0, Adds ALTER DATABASE @database SET SINGLE_USER WITH ROLLBACK IMMEDIATE +@ExcludeDiffAndLogBackups - Default 0, 0=full+diff+ log, 1=full only, 2-full+diff, 3=full+log, 4=diff+log +@IncludeDeviceType7 - Defaults to 1, Include device type 7 backups in restore script +@IncludeDeviceType102 - Defaults to 1, Include device type 102 backups in restore script +@IncludeDeviceType2 - Defaults to 1, Include device type 2 backups in restore script +@IncludeDeviceType9 - Defaults to 1, Include device type 9 backups in restore script + +---------------------------------------------------------------------------------------------- CHANGE LOG: + December 23, 2012 - V1.01 - Release -January 4,2013 - V1.02 - LSN Checks + Bug fix to STOPAT date format -January 11,2013 - V1.03 - SQL Server 2005 compatibility (backup compression problem) & @StandbyMode +January 4, 2013 - V1.02 - LSN Checks + Bug fix to STOPAT date format +January 11, 2013 - V1.03 - SQL Server 2005 compatibility (backup compression problem) & @StandbyMode January 14, 2013 - V1.04 - WITH COPY and up to 10 striped backup files January 15, 2013 - V1.05 - Format of constructed restore script, enclose database name in [ ] -February 7, 2013 - V1.06 - Modified WHERE device_type IN (7,102,2) +February 7, 2013 - V1.06 - Modified WHERE device_type IN (7,102,2,9) May 26, 2013 - V1.07 - Various changes for PoSh Driver Script compatibility October 14, 2013 - V1.08 - Rename parameters, more meaningful names October 15, 2013 - V2.00 - Add 2nd CTE for striped backup files and remove repeating calls to CTE @@ -28,11 +63,11 @@ November 5, 2013 - V2.01 - Secondary .ndf files only included if @WithMoveDat - Extended artificial LSN used for sequencing WITH RECOVERY/CHECKDB to 21 characters - Include database name in results for logging in PoSh May 23, 2014 - V3.0 - Improved logging and error handling, add 'LogShippingVariableDeclare' parameter - Default is Yes when called from query analysier, set to No when called by PoSh + Default is Yes when called from query analyser, set to No when called by PoSh May 30, 2014 - V3.1 - Restructured CTE, all predicates moved to the CTE June 6, 2014 - V3.2 - Add 'LogShippingStartTime' parameter for PowerShell script. To skip subsequent full and diff backups when restoring Logs in PoSh log shipping mode - - Add 'Target Restore Database Name' parameter, Manuj Bahl suggestion + - Add 'Target Restore Database Name' parameter If restoring a specific database, allows overriding restored name Probably used in conjunction with a @WithMove override of data and log files to a different folder. - Add LogShippingLastLSN parameter, used to filter results sent to ps_LogShippingLight @@ -45,24 +80,94 @@ August 5, 2014 - V3.4 - Remove TRY CATCH blocks from log restores and chec - Remove CTE's,use #temp tables, suggested by S.Stresser August 25, 2014 - V3.5 - goestock suggestion - Include device type 7 for AWS EC2 backups August 29th, 2014 - V3.6 - Richard found and fixed a problem with variable declare where database name has a space or full stop. -July 28, 2015 - V3.7 - Luke Sarro, modifications for case sensitivity & parameter sniffing +July 28, 2015 - V3.7 - Luke Sarro, modifications for case sensitivity & parameter sniffing, a massive amount of work done. August 28, 2015 - V3.8 - Luke Sarro modifications, recovery fork management. supports forking in recovery plans when constructing a restore script. Only tested where a single fork exists, IE a restore was done to a historic point in time, with recovery, then subsequent log backups are taken. When a fork exists the restore script will follow the new path for subsequent differential and log backups taken after the forking point. If no rbackup forks exist, the procedure works as before. -September 02 2015 - V3.9 - SQLMongo modification to replace hyphens in database name -September 04, 2015 - V4.0 - Domingo modification, check for default backup path = '' +September 02 2015 - V3.9 - SQLMongo modification to replace hyphens in database name +September 04, 2015 - V4.0 - Domingo modification, check for default backup path = '' September 29, 2015 - V4.2 - Fixes bug identifying full backups taken after a recovery fork, has introduced code duplication to be removed later but fixes problem -October 3, 2015 - V4.3 - Remove code duplication introduced in V4.2 +October 3, 2015 - V4.3 - Remove code duplication introduced in V4.2 +* +June 3rd, 2016 - V5.0 - Feedback from Brent Ozar related viewing spike: + - V5.0 - Reintroduce SQL Server 2005 compatibility - Bob McLaren - Declaring and assigning variables on same line doesn't work with SQL Server 2005. + - V5.0 - Override data and log file paths if overriding restored database name + +June 11th, 2016 - V5.1 - Azure http url restore support, mick@sqlfairy.com + - V5.1 - Restore Script find and replacement variables, mick@sqlfairy.com + +June 17th, 2016 - V5.2 - Removed TRY CATCH block in log restore commands +June 26th, 2016 - V5.3 - Include FILESTREAM files in WITH MOVE, jgkiran +July 3rd, 2016 - V5.4 - New parameter for FILESTREAM files, for WITH MOVE parameter, jgkiran +July 14rd, 2016 - V5.5 - Rename rollback files when standby = 1 to allow multiple concurrent ps_RestoreGene invocations, jgkiran + +August 8th, 2016 - V5.6 - Accepts a comma separated variable list of databases to restore, suggested Stephen T + - Got permission to reuse the 'SELECT DATABASES' code snippet from ola hallengren - https://ola.hallengren.com/ +August 8th, 2016 - V5.7 - Make restore to new database, secondary file names, more meaningful +August 9th, 2016 - V5.8 - Include the WITH MOVE statements on the same results line as the corresponding RESTORE DATABASE statement, flatten the result set to simplify the PoSh driver +August 9th, 2016 - V5.9 - New Parameter, suppress WITH MOVE statements is default, parameter allows override to include them in the script. + +August 13th, 2016 - V6.0 + - Add parameter option to pivot WITH MOVE secondary files to a new result set line. Not compatible with PoSh driver, useful with large, complex databases. + - Add a parameter option to include just the restore script in the result set. Not compatible with PoSh driver, useful as SQL Agent Job step output. + +August 14th, 2016 - V6.1 - Remove parameter @UseDefaultDatabaseBackupPath , no longer used +August 15th, 2016 - V6.2 - @TargetDatabase parameter, file rename tidy +August 17th, 2016 - V6.3 - Edge case fix to fork point LSN +August 19th, 2016 - V6.4 - Publish SQL Server Central +September 4th, 2016 - V6.41 - PoSh Driver Last LSN minor fix. - Published SQL Server Central +September 9th, 2016 - V6.42 - Fix for multiple log files with move, J.Peablles +September 9th, 2016 - V6.43 - Fix for mirrored backups, C.Richardson +September 9th, 2016 - V6.44 - Mod to log file LSN selection, include if matches diff, R.Devries +September 30th, 2016 - V6.45 - Improvements to the output generated when @RestoreScriptOnly = 1, John Lee +September 30th, 2016 - V6.5 - New 'Drop Database After Restore' parameter for use with CHECKDB and automated backup verification, John Lee + +November 5th, 2016 - V6.51 - Increase length of @Database parameter to allow for more comma seperated database names +November 5th, 2016 - V6.52 - Edge case log exclusion criteria mod, R.Devries +November 5th, 2016 - V6.53 - New parameter option to include ALTER DATABASE @database SET SINGLE_USER WITH ROLLBACK IMMEDIATE, Hakan Ekman +November 5th, 2016 - V6.54 - New parameter option to exclude differential and log backups (presumaby for development environment refreshes), Mehedi Amin + +November 19th, 2016 - V6.55 - Remove semi colon from start of T-SQL restore command strings, serves no purpose +November 19th, 2016 - V6.56 - Remove variable declare, log reference and RAISERROR, serves no purpose and generates an error in edge cases ( my_database and my-database ), Lars Rasmussen +November 19th, 2016 - V6.57 - Parameters options for device types to include, Lars Rasmussen + +December 3rd, 2016 - V6.58 - Remove TIME function from STANDBY mode file name construct, for SQL Server 2005 compatibility, Erwin Louwerse +March 26th, 2017 - V6.59 - Significant performance improvements where an instance has many databases, Simone Bizzotto + +June 24th, 2017 - V6.70 - Case Sensitive Collation Database Compatibility - M.Pollock +September 9th, 2017 - V6.71 - Device Type filter fix, LostInEurope01 +November 11th, 2017 - V6.72 - Mod to log file selection, R.Devries + - Increase @Databases variable length, Bob +Febuary 14th, 2018 - V6.73 - Add escape characters to database name in SET SINGLE_USER, Rod +Febuary 16th, 2018 - V7.0 - Increase support for stripped backup files from 10 to 15, Mehedi +Febuary 17th, 2018 - V8.0 - Extensive changes to the backup fork handling, Mike +March 30th, 2018 - V8.04 - Code refactor +May 25th, 2018 - V8.05 - Missing exclusion of copy only backups reintroduced - Andy +August 25th, 2018 - V8.10 - Enhancements to the @ExcludeDiffAndLogBackups parameters, Bob and Chris F + - Change from parameter data type from bit to int + - 0 (default) = full, diff and logs, 1 = full only, 2 = full and diff, 3 = full and logs + - Existing BIT data type functionality retained and extended by new values 2 and 3. +November 8th, 2018 - V8.11 - Bug fix to last log file - Mike +December 6th, 2018 - V8.12 - Optimisation and environment setup fix - Adam +January 12th, 2019 - V8.13 - Sequence of FROM DISK = 'Stripe' files in RESTORE command +January 3rd, 2021 - V8.14 - Restore from Azure blog storage using FROM DISK instead of FROM URL for backup stripes - Aaron +January 9rd, 2021 - V8.15 - Change parameter @ExcludeDiffAndLogBackups, new option 4 to exclude full restore, return incremental diff & log restores - Mehedi Amin +July 11th, 2021 - V8.16 - Add support for an additional 5 stripes bring the total supported to 20, Steven Dannen +April 5th, 2023 - V8.2 - Masood : Bug fix restoring striped backups +April 11th, 2023 - V8.3 - Aaron : Result Set Columns fix + + +* ********************************************************************************************/ - - -ALTER PROC dbo.sp_RestoreGene + +ALTER PROC [dbo].[sp_RestoreGene] ( - @Database SYSNAME = NULL, + @Database VARCHAR(MAX) = NULL, @TargetDatabase SYSNAME = NULL, @WithMoveDataFiles VARCHAR(2000) = NULL, @WithMoveLogFile VARCHAR(2000) = NULL, + @WithMoveFileStreamFile VARCHAR(2000) = NULL, @FromFileFullUNC VARCHAR(2000) = NULL, @FromFileDiffUNC VARCHAR(2000) = NULL, @FromFileLogUNC VARCHAR(2000) = NULL, @@ -72,934 +177,1556 @@ ALTER PROC dbo.sp_RestoreGene @WithRecovery BIT = 0, @WithCHECKDB BIT = 0, @WithReplace BIT = 0, - @UseDefaultDatabaseBackupPath BIT = 0, - @Log_Reference VARCHAR (250) = NULL, - @LogShippingVariableDeclare BIT = 1, + + -- Parameters for PowerShell script use only @LogShippingStartTime DATETIME = NULL, - @LogShippingLastLSN VARCHAR(25) = NULL + @LogShippingLastLSN VARCHAR(25) = NULL, + -- Parameters for PowerShell script use only + + @BlobCredential VARCHAR(255) = NULL, --Credential used for Azure blob access + @RestoreScriptReplaceThis NVARCHAR(255) = NULL, + @RestoreScriptWithThis NVARCHAR(255) = NULL, + @SuppressWithMove BIT = 1, + @PivotWithMove BIT = 0, + @RestoreScriptOnly BIT = 0, + @DropDatabaseAfterRestore BIT = 0, + @SetSingleUser BIT = 0, + @ExcludeDiffAndLogBackups INT = 0, + + -- Options to exclude device types + @IncludeDeviceType7 BIT = 0, --virtual device + @IncludeDeviceType102 BIT = 1, + @IncludeDeviceType2 BIT = 1, + @IncludeDeviceType9 BIT = 1 ) AS BEGIN - -SET NOCOUNT ON; - --- Avoid Parameter Sniffing Problems -DECLARE @Database_ SYSNAME = @Database, - @TargetDatabase_ SYSNAME = @TargetDatabase, - @WithMoveDataFiles_ VARCHAR(2000) = @WithMoveDataFiles, - @WithMoveLogFile_ VARCHAR(2000) = @WithMoveLogFile, - @FromFileFullUNC_ VARCHAR(2000) = @FromFileFullUNC, - @FromFileDiffUNC_ VARCHAR(2000) = @FromFileDiffUNC, - @FromFileLogUNC_ VARCHAR(2000) = @FromFileLogUNC, - @StopAt_ DATETIME = @StopAt, - @StandbyMode_ BIT = @StandbyMode, - @IncludeSystemDBs_ BIT = @IncludeSystemDBs, - @WithRecovery_ BIT = @WithRecovery, - @WithCHECKDB_ BIT = @WithCHECKDB, - @WithReplace_ BIT = @WithReplace, - @UseDefaultDatabaseBackupPath_ BIT = @UseDefaultDatabaseBackupPath, - @Log_Reference_ VARCHAR (250) = @Log_Reference, - @LogShippingVariableDeclare_ BIT = @LogShippingVariableDeclare, - @LogShippingStartTime_ DATETIME = @LogShippingStartTime, - @LogShippingLastLSN_ VARCHAR(25) = @LogShippingLastLSN - --- Defaults Recovery Point Times -IF ISNULL(@StopAt_,'') = '' - SET @StopAt_ = GETDATE(); - -IF ISNULL(@LogShippingStartTime_,'') = '' - SET @LogShippingStartTime_ = @StopAt_; - --- Default written to the SQL Server Error Log -IF ISNULL(@Log_Reference_,'') = '' - SET @Log_Reference_ = 'sp_RestoreGene - Recovery in Progress'; - --- Allow override of restored database name only if working with a specific database -IF @TargetDatabase_ IS NOT NULL AND @Database_ IS NULL - SET @TargetDatabase_ = NULL; - --- ps_LogShippingLight - Filtered Results -IF ISNULL(@LogShippingLastLSN_,'') = '' - SET @LogShippingLastLSN_ = '-1'; - --- Backup file locations defaulted to '' by ps_RestoreGene -IF @FromFileFullUNC_ = '' - SET @FromFileFullUNC_ = NULL; - -IF @FromFileDiffUNC_ = '' - SET @FromFileDiffUNC_ = NULL; - -IF @FromFileLogUNC_ = '' - SET @FromFileLogUNC_ = NULL; - --- Environment Preparation -IF OBJECT_ID('tempdb..#CTE') IS NOT NULL - DROP TABLE #CTE; - -IF OBJECT_ID('tempdb..#Stripes') IS NOT NULL - DROP TABLE #Stripes; - --- Backup forking -IF OBJECT_ID('tempdb..#BackupFork') IS NOT NULL - DROP TABLE #BackupFork; - -SELECT rf1.database_name, MAX(database_backup_lsn) database_backup_lsn, MAX(fork_point_lsn) fork_point_lsn, MAX(last_lsn) last_lsn -INTO #BackupFork -FROM msdb.dbo.backupset rf1 -INNER JOIN -( - SELECT database_name, MAX(backup_finish_date) AS backup_finish_date - FROM msdb.dbo.backupset - WHERE backup_start_date <= @LogShippingStartTime_ - AND fork_point_lsn IS NULL - GROUP BY database_name -) rf2 - ON rf1.database_name = rf2.database_name - -WHERE fork_point_lsn IS NOT NULL -AND rf1.backup_start_date <= @LogShippingStartTime_ -AND rf1.backup_finish_date > rf2.backup_finish_date -GROUP BY rf1.database_name; - -CREATE INDEX IDX_BackupFork ON #BackupFork(database_name); - - --------------------------------------------------------------- --- CTE1 Full Backup UNION Differential Backup UNION Log Backup --------------------------------------------------------------- -WITH CTE -( - database_name - ,current_compatibility_level - ,last_lsn - ,current_is_read_only - ,current_state_desc - ,current_recovery_model_desc - ,has_backup_checksums - ,backup_size - ,[type] - ,backupmediasetid - ,family_sequence_number - ,backupstartdate - ,physical_device_name - ,position -) -AS -( - --------------------------------------------------------------- --- Full backup - Most current immediately before @LogShippingStartTime_ -SELECT - bs.database_name - ,d.[compatibility_level] AS current_compatibility_level - ,bs.last_lsn - ,d.[is_read_only] AS current_is_read_only - ,d.[state_desc] AS current_state_desc - ,d.[recovery_model_desc] current_recovery_model_desc - ,bs.has_backup_checksums - ,bs.backup_size AS backup_size - ,'D' AS [type] - ,bs.media_set_id AS backupmediasetid - ,mf.family_sequence_number - ,x.backup_start_date AS backupstartdate - ,mf.physical_device_name - ,bs.position -FROM msdb.dbo.backupset bs - -INNER JOIN sys.databases d - ON bs.database_name = d.name - -INNER JOIN -( + + SET NOCOUNT ON; + + -- Avoid Parameter Sniffing Problems + DECLARE @Database_ VARCHAR(MAX); + SET @Database_ = @Database; + DECLARE @TargetDatabase_ SYSNAME; + SET @TargetDatabase_ = @TargetDatabase; + + -- Special handling for PoSh Driver + DECLARE @WithMoveDataFiles_ VARCHAR(2000); + IF @WithMoveDataFiles <> '' SET @WithMoveDataFiles_= @WithMoveDataFiles; + DECLARE @WithMoveLogFile_ VARCHAR(2000); + IF @WithMoveLogFile <> '' SET @WithMoveLogFile_= @WithMoveLogFile; + DECLARE @WithMoveFileStreamFile_ VARCHAR(2000); + IF @WithMoveFileStreamFile <> '' SET @WithMoveFileStreamFile_= @WithMoveFileStreamFile; + + DECLARE @FromFileFullUNC_ VARCHAR(2000); + SET @FromFileFullUNC_ = @FromFileFullUNC; + DECLARE @FromFileDiffUNC_ VARCHAR(2000); + SET @FromFileDiffUNC_ = @FromFileDiffUNC; + DECLARE @FromFileLogUNC_ VARCHAR(2000); + SET @FromFileLogUNC_ = @FromFileLogUNC; + DECLARE @StopAt_ DATETIME; + SET @StopAt_ = @StopAt; + DECLARE @StandbyMode_ BIT; + SET @StandbyMode_ = @StandbyMode; + DECLARE @IncludeSystemDBs_ BIT; + SET @IncludeSystemDBs_ = @IncludeSystemDBs; + DECLARE @WithRecovery_ BIT; + SET @WithRecovery_ = @WithRecovery; + DECLARE @WithCHECKDB_ BIT; + SET @WithCHECKDB_ = @WithCHECKDB; + DECLARE @WithReplace_ BIT; + SET @WithReplace_ = @WithReplace; + DECLARE @LogShippingStartTime_ DATETIME; + SET @LogShippingStartTime_ = @LogShippingStartTime; + DECLARE @LogShippingLastLSN_ VARCHAR(25); + SET @LogShippingLastLSN_ = @LogShippingLastLSN; + DECLARE @BlobCredential_ VARCHAR(255); + SET @BlobCredential_ = @BlobCredential; + DECLARE @RestoreScriptReplaceThis_ NVARCHAR(255); + SET @RestoreScriptReplaceThis_ = @RestoreScriptReplaceThis; + DECLARE @RestoreScriptWithThis_ NVARCHAR(255); + SET @RestoreScriptWithThis_ = @RestoreScriptWithThis; + DECLARE @SuppressWithMove_ BIT; + SET @SuppressWithMove_ = @SuppressWithMove; + DECLARE @PivotWithMove_ BIT + SET @PivotWithMove_ = @PivotWithMove; + DECLARE @RestoreScriptOnly_ BIT; + SET @RestoreScriptOnly_ = @RestoreScriptOnly; + DECLARE @DropDatabaseAfterRestore_ BIT; + SET @DropDatabaseAfterRestore_ = @DropDatabaseAfterRestore; + DECLARE @SetSingleUser_ BIT; + SET @SetSingleUser_ = @SetSingleUser; + DECLARE @ExcludeDiffAndLogBackups_ INT; + SET @ExcludeDiffAndLogBackups_ = @ExcludeDiffAndLogBackups; + + -- Defaults Recovery Point Times + IF ISNULL(@StopAt_,'') = '' + SET @StopAt_ = GETDATE(); + + IF ISNULL(@LogShippingStartTime_,'') = '' + SET @LogShippingStartTime_ = @StopAt_; + + -- Allow override of restored database name only if working with a specific database + IF @TargetDatabase_ IS NOT NULL AND @Database_ IS NULL + SET @TargetDatabase_ = NULL; + + IF CHARINDEX(',',@Database_, 1) > 0 + SET @TargetDatabase_ = NULL; + + -- ps_LogShippingLight - Filtered Results + IF ISNULL(@LogShippingLastLSN_,'') = '' + SET @LogShippingLastLSN_ = '-1'; + + -- Present WITH MOVE if override paths are supplied + IF ISNULL(@WithMoveDataFiles,'') <> '' OR ISNULL(@WithMoveLogFile_,'') <> '' OR ISNULL(@WithMoveFileStreamFile_,'') <> '' OR ISNULL(@TargetDatabase_,'') <> '' + SET @SuppressWithMove_ = 0 + + -- Backup file locations defaulted to '' by ps_RestoreGene + IF @FromFileFullUNC_ = '' + SET @FromFileFullUNC_ = NULL; + + IF @FromFileDiffUNC_ = '' + SET @FromFileDiffUNC_ = NULL; + + IF @FromFileLogUNC_ = '' + SET @FromFileLogUNC_ = NULL; + + -- Environment Preparation + IF OBJECT_ID('tempdb..#CTE') IS NOT NULL + DROP TABLE #CTE; + + IF OBJECT_ID('tempdb..#Stripes') IS NOT NULL + DROP TABLE #Stripes; + + IF OBJECT_ID('tempdb..#BackupFork') IS NOT NULL + DROP TABLE #BackupFork; + + IF OBJECT_ID('tempdb..#ForkPointsCount') IS NOT NULL + DROP TABLE #ForkPointsCount; + + IF OBJECT_ID('tempdb..#RestoreGeneResults') IS NOT NULL + DROP TABLE #RestoreGeneResults; + + IF OBJECT_ID('tempdb..#tmpDatabases') IS NOT NULL + DROP TABLE #tmpDatabases; + + IF OBJECT_ID('tempdb..#DeviceTypes') IS NOT NULL + DROP TABLE #DeviceTypes; + + IF OBJECT_ID('tempdb..#FullBackups') IS NOT NULL + DROP TABLE #FullBackups; + + CREATE TABLE #DeviceTypes (device_type tinyint); + IF @IncludeDeviceType7 = 1 INSERT INTO #DeviceTypes (device_type) SELECT 7; + IF @IncludeDeviceType102 = 1 INSERT INTO #DeviceTypes (device_type) SELECT 102; + IF @IncludeDeviceType2 = 1 INSERT INTO #DeviceTypes (device_type) SELECT 2; + IF @IncludeDeviceType9 = 1 INSERT INTO #DeviceTypes (device_type) SELECT 9; + + --======================================================================================================================================= + -- 'SELECT DATABASES' code snippet used below with permission from the ola hallengren - https://ola.hallengren.com/ + ----------------------------------------------------------------------------------------------------------------------------------------- + CREATE TABLE #tmpDatabases + ( + ID int IDENTITY, + DatabaseName nvarchar(450), + DatabaseNameFS nvarchar(max), + DatabaseType nvarchar(max), + Selected bit, + Completed bit + ); + CREATE CLUSTERED INDEX IDX_tmpDatabases ON #tmpDatabases(DatabaseName); + + IF CHARINDEX(',',@Database_,1) > 0 + BEGIN + + DECLARE @SelectedDatabases TABLE + ( + DatabaseName nvarchar(max), + DatabaseType nvarchar(max), + Selected bit + ); + + DECLARE @ErrorMessage nvarchar(max); + DECLARE @Error int; + + ---------------------------------------------------------------------------------------------------- + --// Select databases //-- + ---------------------------------------------------------------------------------------------------- + + SET @Database_ = REPLACE(@Database_, ', ', ','); + + WITH Databases1 (StartPosition, EndPosition, DatabaseItem) AS + ( + SELECT 1 AS StartPosition, + ISNULL(NULLIF(CHARINDEX(',', @Database_, 1), 0), LEN(@Database_) + 1) AS EndPosition, + SUBSTRING(@Database_, 1, ISNULL(NULLIF(CHARINDEX(',', @Database_, 1), 0), LEN(@Database_) + 1) - 1) AS DatabaseItem + WHERE @Database_ IS NOT NULL + UNION ALL + SELECT CAST(EndPosition AS int) + 1 AS StartPosition, + ISNULL(NULLIF(CHARINDEX(',', @Database_, EndPosition + 1), 0), LEN(@Database_) + 1) AS EndPosition, + SUBSTRING(@Database_, EndPosition + 1, ISNULL(NULLIF(CHARINDEX(',', @Database_, EndPosition + 1), 0), LEN(@Database_) + 1) - EndPosition - 1) AS DatabaseItem + FROM Databases1 + WHERE EndPosition < LEN(@Database_) + 1 + ), + Databases2 (DatabaseItem, Selected) AS + ( + SELECT CASE WHEN DatabaseItem LIKE '-%' THEN RIGHT(DatabaseItem,LEN(DatabaseItem) - 1) ELSE DatabaseItem END AS DatabaseItem, + CASE WHEN DatabaseItem LIKE '-%' THEN 0 ELSE 1 END AS Selected + FROM Databases1 + ), + Databases3 (DatabaseItem, DatabaseType, Selected) AS + ( + SELECT CASE WHEN DatabaseItem IN('ALL_DATABASES','SYSTEM_DATABASES','USER_DATABASES') THEN '%' ELSE DatabaseItem END AS DatabaseItem, + CASE WHEN DatabaseItem = 'SYSTEM_DATABASES' THEN 'S' WHEN DatabaseItem = 'USER_DATABASES' THEN 'U' ELSE NULL END AS DatabaseType, + Selected + FROM Databases2 + ), + Databases4 (DatabaseName, DatabaseType, Selected) AS + ( + SELECT CASE WHEN LEFT(DatabaseItem,1) = '[' AND RIGHT(DatabaseItem,1) = ']' THEN PARSENAME(DatabaseItem,1) ELSE DatabaseItem END AS DatabaseItem, + DatabaseType, + Selected + FROM Databases3 + ) + INSERT INTO @SelectedDatabases (DatabaseName, DatabaseType, Selected) + SELECT DatabaseName, + DatabaseType, + Selected + FROM Databases4 + OPTION (MAXRECURSION 0) + + INSERT INTO #tmpDatabases (DatabaseName, DatabaseNameFS, DatabaseType, Selected, Completed) + SELECT [name] AS DatabaseName, + REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE([name],'\',''),'/',''),':',''),'*',''),'?',''),'"',''),'<',''),'>',''),'|',''),' ','') AS DatabaseNameFS, + CASE WHEN name IN('master','msdb','model') THEN 'S' ELSE 'U' END AS DatabaseType, + 0 AS Selected, + 0 AS Completed + FROM sys.databases + WHERE [name] <> 'tempdb' + AND source_database_id IS NULL + ORDER BY [name] ASC + + UPDATE tmpDatabases + SET tmpDatabases.Selected = SelectedDatabases.Selected + FROM #tmpDatabases tmpDatabases + INNER JOIN @SelectedDatabases SelectedDatabases + ON tmpDatabases.DatabaseName LIKE REPLACE(SelectedDatabases.DatabaseName,'_','[_]') + AND (tmpDatabases.DatabaseType = SelectedDatabases.DatabaseType OR SelectedDatabases.DatabaseType IS NULL) + WHERE SelectedDatabases.Selected = 1 + + UPDATE tmpDatabases + SET tmpDatabases.Selected = SelectedDatabases.Selected + FROM #tmpDatabases tmpDatabases + INNER JOIN @SelectedDatabases SelectedDatabases + ON tmpDatabases.DatabaseName LIKE REPLACE(SelectedDatabases.DatabaseName,'_','[_]') + AND (tmpDatabases.DatabaseType = SelectedDatabases.DatabaseType OR SelectedDatabases.DatabaseType IS NULL) + WHERE SelectedDatabases.Selected = 0 + + IF @Database_ IS NULL OR NOT EXISTS(SELECT * FROM @SelectedDatabases) OR EXISTS(SELECT * FROM @SelectedDatabases WHERE DatabaseName IS NULL OR DatabaseName = '') + BEGIN + SET @ErrorMessage = 'The value for the parameter @Databases is not supported.' + CHAR(13) + CHAR(10) + ' ' + RAISERROR(@ErrorMessage,16,1) WITH NOWAIT + SET @Error = @@ERROR + END + + END + + --======================================================================================================================================= + -- Full Backups - Last before stop at for each database SELECT - a.database_name - ,MAX(a.backup_start_date) backup_start_date + a.database_name + ,MAX(a.backup_finish_date) AS backup_finish_date + INTO #FullBackups FROM msdb.dbo.backupset a JOIN msdb.dbo.backupmediafamily b - ON a.media_set_id = b.media_set_id - - LEFT OUTER JOIN #BackupFork c - ON c.database_name = a.database_name - + ON a.media_set_id = b.media_set_id + WHERE a.[type] = 'D' - AND device_type IN (7,102,2) + AND (a.database_name IN (SELECT DatabaseName FROM #tmpDatabases WHERE Selected = 1) OR @Database_ IS NULL OR a.database_name = @Database_) + AND device_type IN (SELECT device_type FROM #DeviceTypes) AND a.is_copy_only = 0 + AND b.mirror = 0 AND a.backup_start_date <= @LogShippingStartTime_ - - -- Recovery Forking - AND ISNULL(c.fork_point_lsn,a.database_backup_lsn) >= a.database_backup_lsn - AND ((c.fork_point_lsn IS NOT NULL AND a.database_backup_lsn < c.database_backup_lsn) OR c.fork_point_lsn IS NULL) - - GROUP BY a.database_name - -) x - ON x.database_name = bs.database_name - AND x.backup_start_date = bs.backup_start_date - -JOIN msdb.dbo.backupmediafamily mf - ON mf.media_set_id = bs.media_set_id - AND mf.family_sequence_number Between bs.first_family_number And bs.last_family_number - -WHERE bs.type = 'D' -AND mf.physical_device_name NOT IN ('Nul', 'Nul:') - -UNION - --------------------------------------------------------------- --- Differential backup, most current immediately before @StopAt_ -SELECT - bs.database_name - ,d.[compatibility_level] AS current_compatibility_level - ,bs.last_lsn - ,d.[is_read_only] AS current_is_read_only - ,d.[state_desc] AS current_state_desc - ,d.[recovery_model_desc] current_recovery_model_desc - ,bs.has_backup_checksums - ,bs.backup_size AS backup_size - ,'I' AS [type] - ,bs.media_set_id AS backupmediasetid - ,mf.family_sequence_number - ,x.backup_start_date AS backupstartdate - ,mf.physical_device_name - ,bs.position -FROM msdb.dbo.backupset bs - -INNER JOIN sys.databases d - ON bs.database_name = d.name - + GROUP BY a.database_name; -INNER JOIN -- Last Full in recovery fork before STOPAT -( --------------------------------------------- - SELECT - a.database_name - ,MAX(a.backup_start_date) backup_start_date - FROM msdb.dbo.backupset a + CREATE INDEX IDX_FullBackups ON #FullBackups(database_name); + + --======================================================================================================================================= + -- Backup forking (suppress differential, log file select criteria) + SELECT bs.database_name, first_recovery_fork_guid, MIN(fork_point_lsn) AS fork_point_lsn + INTO #BackupFork + FROM msdb.dbo.backupset bs JOIN msdb.dbo.backupmediafamily b - ON a.media_set_id = b.media_set_id - - LEFT OUTER JOIN #BackupFork c - ON c.database_name = a.database_name - - WHERE a.[type] = 'D' - AND device_type IN (7,102,2) - AND a.is_copy_only = 0 - AND a.backup_start_date <= @LogShippingStartTime_ - - -- Recovery Forking - AND ISNULL(c.fork_point_lsn,a.database_backup_lsn) >= a.database_backup_lsn - AND ((c.fork_point_lsn IS NOT NULL AND a.database_backup_lsn < c.database_backup_lsn) OR c.fork_point_lsn IS NULL) - - GROUP BY a.database_name --------------------------------------------- -) y - ON y.database_name = bs.database_name + ON bs.media_set_id = b.media_set_id + JOIN #FullBackups fb + ON fb.database_name = bs.database_name + WHERE fb.backup_finish_date < bs.backup_start_date + AND bs.backup_finish_date < @LogShippingStartTime_ + AND bs.first_recovery_fork_guid <> bs.last_recovery_fork_guid + GROUP BY bs.database_name, first_recovery_fork_guid; + + -- Only one fork point between the selected full backup and the stop at time supported + SELECT database_name, COUNT(*) AS ForkPoints + INTO #ForkPointsCount + FROM #BackupFork rh + GROUP BY database_name; + + --======================================================================================================================================= + -------------------------------------------------------------- + -- CTE1 Full Backup + -------------------------------------------------------------- + WITH CTE + ( + database_name + ,current_compatibility_level + ,first_lsn + ,last_lsn + ,fork_point_lsn + ,current_is_read_only + ,current_state_desc + ,current_recovery_model_desc + ,has_backup_checksums + ,backup_size + ,[type] + ,backupmediasetid + ,family_sequence_number + ,backupfinishdate + ,physical_device_name + ,position + ,first_recovery_fork_guid + ,last_recovery_fork_guid + ) + AS + ( + -------------------------------------------------------------- + -- Full backup - Most recent before @LogShippingStartTime_ + SELECT + bs.database_name + ,d.[compatibility_level] AS current_compatibility_level + ,bs.first_lsn + ,bs.last_lsn + ,bs.fork_point_lsn + ,d.[is_read_only] AS current_is_read_only + ,d.[state_desc] AS current_state_desc + ,d.[recovery_model_desc] current_recovery_model_desc + ,bs.has_backup_checksums + ,bs.backup_size AS backup_size + ,'D' AS [type] + ,bs.media_set_id AS backupmediasetid + ,mf.family_sequence_number + ,bs.backup_finish_date AS backupfinishdate + ,mf.physical_device_name + ,bs.position + ,bs.first_recovery_fork_guid + ,bs.last_recovery_fork_guid + + FROM msdb.dbo.backupset bs + + INNER JOIN sys.databases d + ON bs.database_name = d.name + + INNER JOIN #FullBackups fb + ON fb.database_name = bs.database_name + AND fb.backup_finish_date = bs.backup_finish_date + + JOIN msdb.dbo.backupmediafamily mf + ON mf.media_set_id = bs.media_set_id + AND mf.family_sequence_number Between bs.first_family_number And bs.last_family_number + + WHERE bs.type = 'D' + AND mf.mirror = 0 + AND mf.physical_device_name NOT IN ('Nul', 'Nul:') + AND bs.is_copy_only = 0 + + UNION + + -------------------------------------------------------------- + -- Differential backup, most current immediately before @StopAt_, suppress if backup fork points exist + SELECT + bs.database_name + ,d.[compatibility_level] AS current_compatibility_level + ,bs.first_lsn + ,bs.last_lsn + ,bs.fork_point_lsn + ,d.[is_read_only] AS current_is_read_only + ,d.[state_desc] AS current_state_desc + ,d.[recovery_model_desc] current_recovery_model_desc + ,bs.has_backup_checksums + ,bs.backup_size AS backup_size + ,'I' AS [type] + ,bs.media_set_id AS backupmediasetid + ,mf.family_sequence_number + ,bs.backup_finish_date AS backupfinishdate + ,mf.physical_device_name + ,bs.position + ,bs.first_recovery_fork_guid + ,bs.last_recovery_fork_guid + FROM msdb.dbo.backupset bs + + INNER JOIN sys.databases d + ON bs.database_name = d.name + + INNER JOIN #FullBackups fb + ON fb.database_name = bs.database_name + AND fb.backup_finish_date < bs.backup_finish_date + + INNER JOIN -- Last Diff before STOPAT / Suppress if backup forkpoints exist + ( + SELECT + a.database_name + ,MAX(backup_start_date) backup_start_date + FROM msdb.dbo.backupset a + JOIN msdb.dbo.backupmediafamily b + ON a.media_set_id = b.media_set_id + + WHERE a.[type] = 'I' + AND (a.database_name IN (SELECT DatabaseName FROM #tmpDatabases WHERE Selected = 1) OR @Database_ IS NULL OR a.database_name = @Database_) + AND device_type IN (SELECT device_type FROM #DeviceTypes) + AND a.is_copy_only = 0 + AND b.mirror = 0 + AND a.backup_start_date <= ISNULL(@StopAt_,GETDATE()) + GROUP BY a.database_name + ) x + ON x.database_name = bs.database_name + AND x.backup_start_date = bs.backup_start_date + + INNER JOIN msdb.dbo.backupmediafamily mf + ON mf.media_set_id = bs.media_set_id + AND mf.family_sequence_number Between bs.first_family_number And bs.last_family_number + + LEFT OUTER JOIN #BackupFork bf + ON bf.database_name = bs.database_name + + WHERE bs.type = 'I' + AND mf.physical_device_name NOT IN ('Nul', 'Nul:') + AND mf.mirror = 0 + AND @StopAt_ = @LogShippingStartTime_ + AND bf.fork_point_lsn IS NULL + + UNION + + -------------------------------------------------------------- + -- Log file backups - after 1st full / before @StopAt_ + SELECT + bs.database_name + ,d.[compatibility_level] AS current_compatibility_level + ,bs.first_lsn + ,bs.last_lsn + ,bs.fork_point_lsn + ,d.[is_read_only] AS current_is_read_only + ,d.[state_desc] AS current_state_desc + ,d.[recovery_model_desc] current_recovery_model_desc + ,bs.has_backup_checksums + ,bs.backup_size AS backup_size + ,'L' AS [type] + ,bs.media_set_id AS backupmediasetid + ,mf.family_sequence_number + ,bs.backup_finish_date as backupfinishdate + ,mf.physical_device_name + ,bs.position + ,bs.first_recovery_fork_guid + ,bs.last_recovery_fork_guid + FROM msdb.dbo.backupset bs + + INNER JOIN sys.databases d + ON bs.database_name = d.name + + INNER JOIN msdb.dbo.backupmediafamily mf + ON mf.media_set_id = bs.media_set_id + AND mf.family_sequence_number Between bs.first_family_number And bs.last_family_number + + INNER JOIN #FullBackups fb + ON bs.database_name = fb.database_name + + LEFT OUTER JOIN -- Select the first log file after STOPAT + ( + SELECT DISTINCT x.database_name, CASE WHEN y.last_Log_After_StopAt IS NULL THEN CONVERT(datetime, '31 Dec 2050') ELSE y.last_Log_After_StopAt END AS last_Log_After_StopAt + FROM msdb.dbo.backupset x + LEFT JOIN + ( + SELECT + database_name + ,MIN(backup_start_date) last_Log_After_StopAt + FROM msdb.dbo.backupset a + JOIN msdb.dbo.backupmediafamily b + ON a.media_set_id = b.media_set_id + WHERE a.[type] = 'L' + AND (a.database_name IN (SELECT DatabaseName FROM #tmpDatabases WHERE Selected = 1) OR @Database_ IS NULL OR a.database_name = @Database_) + AND b.mirror = 0 + AND device_type IN (SELECT device_type FROM #DeviceTypes) + AND a.backup_start_date > ISNULL(@StopAt_,'1 Jan, 1900') + GROUP BY database_name + ) y + ON x.database_name = y.database_name + ) x + ON bs.database_name = x.database_name + + LEFT OUTER JOIN #BackupFork bf + ON bf.database_name = bs.database_name + AND bf.first_recovery_fork_guid = bs.first_recovery_fork_guid + + WHERE bs.backup_start_date <= x.last_Log_After_StopAt -- Include 1st log after stop at + AND bs.backup_start_date >= fb.backup_finish_date -- Full backup finish + --AND bs.backup_finish_date <= @StopAt_ + AND (bs.database_name IN (SELECT DatabaseName FROM #tmpDatabases WHERE Selected = 1) OR @Database_ IS NULL OR bs.database_name = @Database_) + AND mf.physical_device_name NOT IN ('Nul', 'Nul:') + AND mf.mirror = 0 + AND bs.type = 'L' + AND device_type IN (SELECT device_type FROM #DeviceTypes) + AND (bf.fork_point_lsn > bs.first_lsn OR bf.first_recovery_fork_guid IS NULL OR bs.first_recovery_fork_guid <> bs.last_recovery_fork_guid) + ) + + SELECT * INTO #CTE FROM CTE; + CREATE INDEX IDX_CTE ON #CTE(database_name); + + -------------------------------------------------------------- + -- CTE2 Optionally, striped backup file details + -------------------------------------------------------------- + WITH Stripes + ( + database_name, + backupmediasetid, + family_sequence_number, + last_lsn, + S2_pdn, + S3_pdn, + S4_pdn, + S5_pdn, + S6_pdn, + S7_pdn, + S8_pdn, + S9_pdn, + S10_pdn, + S11_pdn, + S12_pdn, + S13_pdn, + S14_pdn, + S15_pdn, + --************************ + S16_pdn, + S17_pdn, + S18_pdn, + S19_pdn, + S20_pdn + --************************ + ) + AS + ( + SELECT + Stripe1.database_name, + Stripe1.backupmediasetid, + Stripe1.family_sequence_number, + Stripe1.last_lsn, + Stripe2.physical_device_name AS S2_pdn, + Stripe3.physical_device_name AS S3_pdn, + Stripe4.physical_device_name AS S4_pdn, + Stripe5.physical_device_name AS S5_pdn, + Stripe6.physical_device_name AS S6_pdn, + Stripe7.physical_device_name AS S7_pdn, + Stripe8.physical_device_name AS S8_pdn, + Stripe9.physical_device_name AS S9_pdn, + Stripe10.physical_device_name AS S10_pdn, + Stripe11.physical_device_name AS S11_pdn, + Stripe12.physical_device_name AS S12_pdn, + Stripe13.physical_device_name AS S13_pdn, + Stripe14.physical_device_name AS S14_pdn, + Stripe15.physical_device_name AS S15_pdn + --************************ + ,Stripe16.physical_device_name AS S16_pdn + ,Stripe17.physical_device_name AS S17_pdn + ,Stripe18.physical_device_name AS S18_pdn + ,Stripe19.physical_device_name AS S19_pdn + ,Stripe20.physical_device_name AS S20_pdn + --************************ + FROM #CTE AS Stripe1 + + LEFT OUTER JOIN #CTE AS Stripe2 + ON Stripe2.database_name = Stripe1.database_name + AND Stripe2.backupmediasetid = Stripe1.backupmediasetid + AND Stripe2.family_sequence_number = 2 + + LEFT OUTER JOIN #CTE AS Stripe3 + ON Stripe3.database_name = Stripe1.database_name + AND Stripe3.backupmediasetid = Stripe1.backupmediasetid + AND Stripe3.family_sequence_number = 3 + + LEFT OUTER JOIN #CTE AS Stripe4 + ON Stripe4.database_name = Stripe1.database_name + AND Stripe4.backupmediasetid = Stripe1.backupmediasetid + AND Stripe4.family_sequence_number = 4 + + LEFT OUTER JOIN #CTE AS Stripe5 + ON Stripe5.database_name = Stripe1.database_name + AND Stripe5.backupmediasetid = Stripe1.backupmediasetid + AND Stripe5.family_sequence_number = 5 + + LEFT OUTER JOIN #CTE AS Stripe6 + ON Stripe6.database_name = Stripe1.database_name + AND Stripe6.backupmediasetid = Stripe1.backupmediasetid + AND Stripe6.family_sequence_number = 6 + + LEFT OUTER JOIN #CTE AS Stripe7 + ON Stripe7.database_name = Stripe1.database_name + AND Stripe7.backupmediasetid = Stripe1.backupmediasetid + AND Stripe7.family_sequence_number = 7 + + LEFT OUTER JOIN #CTE AS Stripe8 + ON Stripe8.database_name = Stripe1.database_name + AND Stripe8.backupmediasetid = Stripe1.backupmediasetid + AND Stripe8.family_sequence_number = 8 + + LEFT OUTER JOIN #CTE AS Stripe9 + ON Stripe9.database_name = Stripe1.database_name + AND Stripe9.backupmediasetid = Stripe1.backupmediasetid + AND Stripe9.family_sequence_number = 9 + + LEFT OUTER JOIN #CTE AS Stripe10 + ON Stripe10.database_name = Stripe1.database_name + AND Stripe10.backupmediasetid = Stripe1.backupmediasetid + AND Stripe10.family_sequence_number = 10 + + LEFT OUTER JOIN #CTE AS Stripe11 + ON Stripe11.database_name = Stripe1.database_name + AND Stripe11.backupmediasetid = Stripe1.backupmediasetid + AND Stripe11.family_sequence_number = 11 + + LEFT OUTER JOIN #CTE AS Stripe12 + ON Stripe12.database_name = Stripe1.database_name + AND Stripe12.backupmediasetid = Stripe1.backupmediasetid + AND Stripe12.family_sequence_number = 12 + + LEFT OUTER JOIN #CTE AS Stripe13 + ON Stripe13.database_name = Stripe1.database_name + AND Stripe13.backupmediasetid = Stripe1.backupmediasetid + AND Stripe13.family_sequence_number = 13 + + LEFT OUTER JOIN #CTE AS Stripe14 + ON Stripe14.database_name = Stripe1.database_name + AND Stripe14.backupmediasetid = Stripe1.backupmediasetid + AND Stripe14.family_sequence_number = 14 + + LEFT OUTER JOIN #CTE AS Stripe15 + ON Stripe15.database_name = Stripe1.database_name + AND Stripe15.backupmediasetid = Stripe1.backupmediasetid + AND Stripe15.family_sequence_number = 15 -INNER JOIN -- Last Diff before STOPAT -( + --************************ + LEFT OUTER JOIN #CTE AS Stripe16 + ON Stripe16.database_name = Stripe1.database_name + AND Stripe16.backupmediasetid = Stripe1.backupmediasetid + AND Stripe16.family_sequence_number = 16 + + LEFT OUTER JOIN #CTE AS Stripe17 + ON Stripe17.database_name = Stripe1.database_name + AND Stripe17.backupmediasetid = Stripe1.backupmediasetid + AND Stripe17.family_sequence_number = 17 + + LEFT OUTER JOIN #CTE AS Stripe18 + ON Stripe18.database_name = Stripe1.database_name + AND Stripe18.backupmediasetid = Stripe1.backupmediasetid + AND Stripe18.family_sequence_number = 18 + + LEFT OUTER JOIN #CTE AS Stripe19 + ON Stripe19.database_name = Stripe1.database_name + AND Stripe19.backupmediasetid = Stripe1.backupmediasetid + AND Stripe19.family_sequence_number = 19 + + LEFT OUTER JOIN #CTE AS Stripe20 + ON Stripe20.database_name = Stripe1.database_name + AND Stripe20.backupmediasetid = Stripe1.backupmediasetid + AND Stripe20.family_sequence_number = 20 +-- ************************ + + ) + + SELECT * INTO #Stripes FROM Stripes; + + CREATE INDEX IDX_Stripes ON #Stripes(database_name); + + -------------------------------------------------------------- + -- Results, T-SQL RESTORE commands, below are based on CTE's above + -------------------------------------------------------------- + SELECT - a.database_name - ,MAX(backup_start_date) backup_start_date - FROM msdb.dbo.backupset a - JOIN msdb.dbo.backupmediafamily b - ON a.media_set_id = b.media_set_id - - LEFT OUTER JOIN #BackupFork c - ON c.database_name = a.database_name - - WHERE a.[type] = 'I' - AND device_type IN (7,102,2) - AND a.is_copy_only = 0 - AND a.backup_start_date <= ISNULL(@StopAt_,GETDATE()) - AND a.database_backup_lsn = ISNULL(c.database_backup_lsn,a.database_backup_lsn ) - AND a.last_lsn <= ISNULL(c.fork_point_lsn, a.last_lsn) - GROUP BY a.database_name - -) x - ON x.database_name = bs.database_name - AND x.backup_start_date = bs.backup_start_date - - -INNER JOIN msdb.dbo.backupmediafamily mf - ON mf.media_set_id = bs.media_set_id - AND mf.family_sequence_number Between bs.first_family_number And bs.last_family_number - -WHERE bs.type = 'I' -AND mf.physical_device_name NOT IN ('Nul', 'Nul:') -AND x.backup_start_date > y.backup_start_date -AND @StopAt_ = @LogShippingStartTime_ - -UNION - --------------------------------------------------------------- --- Log file backups - after 1st full / before @StopAt_ -SELECT - bs.database_name - ,d.[compatibility_level] AS current_compatibility_level - ,bs.last_lsn - ,d.[is_read_only] AS current_is_read_only - ,d.[state_desc] AS current_state_desc - ,d.[recovery_model_desc] current_recovery_model_desc - ,bs.has_backup_checksums - ,bs.backup_size AS backup_size - ,'L' AS [type] - ,bs.media_set_id AS backupmediasetid - ,mf.family_sequence_number - ,bs.backup_start_date as backupstartdate - ,mf.physical_device_name - ,bs.position - -FROM msdb.dbo.backupset bs - -INNER JOIN sys.databases d - ON bs.database_name = d.name - -INNER JOIN msdb.dbo.backupmediafamily mf - ON mf.media_set_id = bs.media_set_id - AND mf.family_sequence_number Between bs.first_family_number And bs.last_family_number - -INNER JOIN -- After the selected full backup -( + CASE WHEN @RestoreScriptReplaceThis_ IS NOT NULL AND @RestoreScriptWithThis_ IS NOT NULL THEN REPLACE(a.Command, @RestoreScriptReplaceThis_, @RestoreScriptWithThis_) ELSE a.Command END AS TSQL, --Allow substitution of a path + CONVERT(nvarchar(30), a.backupfinishdate, 126) + AS BackupDate, + a.BackupDevice, + a.first_lsn, + a.last_lsn, + a.fork_point_lsn, + a.first_recovery_fork_guid, + a.last_recovery_fork_guid, + a.database_name , + ROW_NUMBER() OVER(ORDER BY database_name, Sequence, a.backupfinishdate) AS SortSequence + INTO #RestoreGeneResults + FROM + ( + + -------------------------------------------------------------- + -- Most recent full backup + -------------------------------------------------------------- + SELECT - a.database_name - ,MAX(a.backup_start_date) backup_start_date - FROM msdb.dbo.backupset a - JOIN msdb.dbo.backupmediafamily b - ON a.media_set_id = b.media_set_id - - LEFT OUTER JOIN #BackupFork c - ON c.database_name = a.database_name - - WHERE a.[type] = 'D' - AND device_type IN (7,102,2) - AND a.is_copy_only = 0 - AND a.backup_start_date <= @LogShippingStartTime_ - - -- Recovery Forking - AND ISNULL(c.fork_point_lsn,a.database_backup_lsn) >= a.database_backup_lsn - AND ((c.fork_point_lsn IS NOT NULL AND a.database_backup_lsn < c.database_backup_lsn) OR c.fork_point_lsn IS NULL) - - GROUP BY a.database_name -) y - ON bs.database_name = y.database_name - -LEFT OUTER JOIN #BackupFork r - ON r.database_name = bs.database_name + + 'RESTORE DATABASE [' + CASE ISNULL(@TargetDatabase_,'') WHEN '' THEN d.[name] ELSE @TargetDatabase_ END + ']' + SPACE(1) + CHAR(13) + + + CASE WHEN #CTE.physical_device_name LIKE 'http%' THEN ' FROM URL = N' ELSE ' FROM DISK = N' END + '''' + --Support restore from blob storage in Azure + + CASE ISNULL(@FromFileFullUNC_,'Actual') + WHEN 'Actual' THEN #CTE.physical_device_name + ELSE @FromFileFullUNC_ + SUBSTRING(#CTE.physical_device_name,LEN(#CTE.physical_device_name) - CHARINDEX('\',REVERSE(#CTE.physical_device_name),1) + 2,CHARINDEX('\',REVERSE(#CTE.physical_device_name),1) + 1) + END + '''' + SPACE(1) + CHAR(13) + + + -- Striped backup files + CASE ISNULL(#Stripes.S2_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S2_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S2_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S2_pdn,LEN(#Stripes.S2_pdn) - CHARINDEX('\',REVERSE(#Stripes.S2_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S2_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S3_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S3_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S3_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S3_pdn,LEN(#Stripes.S3_pdn) - CHARINDEX('\',REVERSE(#Stripes.S3_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S3_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S4_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S4_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S4_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S4_pdn,LEN(#Stripes.S4_pdn) - CHARINDEX('\',REVERSE(#Stripes.S4_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S4_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S5_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S5_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S5_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S5_pdn,LEN(#Stripes.S5_pdn) - CHARINDEX('\',REVERSE(#Stripes.S5_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S5_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S6_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S6_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S6_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S6_pdn,LEN(#Stripes.S6_pdn) - CHARINDEX('\',REVERSE(#Stripes.S6_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S6_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S7_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S7_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S7_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S7_pdn,LEN(#Stripes.S7_pdn) - CHARINDEX('\',REVERSE(#Stripes.S7_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S7_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S8_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S8_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S8_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S8_pdn,LEN(#Stripes.S8_pdn) - CHARINDEX('\',REVERSE(#Stripes.S8_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S8_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S9_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S9_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S9_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S9_pdn,LEN(#Stripes.S9_pdn) - CHARINDEX('\',REVERSE(#Stripes.S9_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S9_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S10_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S10_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S10_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S10_pdn,LEN(#Stripes.S10_pdn) - CHARINDEX('\',REVERSE(#Stripes.S10_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S10_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S11_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S11_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S11_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S11_pdn,LEN(#Stripes.S11_pdn) - CHARINDEX('\',REVERSE(#Stripes.S11_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S11_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S12_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S12_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S12_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S12_pdn,LEN(#Stripes.S12_pdn) - CHARINDEX('\',REVERSE(#Stripes.S12_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S12_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S13_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S13_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S13_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S13_pdn,LEN(#Stripes.S13_pdn) - CHARINDEX('\',REVERSE(#Stripes.S13_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S13_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S14_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S14_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S14_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S14_pdn,LEN(#Stripes.S14_pdn) - CHARINDEX('\',REVERSE(#Stripes.S14_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S14_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S15_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S15_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S15_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S15_pdn,LEN(#Stripes.S15_pdn) - CHARINDEX('\',REVERSE(#Stripes.S15_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S15_pdn),1) + 1) END + '''' + END + + + --******* + + CASE ISNULL(#Stripes.S16_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S16_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S16_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S16_pdn,LEN(#Stripes.S16_pdn) - CHARINDEX('\',REVERSE(#Stripes.S16_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S16_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S17_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S17_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S17_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S17_pdn,LEN(#Stripes.S17_pdn) - CHARINDEX('\',REVERSE(#Stripes.S17_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S17_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S18_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S18_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S18_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S18_pdn,LEN(#Stripes.S18_pdn) - CHARINDEX('\',REVERSE(#Stripes.S18_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S18_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S19_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S19_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S19_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S19_pdn,LEN(#Stripes.S19_pdn) - CHARINDEX('\',REVERSE(#Stripes.S19_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S19_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S20_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S20_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S20_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S20_pdn,LEN(#Stripes.S20_pdn) - CHARINDEX('\',REVERSE(#Stripes.S20_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S20_pdn),1) + 1) END + '''' + END + -LEFT OUTER JOIN -- Select the first log file after STOPAT -( - SELECT DISTINCT x.database_name, database_backup_lsn, - CASE WHEN y.last_Log_After_StopAt IS NULL THEN CONVERT(datetime, '31 Dec 2050') ELSE y.last_Log_After_StopAt END AS last_Log_After_StopAt - FROM msdb.dbo.backupset x - LEFT JOIN + --****** + + ' WITH ' + + + CASE WHEN #CTE.physical_device_name LIKE 'http%' AND @BlobCredential_ IS NOT NULL THEN ' CREDENTIAL = ''' + @BlobCredential_ + ''', ' ELSE '' END + + + CASE ISNULL(@WithReplace_,0) WHEN 1 THEN 'REPLACE, ' ELSE '' END + 'FILE = ' + CAST(#CTE.position AS VARCHAR(5)) + ',' + + CASE #CTE.has_backup_checksums WHEN 1 THEN 'CHECKSUM, ' ELSE ' ' END + + + CASE @StandbyMode_ WHEN 0 THEN 'NORECOVERY,' ELSE 'STANDBY =N' + '''' + ISNULL(@FromFileFullUNC_,SUBSTRING(#CTE.physical_device_name,1,LEN(#CTE.physical_device_name) - CHARINDEX('\',REVERSE(#CTE.physical_device_name)))) + '\' + d.name + '_' + REPLACE(REPLACE(SUBSTRING(CONVERT(VARCHAR(24),GETDATE(),127),12,12),':',''),'.','') + '_ROLLBACK_UNDO.bak ' + '''' + ',' END + SPACE(1) + + + 'STATS=10' + SPACE(1) + + + CASE @SuppressWithMove_ WHEN 0 THEN + + ', MOVE N' + '''' + x.LogicalName + '''' + ' TO ' + + '''' + + CASE ISNULL(@WithMoveDataFiles_,'Actual') + WHEN 'Actual' THEN x.PhysicalName + ELSE @WithMoveDataFiles_ + SUBSTRING(x.PhysicalName,LEN(x.PhysicalName) - CHARINDEX('\',REVERSE(x.PhysicalName),1) + 2,CHARINDEX('\',REVERSE(x.PhysicalName),1) + 1) + END + '''' + SPACE(1) + + + ', MOVE N' + '''' + y.LogicalName + '''' + ' TO ' + + '''' + + CASE ISNULL(@WithMoveLogFile_ ,'Actual') + WHEN 'Actual' THEN y.PhysicalName + ELSE @WithMoveLogFile_ + SUBSTRING(y.PhysicalName,LEN(y.PhysicalName) - CHARINDEX('\',REVERSE(y.PhysicalName),1) + 2,CHARINDEX('\',REVERSE(y.PhysicalName),1) + 1) + END + '''' + ELSE ' ' + END + + AS Command, + 1 AS Sequence, + d.name AS database_name, + #CTE.physical_device_name AS BackupDevice, + #CTE.backupfinishdate, + #CTE.backup_size, + #CTE.first_lsn, + #CTE.last_lsn, + #CTE.fork_point_lsn, + #CTE.first_recovery_fork_guid, + #CTE.last_recovery_fork_guid + + FROM sys.databases d + + INNER JOIN ( SELECT - database_name - ,MIN(backup_start_date) last_Log_After_StopAt - FROM msdb.dbo.backupset a - JOIN msdb.dbo.backupmediafamily b - ON a.media_set_id = b.media_set_id - WHERE a.[type] = 'L' - AND device_type IN (7,102,2) - AND a.backup_start_date > ISNULL(@StopAt_,'1 Jan, 1900') - GROUP BY database_name + DB_NAME(mf.database_id) AS name + ,CASE ISNULL(@TargetDatabase_,'') WHEN '' THEN mf.Physical_Name ELSE SUBSTRING(mf.Physical_Name,1,CASE CHARINDEX('.',mf.Physical_Name) WHEN 0 THEN LEN(mf.Physical_Name) ELSE CHARINDEX('.',mf.Physical_Name) - 1 END) + '_' + @TargetDatabase_ + '.mdf' END AS PhysicalName + ,mf.Name AS LogicalName + FROM sys.master_files mf + WHERE type_desc = 'ROWS' + AND mf.file_id = 1 + ) x + ON d.name = x.name + + INNER JOIN + ( + SELECT + DB_NAME(mf.database_id) AS name, type_desc + ,CASE ISNULL(@TargetDatabase_,'') WHEN '' THEN mf.Physical_Name ELSE SUBSTRING(mf.Physical_Name,1,CASE CHARINDEX('.',mf.Physical_Name) WHEN 0 THEN LEN(mf.Physical_Name) ELSE CHARINDEX('.',mf.Physical_Name) - 1 END) + '_' + @TargetDatabase_ + '.ldf' END AS PhysicalName + ,mf.Name AS LogicalName + FROM sys.master_files mf + + -- Fix for multiple log files/with moves + INNER JOIN + ( + SELECT database_id, MIN(file_id) AS logfile_id + FROM sys.master_files + WHERE type_desc = 'LOG' + GROUP BY database_id + ) logfileid + on logfileid.database_id = mf.database_id + AND logfileid.logfile_id = mf.file_id + WHERE type_desc = 'LOG' ) y - ON x.database_name = y.database_name -) x - ON bs.database_name = x.database_name - AND bs.database_backup_lsn = ISNULL(r.database_backup_lsn,bs.database_backup_lsn) - -WHERE bs.backup_start_date <= x.last_Log_After_StopAt -- Include 1st log after stop at -AND bs.backup_start_date >= y.backup_start_date -- After last full backup start date -AND bs.database_backup_lsn = ISNULL(r.database_backup_lsn,bs.database_backup_lsn) -- Recovery Fork -AND NOT (bs.first_lsn < ISNULL(r.fork_point_lsn,'99999999999999999') AND bs.last_lsn > ISNULL(r.fork_point_lsn,'00000000000000000') AND bs.last_lsn <> ISNULL(r.last_lsn,bs.last_lsn)) - + ON d.name = y.name + + LEFT OUTER JOIN #CTE + ON #CTE.database_name = d.name + AND #CTE.family_sequence_number = 1 + + INNER JOIN #Stripes + ON #Stripes.database_name = d.name + AND #Stripes.backupmediasetid = #CTE.backupmediasetid + AND #Stripes.last_lsn = #CTE.last_lsn + + LEFT OUTER JOIN #ForkPointsCount fpc + ON fpc.database_name = #CTE.database_name + + WHERE #CTE.[type] = 'D' + AND #CTE.family_sequence_number = 1 + AND ISNULL(fpc.ForkPoints,0) < 2 + AND @ExcludeDiffAndLogBackups_ IN (0,1,2,3) + + -------------------------------------------------------------- + -- Most recent differential backup + -------------------------------------------------------------- + UNION + + SELECT + + 'RESTORE DATABASE [' + CASE ISNULL(@TargetDatabase_,'') WHEN '' THEN d.[name] ELSE @TargetDatabase_ END + ']' + SPACE(1) + CHAR(13) + + CASE WHEN #CTE.physical_device_name LIKE 'http%' THEN ' FROM URL = N' ELSE ' FROM DISK = N' END + '''' + + + CASE ISNULL(@FromFileDiffUNC_,'Actual') + WHEN 'Actual' THEN #CTE.physical_device_name + ELSE @FromFileDiffUNC_ + SUBSTRING(#CTE.physical_device_name,LEN(#CTE.physical_device_name) - CHARINDEX('\',REVERSE(#CTE.physical_device_name),1) + 2,CHARINDEX('\',REVERSE(#CTE.physical_device_name),1) + 1) + END + '''' + SPACE(1) + CHAR(13) + + + -- Striped backup files + CASE ISNULL(#Stripes.S2_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S2_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S2_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S2_pdn,LEN(#Stripes.S2_pdn) - CHARINDEX('\',REVERSE(#Stripes.S2_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S2_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S3_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S3_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S3_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S3_pdn,LEN(#Stripes.S3_pdn) - CHARINDEX('\',REVERSE(#Stripes.S3_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S3_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S4_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S4_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S4_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S4_pdn,LEN(#Stripes.S4_pdn) - CHARINDEX('\',REVERSE(#Stripes.S4_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S4_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S5_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S5_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S5_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S5_pdn,LEN(#Stripes.S5_pdn) - CHARINDEX('\',REVERSE(#Stripes.S5_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S5_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S6_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S6_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S6_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S6_pdn,LEN(#Stripes.S6_pdn) - CHARINDEX('\',REVERSE(#Stripes.S6_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S6_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S7_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S7_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S7_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S7_pdn,LEN(#Stripes.S7_pdn) - CHARINDEX('\',REVERSE(#Stripes.S7_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S7_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S8_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S8_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S8_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S8_pdn,LEN(#Stripes.S8_pdn) - CHARINDEX('\',REVERSE(#Stripes.S8_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S8_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S9_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S9_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S9_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S9_pdn,LEN(#Stripes.S9_pdn) - CHARINDEX('\',REVERSE(#Stripes.S9_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S9_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S10_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S10_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S10_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S10_pdn,LEN(#Stripes.S10_pdn) - CHARINDEX('\',REVERSE(#Stripes.S10_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S10_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S11_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S11_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S11_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S11_pdn,LEN(#Stripes.S11_pdn) - CHARINDEX('\',REVERSE(#Stripes.S11_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S11_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S12_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S12_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S12_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S12_pdn,LEN(#Stripes.S12_pdn) - CHARINDEX('\',REVERSE(#Stripes.S12_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S12_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S13_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S13_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S13_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S13_pdn,LEN(#Stripes.S13_pdn) - CHARINDEX('\',REVERSE(#Stripes.S13_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S13_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S14_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S14_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S14_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S14_pdn,LEN(#Stripes.S14_pdn) - CHARINDEX('\',REVERSE(#Stripes.S14_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S14_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S15_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S15_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S15_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S15_pdn,LEN(#Stripes.S15_pdn) - CHARINDEX('\',REVERSE(#Stripes.S15_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S15_pdn),1) + 1) END + '''' + END + + + --************************** + + CASE ISNULL(#Stripes.S16_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S16_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S16_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S16_pdn,LEN(#Stripes.S16_pdn) - CHARINDEX('\',REVERSE(#Stripes.S16_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S16_pdn),1) + 1) END + '''' + END + + + + CASE ISNULL(#Stripes.S17_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S17_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S17_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S17_pdn,LEN(#Stripes.S17_pdn) - CHARINDEX('\',REVERSE(#Stripes.S17_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S17_pdn),1) + 1) END + '''' + END + + + + CASE ISNULL(#Stripes.S18_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S18_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S18_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S18_pdn,LEN(#Stripes.S18_pdn) - CHARINDEX('\',REVERSE(#Stripes.S18_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S18_pdn),1) + 1) END + '''' + END + + + + CASE ISNULL(#Stripes.S19_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S19_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S19_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S19_pdn,LEN(#Stripes.S19_pdn) - CHARINDEX('\',REVERSE(#Stripes.S19_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S19_pdn),1) + 1) END + '''' + END + + + + CASE ISNULL(#Stripes.S20_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S20_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S20_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S20_pdn,LEN(#Stripes.S20_pdn) - CHARINDEX('\',REVERSE(#Stripes.S20_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S20_pdn),1) + 1) END + '''' + END + + + --************************** + + ' WITH FILE = ' + CAST(#CTE.position AS VARCHAR(5)) + ',' + + CASE #CTE.has_backup_checksums WHEN 1 THEN 'CHECKSUM, ' ELSE ' ' END + + + CASE WHEN #CTE.physical_device_name LIKE 'http%' AND @BlobCredential_ IS NOT NULL THEN ' CREDENTIAL = ''' + @BlobCredential_ + ''', ' ELSE '' END + + + CASE @StandbyMode_ WHEN 0 THEN 'NORECOVERY,' ELSE 'STANDBY =N' + '''' + ISNULL(@FromFileFullUNC_,SUBSTRING(#CTE.physical_device_name,1,LEN(#CTE.physical_device_name) - CHARINDEX('\',REVERSE(#CTE.physical_device_name)))) + '\' + d.name + '_' + REPLACE(REPLACE(SUBSTRING(CONVERT(VARCHAR(24),GETDATE(),127),12,12),':',''),'.','') + '_ROLLBACK_UNDO.bak ' + '''' + ',' END + SPACE(1) + + + 'STATS=10' + SPACE(1) + + AS Command, + 750000 AS Sequence, + d.name AS database_name, + #CTE.physical_device_name AS BackupDevice, + #CTE.backupfinishdate, + #CTE.backup_size, + #CTE.first_lsn, + #CTE.last_lsn, + #CTE.fork_point_lsn, + #CTE.first_recovery_fork_guid, + #CTE.last_recovery_fork_guid + + + FROM sys.databases d + + INNER JOIN #CTE + ON #CTE.database_name = d.name + AND #CTE.family_sequence_number = 1 + + LEFT OUTER JOIN #Stripes + ON #Stripes.database_name = d.name + AND #Stripes.backupmediasetid = #CTE.backupmediasetid + AND #Stripes.last_lsn = #CTE.last_lsn + + LEFT OUTER JOIN #ForkPointsCount fpc + ON fpc.database_name = #CTE.database_name + + WHERE #CTE.[type] = 'I' + AND #CTE.family_sequence_number = 1 + AND @ExcludeDiffAndLogBackups_ IN (0,2,4) + AND ISNULL(fpc.ForkPoints,0) < 2 + + -------------------------------------------------------------- + UNION -- Log backups taken since most recent full or diff + -------------------------------------------------------------- + + SELECT + + 'RESTORE LOG [' + CASE ISNULL(@TargetDatabase_,'') WHEN '' THEN d.[name] ELSE @TargetDatabase_ END + ']' + SPACE(1) + CHAR(13) + + + CASE WHEN #CTE.physical_device_name LIKE 'http%' THEN ' FROM URL = N' ELSE ' FROM DISK = N' END + '''' + + + CASE ISNULL(@FromFileLogUNC_,'Actual') + WHEN 'Actual' THEN #CTE.physical_device_name + ELSE @FromFileLogUNC_ + SUBSTRING(#CTE.physical_device_name,LEN(#CTE.physical_device_name) - CHARINDEX('\',REVERSE(#CTE.physical_device_name),1) + 2,CHARINDEX('\',REVERSE(#CTE.physical_device_name),1) + 1) + END + '''' + CHAR(13) + + + -- Striped backup files + CASE ISNULL(#Stripes.S2_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S2_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S2_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S2_pdn,LEN(#Stripes.S2_pdn) - CHARINDEX('\',REVERSE(#Stripes.S2_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S2_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S3_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S3_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S3_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S3_pdn,LEN(#Stripes.S3_pdn) - CHARINDEX('\',REVERSE(#Stripes.S3_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S3_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S4_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S4_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S4_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S4_pdn,LEN(#Stripes.S4_pdn) - CHARINDEX('\',REVERSE(#Stripes.S4_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S4_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S5_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S5_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S5_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S5_pdn,LEN(#Stripes.S5_pdn) - CHARINDEX('\',REVERSE(#Stripes.S5_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S5_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S6_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S6_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S6_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S6_pdn,LEN(#Stripes.S6_pdn) - CHARINDEX('\',REVERSE(#Stripes.S6_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S6_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S7_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S7_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S7_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S7_pdn,LEN(#Stripes.S7_pdn) - CHARINDEX('\',REVERSE(#Stripes.S7_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S7_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S8_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S8_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S8_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S8_pdn,LEN(#Stripes.S8_pdn) - CHARINDEX('\',REVERSE(#Stripes.S8_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S8_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S9_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S9_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S9_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S9_pdn,LEN(#Stripes.S9_pdn) - CHARINDEX('\',REVERSE(#Stripes.S9_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S9_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S10_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S10_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S10_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S10_pdn,LEN(#Stripes.S10_pdn) - CHARINDEX('\',REVERSE(#Stripes.S10_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S10_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S11_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S11_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S11_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S11_pdn,LEN(#Stripes.S10_pdn) - CHARINDEX('\',REVERSE(#Stripes.S11_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S11_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S12_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S12_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S12_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S12_pdn,LEN(#Stripes.S12_pdn) - CHARINDEX('\',REVERSE(#Stripes.S12_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S12_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S13_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S13_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S13_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S13_pdn,LEN(#Stripes.S13_pdn) - CHARINDEX('\',REVERSE(#Stripes.S13_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S13_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S14_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S14_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S14_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S14_pdn,LEN(#Stripes.S14_pdn) - CHARINDEX('\',REVERSE(#Stripes.S14_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S14_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S15_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S15_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S15_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S15_pdn,LEN(#Stripes.S15_pdn) - CHARINDEX('\',REVERSE(#Stripes.S15_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S15_pdn),1) + 1) END + '''' + END + -AND mf.physical_device_name NOT IN ('Nul', 'Nul:') -AND bs.type = 'L' -AND device_type IN (7,102,2) -) - -SELECT * INTO #CTE FROM CTE; -CREATE INDEX IDX_CTE ON #CTE(database_name); - --------------------------------------------------------------- --- CTE2 Optionally, striped backup file details --------------------------------------------------------------- -WITH Stripes -( - database_name, - backupmediasetid, - family_sequence_number, - last_lsn, - S2_pdn, - S3_pdn, - S4_pdn, - S5_pdn, - S6_pdn, - S7_pdn, - S8_pdn, - S9_pdn, - S10_pdn -) -AS -( -SELECT - Stripe1.database_name, - Stripe1.backupmediasetid, - Stripe1.family_sequence_number, - Stripe1.last_lsn, - Stripe2.physical_device_name AS S2_pdn, - Stripe3.physical_device_name AS S3_pdn, - Stripe4.physical_device_name AS S4_pdn, - Stripe5.physical_device_name AS S5_pdn, - Stripe6.physical_device_name AS S6_pdn, - Stripe7.physical_device_name AS S7_pdn, - Stripe8.physical_device_name AS S8_pdn, - Stripe9.physical_device_name AS S9_pdn, - Stripe10.physical_device_name AS S10_pdn -FROM #CTE AS Stripe1 - -LEFT OUTER JOIN #CTE AS Stripe2 - ON Stripe2.database_name = Stripe1.database_name - AND Stripe2.backupmediasetid = Stripe1.backupmediasetid - AND Stripe2.family_sequence_number = 2 - -LEFT OUTER JOIN #CTE AS Stripe3 - ON Stripe3.database_name = Stripe1.database_name - AND Stripe3.backupmediasetid = Stripe1.backupmediasetid - AND Stripe3.family_sequence_number = 3 - -LEFT OUTER JOIN #CTE AS Stripe4 - ON Stripe4.database_name = Stripe1.database_name - AND Stripe4.backupmediasetid = Stripe1.backupmediasetid - AND Stripe4.family_sequence_number = 4 - -LEFT OUTER JOIN #CTE AS Stripe5 - ON Stripe5.database_name = Stripe1.database_name - AND Stripe5.backupmediasetid = Stripe1.backupmediasetid - AND Stripe5.family_sequence_number = 5 - -LEFT OUTER JOIN #CTE AS Stripe6 - ON Stripe6.database_name = Stripe1.database_name - AND Stripe6.backupmediasetid = Stripe1.backupmediasetid - AND Stripe6.family_sequence_number = 6 - -LEFT OUTER JOIN #CTE AS Stripe7 - ON Stripe7.database_name = Stripe1.database_name - AND Stripe7.backupmediasetid = Stripe1.backupmediasetid - AND Stripe7.family_sequence_number = 7 - -LEFT OUTER JOIN #CTE AS Stripe8 - ON Stripe8.database_name = Stripe1.database_name - AND Stripe8.backupmediasetid = Stripe1.backupmediasetid - AND Stripe8.family_sequence_number = 8 - -LEFT OUTER JOIN #CTE AS Stripe9 - ON Stripe9.database_name = Stripe1.database_name - AND Stripe9.backupmediasetid = Stripe1.backupmediasetid - AND Stripe9.family_sequence_number = 9 - -LEFT OUTER JOIN #CTE AS Stripe10 - ON Stripe10.database_name = Stripe1.database_name - AND Stripe10.backupmediasetid = Stripe1.backupmediasetid - AND Stripe10.family_sequence_number = 10 -) - -SELECT * INTO #Stripes FROM Stripes; + --*************** + CASE ISNULL(#Stripes.S16_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S16_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S16_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S16_pdn,LEN(#Stripes.S16_pdn) - CHARINDEX('\',REVERSE(#Stripes.S16_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S16_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S17_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S17_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S17_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S17_pdn,LEN(#Stripes.S17_pdn) - CHARINDEX('\',REVERSE(#Stripes.S17_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S17_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S18_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S18_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S18_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S18_pdn,LEN(#Stripes.S18_pdn) - CHARINDEX('\',REVERSE(#Stripes.S18_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S18_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S19_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S19_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S19_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S19_pdn,LEN(#Stripes.S19_pdn) - CHARINDEX('\',REVERSE(#Stripes.S19_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S19_pdn),1) + 1) END + '''' + END + + + CASE ISNULL(#Stripes.S20_pdn,'') + WHEN '' THEN '' + ELSE ',' + CASE WHEN #Stripes.S20_pdn LIKE 'http%' THEN ' URL = N' ELSE ' DISK = N' END + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S20_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S20_pdn,LEN(#Stripes.S20_pdn) - CHARINDEX('\',REVERSE(#Stripes.S20_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S20_pdn),1) + 1) END + '''' + END + -CREATE INDEX IDX_Stripes ON #Stripes(database_name); - --------------------------------------------------------------- --- Results, T-SQL RESTORE commands, below are based on CTE's above --------------------------------------------------------------- - -SELECT - a.Command AS TSQL, - CONVERT(nvarchar(30), a.backupstartdate, 126) - AS BackupDate, - a.BackupDevice, - a.last_lsn, - a.database_name , - --ROW_NUMBER() OVER(ORDER BY database_name, Sequence, last_lsn) AS SortSequence - ROW_NUMBER() OVER(ORDER BY database_name, Sequence, a.backupstartdate) AS SortSequence -FROM -( - --------------------------------------------------------------- --- Most recent full backup --------------------------------------------------------------- - -SELECT - ';RESTORE DATABASE [' + CASE ISNULL(@TargetDatabase_,'') WHEN '' THEN d.[name] ELSE @TargetDatabase_ END + ']' + SPACE(1) + - 'FROM DISK = N' + '''' + - CASE ISNULL(@FromFileFullUNC_,'Actual') - WHEN 'Actual' THEN #CTE.physical_device_name - ELSE @FromFileFullUNC_ + SUBSTRING(#CTE.physical_device_name,LEN(#CTE.physical_device_name) - CHARINDEX('\',REVERSE(#CTE.physical_device_name),1) + 2,CHARINDEX('\',REVERSE(#CTE.physical_device_name),1) + 1) - END + '''' + SPACE(1) + - - -- Striped backup files - CASE ISNULL(#Stripes.S2_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S2_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S2_pdn,LEN(#Stripes.S2_pdn) - CHARINDEX('\',REVERSE(#Stripes.S2_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S2_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S3_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S3_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S3_pdn,LEN(#Stripes.S3_pdn) - CHARINDEX('\',REVERSE(#Stripes.S3_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S3_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S4_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S4_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S4_pdn,LEN(#Stripes.S4_pdn) - CHARINDEX('\',REVERSE(#Stripes.S4_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S4_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S5_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S5_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S5_pdn,LEN(#Stripes.S5_pdn) - CHARINDEX('\',REVERSE(#Stripes.S5_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S5_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S6_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S6_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S6_pdn,LEN(#Stripes.S6_pdn) - CHARINDEX('\',REVERSE(#Stripes.S6_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S6_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S7_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S7_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S7_pdn,LEN(#Stripes.S7_pdn) - CHARINDEX('\',REVERSE(#Stripes.S7_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S7_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S8_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S8_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S8_pdn,LEN(#Stripes.S8_pdn) - CHARINDEX('\',REVERSE(#Stripes.S8_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S8_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S9_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S9_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S9_pdn,LEN(#Stripes.S9_pdn) - CHARINDEX('\',REVERSE(#Stripes.S9_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S9_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S10_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileFullUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S10_pdn ELSE @FromFileFullUNC_ + SUBSTRING(#Stripes.S10_pdn,LEN(#Stripes.S10_pdn) - CHARINDEX('\',REVERSE(#Stripes.S10_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S10_pdn),1) + 1) END + '''' - END + - - ' WITH ' + CASE ISNULL(@WithReplace_,0) WHEN 1 THEN 'REPLACE, ' ELSE '' END + 'FILE = ' + CAST(#CTE.position AS VARCHAR(5)) + ',' + - CASE #CTE.has_backup_checksums WHEN 1 THEN 'CHECKSUM, ' ELSE ' ' END + - - CASE @StandbyMode_ WHEN 0 THEN 'NORECOVERY,' ELSE 'STANDBY =N' + '''' + ISNULL(@FromFileFullUNC_,SUBSTRING(#CTE.physical_device_name,1,LEN(#CTE.physical_device_name) - CHARINDEX('\',REVERSE(#CTE.physical_device_name)))) + '\' + d.name + '_ROLLBACK_UNDO.bak ' + '''' + ',' END + SPACE(1) + - - 'STATS=10,' + SPACE(1) + - 'MOVE N' + '''' + x.LogicalName + '''' + ' TO ' + - '''' + - CASE ISNULL(@WithMoveDataFiles_,'Actual') - WHEN 'Actual' THEN x.PhysicalName - ELSE @WithMoveDataFiles_ + SUBSTRING(x.PhysicalName,LEN(x.PhysicalName) - CHARINDEX('\',REVERSE(x.PhysicalName),1) + 2,CHARINDEX('\',REVERSE(x.PhysicalName),1) + 1) - END + '''' + ',' + SPACE(1) + - - 'MOVE N' + '''' + y.LogicalName + '''' + ' TO ' + - '''' + - CASE ISNULL(@WithMoveLogFile_ ,'Actual') - WHEN 'Actual' THEN y.PhysicalName - ELSE @WithMoveLogFile_ + SUBSTRING(y.PhysicalName,LEN(y.PhysicalName) - CHARINDEX('\',REVERSE(y.PhysicalName),1) + 2,CHARINDEX('\',REVERSE(y.PhysicalName),1) + 1) - END + '''' AS Command, - 1 AS Sequence, - d.name AS database_name, - #CTE.physical_device_name AS BackupDevice, - #CTE.backupstartdate, - #CTE.backup_size, - #CTE.last_lsn - -FROM sys.databases d - -JOIN -( + --***************** + + CASE @StandbyMode_ WHEN 0 THEN ' WITH NORECOVERY,' ELSE ' WITH STANDBY =N' + '''' + ISNULL(@FromFileFullUNC_,SUBSTRING(#CTE.physical_device_name,1,LEN(#CTE.physical_device_name) - CHARINDEX('\',REVERSE(#CTE.physical_device_name)))) + '\' + d.name + '_' + REPLACE(REPLACE(SUBSTRING(CONVERT(VARCHAR(24),GETDATE(),127),12,12),':',''),'.','') + '_ROLLBACK_UNDO.bak ' + '''' + ',' END + SPACE(1) + + + CASE WHEN #CTE.physical_device_name LIKE 'http%' AND @BlobCredential_ IS NOT NULL THEN ' CREDENTIAL = ''' + @BlobCredential_ + ''', ' ELSE '' END + + + CASE #CTE.has_backup_checksums WHEN 1 THEN ' CHECKSUM, ' ELSE ' ' END + + + + 'FILE = ' + CAST(#CTE.position AS VARCHAR(5)) + + ' ,STOPAT = ' + '''' + CONVERT(VARCHAR(21),@StopAt_,120) + '''' + + AS Command, + 1000000 AS Sequence, + d.name AS database_name, + #CTE.physical_device_name AS BackupDevice, + #CTE.backupfinishdate, + #CTE.backup_size, + #CTE.first_lsn, + #CTE.last_lsn, + #CTE.fork_point_lsn, + #CTE.first_recovery_fork_guid, + #CTE.last_recovery_fork_guid + + + FROM sys.databases d + + INNER JOIN #CTE + ON #CTE.database_name = d.name + AND #CTE.family_sequence_number = 1 + + LEFT OUTER JOIN #Stripes + ON #Stripes.database_name = d.name + AND #Stripes.backupmediasetid = #CTE.backupmediasetid + AND #Stripes.last_lsn = #CTE.last_lsn + + LEFT OUTER JOIN + ( + SELECT database_name, MAX(last_lsn) last_lsn + FROM #CTE + WHERE [type] = 'I' + + GROUP BY database_name + ) after_diff + ON after_diff.database_name = #CTE.database_name + + LEFT OUTER JOIN #ForkPointsCount fpc + ON fpc.database_name = #CTE.database_name + + WHERE #CTE.[type] = 'L' + AND #CTE.family_sequence_number = 1 + AND #CTE.last_lsn >= CASE WHEN @ExcludeDiffAndLogBackups_ IN(0,4) THEN ISNULL(after_diff.last_lsn,'0') ELSE 0 END + AND @ExcludeDiffAndLogBackups_ IN (0,3,4) + + AND ISNULL(fpc.ForkPoints,0) < 2 + + -------------------------------------------------------------- + UNION -- SET SINGLE USER WITH ROLLBACK IMMEDIATE + -------------------------------------------------------------- SELECT - DB_NAME(mf.database_id) AS name - ,mf.Physical_Name AS PhysicalName - ,mf.Name AS LogicalName - FROM sys.master_files mf - WHERE type_desc = 'ROWS' - AND mf.file_id = 1 -) x - ON d.name = x.name - -JOIN -( + + 'BEGIN TRY ALTER DATABASE [' + CASE ISNULL(@TargetDatabase_,'') WHEN '' THEN d.[name] ELSE @TargetDatabase_ END + ']' + ' SET SINGLE_USER WITH ROLLBACK IMMEDIATE END TRY BEGIN CATCH PRINT' + '''' + 'SET SINGLE USER FAILED' + '''' + ' END CATCH' AS Command, + 0 AS Sequence, + d.name AS database_name, + '' AS BackupDevice, + GETDATE() AS backupfinishdate, + #CTE.backup_size, + '0' AS first_lsn, + '0' AS last_lsn, + '0' AS fork_point_lsn , + '00000000-0000-0000-0000-000000000000' AS first_recovery_fork_guid, + '00000000-0000-0000-0000-000000000000' AS last_recovery_fork_guid + + FROM sys.databases d + + INNER JOIN #CTE + ON #CTE.database_name = d.name + + LEFT OUTER JOIN #ForkPointsCount fpc + ON fpc.database_name = #CTE.database_name + + WHERE #CTE.[type] = 'D' + AND @SetSingleUser_ = 1 + AND ISNULL(fpc.ForkPoints,0) < 2 + + -------------------------------------------------------------- + UNION -- Restore WITH RECOVERY + -------------------------------------------------------------- SELECT - DB_NAME(mf.database_id) AS name, type_desc - ,mf.Physical_Name PhysicalName - ,mf.Name AS LogicalName - FROM sys.master_files mf - WHERE type_desc = 'LOG' -) y - ON d.name = y.name - -LEFT OUTER JOIN #CTE - ON #CTE.database_name = d.name - AND #CTE.family_sequence_number = 1 - -JOIN #Stripes - ON #Stripes.database_name = d.name - AND #Stripes.backupmediasetid = #CTE.backupmediasetid - AND #Stripes.last_lsn = #CTE.last_lsn - -WHERE #CTE.[type] = 'D' -AND #CTE.family_sequence_number = 1 - --------------------------------------------------------------- --- Most recent differential backup --------------------------------------------------------------- -UNION - -SELECT - ';RESTORE DATABASE [' + CASE ISNULL(@TargetDatabase_,'') WHEN '' THEN d.[name] ELSE @TargetDatabase_ END + ']' + SPACE(1) + - 'FROM DISK = N' + '''' + - CASE ISNULL(@FromFileDiffUNC_,'Actual') - WHEN 'Actual' THEN #CTE.physical_device_name - ELSE @FromFileDiffUNC_ + SUBSTRING(#CTE.physical_device_name,LEN(#CTE.physical_device_name) - CHARINDEX('\',REVERSE(#CTE.physical_device_name),1) + 2,CHARINDEX('\',REVERSE(#CTE.physical_device_name),1) + 1) - END + '''' + SPACE(1) + - - -- Striped backup files - CASE ISNULL(#Stripes.S2_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S2_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S2_pdn,LEN(#Stripes.S2_pdn) - CHARINDEX('\',REVERSE(#Stripes.S2_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S2_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S3_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S3_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S3_pdn,LEN(#Stripes.S3_pdn) - CHARINDEX('\',REVERSE(#Stripes.S3_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S3_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S4_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S4_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S4_pdn,LEN(#Stripes.S4_pdn) - CHARINDEX('\',REVERSE(#Stripes.S4_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S4_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S5_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S5_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S5_pdn,LEN(#Stripes.S5_pdn) - CHARINDEX('\',REVERSE(#Stripes.S5_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S5_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S6_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S6_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S6_pdn,LEN(#Stripes.S6_pdn) - CHARINDEX('\',REVERSE(#Stripes.S6_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S6_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S7_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S7_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S7_pdn,LEN(#Stripes.S7_pdn) - CHARINDEX('\',REVERSE(#Stripes.S7_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S7_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S8_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S8_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S8_pdn,LEN(#Stripes.S8_pdn) - CHARINDEX('\',REVERSE(#Stripes.S8_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S8_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S9_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S9_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S9_pdn,LEN(#Stripes.S9_pdn) - CHARINDEX('\',REVERSE(#Stripes.S9_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S9_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S10_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileDiffUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S10_pdn ELSE @FromFileDiffUNC_ + SUBSTRING(#Stripes.S10_pdn,LEN(#Stripes.S10_pdn) - CHARINDEX('\',REVERSE(#Stripes.S10_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S10_pdn),1) + 1) END + '''' - END + - - ' WITH FILE = ' + CAST(#CTE.position AS VARCHAR(5)) + ',' + - CASE #CTE.has_backup_checksums WHEN 1 THEN 'CHECKSUM, ' ELSE ' ' END + - - CASE @StandbyMode_ WHEN 0 THEN 'NORECOVERY,' ELSE 'STANDBY =N' + '''' + ISNULL(@FromFileFullUNC_,SUBSTRING(#CTE.physical_device_name,1,LEN(#CTE.physical_device_name) - CHARINDEX('\',REVERSE(#CTE.physical_device_name)))) + '\' + d.name + '_ROLLBACK_UNDO.bak ' + '''' + ',' END + SPACE(1) + - - 'STATS=10,' + SPACE(1) + - 'MOVE N' + '''' + x.LogicalName + '''' + ' TO ' + - '''' + - CASE ISNULL(@WithMoveDataFiles_,'Actual') - WHEN 'Actual' THEN x.PhysicalName - ELSE @WithMoveDataFiles_ + SUBSTRING(x.PhysicalName,LEN(x.PhysicalName) - CHARINDEX('\',REVERSE(x.PhysicalName),1) + 2,CHARINDEX('\',REVERSE(x.PhysicalName),1) + 1) - END + '''' + ',' + SPACE(1) + - - 'MOVE N' + '''' + y.LogicalName + '''' + ' TO ' + - '''' + - CASE ISNULL(@WithMoveLogFile_ ,'Actual') - WHEN 'Actual' THEN y.PhysicalName - ELSE @WithMoveLogFile_ + SUBSTRING(y.PhysicalName,LEN(y.PhysicalName) - CHARINDEX('\',REVERSE(y.PhysicalName),1) + 2,CHARINDEX('\',REVERSE(y.PhysicalName),1) + 1) - END + '''' AS Command, - 32769/2 AS Sequence, - d.name AS database_name, - #CTE.physical_device_name AS BackupDevice, - #CTE.backupstartdate, - #CTE.backup_size, - #CTE.last_lsn - -FROM sys.databases d - -JOIN #CTE -ON #CTE.database_name = d.name -AND #CTE.family_sequence_number = 1 - -LEFT OUTER JOIN #Stripes -ON #Stripes.database_name = d.name -AND #Stripes.backupmediasetid = #CTE.backupmediasetid -AND #Stripes.last_lsn = #CTE.last_lsn - -INNER JOIN -( + + 'RESTORE DATABASE [' + CASE ISNULL(@TargetDatabase_,'') WHEN '' THEN d.[name] ELSE @TargetDatabase_ END + ']' + SPACE(1) + 'WITH RECOVERY' AS Command, + 1000001 AS Sequence, + d.name AS database_name, + '' AS BackupDevice, + GETDATE() AS backupfinishdate, + #CTE.backup_size, + #CTE.first_lsn, + '999999999999999999997' AS last_lsn, + #CTE.fork_point_lsn , + '00000000-0000-0000-0000-000000000000' AS first_recovery_fork_guid, + '00000000-0000-0000-0000-000000000000' AS last_recovery_fork_guid + + FROM sys.databases d + + INNER JOIN #CTE + ON #CTE.database_name = d.name + + LEFT OUTER JOIN #ForkPointsCount fpc + ON fpc.database_name = #CTE.database_name + + WHERE #CTE.[type] = 'D' + AND @WithRecovery_ = 1 + AND ISNULL(fpc.ForkPoints,0) < 2 + + -------------------------------------------------------------- + UNION -- CHECKDB + -------------------------------------------------------------- SELECT - DB_NAME(mf.database_id) AS name - ,mf.Physical_Name AS PhysicalName - ,mf.Name AS LogicalName - FROM sys.master_files mf - WHERE type_desc = 'ROWS' - AND mf.file_id = 1 -) x - ON d.name = x.name - -JOIN -( + + 'DBCC CHECKDB(' + '''' + CASE ISNULL(@TargetDatabase_,'') WHEN '' THEN d.[name] ELSE @TargetDatabase_ END + '''' + ') WITH NO_INFOMSGS, ALL_ERRORMSGS' AS Command, + 1000002 AS Sequence, + d.name AS database_name, + '' AS BackupDevice, + DATEADD(minute,1,GETDATE()) AS backupfinishdate, + #CTE.backup_size, + #CTE.first_lsn, + '999999999999999999998' AS last_lsn, + #CTE.fork_point_lsn, + '00000000-0000-0000-0000-000000000000' AS first_recovery_fork_guid, + '00000000-0000-0000-0000-000000000000' AS last_recovery_fork_guid + + FROM sys.databases d + + INNER JOIN #CTE + ON #CTE.database_name = d.name + + LEFT OUTER JOIN #ForkPointsCount fpc + ON fpc.database_name = #CTE.database_name + + WHERE #CTE.[type] = 'D' + AND @WithCHECKDB_ = 1 + AND @WithRecovery_ = 1 + AND ISNULL(fpc.ForkPoints,0) < 2 + + -------------------------------------------------------------- + UNION -- Drop database after restore + -------------------------------------------------------------- SELECT - DB_NAME(mf.database_id) AS name, type_desc - ,mf.Physical_Name PhysicalName - ,mf.Name AS LogicalName - FROM sys.master_files mf - WHERE type_desc = 'LOG' -) y - ON d.name = y.name - -WHERE #CTE.[type] = 'I' -AND #CTE.family_sequence_number = 1 - --------------------------------------------------------------- -UNION -- Log backups taken since most recent full or diff --------------------------------------------------------------- - -SELECT - ';BEGIN TRY RESTORE LOG [' + CASE ISNULL(@TargetDatabase_,'') WHEN '' THEN d.[name] ELSE @TargetDatabase_ END + ']' + SPACE(1) + - 'FROM DISK = N' + '''' + --#CTE.physical_device_name + '''' + SPACE(1) + - CASE ISNULL(@FromFileLogUNC_,'Actual') - WHEN 'Actual' THEN #CTE.physical_device_name - ELSE @FromFileLogUNC_ + SUBSTRING(#CTE.physical_device_name,LEN(#CTE.physical_device_name) - CHARINDEX('\',REVERSE(#CTE.physical_device_name),1) + 2,CHARINDEX('\',REVERSE(#CTE.physical_device_name),1) + 1) - END + '''' + - - -- Striped backup files - CASE ISNULL(#Stripes.S2_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S2_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S2_pdn,LEN(#Stripes.S2_pdn) - CHARINDEX('\',REVERSE(#Stripes.S2_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S2_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S3_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S3_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S3_pdn,LEN(#Stripes.S3_pdn) - CHARINDEX('\',REVERSE(#Stripes.S3_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S3_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S4_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S4_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S4_pdn,LEN(#Stripes.S4_pdn) - CHARINDEX('\',REVERSE(#Stripes.S4_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S4_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S5_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S5_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S5_pdn,LEN(#Stripes.S5_pdn) - CHARINDEX('\',REVERSE(#Stripes.S5_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S5_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S6_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S6_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S6_pdn,LEN(#Stripes.S6_pdn) - CHARINDEX('\',REVERSE(#Stripes.S6_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S6_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S7_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S7_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S7_pdn,LEN(#Stripes.S7_pdn) - CHARINDEX('\',REVERSE(#Stripes.S7_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S7_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S8_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S8_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S8_pdn,LEN(#Stripes.S8_pdn) - CHARINDEX('\',REVERSE(#Stripes.S8_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S8_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S9_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S9_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S9_pdn,LEN(#Stripes.S9_pdn) - CHARINDEX('\',REVERSE(#Stripes.S9_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S9_pdn),1) + 1) END + '''' - END + - - CASE ISNULL(#Stripes.S10_pdn,'') - WHEN '' THEN '' - ELSE ', DISK = N' + '''' + CASE ISNULL(@FromFileLogUNC_,'Actual') WHEN 'Actual' THEN #Stripes.S10_pdn ELSE @FromFileLogUNC_ + SUBSTRING(#Stripes.S10_pdn,LEN(#Stripes.S10_pdn) - CHARINDEX('\',REVERSE(#Stripes.S10_pdn),1) + 2,CHARINDEX('\',REVERSE(#Stripes.S10_pdn),1) + 1) END + '''' - END + - - CASE @StandbyMode_ WHEN 0 THEN ' WITH NORECOVERY,' ELSE ' WITH STANDBY =N' + '''' + ISNULL(@FromFileFullUNC_,SUBSTRING(#CTE.physical_device_name,1,LEN(#CTE.physical_device_name) - CHARINDEX('\',REVERSE(#CTE.physical_device_name)))) + '\' + d.name + '_ROLLBACK_UNDO.bak ' + '''' + ',' END + SPACE(1) + - - CASE #CTE.has_backup_checksums WHEN 1 THEN ' CHECKSUM, ' ELSE ' ' END + - - + 'FILE = ' + CAST(#CTE.position AS VARCHAR(5)) + - ' ,STOPAT = ' + '''' + CONVERT(VARCHAR(21),@StopAt_,120) + '''' + - ' ,MOVE N' + '''' + x2.LogicalName + '''' + ' TO ' + - '''' + - CASE ISNULL(@WithMoveDataFiles_,'Actual') - WHEN 'Actual' THEN x2.PhysicalName - ELSE @WithMoveDataFiles_ + SUBSTRING(x2.PhysicalName,LEN(x2.PhysicalName) - CHARINDEX('\',REVERSE(x2.PhysicalName),1) + 2,CHARINDEX('\',REVERSE(x2.PhysicalName),1) + 1) - END + '''' + ',' + SPACE(1) + - - ' MOVE N' + '''' + y1.LogicalName + '''' + ' TO ' + - '''' + - CASE ISNULL(@WithMoveLogFile_ ,'Actual') - WHEN 'Actual' THEN y1.PhysicalName - ELSE @WithMoveLogFile_ + SUBSTRING(y1.PhysicalName,LEN(y1.PhysicalName) - CHARINDEX('\',REVERSE(y1.PhysicalName),1) + 2,CHARINDEX('\',REVERSE(y1.PhysicalName),1) + 1) - END + '''' + 'END TRY BEGIN CATCH PRINT ' + '''' + 'Transaction Log File Restore Exclusion - Check Recovery Sequence.' + '''' + ' END CATCH;' AS Command, - 32769 AS Sequence, - d.name AS database_name, - #CTE.physical_device_name AS BackupDevice, - #CTE.backupstartdate, - #CTE.backup_size, - #CTE.last_lsn - -FROM sys.databases d - -INNER JOIN -( + + -- Comment out all commands if multiple forking points exist + --CASE WHEN @CommentOut = 1 THEN ' -- Multipe backup fork points detected, command suppressed -- ' ELSE '' END + + + 'DROP DATABASE [' + CASE ISNULL(@TargetDatabase_,'') WHEN '' THEN d.[name] ELSE @TargetDatabase_ END + ']' + SPACE(1) AS Command, + 1000003 AS Sequence, + d.name AS database_name, + '' AS BackupDevice, + GETDATE() AS backupfinishdate, + #CTE.backup_size, + #CTE.first_lsn, + '999999999999999999999' AS last_lsn, + #CTE.fork_point_lsn, + '00000000-0000-0000-0000-000000000000' AS first_recovery_fork_guid, + '00000000-0000-0000-0000-000000000000' AS last_recovery_fork_guid + + + + FROM sys.databases d + + INNER JOIN #CTE + ON #CTE.database_name = d.name + + LEFT OUTER JOIN #ForkPointsCount fpc + ON fpc.database_name = #CTE.database_name + + WHERE #CTE.[type] = 'D' + AND @DropDatabaseAfterRestore_ = 1 + AND ISNULL(fpc.ForkPoints,0) < 2 + + -------------------------------------------------------------- + UNION -- RAISERROR suppress restore when multiple forkpoints exist + -------------------------------------------------------------- SELECT - DB_NAME(mf.database_id) AS name - ,mf.Physical_Name AS PhysicalName - ,mf.Name AS LogicalName - FROM sys.master_files mf - WHERE type_desc = 'ROWS' - AND mf.file_id = 1 -) x2 -ON d.name = x2.name - -INNER JOIN -( + + 'RAISERROR (' + '''' + 'Multiple restores per performed between the selected full backup and stop at time for database ' + CASE ISNULL(@TargetDatabase_,'') WHEN '' THEN d.[name] ELSE @TargetDatabase_ END + ' - Restore Gene processing aborted.' + '''' + ',0,0);' + + SPACE(1) AS Command, + 1 AS Sequence, + d.name AS database_name, + '' AS BackupDevice, + GETDATE() AS backupfinishdate, + #CTE.backup_size, + '000000000000000000000' AS first_lsn, + '999999999999999999999' AS last_lsn, + #CTE.fork_point_lsn, + '00000000-0000-0000-0000-000000000000' AS first_recovery_fork_guid, + '00000000-0000-0000-0000-000000000000' AS last_recovery_fork_guid + + FROM sys.databases d + + INNER JOIN #CTE + ON #CTE.database_name = d.name + + LEFT OUTER JOIN #ForkPointsCount fpc + ON fpc.database_name = #CTE.database_name + + WHERE #CTE.[type] = 'D' + AND ISNULL(fpc.ForkPoints,0) > 1 + + -------------------------------------------------------------- + UNION -- WITH MOVE secondary data files, allows for up to 32769/2 file groups + -------------------------------------------------------------- + SELECT - DB_NAME(mf.database_id) AS name, type_desc - ,mf.Physical_Name PhysicalName - ,mf.Name AS LogicalName - FROM sys.master_files mf - WHERE type_desc = 'LOG' -) y1 - ON d.name = y1.name - -INNER JOIN #CTE - ON #CTE.database_name = d.name - AND #CTE.family_sequence_number = 1 - -LEFT OUTER JOIN #Stripes - ON #Stripes.database_name = d.name - AND #Stripes.backupmediasetid = #CTE.backupmediasetid - AND #Stripes.last_lsn = #CTE.last_lsn - -LEFT OUTER JOIN -( - SELECT database_name, MAX(last_lsn) last_lsn - FROM #CTE - WHERE [type] = 'I' - GROUP BY database_name -) after_diff - ON after_diff.database_name = #CTE.database_name - -WHERE #CTE.[type] = 'L' -AND #CTE.family_sequence_number = 1 -AND #CTE.last_lsn > ISNULL(after_diff.last_lsn,'0') - --------------------------------------------------------------- -UNION -- Declare @msg_ variable --------------------------------------------------------------- -SELECT --- '; DECLARE @msg_' + d.name + ' VARCHAR(1000)' AS Command, - ';DECLARE @msg_' + REPLACE(REPLACE(REPLACE(d.name,' ','_'),'.','_'),'-','_') + ' VARCHAR(1000)' AS Command, - 0 AS Sequence, - d.name AS database_name, - '' AS BackupDevice, - GETDATE() AS backupstartdate, - #CTE.backup_size, - '0' AS last_lsn - -FROM sys.databases d - -JOIN #CTE -ON #CTE.database_name = d.name - -WHERE #CTE.[type] = 'D' -AND @LogShippingVariableDeclare_ = 1 - --------------------------------------------------------------- -UNION -- Restore WITH RECOVERY --------------------------------------------------------------- -SELECT - ';SET @msg_' + REPLACE(REPLACE(REPLACE(d.name,' ','_'),'.','_'),'-','_') + ' = ' + '''' + @Log_Reference_ + '''' + '; RAISERROR (@msg_' + REPLACE(REPLACE(REPLACE(d.name,' ','_'),'.','_'),'-','_') + ',0,0) WITH LOG' + ';RESTORE DATABASE [' + CASE ISNULL(@TargetDatabase_,'') WHEN '' THEN d.[name] ELSE @TargetDatabase_ END + ']' + SPACE(1) + 'WITH RECOVERY' AS Command, - 32771 AS Sequence, - d.name AS database_name, - '' AS BackupDevice, - GETDATE() AS backupstartdate, - #CTE.backup_size, - '999999999999999999998' AS last_lsn - -FROM sys.databases d - -JOIN #CTE -ON #CTE.database_name = d.name - -WHERE #CTE.[type] = 'D' -AND @WithRecovery_ = 1 - --------------------------------------------------------------- -UNION -- CHECKDB --------------------------------------------------------------- -SELECT - ';SET @msg_' + REPLACE(REPLACE(REPLACE(d.name,' ','_'),'.','_'),'-','_') + ' = ' + '''' + @Log_Reference_ + '''' + '; RAISERROR (@msg_' + REPLACE(REPLACE(REPLACE(d.name,' ','_'),'.','_'),'-','_') + ',0,0) WITH LOG' + ';DBCC CHECKDB(' + '''' + CASE ISNULL(@TargetDatabase_,'') WHEN '' THEN d.[name] ELSE @TargetDatabase_ END + '''' + ') WITH NO_INFOMSGS, ALL_ERRORMSGS' AS Command, - 32772 AS Sequence, - d.name AS database_name, - '' AS BackupDevice, - DATEADD(minute,1,GETDATE()) AS backupstartdate, - #CTE.backup_size, - '999999999999999999999' AS last_lsn - -FROM sys.databases d - -JOIN #CTE -ON #CTE.database_name = d.name - -WHERE #CTE.[type] = 'D' -AND @WithCHECKDB_ = 1 -AND @WithRecovery_ = 1 - --------------------------------------------------------------- -UNION -- WITH MOVE secondary data files, allows for up to 32769/2 file groups --------------------------------------------------------------- -SELECT - ', MOVE N' + '''' + b.name + '''' + ' TO N' + '''' + - CASE ISNULL(@WithMoveDataFiles_,'Actual') - WHEN 'Actual' THEN b.physical_name - ELSE @WithMoveDataFiles_ + SUBSTRING(b.Physical_Name,LEN(b.Physical_Name) - CHARINDEX('\',REVERSE(b.Physical_Name),1) + 2,CHARINDEX('\',REVERSE(b.Physical_Name),1) + 1) - END + '''', - b.file_id AS Sequence, - DB_NAME(b.database_id) AS database_name, - 'SECONDARY FULL' AS BackupDevice, - #CTE.backupstartdate, - #CTE.backup_size, - #CTE.last_lsn - -FROM sys.master_files b -INNER JOIN #CTE -ON #CTE.database_name = DB_NAME(b.database_id) - -WHERE #CTE.[type] = 'D' -AND b.type_desc = 'ROWS' -AND b.file_id > 2 -AND @WithMoveDataFiles_ IS NOT NULL --------------------------------------------------------------- -) a --------------------------------------------------------------- - -WHERE a.database_name = ISNULL(@Database_,a.database_name) -AND (@IncludeSystemDBs_ = 1 OR a.database_name NOT IN('master','model','msdb')) -AND a.last_lsn > @LogShippingLastLSN_ - -ORDER BY - database_name, - Sequence, - --last_lsn - backupstartdate - -END; + -- Comment out all commands if multiple forking points exist + --CASE WHEN @CommentOut = 1 THEN ' -- Multipe backup fork points detected, command suppressed -- ' ELSE '' END + + + ' ,MOVE N' + '''' + b.name + '''' + ' TO N' + '''' + + + CASE b.type_desc + + WHEN 'ROWS' THEN + CASE ISNULL(@WithMoveDataFiles_,'Actual') + WHEN 'Actual' THEN CASE ISNULL(@TargetDatabase_,'') WHEN '' THEN b.Physical_Name ELSE SUBSTRING(b.Physical_Name,1,CASE CHARINDEX('.',b.Physical_Name) WHEN 0 THEN LEN(b.Physical_Name) ELSE CHARINDEX('.',b.Physical_Name) - 1 END) + '_' + @TargetDatabase_ + '.ndf' END + ELSE CASE ISNULL(@TargetDatabase_,'') WHEN '' THEN @WithMoveDataFiles_ + SUBSTRING(b.Physical_Name,LEN(b.Physical_Name) - CHARINDEX('\',REVERSE(b.Physical_Name),1) + 2,CHARINDEX('\',REVERSE(b.Physical_Name),1) + 1) + ELSE @WithMoveDataFiles_ + SUBSTRING (b.Physical_Name, (LEN(b.Physical_Name)-CHARINDEX('\',REVERSE(b.Physical_Name)) + 2),CHARINDEX('\',REVERSE(b.Physical_Name)) - 1 - CHARINDEX('.',REVERSE(b.Physical_Name))) + '_' + @TargetDatabase_ + '.ndf' END + END + + WHEN 'FILESTREAM' THEN + CASE ISNULL(@WithMoveFileStreamFile_,'Actual') + WHEN 'Actual' THEN CASE ISNULL(@TargetDatabase_,'') WHEN '' THEN b.Physical_Name ELSE SUBSTRING(b.Physical_Name,1,CASE CHARINDEX('.',b.Physical_Name) WHEN 0 THEN LEN(b.Physical_Name) ELSE CHARINDEX('.',b.Physical_Name) - 1 END) + '_' + @TargetDatabase_ END + ELSE CASE ISNULL(@TargetDatabase_,'') WHEN '' THEN @WithMoveFileStreamFile_ + SUBSTRING(b.Physical_Name,LEN(b.Physical_Name) - CHARINDEX('\',REVERSE(b.Physical_Name),1) + 2,CHARINDEX('\',REVERSE(b.Physical_Name),1) + 1) + ELSE @WithMoveFileStreamFile_ + SUBSTRING (b.Physical_Name, (LEN(b.Physical_Name)-CHARINDEX('\',REVERSE(b.Physical_Name)) + 2),CHARINDEX('\',REVERSE(b.Physical_Name)) - 1 - CHARINDEX('.',REVERSE(b.Physical_Name))) + '_' + @TargetDatabase_ END + END + + WHEN 'LOG' THEN + CASE ISNULL(@WithMoveLogFile_,'Actual') + WHEN 'Actual' THEN CASE ISNULL(@TargetDatabase_,'') WHEN '' THEN b.Physical_Name ELSE SUBSTRING(b.Physical_Name,1,CASE CHARINDEX('.',b.Physical_Name) WHEN 0 THEN LEN(b.Physical_Name) ELSE CHARINDEX('.',b.Physical_Name) - 1 END) + '_' + @TargetDatabase_ + '.ldf' END + ELSE CASE ISNULL(@TargetDatabase_,'') WHEN '' THEN @WithMoveLogFile_ + SUBSTRING(b.Physical_Name,LEN(b.Physical_Name) - CHARINDEX('\',REVERSE(b.Physical_Name),1) + 2,CHARINDEX('\',REVERSE(b.Physical_Name),1) + 1) + ELSE @WithMoveLogFile_ + SUBSTRING (b.Physical_Name, (LEN(b.Physical_Name)-CHARINDEX('\',REVERSE(b.Physical_Name)) + 2),CHARINDEX('\',REVERSE(b.Physical_Name)) - 1 - CHARINDEX('.',REVERSE(b.Physical_Name))) + '_' + @TargetDatabase_ + '.ldf' END + + END + + END + + + '''', + b.file_id AS Sequence, + DB_NAME(b.database_id) AS database_name, + 'SECONDARY FULL' AS BackupDevice, + #CTE.backupfinishdate, + #CTE.backup_size, + #CTE.first_lsn, + #CTE.last_lsn, + #CTE.fork_point_lsn, + #CTE.first_recovery_fork_guid, + #CTE.last_recovery_fork_guid + + FROM sys.master_files b + INNER JOIN #CTE + ON #CTE.database_name = DB_NAME(b.database_id) + + LEFT OUTER JOIN #ForkPointsCount fpc + ON fpc.database_name = #CTE.database_name + + WHERE #CTE.[type] = 'D' + AND b.type_desc IN ('ROWS','FILESTREAM','LOG') + AND b.file_id > 2 + AND ISNULL(fpc.ForkPoints,0) < 2 + + -------------------------------------------------------------- + ) a + LEFT OUTER JOIN #tmpDatabases b + ON a.database_name = b.DatabaseName + -------------------------------------------------------------- + + WHERE (@Database_ IS NULL OR b.Selected = 1 OR @Database_ = a.database_name) + AND (@IncludeSystemDBs_ = 1 OR a.database_name NOT IN('master','model','msdb')) + AND a.last_lsn >= @LogShippingLastLSN_; + + CREATE INDEX IDX_RestoreGeneResults ON #RestoreGeneResults (database_name,SortSequence,BackupDate); + + -------------------------------------------------------------- + -- Result Set + IF @SuppressWithMove_ = 1 + BEGIN + IF @RestoreScriptOnly_ = 0 + BEGIN + + SELECT x4.TSQL, x4.BackupDate, x4.BackupDevice, x4.first_lsn, x4.last_lsn, x4.fork_point_lsn, x4.first_recovery_fork_guid, x4.last_recovery_fork_guid, x4.database_name, x4.SortSequence + FROM #RestoreGeneResults x4 + WHERE ISNULL(x4.BackupDevice,'') <> 'SECONDARY FULL' + ORDER BY + x4.database_name, + x4.SortSequence, + x4.BackupDate + END + ELSE + BEGIN + SELECT x4.TSQL AS [--TSQL] + FROM #RestoreGeneResults x4 + WHERE ISNULL(x4.BackupDevice,'') <> 'SECONDARY FULL' + ORDER BY + x4.database_name, + x4.SortSequence, + x4.BackupDate + END + END + ELSE + BEGIN + IF @PivotWithMove_ = 1 + BEGIN + + IF @RestoreScriptOnly_ = 0 + BEGIN + SELECT + x4.TSQL, x4.BackupDate, x4.BackupDevice, x4.first_lsn, x4.last_lsn, x4.fork_point_lsn, x4.first_recovery_fork_guid, x4.last_recovery_fork_guid, x4.database_name, x4.SortSequence + FROM #RestoreGeneResults x4 + ORDER BY + x4.database_name, + x4.SortSequence, + x4.BackupDate + END + ELSE + BEGIN + SELECT + x4.TSQL AS [--TSQL] + FROM #RestoreGeneResults x4 + ORDER BY + x4.database_name, + x4.SortSequence, + x4.BackupDate + END + + END + ELSE + BEGIN + IF @RestoreScriptOnly_ = 0 + BEGIN + WITH WithMoves AS + ( + SELECT + last_lsn, + STUFF((SELECT ' ' + TSQL FROM #RestoreGeneResults x3 WHERE x3.last_lsn = x2.last_lsn AND ISNULL(x3.BackupDevice,'') = 'SECONDARY FULL' ORDER BY x3.SortSequence FOR XML PATH, TYPE).value('.[1]', 'nvarchar(max)'), 1,1,'') AS WithoveCmds + FROM #RestoreGeneResults x2 + GROUP BY last_lsn + ) + + SELECT + CASE @SuppressWithMove_ WHEN 0 THEN CASE ISNULL(x5.WithoveCmds,'') WHEN '' THEN x4.TSQL ELSE x4.TSQL + ' ' + x5.WithoveCmds END + ELSE x4.TSQL + END AS TSQL, + x4.BackupDate, x4.BackupDevice, x4.first_lsn, x4.last_lsn, x4.fork_point_lsn, x4.first_recovery_fork_guid, x4.last_recovery_fork_guid, x4.database_name, x4.SortSequence + FROM #RestoreGeneResults x4 + LEFT OUTER JOIN WithMoves x5 + ON x4.last_lsn = x5.last_lsn + WHERE ISNULL(x4.BackupDevice,'') <> 'SECONDARY FULL' + ORDER BY + x4.database_name, + x4.SortSequence, + x4.BackupDate + END + ELSE + BEGIN + WITH WithMoves AS + ( + SELECT + last_lsn, + STUFF((SELECT ' ' + TSQL FROM #RestoreGeneResults x3 WHERE x3.last_lsn = x2.last_lsn AND ISNULL(x3.BackupDevice,'') = 'SECONDARY FULL' ORDER BY x3.SortSequence FOR XML PATH, TYPE).value('.[1]', 'nvarchar(max)'), 1,1,'') AS WithoveCmds + FROM #RestoreGeneResults x2 + GROUP BY last_lsn + ) + + SELECT + CASE @SuppressWithMove_ WHEN 0 THEN CASE ISNULL(x5.WithoveCmds,'') WHEN '' THEN x4.TSQL ELSE x4.TSQL + ' ' + x5.WithoveCmds END + ELSE x4.TSQL + END AS [--TSQL] + FROM #RestoreGeneResults x4 + LEFT OUTER JOIN WithMoves x5 + ON x4.last_lsn = x5.last_lsn + WHERE ISNULL(x4.BackupDevice,'') <> 'SECONDARY FULL' + ORDER BY + x4.database_name, + x4.SortSequence, + x4.BackupDate + END + END + END +END GO diff --git a/Stored_Procedure/dbo.sp_doc.sql b/Stored_Procedure/dbo.sp_doc.sql new file mode 100644 index 00000000..51f01222 --- /dev/null +++ b/Stored_Procedure/dbo.sp_doc.sql @@ -0,0 +1,1432 @@ +SET ANSI_NULLS ON; +GO + +SET QUOTED_IDENTIFIER ON; +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'Description' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_doc', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_doc'; + END +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@SqlMinorVersion' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_doc', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@SqlMinorVersion' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_doc'; + END +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@SqlMajorVersion' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_doc', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@SqlMajorVersion' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_doc'; + END +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@ExtendedPropertyName' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_doc', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@ExtendedPropertyName' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_doc'; + END +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@DatabaseName' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_doc', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@DatabaseName' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_doc'; + END +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@LimitStoredProcLength' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_doc', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@LimitStoredProcLength' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_doc'; + END +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@Emojis' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_doc', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@Emojis' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_doc'; + END +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@Verbose' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_doc', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@Verbose' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_doc'; + END +GO + +/***************************/ +/* Create stored procedure */ +/***************************/ +IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sp_doc]') AND [type] IN (N'P', N'PC')) +BEGIN +EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[sp_doc] AS'; +END +GO + +ALTER PROCEDURE [dbo].[sp_doc] + @DatabaseName SYSNAME = NULL + ,@ExtendedPropertyName SYSNAME = 'Description' + ,@LimitStoredProcLength BIT = 1 + ,@Emojis BIT = 0 + ,@Verbose BIT = 1 + /* Parameters defined here for testing only */ + ,@SqlMajorVersion TINYINT = 0 + ,@SqlMinorVersion SMALLINT = 0 +WITH RECOMPILE +AS + +/* +sp_doc - Always have current documentation by generating it on the fly in markdown. + +Part of the DBA MultiTool http://dba-multitool.org + +Version: 20201221 + +MIT License + +Copyright (c) 2020 John McCall + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +========= + +Example: + + EXEC sp_doc @DatabaseName = 'WideWorldImporters'; + +*/ + +BEGIN + SET NOCOUNT ON; + + DECLARE @Sql NVARCHAR(MAX) + ,@ParmDefinition NVARCHAR(500) + ,@QuotedDatabaseName SYSNAME + ,@Msg NVARCHAR(MAX) + ,@SensitivityClassification BIT + -- Variables used for Emoji mode + ,@Yes VARCHAR(20) = 'yes' + ,@No VARCHAR(20) = 'no' + ,@PK VARCHAR(20) = NULL + ,@FK VARCHAR(20) = NULL + ,@Column VARCHAR(20) = NULL; + + -- Find Version + IF (@SqlMajorVersion = 0) + BEGIN; + SET @SqlMajorVersion = CAST(SERVERPROPERTY('ProductMajorVersion') AS TINYINT); + END; + IF (@SqlMinorVersion = 0) + BEGIN; + SET @SqlMinorVersion = CAST(SERVERPROPERTY('ProductMinorVersion') AS TINYINT); + END; + + -- Validate Version + IF (@SqlMajorVersion < 11) + BEGIN; + SET @Msg = 'SQL Server versions below 2012 are not supported, sorry!'; + RAISERROR(@Msg, 16, 1); + END; + + -- Check database name + IF (@DatabaseName IS NULL) + BEGIN + SET @DatabaseName = DB_NAME(); + IF (@Verbose = 1) + BEGIN; + SET @Msg = 'No database provided, assuming current database.'; + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + END + ELSE IF (DB_ID(@DatabaseName) IS NULL) + BEGIN; + SET @Msg = 'Database not available.'; + RAISERROR(@Msg, 16, 1); + END; + + SET @QuotedDatabaseName = QUOTENAME(@DatabaseName); --Avoid injections + + -- Check Emoji Mode + IF (@Emojis = 1) + BEGIN; + SET @Yes = ':heavy_check_mark:'; + SET @No = ':x:'; + SET @PK = ':key: '; + SET @FK = ':old_key: '; + SET @Column = ':page_facing_up: '; + END; + + -- Check for Sensitivity Classifications + IF EXISTS (SELECT 1 FROM [sys].[system_views] WHERE [name] = 'sensitivity_classifications') + BEGIN + SET @Sql = N'USE ' + @QuotedDatabaseName + '; + IF EXISTS (SELECT 1 FROM [sys].[sensitivity_classifications]) + BEGIN + SET @SensitivityClassification = 1; + END; + ELSE + BEGIN + SET @SensitivityClassification = 0; + END;'; + SET @ParmDefinition = N'@SensitivityClassification BIT OUTPUT'; + EXEC sp_executesql @Sql + ,@ParmDefinition + ,@SensitivityClassification OUTPUT; + END; + + --Create table to hold EP data + SET @Sql = N'USE ' + @QuotedDatabaseName + '; + CREATE TABLE #markdown ( + [id] INT IDENTITY(1,1), + [value] NVARCHAR(MAX));'; + + /****************************** + Generate markdown for database + ******************************/ + --Database Name + SET @Sql = @Sql + N' + INSERT INTO #markdown (value) + VALUES (CONCAT(''# '', @DatabaseName) COLLATE DATABASE_DEFAULT);' + + + --Database extended properties + + N'INSERT INTO #markdown (value) + SELECT CONCAT(CHAR(13), CHAR(10), CAST([value] AS VARCHAR(8000))) + FROM [sys].[extended_properties] AS [ep] + WHERE [ep].[class] = 0 + AND [ep].[name] = @ExtendedPropertyName;' + + + --Database metadata + + N'INSERT INTO #markdown (value) + VALUES (CONCAT(CHAR(13), CHAR(10), ''| Property | Value |'')) + ,(''| --- | --- |''); + + INSERT INTO #markdown + SELECT CONCAT(''| '', ''SQL Server Version'', '' | '', CAST(SERVERPROPERTY(''ProductVersion'') AS SYSNAME), '' |'') + UNION ALL + SELECT CONCAT(''| '', ''Compatibility Level'', '' | '', [compatibility_level], '' |'') + FROM [sys].[databases] + WHERE [name] = DB_NAME() + UNION ALL + SELECT CONCAT(''| '', ''Collation'', '' | '', [collation_name], '' |'') + FROM [sys].[databases] + WHERE [name] = DB_NAME(); + ' + + + /**************************** + Generate markdown for tables + ****************************/ + --Variables + + N'DECLARE @objectid INT, + @indexobjectid INT, + @TrigObjectId INT, + @CheckConstObjectId INT, + @DefaultConstObjectId INT; + + DECLARE @key_columns NVARCHAR(MAX), + @include_columns NVARCHAR(MAX);'; + + --Build table of contents + SET @Sql = @Sql + N' + IF EXISTS (SELECT 1 FROM [sys].[tables] WHERE [type] = ''U'' AND [is_ms_shipped] = 0) + BEGIN + INSERT INTO #markdown (value) + VALUES (''----'') + ,(CONCAT(CHAR(13), CHAR(10), ''## Tables'')) + ,(CONCAT(CHAR(13), CHAR(10), ''
Click to expand'', CHAR(13), CHAR(10))); + ' + + + + N'INSERT INTO #markdown (value) + SELECT CONCAT(''* ['', OBJECT_SCHEMA_NAME(object_id), ''.'', OBJECT_NAME(object_id), ''](#'', REPLACE(LOWER(OBJECT_SCHEMA_NAME(object_id)), '' '', ''-''), REPLACE(LOWER(OBJECT_NAME(object_id)), '' '', ''-''), '')'') + FROM [sys].[tables] + WHERE [type] = ''U'' + AND [is_ms_shipped] = 0 + ORDER BY OBJECT_SCHEMA_NAME([object_id]), [name] ASC;' + + + --Object details + + N'DECLARE obj_cursor CURSOR + LOCAL STATIC READ_ONLY FORWARD_ONLY + FOR + SELECT [object_id] + FROM [sys].[tables] + WHERE [type] = ''U'' + AND [is_ms_shipped] = 0 + ORDER BY OBJECT_SCHEMA_NAME([object_id]), [name] ASC; + + OPEN obj_cursor + FETCH NEXT FROM obj_cursor INTO @objectid + WHILE @@FETCH_STATUS = 0 + BEGIN + + INSERT INTO #markdown + SELECT CONCAT(CHAR(13), CHAR(10), ''### '', OBJECT_SCHEMA_NAME(@objectid), ''.'', OBJECT_NAME(@objectid));' + + + --Extended Properties + + N'INSERT INTO #markdown + SELECT CONCAT(CHAR(13), CHAR(10), CAST([ep].[value] AS NVARCHAR(4000))) + FROM [sys].[tables] AS [t] WITH(NOLOCK) + INNER JOIN [sys].[extended_properties] AS [ep] WITH(NOLOCK) ON [t].[object_id] = [ep].[major_id] + WHERE [t].[object_id] = @objectid + AND [ep].[minor_id] = 0 --On the table + AND [ep].[name] = @ExtendedPropertyName;'; + + + IF @SensitivityClassification = 1 + BEGIN + SET @Sql = @Sql + N' + INSERT INTO #markdown (value) + VALUES (CONCAT(CHAR(13), CHAR(10), ''| Column | Type | Null | Foreign Key | Default | '', @ExtendedPropertyName COLLATE DATABASE_DEFAULT, '' | Classification |'')) + ,(''| --- | --- | --- | --- | --- | --- | --- |'');'; + END + ELSE + BEGIN + SET @Sql = @Sql + N' + INSERT INTO #markdown (value) + VALUES (CONCAT(CHAR(13), CHAR(10), ''| Column | Type | Null | Foreign Key | Default | '', @ExtendedPropertyName COLLATE DATABASE_DEFAULT, '' |'')) + ,(''| --- | --- | --- | --- | --- | --- |'');'; + END; + + --Columns + SET @Sql = @Sql + N' + INSERT INTO #markdown + SELECT CONCAT(''| '' + ,CASE + WHEN [ic].[object_id] IS NOT NULL + THEN CONCAT(@PK, ''**'',[c].[name],''**'') + WHEN [fk].[parent_object_id] IS NOT NULL + THEN CONCAT(@FK, [c].[name]) + ELSE CONCAT(@Column, [c].[name]) + END + ,'' | '' + ,CONCAT(UPPER(TYPE_NAME([user_type_id])) + ,CASE + WHEN TYPE_NAME([user_type_id]) IN (N''decimal'',N''numeric'') + THEN CONCAT(N''('',CAST(precision AS varchar(5)), N'','',CAST(scale AS varchar(5)), N'')'') + WHEN TYPE_NAME([user_type_id]) IN (''varchar'', ''char'', ''varbinary'') + THEN CASE + WHEN [max_length] = -1 + THEN N''(MAX)'' + ELSE QUOTENAME(CAST([max_length] AS VARCHAR(10)), ''('') + END + WHEN TYPE_NAME([user_type_id]) IN (N''time'',N''datetime2'',N''datetimeoffset'') + THEN QUOTENAME(CAST(scale AS varchar(5)), ''('') + WHEN TYPE_NAME([user_type_id]) in (N''float'') + THEN CASE + WHEN [c].precision = 53 + THEN N'''' + ELSE CONCAT(N''('',CAST([c].precision AS varchar(5)),N'')'') + END + WHEN TYPE_NAME([c].user_type_id) IN (N''int'',N''bigint'',N''smallint'',N''tinyint'',N''money'',N''smallmoney'', + N''real'',N''datetime'',N''smalldatetime'',N''bit'',N''image'',N''text'',N''uniqueidentifier'', + N''date'',N''ntext'',N''sql_variant'',N''hierarchyid'',''geography'',N''timestamp'',N''xml'') + THEN N'''' + WHEN TYPE_NAME([user_type_id]) IN (N''nvarchar'',N''nchar'', N''sysname'') + THEN CASE + WHEN [max_length] = -1 + THEN N''(MAX)'' + ELSE QUOTENAME(CAST([max_length]/2 AS VARCHAR(10)), ''('') + END + ELSE QUOTENAME(CAST([max_length] AS VARCHAR(10)), ''('') + END) + ,'' | '' + ,CASE [c].[is_nullable] + WHEN 1 + THEN @Yes + ELSE @No + END + ,'' | '' + ,CASE + WHEN [fk].[parent_object_id] IS NOT NULL + THEN CONCAT(''['',QUOTENAME(OBJECT_SCHEMA_NAME([fk].[referenced_object_id])), ''.'', QUOTENAME(OBJECT_NAME([fk].[referenced_object_id])), ''.'', QUOTENAME(COL_NAME([fk].[referenced_object_id], [fk].[referenced_column_id])),'']'',''(#'',LOWER(OBJECT_SCHEMA_NAME([fk].[referenced_object_id])), LOWER(OBJECT_NAME([fk].[referenced_object_id])), '')'') + ELSE '''' + END + ,'' | '' + ,OBJECT_DEFINITION([dc].[object_id]) + ,'' | '' + ,CAST([ep].[value] AS NVARCHAR(4000)) + ,'' |'''; + IF @SensitivityClassification = 1 + BEGIN + SET @Sql = @Sql + N' + ,CASE + WHEN [sc].[label] IS NOT NULL + THEN CONCAT('' Label: '', CAST([sc].[Label] AS SYSNAME), ''
'', ''Type: '', CAST([sc].[Information_Type] AS SYSNAME), ''
'', ''Rank: '', CAST([Rank_Desc] AS SYSNAME), ''
'') + ELSE '' '' + END + ,'' |'''; + END + SET @Sql = @Sql + N')'; + SET @Sql = @Sql + N' + FROM [sys].[tables] AS [t] WITH(NOLOCK) + INNER JOIN [sys].[columns] AS [c] WITH(NOLOCK) ON [t].[object_id] = [c].[object_id] + LEFT JOIN [sys].[extended_properties] AS [ep] WITH(NOLOCK) ON [t].[object_id] = [ep].[major_id] + AND [ep].[minor_id] > 0 + AND [ep].[minor_id] = [c].[column_id] + AND [ep].[class] = 1 --Object/col + AND [ep].[name] = @ExtendedPropertyName + LEFT JOIN [sys].[foreign_key_columns] AS [fk] WITH(NOLOCK) ON [fk].[parent_object_id] = [c].[object_id] + AND [fk].[parent_column_id] = [c].[column_id] + LEFT JOIN [sys].[default_constraints] AS [dc] WITH(NOLOCK) ON [dc].[parent_object_id] = [c].[object_id] + AND [dc].[parent_column_id] = [c].[column_id] + LEFT JOIN [sys].[indexes] AS [pk] WITH(NOLOCK) ON [pk].[object_id] = [t].[object_id] + AND [pk].[is_primary_key] = 1 + LEFT JOIN [sys].[index_columns] AS [ic] WITH(NOLOCK) ON [ic].[index_id] = [pk].[index_id] + AND [ic].[object_id] = [t].[object_id] + AND [ic].[column_id] = [c].[column_id]'; + + IF @SensitivityClassification = 1 + BEGIN + SET @Sql = @Sql + N' + LEFT JOIN [sys].[sensitivity_classifications] AS [sc] WITH(NOLOCK) ON [sc].[major_id] = [t].[object_id] + AND [sc].[minor_id] = [c].[column_id]'; + END; + + SET @Sql = @Sql + N' + WHERE [t].[object_id] = @objectid;' + + + --Indexes + + N'IF EXISTS (SELECT 1 FROM [sys].[indexes] WHERE [object_id] = @objectid AND [type] > 0) + BEGIN + INSERT INTO #markdown + SELECT CONCAT(CHAR(13), CHAR(10), ''#### '', ''Indexes'') + DECLARE [index_cursor] CURSOR + LOCAL STATIC READ_ONLY FORWARD_ONLY + FOR + SELECT [ind].[index_id] + FROM [sys].[indexes] AS [ind] + WHERE [ind].[object_id] = @objectId + AND [ind].[type] > 0 -- Not heap + ORDER BY [ind].[is_primary_key] DESC, [ind].[is_unique_constraint] DESC, [ind].[name] DESC + + INSERT INTO #markdown (value) + VALUES (CONCAT(CHAR(13), CHAR(10), ''| Name | Type | Key Columns | Include Columns | '', @ExtendedPropertyName COLLATE DATABASE_DEFAULT, '' |'')) + ,(''| --- | --- | --- | --- | --- |''); + + OPEN [index_cursor] + FETCH NEXT FROM [index_cursor] INTO @indexobjectid + WHILE @@FETCH_STATUS = 0 + BEGIN + ' + + + -- Get key columns as a csv list + + N'SELECT @key_columns = STUFF(( + SELECT CONCAT('', '', QUOTENAME([col].[name])) + FROM [sys].[indexes] AS [ind] + INNER JOIN [sys].[index_columns] AS [ic] ON [ind].[object_id] = [ic].[object_id] + AND [ic].[index_id] = [ind].[index_id] + INNER JOIN [sys].[columns] AS [col] ON [ic].[object_id] = [col].[object_id] + AND [ic].[column_id] = [col].[column_id] + WHERE [ind].[object_id] = @objectid + AND [ind].[index_id] = @indexobjectid + AND [ic].[is_included_column] = 0 + FOR XML PATH('''') + ), 1, 2, ''''); ' + + + -- Get included columns as a csv list + + N'SELECT @include_columns = STUFF(( + SELECT CONCAT('', '', QUOTENAME([col].[name])) + FROM [sys].[indexes] AS [ind] + INNER JOIN [sys].[index_columns] AS [ic] ON [ind].[object_id] = [ic].[object_id] + AND [ic].[index_id] = [ind].[index_id] + INNER JOIN [sys].[columns] AS [col] ON [ic].[object_id] = [col].[object_id] + AND [ic].[column_id] = [col].[column_id] + WHERE [ind].[object_id] = @objectid + AND [ind].[index_id] = @indexobjectid + AND [ic].[is_included_column] = 1 + FOR XML PATH('''') + ), 1, 2, ''''); + + INSERT INTO #markdown (value) + SELECT CONCAT(''| '' + ,CASE + WHEN [ind].[is_primary_key] = 1 + THEN CONCAT(@PK, ''**'',[ind].[name],''**'') + ELSE [ind].[name] + END + , '' | '' + , LOWER([ind].[type_desc]) COLLATE DATABASE_DEFAULT + , '' | '' + , @key_columns COLLATE DATABASE_DEFAULT + , '' | '' + , @include_columns COLLATE DATABASE_DEFAULT + , '' | '' + , CAST([ep].[value] AS NVARCHAR(4000)) COLLATE DATABASE_DEFAULT + , '' |'') + FROM [sys].[indexes] AS [ind] + LEFT JOIN [sys].[extended_properties] AS [ep] ON [ind].[object_id] = [ep].[major_id] + AND [ep].[minor_id] = [ind].[index_id] + AND [ep].[class] = 7 -- Index + AND [ep].[name] = @ExtendedPropertyName + WHERE [ind].[object_id] = @objectid + AND [ind].[index_id] = @indexobjectid; + + FETCH NEXT FROM [index_cursor] INTO @indexobjectid; + END; + + CLOSE [index_cursor]; + DEALLOCATE [index_cursor]; + END; + ' + + + --Triggers + + N'IF EXISTS (SELECT * FROM [sys].[triggers] WHERE [parent_id] = @objectid) + BEGIN + INSERT INTO #markdown + SELECT CONCAT(CHAR(13), CHAR(10), ''#### '', ''Triggers'') + DECLARE [trig_cursor] CURSOR + LOCAL STATIC READ_ONLY FORWARD_ONLY + FOR + SELECT [object_id] + FROM [sys].[triggers] + WHERE [parent_id] = @objectId + ORDER BY OBJECT_SCHEMA_NAME([object_id]), [name] ASC; + + OPEN [trig_cursor] + FETCH NEXT FROM [trig_cursor] INTO @TrigObjectId + WHILE @@FETCH_STATUS = 0 + BEGIN + INSERT INTO #markdown (value) + VALUES (CONCAT(''##### '', OBJECT_SCHEMA_NAME(@TrigObjectId), ''.'', OBJECT_NAME(@TrigObjectId))) + ,(CONCAT(''###### '', ''Definition'')) + ,(CONCAT(''
Click to expand'', CHAR(13), CHAR(10)));' + + + --Object definition + + N'INSERT INTO #markdown (value) + VALUES (CONCAT(CHAR(13), CHAR(10), ''```sql'', + CHAR(13), CHAR(10), OBJECT_DEFINITION(@CheckConstObjectId))) + ,(''```''); + + INSERT INTO #markdown (value) + VALUES (CONCAT(CHAR(13), CHAR(10), ''
'')) + + FETCH NEXT FROM [trig_cursor] INTO @TrigObjectId; + END; + + CLOSE [trig_cursor]; + DEALLOCATE [trig_cursor]; + END;' + + + --Check Constraints + + N'IF EXISTS (SELECT 1 FROM [sys].[check_constraints] WHERE [parent_object_id] = @objectid) + BEGIN + INSERT INTO #markdown + SELECT CONCAT(CHAR(13), CHAR(10), ''#### '', ''Check Constraints'') + DECLARE [check_cursor] CURSOR + LOCAL STATIC READ_ONLY FORWARD_ONLY + FOR + SELECT [object_id] + FROM [sys].[check_constraints] + WHERE [parent_object_id] = @objectid + ORDER BY OBJECT_SCHEMA_NAME(object_id), [name] ASC; + + OPEN [check_cursor] + FETCH NEXT FROM [check_cursor] INTO @CheckConstObjectId + WHILE @@FETCH_STATUS = 0 + BEGIN + INSERT INTO #markdown + VALUES (CONCAT(CHAR(13), CHAR(10),''##### '', OBJECT_SCHEMA_NAME(@CheckConstObjectId), ''.'', OBJECT_NAME(@CheckConstObjectId))) + ,(CONCAT(CHAR(13), CHAR(10),''###### '', ''Definition'')) + ,(CONCAT(CHAR(13), CHAR(10),''
Click to expand''));' + + + --Object definition + + N'INSERT INTO #markdown (value) + VALUES (CONCAT(CHAR(13), CHAR(10), ''```sql'', + CHAR(13), CHAR(10), OBJECT_DEFINITION(@CheckConstObjectId))) + ,(''```''); + + INSERT INTO #markdown + VALUES (CONCAT(CHAR(13), CHAR(10), ''
'')) + + FETCH NEXT FROM [check_cursor] INTO @CheckConstObjectId; + END; + + CLOSE [check_cursor]; + DEALLOCATE [check_cursor]; + END;' + + + --Back to top + + N'INSERT INTO #markdown + VALUES (CONCAT(CHAR(13), CHAR(10), ''[Back to top](#'', LOWER(@DatabaseName COLLATE DATABASE_DEFAULT), '')'')) + + FETCH NEXT FROM obj_cursor INTO @objectid; + + END; + CLOSE obj_cursor; + DEALLOCATE obj_cursor;' + + + --End collapsible table section + + N'INSERT INTO #markdown + VALUES (CONCAT(CHAR(13), CHAR(10), ''
'')); + END;'; --End markdown for tables + + /*************************** + Generate markdown for views + ***************************/ + --Build table of contents + SET @Sql = @Sql + N' + IF EXISTS (SELECT 1 FROM [sys].[views] WHERE [is_ms_shipped] = 0) + BEGIN; + INSERT INTO #markdown (value) + VALUES (CONCAT(CHAR(13), CHAR(10), ''## Views'')) ,(CONCAT(CHAR(13), CHAR(10), ''
Click to expand'', CHAR(13), CHAR(10))); + ' + + + + N'INSERT INTO #markdown (value) + SELECT CONCAT(''* ['', OBJECT_SCHEMA_NAME(object_id), ''.'', OBJECT_NAME(object_id), ''](#'', REPLACE(LOWER(OBJECT_SCHEMA_NAME(object_id)), '' '', ''-''), REPLACE(LOWER(OBJECT_NAME(object_id)), '' '', ''-''), '')'') + FROM [sys].[views] + WHERE [is_ms_shipped] = 0 + ORDER BY OBJECT_SCHEMA_NAME([object_id]), [name] ASC;' + + + --Object details + + N'DECLARE obj_cursor CURSOR + LOCAL STATIC READ_ONLY FORWARD_ONLY + FOR + SELECT [object_id] + FROM [sys].[views] + WHERE [is_ms_shipped] = 0 + ORDER BY OBJECT_SCHEMA_NAME([object_id]), [name] ASC; + + OPEN obj_cursor + FETCH NEXT FROM obj_cursor INTO @objectid + WHILE @@FETCH_STATUS = 0 + BEGIN + + INSERT INTO #markdown + SELECT CONCAT(CHAR(13), CHAR(10), ''### '', OBJECT_SCHEMA_NAME(@objectid), ''.'', OBJECT_NAME(@objectid));' + + + --Extended Properties + + N'INSERT INTO #markdown + SELECT CAST([ep].[value] AS NVARCHAR(4000)) + FROM [sys].[views] AS [v] + INNER JOIN [sys].[extended_properties] AS [ep] ON [v].[object_id] = [ep].[major_id] + WHERE [v].[object_id] = @objectid + AND [ep].[minor_id] = 0 + AND [ep].[name] = @ExtendedPropertyName; + + INSERT INTO #markdown (value) + VALUES (CONCAT(CHAR(13), CHAR(10), ''| Column | Type | Null | '', @ExtendedPropertyName COLLATE DATABASE_DEFAULT, '' |'')) + ,(''| --- | ---| --- | --- |'');' + + + --Projected columns + + N'INSERT INTO #markdown + SELECT CONCAT(''| '', [c].[name] + ,'' | '' + ,CONCAT(UPPER(TYPE_NAME([user_type_id])) + ,CASE + WHEN TYPE_NAME([user_type_id]) IN (N''decimal'',N''numeric'') + THEN CONCAT(N''('',CAST(precision AS varchar(5)), N'','',CAST(scale AS varchar(5)), N'')'') + WHEN TYPE_NAME([user_type_id]) IN (''varchar'', ''char'', ''varbinary'') + THEN CASE + WHEN [max_length] = -1 + THEN N''(MAX)'' + ELSE QUOTENAME(CAST([max_length] AS VARCHAR(10)), ''('') + END + WHEN TYPE_NAME([user_type_id]) IN (N''time'',N''datetime2'',N''datetimeoffset'') + THEN QUOTENAME(CAST(scale AS varchar(5)), ''('') + WHEN TYPE_NAME([user_type_id]) in (N''float'') + THEN CASE + WHEN [c].precision = 53 + THEN N'''' + ELSE CONCAT(N''('',CAST([c].precision AS varchar(5)),N'')'') + END + WHEN TYPE_NAME([c].user_type_id) IN (N''int'',N''bigint'',N''smallint'',N''tinyint'',N''money'',N''smallmoney'', + N''real'',N''datetime'',N''smalldatetime'',N''bit'',N''image'',N''text'',N''uniqueidentifier'', + N''date'',N''ntext'',N''sql_variant'',N''hierarchyid'',''geography'',N''timestamp'',N''xml'') + THEN N'''' + WHEN TYPE_NAME([user_type_id]) IN (N''nvarchar'',N''nchar'', N''sysname'') + THEN CASE + WHEN [max_length] = -1 + THEN N''(MAX)'' + ELSE QUOTENAME(CAST([max_length]/2 AS VARCHAR(10)), ''('') + END + ELSE QUOTENAME(CAST([max_length] AS VARCHAR(10)), ''('') + END) + ,'' | '' + ,CASE [c].[is_nullable] + WHEN 1 + THEN @Yes + ELSE @No + END + ,'' | '' + ,CAST([ep].[value] AS NVARCHAR(4000)) + ,'' |'') + FROM [sys].[views] AS [o] + INNER JOIN [sys].[columns] AS [c] ON [o].[object_id] = [c].[object_id] + LEFT JOIN [sys].[extended_properties] AS [ep] ON [o].[object_id] = [ep].[major_id] + AND [ep].[minor_id] = [c].[column_id] + AND [ep].[name] = @ExtendedPropertyName + WHERE [o].[is_ms_shipped] = 0 -- User objects only + AND [o].[type] = ''V'' -- VIEW + AND [o].[object_id] = @objectid + ORDER BY SCHEMA_NAME([o].[schema_id]), [o].[type_desc], OBJECT_NAME([ep].major_id); + + INSERT INTO #markdown (value) + VALUES(CONCAT(CHAR(13), CHAR(10), ''#### Definition'')) + ,(CONCAT(CHAR(13), CHAR(10), ''
Click to expand''));' + + + --Object definition + + N'INSERT INTO #markdown (value) + VALUES (CONCAT(CHAR(13), CHAR(10), ''```sql'', + CHAR(13), CHAR(10), OBJECT_DEFINITION(@objectid))) + ,(''```'');' + + + --Indexes + + N'IF EXISTS (SELECT 1 FROM [sys].[indexes] WHERE [object_id] = @objectid) + BEGIN + INSERT INTO #markdown + SELECT CONCAT(CHAR(13), CHAR(10), ''#### '', ''Indexes'') + DECLARE [index_cursor] CURSOR + LOCAL STATIC READ_ONLY FORWARD_ONLY + FOR + SELECT [ind].[index_id] + FROM [sys].[indexes] AS [ind] + WHERE [ind].[object_id] = @objectId + AND [ind].[type] > 0 -- Not heap + ORDER BY [ind].[is_primary_key] DESC, [ind].[is_unique_constraint] DESC, [ind].[name] DESC + + INSERT INTO #markdown (value) + VALUES (CONCAT(CHAR(13), CHAR(10), ''| Name | Type | Key Columns | Include Columns | '', @ExtendedPropertyName COLLATE DATABASE_DEFAULT, '' |'')) + ,(''| --- | --- | --- | --- | --- |''); + + OPEN [index_cursor] + FETCH NEXT FROM [index_cursor] INTO @indexobjectid + WHILE @@FETCH_STATUS = 0 + BEGIN + ' + + -- Get key columns as a csv list + + N'SELECT @key_columns = STUFF(( + SELECT CONCAT('', '', QUOTENAME([col].[name])) + FROM [sys].[indexes] AS [ind] + INNER JOIN [sys].[index_columns] AS [ic] ON [ind].[object_id] = [ic].[object_id] + AND [ic].[index_id] = [ind].[index_id] + INNER JOIN [sys].[columns] AS [col] ON [ic].[object_id] = [col].[object_id] + AND [ic].[column_id] = [col].[column_id] + WHERE [ind].[object_id] = @objectid + AND [ind].[index_id] = @indexobjectid + AND [ic].[is_included_column] = 0 + FOR XML PATH('''') + ), 1, 2, ''''); ' + + + -- Get included columns as a csv list + + N'SELECT @include_columns = STUFF(( + SELECT CONCAT('', '', QUOTENAME([col].[name])) + FROM [sys].[indexes] AS [ind] + INNER JOIN [sys].[index_columns] AS [ic] ON [ind].[object_id] = [ic].[object_id] + AND [ic].[index_id] = [ind].[index_id] + INNER JOIN [sys].[columns] AS [col] ON [ic].[object_id] = [col].[object_id] + AND [ic].[column_id] = [col].[column_id] + WHERE [ind].[object_id] = @objectid + AND [ind].[index_id] = @indexobjectid + AND [ic].[is_included_column] = 1 + FOR XML PATH('''') + ), 1, 2, ''''); + + INSERT INTO #markdown (value) + SELECT CONCAT(''| '' + ,CASE + WHEN [ind].[is_primary_key] = 1 + THEN CONCAT(@PK, ''**'',[ind].[name],''**'') + ELSE [ind].[name] + END + , '' | '' + , LOWER([ind].[type_desc]) COLLATE DATABASE_DEFAULT + , '' | '' + , @key_columns COLLATE DATABASE_DEFAULT + , '' | '' + , @include_columns COLLATE DATABASE_DEFAULT + , '' | '' + , CAST([ep].[value] AS NVARCHAR(4000)) COLLATE DATABASE_DEFAULT + , '' |'') + FROM [sys].[indexes] AS [ind] + LEFT JOIN [sys].[extended_properties] AS [ep] ON [ind].[object_id] = [ep].[major_id] + AND [ep].[minor_id] = [ind].[index_id] + AND [ep].[class] = 7 -- Index + AND [ep].[name] = @ExtendedPropertyName + WHERE [ind].[object_id] = @objectid + AND [ind].[index_id] = @indexobjectid; + + FETCH NEXT FROM [index_cursor] INTO @indexobjectid; + END; + + CLOSE [index_cursor]; + DEALLOCATE [index_cursor]; + END; + ' + + + --Back to top + + N'INSERT INTO #markdown + VALUES (CONCAT(CHAR(13), CHAR(10), ''
'')) + ,(CONCAT(CHAR(13), CHAR(10), ''[Back to top](#'', LOWER(@DatabaseName COLLATE DATABASE_DEFAULT), '')'')); + + FETCH NEXT FROM obj_cursor INTO @objectid; + + END; + CLOSE obj_cursor; + DEALLOCATE obj_cursor;' + + + --End collapsible view section + + N'INSERT INTO #markdown + VALUES (CONCAT(CHAR(13), CHAR(10), ''
'')); + END;'; --End markdown for views + + /************************************** + Generate markdown for stored procedures + **************************************/ + --Build table of contents + SET @Sql = @Sql + N' + IF EXISTS (SELECT 1 FROM [sys].[procedures] WHERE [is_ms_shipped] = 0) + BEGIN; + INSERT INTO #markdown + VALUES (CONCAT(CHAR(13), CHAR(10), ''## Stored Procedures'')) ,(CONCAT(CHAR(13), CHAR(10), ''
Click to expand'', CHAR(13), CHAR(10))); + ' + + + + N'INSERT INTO #markdown + SELECT CONCAT(''* ['', OBJECT_SCHEMA_NAME(object_id), ''.'', OBJECT_NAME(object_id), ''](#'', REPLACE(LOWER(OBJECT_SCHEMA_NAME(object_id)), '' '', ''-''), REPLACE(LOWER(OBJECT_NAME(object_id)), '' '', ''-''), '')'') + FROM [sys].[procedures] + WHERE [is_ms_shipped] = 0 + ORDER BY OBJECT_SCHEMA_NAME(object_id), [name] ASC;' + + + --Object details + + N'DECLARE obj_cursor CURSOR + LOCAL STATIC READ_ONLY FORWARD_ONLY + FOR + SELECT [object_id] + FROM [sys].[procedures] + WHERE [is_ms_shipped] = 0 + ORDER BY OBJECT_SCHEMA_NAME([object_id]), [name] ASC; + + OPEN obj_cursor + FETCH NEXT FROM obj_cursor INTO @objectid + WHILE @@FETCH_STATUS = 0 + BEGIN + + INSERT INTO #markdown + SELECT CONCAT(CHAR(13), CHAR(10), ''### '', OBJECT_SCHEMA_NAME(@objectid), ''.'', OBJECT_NAME(@objectid));' + + + --Extended properties + + N'INSERT INTO #markdown + SELECT CAST([ep].[value] AS NVARCHAR(4000)) + FROM [sys].[procedures] AS [p] + INNER JOIN [sys].[extended_properties] AS [ep] ON [p].[object_id] = [ep].[major_id] + WHERE [p].[object_id] = @objectid + AND [ep].[minor_id] = 0 + AND [ep].[name] = @ExtendedPropertyName;' + + + --Check for parameters + + N'IF EXISTS (SELECT * FROM [sys].[parameters] AS [param] WHERE [param].[object_id] = @objectid) + BEGIN + INSERT INTO #markdown (value) + VALUES (CONCAT(CHAR(13), CHAR(10), ''| Parameter | Type | Output | Description |'')) + ,(''| --- | --- | --- | --- |''); + + INSERT INTO #markdown + select CONCAT(''| '', CASE WHEN LEN([param].[name]) = 0 THEN ''*Output*'' ELSE [param].[name] END + ,'' | '' + ,CONCAT(UPPER(TYPE_NAME([user_type_id])) + ,CASE + WHEN TYPE_NAME([user_type_id]) IN (N''decimal'',N''numeric'') + THEN CONCAT(N''('',CAST(precision AS varchar(5)), N'','',CAST(scale AS varchar(5)), N'')'') + WHEN TYPE_NAME([user_type_id]) IN (''varchar'', ''char'', ''varbinary'') + THEN CASE + WHEN [max_length] = -1 + THEN N''(MAX)'' + ELSE QUOTENAME(CAST([max_length] AS VARCHAR(10)), ''('') + END + WHEN TYPE_NAME([user_type_id]) IN (N''time'',N''datetime2'',N''datetimeoffset'') + THEN QUOTENAME(CAST(scale AS varchar(5)), ''('') + WHEN TYPE_NAME([user_type_id]) in (N''float'') + THEN CASE + WHEN [param].precision = 53 + THEN N'''' + ELSE CONCAT(N''('',CAST([param].precision AS varchar(5)),N'')'') + END + WHEN TYPE_NAME([param].user_type_id) IN (N''int'',N''bigint'',N''smallint'',N''tinyint'',N''money'',N''smallmoney'', + N''real'',N''datetime'',N''smalldatetime'',N''bit'',N''image'',N''text'',N''uniqueidentifier'', + N''date'',N''ntext'',N''sql_variant'',N''hierarchyid'',''geography'',N''timestamp'',N''xml'') OR [is_readonly] = 1 + THEN N'''' + WHEN TYPE_NAME([user_type_id]) IN (N''nvarchar'',N''nchar'', N''sysname'') + THEN CASE + WHEN [max_length] = -1 + THEN N''(MAX)'' + ELSE QUOTENAME(CAST([max_length]/2 AS VARCHAR(10)), ''('') + END + ELSE QUOTENAME(CAST([max_length] AS VARCHAR(10)), ''('') + END) + ,'' | '' + ,CASE [is_output] + WHEN 1 + THEN @Yes + ELSE @No + END + ,'' | '' + ,CAST([ep].[value] AS NVARCHAR(4000)) + , '' |'') + FROM [sys].[procedures] AS [proc] + INNER JOIN [sys].[parameters] AS [param] ON [param].[object_id] = [proc].[object_id] + LEFT JOIN [sys].[extended_properties] AS [ep] ON [proc].[object_id] = [ep].[major_id] + AND [ep].[name] = [param].[name] + WHERE [proc].[object_id] = @objectid + ORDER BY [param].[parameter_id] ASC; + END + + INSERT INTO #markdown (value) + VALUES(CONCAT(CHAR(13), CHAR(10), ''#### Definition'')) + ,(CONCAT(CHAR(13), CHAR(10), ''
Click to expand''));' + + + --Object definition + + N' + IF (@LimitStoredProcLength = 1 AND LEN(OBJECT_DEFINITION(@objectid)) > 8000) + BEGIN; + INSERT INTO #markdown (value) + VALUES (CONCAT(CHAR(13), CHAR(10), ''```sql'', + CHAR(13), CHAR(10), CAST(OBJECT_DEFINITION(@objectid) AS VARCHAR(8000)))) + ,(''/************************************************************************************************/'') + ,(''/* sp_doc: Max 8000 characters reached. Set @LimitStoredProcLength = 0 to show full definition. */'') + ,(''/************************************************************************************************/'') + ,(''```''); + END; + ELSE + BEGIN; + INSERT INTO #markdown (value) + VALUES (CONCAT(CHAR(13), CHAR(10), ''```sql'', + CHAR(13), CHAR(10), OBJECT_DEFINITION(@objectid))) + ,(''```''); + END;' + + + --Back to top + + N'INSERT INTO #markdown + VALUES (CONCAT(CHAR(13), CHAR(10), ''
'')) + ,(CONCAT(CHAR(13), CHAR(10), ''[Back to top](#'', LOWER(@DatabaseName COLLATE DATABASE_DEFAULT), '')'')); + + FETCH NEXT FROM obj_cursor INTO @objectid + + END; + CLOSE obj_cursor; + DEALLOCATE obj_cursor;' + + + --End collapsible stored procedure section + + N'INSERT INTO #markdown + VALUES (CONCAT(CHAR(13), CHAR(10), ''
'')); + END;'; --End markdown for stored procedures + + /************************************* + Generate markdown for scalar functions + *************************************/ + --Build table of contents + SET @Sql = @Sql + N' + IF EXISTS (SELECT 1 FROM [sys].[objects] WHERE [is_ms_shipped] = 0 AND [type] = ''FN'') + BEGIN; + INSERT INTO #markdown (value) + VALUES (CONCAT(CHAR(13), CHAR(10), ''## Scalar Functions'')) ,(CONCAT(CHAR(13), CHAR(10), ''
Click to expand'', CHAR(13), CHAR(10))); + ' + + + + N'INSERT INTO #markdown + SELECT CONCAT(''* ['', OBJECT_SCHEMA_NAME(object_id), ''.'', OBJECT_NAME(object_id), ''](#'', REPLACE(LOWER(OBJECT_SCHEMA_NAME(object_id)), '' '', ''-''), REPLACE(LOWER(OBJECT_NAME(object_id)), '' '', ''-''), '')'') + FROM [sys].[objects] + WHERE [is_ms_shipped] = 0 + AND [type] = ''FN'' --SQL_SCALAR_FUNCTION + ORDER BY OBJECT_SCHEMA_NAME([object_id]), [name] ASC;' + + + --Object details + + N'DECLARE obj_cursor CURSOR + LOCAL STATIC READ_ONLY FORWARD_ONLY + FOR + SELECT [object_id] + FROM [sys].[objects] + WHERE [is_ms_shipped] = 0 + AND [type] = ''FN'' --SQL_SCALAR_FUNCTION + ORDER BY OBJECT_SCHEMA_NAME([object_id]), [name] ASC; + + OPEN obj_cursor + FETCH NEXT FROM obj_cursor INTO @objectid + WHILE @@FETCH_STATUS = 0 + BEGIN + + INSERT INTO #markdown + SELECT CONCAT(CHAR(13), CHAR(10), ''### '', OBJECT_SCHEMA_NAME(@objectid), ''.'', OBJECT_NAME(@objectid));' + + + --Extended properties + + N'INSERT INTO #markdown + SELECT CAST([ep].[value] AS NVARCHAR(4000)) + FROM [sys].[objects] AS [o] + INNER JOIN [sys].[extended_properties] AS [ep] ON [o].[object_id] = [ep].[major_id] + WHERE [o].[object_id] = @objectid + AND [ep].[minor_id] = 0 + AND [ep].[name] = @ExtendedPropertyName;' + + + --Check for parameters + + N'IF EXISTS (SELECT * FROM [sys].[parameters] AS [param] WHERE [param].[object_id] = @objectid) + BEGIN + INSERT INTO #markdown (value) + VALUES (CONCAT(CHAR(13), CHAR(10), ''| Parameter | Type | Output | Description |'')) + ,(''| --- | --- | --- | --- |''); + + INSERT INTO #markdown + select CONCAT(''| '', CASE WHEN LEN([param].[name]) = 0 THEN ''*Output*'' ELSE [param].[name] END + ,'' | '' + ,CONCAT(UPPER(TYPE_NAME([user_type_id])) + ,CASE + WHEN TYPE_NAME([user_type_id]) IN (N''decimal'',N''numeric'') + THEN CONCAT(N''('',CAST(precision AS varchar(5)), N'','',CAST(scale AS varchar(5)), N'')'') + WHEN TYPE_NAME([user_type_id]) IN (''varchar'', ''char'', ''varbinary'') + THEN CASE + WHEN [max_length] = -1 + THEN N''(MAX)'' + ELSE QUOTENAME(CAST([max_length] AS VARCHAR(10)), ''('') + END + WHEN TYPE_NAME([user_type_id]) IN (N''time'',N''datetime2'',N''datetimeoffset'') + THEN QUOTENAME(CAST(scale AS varchar(5)), ''('') + WHEN TYPE_NAME([user_type_id]) in (N''float'') + THEN CASE + WHEN [param].precision = 53 + THEN N'''' + ELSE CONCAT(N''('',CAST([param].precision AS varchar(5)),N'')'') + END + WHEN TYPE_NAME([param].user_type_id) IN (N''int'',N''bigint'',N''smallint'',N''tinyint'',N''money'',N''smallmoney'', + N''real'',N''datetime'',N''smalldatetime'',N''bit'',N''image'',N''text'',N''uniqueidentifier'', + N''date'',N''ntext'',N''sql_variant'',N''hierarchyid'',''geography'',N''timestamp'',N''xml'') OR [is_readonly] = 1 + THEN N'''' + WHEN TYPE_NAME([user_type_id]) IN (N''nvarchar'',N''nchar'', N''sysname'') + THEN CASE + WHEN [max_length] = -1 + THEN N''(MAX)'' + ELSE QUOTENAME(CAST([max_length]/2 AS VARCHAR(10)), ''('') + END + ELSE QUOTENAME(CAST([max_length] AS VARCHAR(10)), ''('') + END) + ,'' | '' + ,CASE [is_output] + WHEN 1 + THEN @Yes + ELSE @No + END + ,'' | '' + ,CAST([ep].[value] AS NVARCHAR(4000)) + , '' |'') + FROM [sys].[objects] AS [o] + INNER JOIN [sys].[parameters] AS [param] ON [param].[object_id] = [o].[object_id] + LEFT JOIN [sys].[extended_properties] AS [ep] ON [o].[object_id] = [ep].[major_id] + AND [ep].[name] = [param].[name] + WHERE [o].[object_id] = @objectid + ORDER BY [param].[parameter_id] ASC; + END; + + INSERT INTO #markdown (value) + VALUES(CONCAT(CHAR(13), CHAR(10), ''#### Definition'')) + ,(CONCAT(CHAR(13), CHAR(10), ''
Click to expand''));' + + + --Object definition + + N'INSERT INTO #markdown (value) + VALUES (CONCAT(CHAR(13), CHAR(10), ''```sql'', + CHAR(13), CHAR(10), OBJECT_DEFINITION(@objectid))) + ,(''```'');' + + + --Back to top + + N'INSERT INTO #markdown + VALUES (CONCAT(CHAR(13), CHAR(10), ''
'')) + ,(CONCAT(CHAR(13), CHAR(10), ''[Back to top](#'', LOWER(@DatabaseName COLLATE DATABASE_DEFAULT), '')'')); + + FETCH NEXT FROM obj_cursor INTO @objectid; + + END; + CLOSE obj_cursor; + DEALLOCATE obj_cursor;' + + + --End collapsible scalar functions section + + N'INSERT INTO #markdown + VALUES (CONCAT(CHAR(13), CHAR(10), ''
'')); + END;'; --End markdown for scalar functions + + /************************************ + Generate markdown for table functions + ************************************/ + --Build table of contents + SET @Sql = @Sql + N' + IF EXISTS (SELECT 1 FROM [sys].[objects] WHERE [is_ms_shipped] = 0 AND [type] = ''IF'') + BEGIN; + INSERT INTO #markdown + VALUES (CONCAT(CHAR(13), CHAR(10), ''## Table Functions'')) ,(CONCAT(CHAR(13), CHAR(10), ''
Click to expand'', CHAR(13), CHAR(10))); + ' + + + + N'INSERT INTO #markdown + SELECT CONCAT(''* ['', OBJECT_SCHEMA_NAME(object_id), ''.'', OBJECT_NAME(object_id), ''](#'', REPLACE(LOWER(OBJECT_SCHEMA_NAME(object_id)), '' '', ''-''), REPLACE(LOWER(OBJECT_NAME(object_id)), '' '', ''-''), '')'') + FROM [sys].[objects] + WHERE [is_ms_shipped] = 0 + AND [type] = ''IF'' --SQL_INLINE_TABLE_VALUED_FUNCTION + ORDER BY OBJECT_SCHEMA_NAME(object_id), [name] ASC;' + + + --Object details + + N'DECLARE obj_cursor CURSOR + LOCAL STATIC READ_ONLY FORWARD_ONLY + FOR + SELECT [object_id] + FROM [sys].[objects] + WHERE [is_ms_shipped] = 0 + AND [type] = ''IF'' --SQL_INLINE_TABLE_VALUED_FUNCTION + ORDER BY OBJECT_SCHEMA_NAME([object_id]), [name] ASC; + + OPEN obj_cursor + FETCH NEXT FROM obj_cursor INTO @objectid + WHILE @@FETCH_STATUS = 0 + BEGIN + + INSERT INTO #markdown + SELECT CONCAT(CHAR(13), CHAR(10), ''### '', OBJECT_SCHEMA_NAME(@objectid), ''.'', OBJECT_NAME(@objectid));' + + + --Extended properties + + N'INSERT INTO #markdown + SELECT CAST([ep].[value] AS NVARCHAR(4000)) + FROM [sys].[objects] AS [o] + INNER JOIN [sys].[extended_properties] AS [ep] ON [o].[object_id] = [ep].[major_id] + WHERE [o].[object_id] = @objectid + AND [ep].[minor_id] = 0 + AND [ep].[name] = @ExtendedPropertyName;' + + + --Check for parameters + + N'IF EXISTS (SELECT * FROM [sys].[parameters] AS [param] WHERE [param].[object_id] = @objectid) + BEGIN + INSERT INTO #markdown (value) + VALUES (CONCAT(CHAR(13), CHAR(10), ''| Parameter | Type | Output | Description |'')) + ,(''| --- | --- | --- | --- |''); + + INSERT INTO #markdown + select CONCAT(''| '', CASE WHEN LEN([param].[name]) = 0 THEN ''*Output*'' ELSE [param].[name] END + ,'' | '' + ,CONCAT(UPPER(TYPE_NAME([user_type_id])) + ,CASE + WHEN TYPE_NAME([user_type_id]) IN (N''decimal'',N''numeric'') + THEN CONCAT(N''('',CAST(precision AS varchar(5)), N'','',CAST(scale AS varchar(5)), N'')'') + WHEN TYPE_NAME([user_type_id]) IN (''varchar'', ''char'') + THEN QUOTENAME(CAST([max_length] AS VARCHAR(10)), ''('') + WHEN TYPE_NAME([user_type_id]) IN (N''time'',N''datetime2'',N''datetimeoffset'') + THEN QUOTENAME(CAST(scale AS varchar(5)), ''('') + WHEN TYPE_NAME([user_type_id]) in (N''float'') + THEN CASE + WHEN precision = 53 + THEN N'''' + ELSE QUOTENAME(CAST(precision AS varchar(5)),''('') END + WHEN TYPE_NAME([user_type_id]) IN (N''int'',N''bigint'',N''smallint'',N''tinyint'',N''money'',N''smallmoney'', + N''real'',N''datetime'',N''smalldatetime'',N''bit'',N''image'',N''text'',N''uniqueidentifier'', + N''date'',N''ntext'',N''sql_variant'',N''hierarchyid'',''geography'',N''timestamp'',N''xml'') + THEN N'''' + ELSE CASE + WHEN [is_readonly] = 1 --User defined table type + THEN N'''' + WHEN [max_length] = -1 + THEN N''(MAX)'' + WHEN TYPE_NAME([user_type_id]) IN (N''nvarchar'',N''nchar'', N''sysname'') + THEN QUOTENAME(CAST([max_length]/2 AS VARCHAR(10)), ''('') + ELSE QUOTENAME(CAST([max_length] AS VARCHAR(10)), ''('') + END + END) + ,'' | '' + ,CASE [is_output] + WHEN 1 + THEN @Yes + ELSE @No + END + ,'' | '' + ,CAST([ep].[value] AS NVARCHAR(4000)) + , '' |'') + FROM [sys].[objects] AS [o] + INNER JOIN [sys].[parameters] AS [param] ON [param].[object_id] = [o].[object_id] + LEFT JOIN [sys].[extended_properties] AS [ep] ON [o].[object_id] = [ep].[major_id] + AND [ep].[name] = [param].[name] + WHERE [o].[object_id] = @objectid + ORDER BY [param].[parameter_id] ASC; + END; + + INSERT INTO #markdown (value) + VALUES(CONCAT(CHAR(13), CHAR(10), ''#### Definition'')) + ,(CONCAT(CHAR(13), CHAR(10), ''
Click to expand''));' + + + --Object definition + + N'INSERT INTO #markdown (value) + VALUES (CONCAT(CHAR(13), CHAR(10), ''```sql'', + CHAR(13), CHAR(10), OBJECT_DEFINITION(@objectid))) + ,(''```'');' + + + --Back to top + + N'INSERT INTO #markdown + VALUES (CONCAT(CHAR(13), CHAR(10), ''
'')) + ,(CONCAT(CHAR(13), CHAR(10),''[Back to top](#'', LOWER(@DatabaseName COLLATE DATABASE_DEFAULT), '')'')); + + FETCH NEXT FROM obj_cursor INTO @objectid; + + END; + CLOSE obj_cursor; + DEALLOCATE obj_cursor;' + + + --End collapsible table functions section + + N'INSERT INTO #markdown + VALUES (CONCAT(CHAR(13), CHAR(10), ''
'')); + END;'; --End markdown for table functions + + /****************************** + Generate markdown for synonyms + ******************************/ + --Build table of contents + SET @Sql = @Sql + N' + IF EXISTS (SELECT 1 FROM [sys].[synonyms] WHERE [is_ms_shipped] = 0) + BEGIN; + INSERT INTO #markdown ([value]) + VALUES (CONCAT(CHAR(13), CHAR(10), ''## Synonyms'')) ,(CONCAT(CHAR(13), CHAR(10), ''
Click to expand'')); + ' + + + + N'INSERT INTO #markdown + SELECT CONCAT(''* ['', OBJECT_SCHEMA_NAME(object_id), ''.'', OBJECT_NAME(object_id), ''](#'', REPLACE(LOWER(OBJECT_SCHEMA_NAME(object_id)), '' '', ''-''), REPLACE(LOWER(OBJECT_NAME(object_id)), '' '', ''-''), '')'') + FROM [sys].[synonyms] + WHERE [is_ms_shipped] = 0 + ORDER BY OBJECT_SCHEMA_NAME([object_id]), [name] ASC;' + + + --Object details + + N'DECLARE obj_cursor CURSOR + LOCAL STATIC READ_ONLY FORWARD_ONLY + FOR + SELECT [object_id] + FROM [sys].[synonyms] + WHERE [is_ms_shipped] = 0 + ORDER BY OBJECT_SCHEMA_NAME([object_id]), [name] ASC; + + OPEN obj_cursor + FETCH NEXT FROM obj_cursor INTO @objectid + WHILE @@FETCH_STATUS = 0 + BEGIN + + INSERT INTO #markdown + SELECT CONCAT(CHAR(13), CHAR(10), ''### '', OBJECT_SCHEMA_NAME(@objectid), ''.'', OBJECT_NAME(@objectid), CHAR(13), CHAR(10)); ' + + + --Extended properties + + N'INSERT INTO #markdown + SELECT CAST([ep].[value] AS NVARCHAR(4000)) + FROM [sys].[synonyms] AS [s] + INNER JOIN [sys].[extended_properties] AS [ep] ON [s].[object_id] = [ep].[major_id] + WHERE [s].[object_id] = @objectid + AND [ep].[minor_id] = 0 + AND [ep].[name] = @ExtendedPropertyName; + + INSERT INTO #markdown (value) + VALUES (CONCAT(CHAR(13), CHAR(10), ''| Synonym | Base Object |'')) + ,(''| --- | --- |'');' + + + --Object mapping + + N'INSERT INTO #markdown + SELECT CONCAT(''| '', OBJECT_SCHEMA_NAME([syn].[object_id]), ''.'', OBJECT_NAME([syn].[object_id]) + ,'' | '' + ,CASE WHEN PARSENAME([base_object_name], 3) = DB_NAME() + THEN CONCAT(''['', PARSENAME([base_object_name], 3), ''.'', PARSENAME([base_object_name], 2), ''.'', PARSENAME([base_object_name], 1), '']'', ''(#'', PARSENAME([base_object_name], 2), ''.'', PARSENAME([base_object_name], 1), '')'') + ELSE CONCAT(PARSENAME([base_object_name], 3), PARSENAME([base_object_name], 2), PARSENAME([base_object_name], 1)) + END + ,'' |'') + FROM [sys].[synonyms] AS [syn] + WHERE [syn].[object_id] = @objectid;' + + + --Back to top + + N'INSERT INTO #markdown + VALUES (CONCAT(CHAR(13), CHAR(10),''[Back to top](#'', LOWER(@DatabaseName COLLATE DATABASE_DEFAULT), '')'')); + + FETCH NEXT FROM obj_cursor INTO @objectid + + END + CLOSE obj_cursor + DEALLOCATE obj_cursor;' + + + --End collapsible synonyms section + + N'INSERT INTO #markdown + VALUES (CONCAT(CHAR(13), CHAR(10), ''
'')); + END;'; --End markdown for synonyms + + /*********************************************** + Generate markdown for user defined table types + ***********************************************/ + --Build table of contents + SET @Sql = @Sql + N' + IF EXISTS (SELECT 1 FROM [sys].[table_types] WHERE [is_user_defined] = 1) + BEGIN + INSERT INTO #markdown (value) + VALUES (CONCAT(CHAR(13), CHAR(10), ''## User Defined Table Types'')) + ,(CONCAT(CHAR(13), CHAR(10), ''
Click to expand'', CHAR(13), CHAR(10))); + ' + + + + N'INSERT INTO #markdown (value) + SELECT CONCAT(''* ['', SCHEMA_NAME([schema_id]), ''.'', [name], ''](#'', REPLACE(LOWER(SCHEMA_NAME([schema_id])), '' '', ''-''), REPLACE(LOWER([name]), '' '', ''-''), '')'') + FROM [sys].[table_types] + WHERE [is_user_defined] = 1 + ORDER BY OBJECT_SCHEMA_NAME([type_table_object_id]), [name] ASC;' + + + --Object details + + N'DECLARE obj_cursor CURSOR + LOCAL STATIC READ_ONLY FORWARD_ONLY + FOR + SELECT [type_table_object_id] + FROM [sys].[table_types] + WHERE [is_user_defined] = 1 + ORDER BY OBJECT_SCHEMA_NAME([type_table_object_id]), [name] ASC; + + OPEN obj_cursor + FETCH NEXT FROM obj_cursor INTO @objectid + WHILE @@FETCH_STATUS = 0 + BEGIN + + INSERT INTO #markdown + SELECT CONCAT(CHAR(13), CHAR(10), ''### '', SCHEMA_NAME([schema_id]), ''.'', [name]) + FROM [sys].[table_types] + WHERE [type_table_object_id] = @objectid + AND [is_user_defined] = 1;' + + + --Extended Properties + + N'INSERT INTO #markdown + SELECT CONCAT(CHAR(13), CHAR(10), CAST([ep].[value] AS NVARCHAR(4000))) + FROM [sys].[table_types] AS [tt] + INNER JOIN [sys].[extended_properties] AS [ep] ON [tt].[type_table_object_id] = [ep].[major_id] + WHERE [tt].[type_table_object_id] = @objectid + AND [ep].[minor_id] = 0 --On the table + AND [ep].[name] = @ExtendedPropertyName + AND [tt].[is_user_defined] = 1; + + INSERT INTO #markdown (value) + VALUES (CONCAT(CHAR(13), CHAR(10), ''| Column | Type | Null | Default | '', @ExtendedPropertyName COLLATE DATABASE_DEFAULT, '' |'')) + ,(''| --- | ---| --- | --- | --- |'');' + + + --Columns + + N'INSERT INTO #markdown + SELECT CONCAT(''| '' + ,CASE + WHEN [ic].[object_id] IS NOT NULL + THEN ISNULL(CONCAT(''**'',[c].[name],''**''), ''N/A'') + ELSE ISNULL([c].[name], ''N/A'') + END + ,'' | '' + ,CONCAT(UPPER(TYPE_NAME([c].[user_type_id])) + ,CASE + WHEN TYPE_NAME([c].[user_type_id]) IN (N''decimal'',N''numeric'') + THEN CONCAT(N''('',CAST([c].[precision] AS VARCHAR(5)), N'','',CAST([c].[scale] AS varchar(5)), N'')'') + WHEN TYPE_NAME([c].[user_type_id]) IN (''varchar'', ''char'', ''varbinary'') + THEN CASE + WHEN [c].[max_length] = -1 + THEN N''(MAX)'' + ELSE QUOTENAME(CAST([c].[max_length] AS VARCHAR(10)), ''('') + END + WHEN TYPE_NAME([c].[user_type_id]) IN (N''time'',N''datetime2'',N''datetimeoffset'') + THEN QUOTENAME(CAST([c].[scale] AS VARCHAR(5)), ''('') + WHEN TYPE_NAME([c].[user_type_id]) in (N''float'') + THEN CASE + WHEN [c].precision = 53 + THEN N'''' + ELSE CONCAT(N''('',CAST([c].[precision] AS VARCHAR(5)),N'')'') + END + WHEN TYPE_NAME([c].[user_type_id]) IN (N''int'',N''bigint'',N''smallint'',N''tinyint'',N''money'',N''smallmoney'', + N''real'',N''datetime'',N''smalldatetime'',N''bit'',N''image'',N''text'',N''uniqueidentifier'', + N''date'',N''ntext'',N''sql_variant'',N''hierarchyid'',''geography'',N''timestamp'',N''xml'') + THEN N'''' + WHEN TYPE_NAME([c].[user_type_id]) IN (N''nvarchar'',N''nchar'', N''sysname'') + THEN CASE + WHEN [c].[max_length] = -1 + THEN N''(MAX)'' + ELSE QUOTENAME(CAST([c].[max_length]/2 AS VARCHAR(10)), ''('') + END + ELSE QUOTENAME(CAST([c].[max_length] AS VARCHAR(10)), ''('') + END) + ,'' | '' + ,CASE [c].[is_nullable] + WHEN 1 + THEN @Yes + ELSE @No + END + ,'' | '' + ,OBJECT_DEFINITION([dc].[object_id]) + ,'' | '' + ,CAST([ep].[value] AS NVARCHAR(4000)) + ,'' |'') + FROM [sys].[table_types] AS [tt] + INNER JOIN [sys].[columns] AS [c] ON [tt].[type_table_object_id] = [c].[object_id] + LEFT JOIN [sys].[extended_properties] AS [ep] ON [tt].[type_table_object_id] = [ep].[major_id] + AND [ep].[minor_id] > 0 + AND [ep].[minor_id] = [c].[column_id] + AND [ep].[class] = 1 --Object/col + -- AND [ep].[name] = @ExtendedPropertyName + LEFT JOIN [sys].[foreign_key_columns] AS [fk] ON [fk].[parent_object_id] = [c].[object_id] + AND [fk].[parent_column_id] = [c].[column_id] + LEFT JOIN [sys].[default_constraints] [dc] ON [dc].[parent_object_id] = [c].[object_id] + AND [dc].[parent_column_id] = [c].[column_id] + LEFT JOIN [sys].[indexes] AS [pk] ON [pk].[object_id] = [tt].[type_table_object_id] + AND [pk].[is_primary_key] = 1 + LEFT JOIN [sys].[index_columns] AS [ic] ON [ic].[index_id] = [pk].[index_id] + AND [ic].[object_id] = [tt].[type_table_object_id] + AND [ic].[column_id] = [c].[column_id] + WHERE [tt].[type_table_object_id] = @objectid + AND [tt].[is_user_defined] = 1;' + + + --Back to top + + N'INSERT INTO #markdown + VALUES (CONCAT(CHAR(13), CHAR(10), ''[Back to top](#'', LOWER(@DatabaseName COLLATE DATABASE_DEFAULT), '')'')) + + FETCH NEXT FROM obj_cursor INTO @objectid; + + END; + CLOSE obj_cursor; + DEALLOCATE obj_cursor;' + + + --End collapsible table section + + N'INSERT INTO #markdown + VALUES (CONCAT(CHAR(13), CHAR(10), ''
'')); + END;'; --End markdown for user defined table types + + --Attribution + SET @Sql = @Sql + N'INSERT INTO #markdown + VALUES (CONCAT(CHAR(13), CHAR(10), ''----'')) + ,(CONCAT(CHAR(13), CHAR(10), ''*Markdown generated by [sp_doc](http://dba-multitool.org)'')) + ,(CONCAT('' at '', SYSDATETIMEOFFSET(), ''.*''));'; + + --Return all data + SET @Sql = @Sql + N' + SELECT [value] + FROM #markdown + ORDER BY [ID] ASC;'; + + SET @ParmDefinition = N'@ExtendedPropertyName SYSNAME, @DatabaseName SYSNAME, @LimitStoredProcLength BIT, @Yes VARCHAR(20), @No VARCHAR(20), @PK VARCHAR(20), @FK VARCHAR(20), @Column VARCHAR(20)'; + EXEC sp_executesql @Sql + ,@ParmDefinition + ,@ExtendedPropertyName + ,@DatabaseName + ,@LimitStoredProcLength + ,@Yes + ,@No + ,@PK + ,@FK + ,@Column; +END; +GO + +EXEC sys.sp_addextendedproperty @name=N'Description', @value=N'Generate on the fly database documentation in markdown. Documentation at https://expresssql.lowlydba.com' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_doc'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@DatabaseName', @value=N'Target database to document. Default is the stored procedure''s database.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_doc'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@ExtendedPropertyName', @value=N'Key for extended properties on objects. Default is ''Description''.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_doc'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@SqlMajorVersion', @value=N'Used for unit testing purposes only.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_doc'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@SqlMinorVersion', @value=N'Used for unit testing purposes only.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_doc'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@LimitStoredProcLength', @value=N'Limit stored procedure contents to 8000 characters, to avoid memory issues with some IDEs. Default is 1.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_doc'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@Emojis', @value=N'Use emojis when generating documentation. Default is 0.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_doc'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@Verbose', @value=N'Whether or not to print additional information during the script run. Default is 0.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_doc'; +GO + diff --git a/Stored_Procedure/dbo.sp_estindex.sql b/Stored_Procedure/dbo.sp_estindex.sql new file mode 100644 index 00000000..7a35fddb --- /dev/null +++ b/Stored_Procedure/dbo.sp_estindex.sql @@ -0,0 +1,877 @@ +SET ANSI_NULLS ON; +GO + +SET QUOTED_IDENTIFIER ON; +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'Description' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_estindex', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_estindex'; + END; +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@TableName' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_estindex', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@TableName' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_estindex'; + END; +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@SqlMajorVersion' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_estindex', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@SqlMajorVersion' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_estindex'; + END; +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@SchemaName' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_estindex', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@SchemaName' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_estindex'; + END; +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@IsUnique' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_estindex', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@IsUnique' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_estindex'; + END; +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@IndexColumns' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_estindex', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@IndexColumns' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_estindex'; + END; +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@IncludeColumns' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_estindex', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@IncludeColumns' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_estindex'; + END; +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@Filter' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_estindex', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@Filter' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_estindex'; + END; +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@FillFactor' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_estindex', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@FillFactor' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_estindex'; + END; +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@DatabaseName' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_estindex', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@DatabaseName' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_estindex'; + END; +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@Verbose' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_estindex', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@Verbose' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_estindex'; + END; +GO + +/***************************/ +/* Create stored procedure */ +/***************************/ +IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sp_estindex]') AND [type] IN (N'P', N'PC')) + BEGIN; + EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[sp_estindex] AS'; + END +GO + +ALTER PROCEDURE [dbo].[sp_estindex] + @SchemaName SYSNAME = NULL + ,@TableName SYSNAME + ,@DatabaseName SYSNAME = NULL + ,@IndexColumns NVARCHAR(2048) + ,@IncludeColumns NVARCHAR(2048) = NULL + ,@IsUnique BIT = 0 + ,@Filter NVARCHAR(2048) = '' + ,@FillFactor TINYINT = 100 + ,@Verbose BIT = 0 + -- Unit testing only + ,@SqlMajorVersion TINYINT = 0 +AS +BEGIN + +SET NOCOUNT ON; + +/* +sp_estindex - Estimate a new index's size and statistics. + +Part of the DBA MultiTool http://dba-multitool.org + +Version: 2020121 + +MIT License + +Copyright (c) 2020 John McCall + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +-- TODO: + -- Handle clustered indexes - https://docs.microsoft.com/en-us/sql/relational-databases/databases/estimate-the-size-of-a-clustered-index?view=sql-server-ver15 + +========= + +Example: + + EXEC dbo.sp_estindex @SchemaName = 'dbo', @tableName = 'Marathon', @IndexColumns = 'racer_id, finish_time, is_disqualified'; + + EXEC dbo.sp_estindex @tableName = 'Marathon', @IndexColumns = 'racer_id, finish_time, is_disqualified', @Filter = 'WHERE racer_id IS NOT NULL', @FillFactor = 90; + +*/ + +DECLARE @Sql NVARCHAR(MAX) = N'' + ,@QualifiedTable NVARCHAR(257) + ,@IndexName SYSNAME = CONCAT('sp_estindex_hypothetical_idx_', DATEDIFF(SECOND,'1970-01-01 00:08:46', GETUTCDATE())) + ,@DropIndexSql NVARCHAR(MAX) + ,@Msg NVARCHAR(MAX) = N'' + ,@IndexType SYSNAME = 'NONCLUSTERED' + ,@IsHeap BIT + ,@IsClusterUnique BIT + ,@ObjectID INT + ,@IndexID INT + ,@ParmDefinition NVARCHAR(MAX) = N'' + ,@NumRows BIGINT + ,@UseDatabase NVARCHAR(200) + ,@UniqueSql VARCHAR(10) + ,@IncludeSql VARCHAR(2048) + ,@PageSize BIGINT = 8192 + ,@FreeBytesPerPage BIGINT = 8096; + +BEGIN TRY + -- Find Version + IF (@SqlMajorVersion = 0) + BEGIN; + SET @SqlMajorVersion = CAST(SERVERPROPERTY('ProductMajorVersion') AS TINYINT); + END; + + /* Validate Version */ + IF (@SqlMajorVersion < 11) + BEGIN; + SET @Msg = 'SQL Server versions below 2012 are not supported, sorry!'; + RAISERROR(@Msg, 16, 1); + END; + + /* Validate Fill Factor */ + IF (@FillFactor > 100 OR @FillFactor < 1) + BEGIN; + SET @Msg = 'Fill factor must be between 1 and 100.'; + THROW 51000, @Msg, 1; + END; + + /* Validate Database */ + IF (@DatabaseName IS NULL) + BEGIN; + SET @DatabaseName = DB_NAME(); + IF (@Verbose = 1) + BEGIN; + SET @Msg = 'No database provided, assuming current database.'; + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + END; + ELSE IF (DB_ID(@DatabaseName) IS NULL) + BEGIN; + SET @DatabaseName = DB_NAME(); + SET @Msg = 'Database does not exist.'; + RAISERROR(@Msg, 16, 1); + END; + + /* Validate Schema */ + IF (@SchemaName IS NULL) + BEGIN; + SET @SchemaName = 'dbo'; + IF (@Verbose = 1) + BEGIN; + SET @Msg = 'No schema provided, assuming dbo.'; + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + END; + + -- Set variables with validated params + SET @QualifiedTable = CONCAT(QUOTENAME(@SchemaName), '.', QUOTENAME(@TableName)); + SET @UseDatabase = N'USE ' + QUOTENAME(@DatabaseName) + '; '; + IF (@IsUnique = 1) + BEGIN; + SET @UniqueSql = ' UNIQUE '; + END; + IF (@IncludeColumns IS NOT NULL) + BEGIN; + SET @IncludeSql = CONCAT(' INCLUDE(', @IncludeColumns, ') '); + END; + + -- Find object id + SET @Sql = CONCAT(@UseDatabase, + N'SELECT @ObjectID = [object_id] + FROM [sys].[all_objects] + WHERE [object_id] = OBJECT_ID(@QualifiedTable)'); + SET @ParmDefinition = N'@QualifiedTable NVARCHAR(257) + ,@ObjectID INT OUTPUT'; + EXEC sp_executesql @Sql + ,@ParmDefinition + ,@QualifiedTable + ,@ObjectID OUTPUT; + + -- Determine Heap or Clustered + SET @Sql = CONCAT(@UseDatabase, + N'SELECT @IsHeap = CASE [type] WHEN 0 THEN 1 ELSE 0 END + ,@IsClusterUnique = [is_unique] + FROM [sys].[indexes] + WHERE [object_id] = OBJECT_ID(@QualifiedTable) + AND [type] IN (1, 0)'); + SET @ParmDefinition = N'@QualifiedTable NVARCHAR(257), @IsHeap BIT OUTPUT, @IsClusterUnique BIT OUTPUT'; + EXEC sp_executesql @Sql + ,@ParmDefinition + ,@QualifiedTable + ,@IsHeap OUTPUT + ,@IsClusterUnique OUTPUT; + + -- Safety check for leftover index from previous run + SET @DropIndexSql = CONCAT(@UseDatabase, + N'IF EXISTS (SELECT 1 FROM [sys].[indexes] WHERE [object_id] = OBJECT_ID(''',@QualifiedTable,''') AND [name] = ''',@IndexName,''') + DROP INDEX ', QUOTENAME(@IndexName), ' ON ', @QualifiedTable); + EXEC sp_executesql @DropIndexSql; + + -- Fetch missing index stats before creation + IF OBJECT_ID('tempdb..##TempMissingIndex') IS NOT NULL + BEGIN; + DROP TABLE ##TempMissingIndex; + END; + + SET @Sql = CONCAT(@UseDatabase, + N'SELECT [id].[statement] + ,[id].[equality_columns] + ,[id].[inequality_columns] + ,[id].[included_columns] + ,[gs].[unique_compiles] + ,[gs].[user_seeks] + ,[gs].[user_scans] + ,[gs].[avg_total_user_cost] -- Average cost of the user queries that could be reduced + ,[gs].[avg_user_impact] -- % + INTO ##TempMissingIndex + FROM [sys].[dm_db_missing_index_group_stats] [gs] + INNER JOIN [sys].[dm_db_missing_index_groups] [ig] ON [gs].[group_handle] = [ig].[index_group_handle] + INNER JOIN [sys].[dm_db_missing_index_details] [id] ON [ig].[index_handle] = [id].[index_handle] + WHERE [id].[database_id] = DB_ID() + AND [id].[object_id] = @ObjectID + OPTION (RECOMPILE);'); + SET @ParmDefinition = N'@ObjectID INT'; + EXEC sp_executesql @Sql + ,@ParmDefinition + ,@ObjectID; + + -- Create the hypothetical index + SET @Sql = CONCAT(@UseDatabase, 'CREATE ', @UniqueSql, @IndexType, ' INDEX ', QUOTENAME(@IndexName), ' ON ', @QualifiedTable, ' (', @IndexColumns, ') ',@IncludeSql, @Filter, ' WITH (STATISTICS_ONLY = -1)'); + EXEC sp_executesql @Sql; + + /*******************/ + /* Get index stats */ + /*******************/ + -- Use DBCC to avoid various inconsistencies + -- in equivalent DMVs between 2012-2016 + SET @Sql = CONCAT(@UseDatabase, 'DBCC SHOW_STATISTICS ("', @QualifiedTable,'", ', QUOTENAME(@IndexName), ')'); + EXEC sp_executesql @Sql; + + /***************************/ + /* Get missing index stats */ + /***************************/ + DECLARE @QuotedKeyColumns NVARCHAR(2048) + ,@QuotedInclColumns NVARCHAR(2048); + + --Get index columns in same format as dmv table + SET @Sql = CONCAT(@UseDatabase, + N'SELECT @QuotedKeyColumns = CASE WHEN [ic].[is_included_column] = 0 + THEN CONCAT(COALESCE(@QuotedKeyColumns COLLATE DATABASE_DEFAULT + '', '', ''''), QUOTENAME([ac].[name])) + ELSE @QuotedKeyColumns + END, + @QuotedInclColumns = CASE WHEN [ic].[is_included_column] = 1 + THEN CONCAT(COALESCE(@QuotedInclColumns COLLATE DATABASE_DEFAULT + '', '', ''''), QUOTENAME([ac].[name])) + ELSE @QuotedInclColumns + END + FROM [sys].[indexes] AS [i] + INNER JOIN [sys].[index_columns] AS [ic] ON [i].[index_id] = [ic].[index_id] + AND [ic].object_id = [i].object_id + INNER JOIN [sys].[all_columns] AS [ac] ON [ac].[object_id] = [ic].[object_id] + AND [ac].[column_id] = [ic].[column_id] + WHERE [i].[name] = @IndexName + AND [i].[object_id] = @ObjectID + AND [i].[is_hypothetical] = 1;'); + SET @ParmDefinition = N'@IndexName SYSNAME, @ObjectID INT, @QuotedKeyColumns NVARCHAR(2048) OUTPUT, @QuotedInclColumns NVARCHAR(2048) OUTPUT'; + EXEC sp_executesql @Sql + ,@ParmDefinition + ,@IndexName + ,@ObjectID + ,@QuotedKeyColumns OUTPUT + ,@QuotedInclColumns OUTPUT; + + -- Search missing index dmv for a match + SELECT 'Missing index stats' AS [description] + ,[statement] + ,[equality_columns] + ,[inequality_columns] + ,[included_columns] + ,[unique_compiles] + ,[user_seeks] + ,[user_scans] + ,[avg_total_user_cost] + ,[avg_user_impact] + FROM ##TempMissingIndex + WHERE COALESCE([equality_columns] + ', ', '') + [inequality_columns] = @QuotedKeyColumns + AND ([included_columns] = @QuotedInclColumns OR [included_columns] IS NULL); + + IF (SELECT COUNT(*) FROM ##TempMissingIndex) = 0 AND (@Verbose = 1) + BEGIN; + SET @Msg = 'No matching missing index statistics found.'; + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + + DROP TABLE ##TempMissingIndex; + + /************************************************/ + /* Estimate index size - does NOT consider: */ + /* Partitioning, allocation pages, LOB values, */ + /* compression, or sparse columns */ + /************************************************/ + IF (@IndexType = 'NONCLUSTERED') -- http://dba-multitool.org/est-nonclustered-index-size + BEGIN; + DECLARE @NumVariableKeyCols INT = 0 + ,@MaxVarKeySize BIGINT = 0 + ,@NumFixedKeyCols INT = 0 + ,@FixedKeySize BIGINT = 0 + ,@NumKeyCols INT = 0 + ,@NullCols INT = 0 + ,@IndexNullBitmap BIGINT = 0 + ,@VariableKeySize BIGINT = 0 + ,@TotalFixedKeySize BIGINT = 0 + ,@IndexRowSize BIGINT = 0 + ,@IndexRowsPerPage BIGINT = 0 + ,@ClusterNumVarKeyCols INT = 0 + ,@MaxClusterVarKeySize BIGINT = 0 + ,@ClusterNumFixedKeyCols INT = 0 + ,@MaxClusterFixedKeySize BIGINT = 0 + ,@ClusterNullCols INT = 0; + + /**************************/ + /* 1. Calculate variables */ + /**************************/ + -- Row count + SET @Sql = CONCAT(@UseDatabase, + N'SELECT @NumRows = [sp].[rows] -- Accounts for index filter if in use + FROM [sys].[objects] AS [o] + INNER JOIN [sys].[stats] AS [stat] ON [stat].[object_id] = [o].[object_id] + CROSS APPLY [sys].[dm_db_stats_properties]([stat].[object_id], [stat].[stats_id]) AS [sp] + WHERE [o].[object_id] = @ObjectID + AND [stat].[name] = @IndexName;'); + SET @ParmDefinition = N'@ObjectID INT, @IndexName SYSNAME, @NumRows BIGINT OUTPUT'; + EXEC sp_executesql @Sql + ,@ParmDefinition + ,@ObjectID + ,@IndexName + ,@NumRows OUTPUT; + + IF (@Verbose = 1) + BEGIN + SET @Msg = CONCAT('NumRows: ', @NumRows); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + + --Key types and sizes + SET @Sql = CONCAT(@UseDatabase, + N'SELECT @NumVariableKeyCols = ISNULL(SUM(CASE + WHEN TYPE_NAME([ac].[user_type_id]) IN(''varchar'', ''nvarchar'', ''text'', ''ntext'', ''image'', ''varbinary'', ''xml'') + THEN 1 + ELSE 0 + END), 0), + @MaxVarKeySize = ISNULL(SUM(CASE + WHEN TYPE_NAME([ac].[user_type_id]) IN(''varchar'', ''nvarchar'', ''text'', ''ntext'', ''image'', ''varbinary'', ''xml'') + THEN CASE [ac].[max_length] + WHEN -1 + THEN(4000 + 2) -- use same estimation as the query engine for max lenths + ELSE COL_LENGTH(OBJECT_NAME([i].object_id), [ac].[name]) + END + ELSE 0 + END), 0), + @NumFixedKeyCols = ISNULL(SUM(CASE + WHEN TYPE_NAME([ac].[user_type_id]) NOT IN(''varchar'', ''nvarchar'', ''text'', ''ntext'', ''image'', ''varbinary'', ''xml'') + THEN 1 + ELSE 0 + END), 0), + @FixedKeySize = ISNULL(SUM(CASE + WHEN TYPE_NAME([ac].[user_type_id]) NOT IN(''varchar'', ''nvarchar'', ''text'', ''ntext'', ''image'', ''varbinary'', ''xml'') + THEN COL_LENGTH(OBJECT_NAME([i].object_id), [ac].[name]) + ELSE 0 + END), 0), + @NullCols = ISNULL(SUM(CAST([ac].[is_nullable] AS TINYINT)),0) + FROM [sys].[indexes] AS [i] + INNER JOIN [sys].[index_columns] AS [ic] ON [i].[index_id] = [ic].[index_id] + AND [ic].object_id = [i].object_id + INNER JOIN [sys].[all_columns] AS [ac] ON [ac].object_id = [ic].object_id + AND [ac].[column_id] = [ic].[column_id] + WHERE [i].[name] = @IndexName + AND [i].[object_id] = @ObjectID + AND [i].[is_hypothetical] = 1 + AND [ic].[is_included_column] = 0'); + SET @ParmDefinition = N'@IndexName SYSNAME, @ObjectID INT, @NumVariableKeyCols INT OUTPUT, + @MaxVarKeySize BIGINT OUTPUT, @NumFixedKeyCols INT OUTPUT, @FixedKeySize BIGINT OUTPUT, + @NullCols INT OUTPUT'; + EXEC sp_executesql @Sql + ,@ParmDefinition + ,@IndexName + ,@ObjectID + ,@NumVariableKeyCols OUTPUT + ,@MaxVarKeySize OUTPUT + ,@NumFixedKeyCols OUTPUT + ,@FixedKeySize OUTPUT + ,@NullCols OUTPUT; + + SET @NumKeyCols = @NumVariableKeyCols + @NumFixedKeyCols; + + IF (@Verbose = 1) + BEGIN + SET @Msg = CONCAT('NumVariableKeyCols: ', @NumVariableKeyCols); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + SET @Msg = CONCAT('MaxVarKeySize: ', @MaxVarKeySize); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + SET @Msg = CONCAT('NumFixedKeyCols: ', @NumFixedKeyCols); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + SET @Msg = CONCAT('FixedKeySize: ', @FixedKeySize); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + SET @Msg = CONCAT('NullCols: ', @NullCols); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + SET @Msg = CONCAT('NumKeyCols: ', @NumKeyCols); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + + -- Account for data row locator for non-unique + IF (@IsHeap = 1 AND @IsUnique = 0) + BEGIN; + SET @NumKeyCols = @NumKeyCols + 1; + SET @NumVariableKeyCols = @NumVariableKeyCols + 1; + SET @MaxVarKeySize = @MaxVarKeySize + 8; --heap RID + END; + ELSE IF (@IsHeap = 0 AND @IsUnique = 0) + BEGIN; + --Clustered keys and sizes not included in the new index + SET @Sql = CONCAT(@UseDatabase, + N'WITH NewIndexCol AS ( + SELECT [ac].[name] + FROM [sys].[indexes] AS [i] + INNER JOIN [sys].[index_columns] AS [ic] ON [i].[index_id] = [ic].[index_id] + AND [ic].object_id = [i].object_id + INNER JOIN [sys].[all_columns] AS [ac] ON [ac].object_id = [ic].object_id + AND [ac].[column_id] = [ic].[column_id] + WHERE [i].[name] = @IndexName + AND [i].[object_id] = @ObjectID + AND [i].[is_hypothetical] = 1 + AND [ic].[is_included_column] = 0 + ) + SELECT @ClusterNumVarKeyCols = ISNULL(SUM(CASE + WHEN TYPE_NAME([ac].[user_type_id]) IN(''varchar'', ''nvarchar'', ''text'', ''ntext'', ''image'', ''varbinary'', ''xml'') + THEN 1 + ELSE 0 + END), 0), + @MaxClusterVarKeySize = ISNULL(SUM(CASE + WHEN TYPE_NAME([ac].[user_type_id]) IN(''varchar'', ''nvarchar'', ''text'', ''ntext'', ''image'', ''varbinary'', ''xml'') + THEN CASE [ac].[max_length] + WHEN -1 + THEN(4000 + 2) -- use same estimation as the query engine for max lenths + ELSE COL_LENGTH(OBJECT_NAME([i].object_id), [ac].[name]) + END + ELSE 0 + END), 0), + @ClusterNumFixedKeyCols = ISNULL(SUM(CASE + WHEN TYPE_NAME([ac].[user_type_id]) NOT IN(''varchar'', ''nvarchar'', ''text'', ''ntext'', ''image'', ''varbinary'', ''xml'') + THEN 1 + ELSE 0 + END), 0), + @MaxClusterFixedKeySize = ISNULL(SUM(CASE + WHEN TYPE_NAME([ac].[user_type_id]) NOT IN(''varchar'', ''nvarchar'', ''text'', ''ntext'', ''image'', ''varbinary'', ''xml'') + THEN COL_LENGTH(OBJECT_NAME([i].object_id), [ac].[name]) + ELSE 0 + END), 0), + @ClusterNullCols = ISNULL(SUM(CAST([ac].[is_nullable] AS TINYINT)),0) + FROM [sys].[indexes] AS [i] + INNER JOIN [sys].[index_columns] AS [ic] ON [i].[index_id] = [ic].[index_id] + AND [ic].object_id = [i].object_id + INNER JOIN [sys].[all_columns] AS [ac] ON [ac].object_id = [ic].object_id + AND [ac].[column_id] = [ic].[column_id] + WHERE [i].[type] = 1 --Clustered + AND [i].[object_id] = @ObjectID + AND [ac].[name] NOT IN (SELECT [name] FROM [NewIndexCol]);'); + SET @ParmDefinition = N'@IndexName SYSNAME, @ObjectID INT, @ClusterNumVarKeyCols INT OUTPUT, + @MaxClusterVarKeySize BIGINT OUTPUT, @ClusterNumFixedKeyCols INT OUTPUT, + @MaxClusterFixedKeySize BIGINT OUTPUT, @ClusterNullCols INT OUTPUT'; + EXEC sp_executesql @Sql + ,@ParmDefinition + ,@IndexName + ,@ObjectID + ,@ClusterNumVarKeyCols OUTPUT + ,@MaxClusterVarKeySize OUTPUT + ,@ClusterNumFixedKeyCols OUTPUT + ,@MaxClusterFixedKeySize OUTPUT + ,@ClusterNullCols OUTPUT; + + IF (@Verbose = 1) + BEGIN + SET @Msg = CONCAT('ClusterNumVarKeyCols: ', @ClusterNumVarKeyCols); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + SET @Msg = CONCAT('ClusterNumFixedKeyCols: ', @ClusterNumFixedKeyCols); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + SET @Msg = CONCAT('MaxClusterVarKeySize: ', @MaxClusterVarKeySize); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + SET @Msg = CONCAT('MaxClusterFixedKeySize: ', @MaxClusterFixedKeySize); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + SET @Msg = CONCAT('ClusterNullCols: ', @ClusterNullCols); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + + -- Add counts from clustered index cols + SET @NumKeyCols = @NumKeyCols + (@ClusterNumVarKeyCols + @ClusterNumFixedKeyCols); + SET @FixedKeySize = @FixedKeySize + @MaxClusterFixedKeySize; + SET @NumVariableKeyCols = @NumVariableKeyCols + @ClusterNumVarKeyCols; + SET @MaxVarKeySize = @MaxVarKeySize + @MaxClusterVarKeySize; + SET @NullCols = @NullCols + @ClusterNullCols; + + IF (@IsClusterUnique = 0) + BEGIN; + SET @MaxVarKeySize = @MaxVarKeySize + 4; + SET @NumVariableKeyCols = @NumVariableKeyCols + 1; + SET @NumKeyCols = @NumKeyCols + 1; + END; + END; + + IF (@Verbose = 1) + BEGIN + SET @Msg = CONCAT('FixedKeySize: ', @FixedKeySize); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + SET @Msg = CONCAT('NumVariableKeyCols: ', @NumVariableKeyCols); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + SET @Msg = CONCAT('NumKeyCols: ', @NumKeyCols); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + SET @Msg = CONCAT('MaxVarKeySize: ', @MaxVarKeySize); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + SET @Msg = CONCAT('NullCols: ', @NullCols); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + + -- Account for index null bitmap + IF (@NullCols > 0) + BEGIN; + SET @IndexNullBitmap = 2 + ((@NullCols + 7) / 8); + END; + + -- Calculate variable length data size + -- Assumes each col is 100% full + IF (@NumVariableKeyCols > 0) + BEGIN; + SET @VariableKeySize = 2 + (@NumVariableKeyCols * 2) + @MaxVarKeySize; --The bytes added to @MaxVarKeySize are for tracking each variable column. + END; + + -- Calculate index row size + SET @IndexRowSize = @FixedKeySize + @VariableKeySize + @IndexNullBitmap + 1 + 6; -- + 1 (for row header overhead of an index row) + 6 (for the child page ID pointer) + + IF (@Verbose = 1) + BEGIN + SET @Msg = CONCAT('IndexRowSize: ', @IndexRowSize); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + + --Calculate number of index rows / page + SET @IndexRowsPerPage = FLOOR(@FreeBytesPerPage / (@IndexRowSize + 2)); -- + 2 for the row's entry in the page's slot array. + + IF (@Verbose = 1) + BEGIN + SET @Msg = CONCAT('IndexRowsPerPage: ', @IndexRowsPerPage); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + + /****************************************************************************/ + /* 2. Calculate the Space Used to Store Index Information in the Leaf Level */ + /****************************************************************************/ + -- Specify the number of fixed-length and variable-length columns at the leaf level + -- and calculate the space that is required for their storage + DECLARE @NumLeafCols INT = @NumKeyCols + ,@FixedLeafSize BIGINT = @FixedKeySize + ,@NumVariableLeafCols INT = @NumVariableKeyCols + ,@MaxVarLeafSize BIGINT = @MaxVarKeySize + ,@LeafNullBitmap BIGINT = 0 + ,@VariableLeafSize BIGINT = 0 + ,@LeafRowSize BIGINT = 0 + ,@LeafRowsPerPage BIGINT = 0 + ,@FreeRowsPerPage BIGINT = 0 + ,@NumLeafPages BIGINT = 0 + ,@LeafSpaceUsed BIGINT = 0; + + IF (@IncludeColumns IS NOT NULL) + BEGIN; + DECLARE @NumVariableInclCols INT = 0 + ,@MaxVarInclSize BIGINT = 0 + ,@NumFixedInclCols INT = 0 + ,@FixedInclSize BIGINT = 0; + + --Incl types and sizes + SET @Sql = CONCAT(@UseDatabase, + N'SELECT @NumVariableInclCols = ISNULL(SUM(CASE + WHEN TYPE_NAME([ac].[user_type_id]) IN(''varchar'', ''nvarchar'', ''text'', ''ntext'', ''image'', ''varbinary'', ''xml'') + THEN 1 + ELSE 0 + END), 0), + @MaxVarInclSize = ISNULL(SUM(CASE + WHEN TYPE_NAME([ac].[user_type_id]) IN(''varchar'', ''nvarchar'', ''text'', ''ntext'', ''image'', ''varbinary'', ''xml'') + THEN CASE [ac].[max_length] + WHEN -1 + THEN (4000 + 2) -- use same estimation as the query engine for max lenths + ELSE COL_LENGTH(OBJECT_NAME([i].object_id), [ac].[name]) + END + ELSE 0 + END), 0), + @NumFixedInclCols = ISNULL(SUM(CASE + WHEN TYPE_NAME([ac].[user_type_id]) NOT IN(''varchar'', ''nvarchar'', ''text'', ''ntext'', ''image'', ''varbinary'', ''xml'') + THEN 1 + ELSE 0 + END), 0), + @FixedInclSize = ISNULL(SUM(CASE + WHEN TYPE_NAME([ac].[user_type_id]) NOT IN(''varchar'', ''nvarchar'', ''text'', ''ntext'', ''image'', ''varbinary'', ''xml'') + THEN COL_LENGTH(OBJECT_NAME([i].object_id), [ac].[name]) + ELSE 0 + END), 0) + FROM [sys].[indexes] AS [i] + INNER JOIN [sys].[index_columns] AS [ic] ON [i].[index_id] = [ic].[index_id] + AND [ic].object_id = [i].object_id + INNER JOIN [sys].[all_columns] AS [ac] ON [ac].object_id = [ic].object_id + AND [ac].[column_id] = [ic].[column_id] + WHERE [i].[name] = @IndexName + AND [i].[object_id] = @ObjectID + AND [i].[is_hypothetical] = 1 + AND [ic].[is_included_column] = 1;'); + SET @ParmDefinition = N'@IndexName SYSNAME, @ObjectID INT, @NumVariableInclCols INT OUTPUT, + @MaxVarInclSize BIGINT OUTPUT, @NumFixedInclCols INT OUTPUT, @FixedInclSize BIGINT OUTPUT'; + EXEC sp_executesql @Sql + ,@ParmDefinition + ,@IndexName + ,@ObjectID + ,@NumVariableInclCols OUTPUT + ,@MaxVarInclSize OUTPUT + ,@NumFixedInclCols OUTPUT + ,@FixedInclSize OUTPUT; + + -- Add included columns to rolling totals + SET @NumLeafCols = @NumLeafCols + (@NumVariableInclCols + @NumFixedInclCols); + SET @FixedLeafSize = @FixedLeafSize + @FixedInclSize; + SET @NumVariableLeafCols = @NumVariableLeafCols + @NumVariableInclCols; + SET @MaxVarLeafSize = @MaxVarLeafSize + @MaxVarInclSize; + END; + + -- Account for data row locator for unique indexes + -- If non-unique, already accounted for above + IF (@IsUnique = 1) + BEGIN; + IF (@IsHeap = 1) + BEGIN; + SET @NumLeafCols = @NumLeafCols + 1; + SET @NumVariableLeafCols = @NumVariableLeafCols + 1; + SET @MaxVarLeafSize = @MaxVarLeafSize + 8; -- the data row locator is the heap RID (size 8 bytes). + END; + ELSE -- Clustered + BEGIN; + SET @NumLeafCols = @NumLeafCols + (@ClusterNumVarKeyCols + @ClusterNumFixedKeyCols); + SET @FixedLeafSize = @FixedLeafSize + @ClusterNumFixedKeyCols; + SET @NumVariableLeafCols = @NumVariableLeafCols + @ClusterNumVarKeyCols; + SET @MaxVarLeafSize = @MaxVarLeafSize + @MaxClusterVarKeySize; + + IF (@IsClusterUnique = 0) + BEGIN; + SET @NumLeafCols = @NumLeafCols + 1; + SET @NumVariableLeafCols = @NumVariableLeafCols + 1; + SET @MaxVarLeafSize = @MaxVarLeafSize + 4; + END; + END; + END; + + IF (@Verbose = 1) + BEGIN + SET @Msg = CONCAT('NumLeafCols: ', @NumLeafCols); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + SET @Msg = CONCAT('FixedLeafSize: ', @FixedLeafSize); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + SET @Msg = CONCAT('NumVariableLeafCols: ', @NumVariableLeafCols); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + SET @Msg = CONCAT('MaxVarLeafSize: ', @MaxVarLeafSize); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + + -- Account for index null bitmap + SET @LeafNullBitmap = 2 + ((@NumLeafCols + 7) / 8); + + IF (@Verbose = 1) + BEGIN + SET @Msg = CONCAT('LeafNullBitmap: ', @LeafNullBitmap); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + + -- Calculate variable length data size + -- Assumes each col is 100% full + IF (@NumVariableLeafCols > 0) + BEGIN; + SET @VariableLeafSize = 2 + (@NumVariableLeafCols * 2) + @MaxVarLeafSize; + END; + + IF (@Verbose = 1) + BEGIN + SET @Msg = CONCAT('VariableLeafSize: ', @VariableLeafSize); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + + -- Calculate index row size + SET @LeafRowSize = @FixedLeafSize + @VariableLeafSize + @LeafNullBitmap + 1; -- +1 for row header overhead of an index row) + + IF (@Verbose = 1) + BEGIN + SET @Msg = CONCAT('LeafRowSize: ', @LeafRowSize); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + + -- Calculate number of index rows / page + SET @LeafRowsPerPage = FLOOR(@FreeBytesPerPage / (@LeafRowSize + 2)); -- + 2 for the row's entry in the page's slot array. + + IF (@Verbose = 1) + BEGIN + SET @Msg = CONCAT('LeafRowsPerPage: ', @LeafRowsPerPage); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + + -- Calculate free rows / page + SET @FreeRowsPerPage = @FreeBytesPerPage * (( 100 - @FillFactor) / 100) / (@LeafRowSize + 2); -- + 2 for the row's entry in the page's slot array. + + IF (@Verbose = 1) + BEGIN + SET @Msg = CONCAT('FreeRowsPerPage: ', @FreeRowsPerPage); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + + -- Calculate pages for all rows + SET @NumLeafPages = CEILING(@NumRows / (@LeafRowsPerPage - @FreeRowsPerPage)); + + IF (@Verbose = 1) + BEGIN + SET @Msg = CONCAT('NumLeafPages: ', @NumLeafPages); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + + -- Calculate size of index at leaf level + SET @LeafSpaceUsed = @PageSize * @NumLeafPages; + + /*********************************************************************************/ + /* 3. Calculate the Space Used to Store Index Information in the Non-leaf Levels */ + /*********************************************************************************/ + DECLARE @NonLeafLevels BIGINT = 0, + @NumIndexPages BIGINT = 0, + @IndexSpaceUsed BIGINT = 0; + + -- Calculate the number of non-leaf levels in the index + SET @NonLeafLevels = CEILING(1 + LOG(@IndexRowsPerPage) * (@NumLeafPages / @IndexRowsPerPage)); + + IF (@Verbose = 1) + BEGIN + SET @Msg = CONCAT('NonLeafLevels: ', @NonLeafLevels); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + + --Formula: IndexPages = Summation (Num_Leaf_Pages/Index_Rows_Per_Page^Level)where 1 <= Level <= Levels + WHILE (@NonLeafLevels > 1) + BEGIN + DECLARE @TempIndexPages FLOAT(30); + + -- TempIndexPages may be exceedingly small, so catch any arith overflows and call it 0 + BEGIN TRY; + SET @TempIndexPages = @NumLeafPages / POWER(@IndexRowsPerPage, @NonLeafLevels); + SET @NumIndexPages = @NumIndexPages + @TempIndexPages; + SET @NonLeafLevels = @NonLeafLevels - 1; + END TRY + BEGIN CATCH; + SET @NonLeafLevels = @NonLeafLevels - 1; + END CATCH; + END; + + -- Calculate size of the index + SET @IndexSpaceUsed = @PageSize * @NumIndexPages; + + /**************************************/ + /* 4. Total index and leaf space used */ + /**************************************/ + DECLARE @Total BIGINT = 0; + + SET @Total = @LeafSpaceUsed + @IndexSpaceUsed; + + SELECT @Total/1024 AS [Est. KB] + ,CAST(ROUND(@Total/1024.0/1024.0,2,1) AS DECIMAL(30,2)) AS [Est. MB] + ,CAST(ROUND(@Total/1024.0/1024.0/1024.0,2,1) AS DECIMAL(30,4)) AS [Est. GB]; + END; + + --Cleanup + EXEC sp_executesql @DropIndexSql; + +END TRY +BEGIN CATCH; + BEGIN; + DECLARE @ErrorNumber INT = ERROR_NUMBER(); + DECLARE @ErrorLine INT = ERROR_LINE(); + DECLARE @ErrorMessage NVARCHAR(4000) = ERROR_MESSAGE(); + DECLARE @ErrorSeverity INT = ERROR_SEVERITY(); + DECLARE @ErrorState INT = ERROR_STATE(); + + EXEC sp_executesql @DropIndexSql; + + SET @ErrorMessage = CONCAT(QUOTENAME(OBJECT_NAME(@@PROCID)), ': ', @ErrorMessage); + RAISERROR(@ErrorMessage, @ErrorSeverity, @ErrorState) WITH NOWAIT; + END; +END CATCH; + +END; +GO + +EXEC sys.sp_addextendedproperty @name=N'@DatabaseName', @value=N'Target database of the index''s table.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_estindex'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@FillFactor', @value=N'Optional fill factor for the index. Default is 100.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_estindex'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@Filter', @value=N'Optional filter for the index.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_estindex'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@IncludeColumns', @value=N'Optional comma separated list of include columns.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_estindex'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@IndexColumns', @value=N'Comma separated list of key columns.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_estindex'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@IsUnique', @value=N'Whether or not the index is UNIQUE. Default is 0.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_estindex'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@SchemaName', @value=N'Target schema of the index''s table. Default is ''dbo''.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_estindex'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@SqlMajorVersion', @value=N'For unit testing only.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_estindex'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@TableName', @value=N'Target table for the index. Default is current database.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_estindex'; +GO + +EXEC sys.sp_addextendedproperty @name=N'Description', @value=N'Estimate a new index''s size and statistics.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_estindex'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@Verbose', @value=N'Show intermediate variables used in size calculations. Default is 0.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_estindex'; +GO diff --git a/Stored_Procedure/dbo.sp_helpme.sql b/Stored_Procedure/dbo.sp_helpme.sql new file mode 100644 index 00000000..8493b30a --- /dev/null +++ b/Stored_Procedure/dbo.sp_helpme.sql @@ -0,0 +1,477 @@ +SET ANSI_NULLS ON; +GO + +SET QUOTED_IDENTIFIER ON; +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'Description' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_helpme', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_helpme'; + END +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@SqlMinorVersion' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_helpme', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@SqlMinorVersion' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_helpme'; + END +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@SqlMajorVersion' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_helpme', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@SqlMajorVersion' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_helpme'; + END +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@ExtendedPropertyName' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_helpme', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@ExtendedPropertyName' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_helpme'; + END +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@ObjectName' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_helpme', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@ObjectName' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_helpme'; + END +GO + +/***************************/ +/* Create stored procedure */ +/***************************/ +IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sp_helpme]') AND [type] IN (N'P', N'PC')) + BEGIN; + EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[sp_helpme] AS'; + END +GO + +ALTER PROCEDURE [dbo].[sp_helpme] + @ObjectName SYSNAME = NULL + ,@ExtendedPropertyName SYSNAME = 'Description' + /* Parameters defined here for testing only */ + ,@SqlMajorVersion TINYINT = 0 + ,@SqlMinorVersion SMALLINT = 0 +AS + +/* +sp_helpme - A drop-in modern alternative to sp_help. + +Part of the DBA MultiTool http://dba-multitool.org + +Version: Version: 20201008 + +MIT License + +Copyright (c) 2020 John McCall + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +========= + +Example: + + EXEC sp_helpme 'dbo.Sales'; + +*/ + +BEGIN + SET NOCOUNT ON; + + DECLARE @DbName SYSNAME + ,@ObjShortName SYSNAME = N'' + ,@No VARCHAR(5) = 'no' + ,@Yes VARCHAR(5) = 'yes' + ,@None VARCHAR(5) = 'none' + ,@SysObj_Type CHAR(2) + ,@ObjID INT + ,@HasParam INT = 0 + ,@HasDepen BIT = 0 + ,@HasHidden BIT = 0 + ,@HasMasked BIT = 0 + ,@SQLString NVARCHAR(MAX) = N'' + ,@Msg NVARCHAR(MAX) = N'' + ,@ParmDefinition NVARCHAR(500); + + /* Find Version */ + IF (@SqlMajorVersion = 0) + BEGIN; + SET @SqlMajorVersion = CAST(SERVERPROPERTY('ProductMajorVersion') AS TINYINT); + END; + IF (@SqlMinorVersion = 0) + BEGIN; + SET @SqlMinorVersion = CAST(SERVERPROPERTY('ProductMinorVersion') AS TINYINT); + END; + + /* Validate Version */ + IF (@SqlMajorVersion < 11) + BEGIN; + SET @Msg = 'SQL Server versions below 2012 are not supported, sorry!'; + RAISERROR(@Msg, 16, 1); + END; + + /* Check for Hidden Columns feature */ + IF 1 = (SELECT COUNT(*) FROM sys.all_columns AS ac WHERE ac.name = 'is_hidden' AND OBJECT_NAME(ac.object_id) = 'all_columns') + BEGIN + SET @HasHidden = 1; + END; + + /* Check for Masked Columns feature */ + IF 1 = (SELECT COUNT(*) FROM sys.all_columns AS ac WHERE ac.name = 'is_masked' AND OBJECT_NAME(ac.object_id) = 'all_columns') + BEGIN + SET @HasMasked = 1; + END; + + -- If no @ObjectName given, give a little info about all objects. + IF (@ObjectName IS NULL) + BEGIN; + SET @SQLString = N'SELECT + [Name] = [o].[name], + [Owner] = USER_NAME(OBJECTPROPERTY([object_id], ''ownerid'')), + [Object_type] = LOWER(REPLACE([o].[type_desc], ''_'', '' '')), + [Create_datetime] = [o].[create_date], + [Modify_datetime] = [o].[modify_date], + [ExtendedProperty] = [ep].[value] + FROM [sys].[all_objects] [o] + LEFT JOIN [sys].[extended_properties] [ep] ON [ep].[major_id] = [o].[object_id] + and [ep].[name] = @ExtendedPropertyName + AND [ep].[minor_id] = 0 + AND [ep].[class] = 1 + ORDER BY [Owner] ASC, [Object_type] DESC, [name] ASC;'; + SET @ParmDefinition = N'@ExtendedPropertyName SYSNAME'; + + EXEC sp_executesql @SQLString + ,@ParmDefinition + ,@ExtendedPropertyName; + + -- Display all user types + SET @SQLString = N'SELECT + [User_type] = [name], + [Storage_type] = TYPE_NAME(system_type_id), + [Length] = max_length, + [Prec] = [precision], + [Scale] = [scale], + [Nullable] = CASE WHEN is_nullable = 1 THEN @Yes ELSE @No END, + [Default_name] = ISNULL(OBJECT_NAME(default_object_id), @None), + [Rule_name] = ISNULL(OBJECT_NAME(rule_object_id), @None), + [Collation] = collation_name + FROM sys.types + WHERE user_type_id > 256 + ORDER BY [name];'; + SET @ParmDefinition = N'@Yes VARCHAR(5), @No VARCHAR(5), @None VARCHAR(5)'; + + EXEC sp_executesql @SQLString + ,@ParmDefinition + ,@Yes + ,@No + ,@None; + + RETURN(0); + END -- End all Sysobjects + + -- Make sure the @ObjectName is local to the current database. + SELECT @ObjShortName = PARSENAME(@ObjectName,1); + SELECT @DbName = PARSENAME(@ObjectName,3); + IF @DbName IS NULL + SELECT @DbName = DB_NAME(); + ELSE IF @DbName <> DB_NAME() + BEGIN + RAISERROR(15250,-1,-1); + END + + -- @ObjectName must be either sysobjects or systypes: first look in sysobjects + SET @SQLString = N'SELECT @ObjID = object_id + , @SysObj_Type = type + FROM sys.all_objects + WHERE object_id = OBJECT_ID(@ObjectName);'; + SET @ParmDefinition = N'@ObjectName SYSNAME + ,@ObjID INT OUTPUT + ,@SysObj_Type VARCHAR(5) OUTPUT'; + + EXEC sp_executesql @SQLString + ,@ParmDefinition + ,@ObjectName + ,@ObjID OUTPUT + ,@SysObj_Type OUTPUT; + + -- If @ObjectName not in sysobjects, try systypes + IF @ObjID IS NULL + BEGIN + SET @SQLSTring = N'SELECT @ObjID = user_type_id + FROM sys.types + WHERE name = PARSENAME(@ObjectName,1);'; + SET @ParmDefinition = N'@ObjectName SYSNAME + ,@ObjID INT OUTPUT'; + + EXEC sp_executesql @SQLString + ,@ParmDefinition + ,@ObjectName + ,@ObjID OUTPUT; + + -- If not in systypes, return + IF @ObjID IS NULL + BEGIN + RAISERROR(15009,-1,-1,@ObjectName,@DbName); + END + + -- Data Type help (prec/scale only valid for numerics) + SET @SQLString = N'SELECT + [Type_name] = t.name, + [Storage_type] = type_name(system_type_id), + [Length] = max_length, + [Prec] = [precision], + [Scale] = [scale], + [Nullable] = case when is_nullable=1 then @Yes else @No end, + [Default_name] = isnull(object_name(default_object_id), @None), + [Rule_name] = isnull(object_name(rule_object_id), @None), + [Collation] = collation_name, + [ExtendedProperty] = ep.[value] + FROM [sys].[types] AS [t] + LEFT JOIN [sys].[extended_properties] AS [ep] ON [ep].[major_id] = [t].[user_type_id] + AND [ep].[name] = @ExtendedPropertyName + AND [ep].[minor_id] = 0 + AND [ep].[class] = 6 + WHERE [user_type_id] = @ObjID'; + SET @ParmDefinition = N'@ObjID INT, @Yes VARCHAR(5), @No VARCHAR(5), @None VARCHAR(5), @ExtendedPropertyName SYSNAME'; + + EXECUTE sp_executesql @SQLString + ,@ParmDefinition + ,@ObjID + ,@Yes + ,@No + ,@None + ,@ExtendedPropertyName; + + RETURN(0); + END --Systypes + + -- FOUND IT IN SYSOBJECT, SO GIVE OBJECT INFO + SET @SQLString = N'SELECT + [Name] = [o].[name], + [Owner] = USER_NAME(ObjectProperty([o].[object_id], ''ownerid'')), + [Type] = LOWER(REPLACE([o].[type_desc], ''_'', '' '')), + [Created_datetime] = [o].[create_date], + [Modify_datetime] = [o].[modify_date], + [ExtendedProperty] = [ep].[value] + FROM [sys].[all_objects] [o] + LEFT JOIN [sys].[extended_properties] [ep] ON [ep].[major_id] = [o].[object_id] + AND [ep].[name] = @ExtendedPropertyName + AND [ep].[minor_id] = 0 + AND [ep].[class] = 1 + WHERE [o].[object_id] = @ObjID;'; + + SET @ParmDefinition = N'@ObjID INT, @ExtendedPropertyName SYSNAME'; + + EXEC sp_executesql @SQLString + ,@ParmDefinition + ,@ObjID + ,@ExtendedPropertyName; + + -- Display column metadata if table / view + SET @SQLString = N' + IF EXISTS (select * from sys.all_columns where object_id = @ObjID) + BEGIN; + + -- SET UP NUMERIC TYPES: THESE WILL HAVE NON-BLANK PREC/SCALE + -- There must be a '','' immediately after each type name (including last one), + -- because that''s what we''ll search for in charindex later. + DECLARE @precscaletypes NVARCHAR(150); + SELECT @precscaletypes = N''tinyint,smallint,decimal,int,bigint,real,money,float,numeric,smallmoney,date,time,datetime2,datetimeoffset,'' + + -- INFO FOR EACH COLUMN + select + [Column_name] = ac.name, + [Type] = type_name([ac].[user_type_id]), + [Computed] = case when ColumnProperty(object_id, [ac].[name], ''IsComputed'') = 0 then ''no'' else ''yes'' end, + [Length] = convert(int, [ac].[max_length]), + -- for prec/scale, only show for those types that have valid precision/scale + -- Search for type name + '','', because ''datetime'' is actually a substring of ''datetime2'' and ''datetimeoffset'' + [Prec] = case when charindex(type_name([ac].[system_type_id]) + '','', '''') > 0 + then convert(char(5),ColumnProperty(object_id, ac.name, ''precision'')) + else '' '' end, + [Scale] = case when charindex(type_name([ac].[system_type_id]) + '','', '''') > 0 + then convert(char(5),OdbcScale([ac].[system_type_id],[ac].[scale])) + else '' '' end, + [Nullable] = case when [ac].[is_nullable] = 0 then ''no'' else ''yes'' end, '; + + --Only include if they exist on the current version + IF @HasMasked = 1 + BEGIN + SET @SQLString = @SQLString + N'[Masked] = case when is_masked = 0 then ''no'' else ''yes'' end, '; + END + + SET @SQLString = @SQLString + N'[Sparse] = case when is_sparse = 0 then ''no'' else ''yes'' end, '; + + IF @HasHidden = 1 + BEGIN + SET @SQLString = @SQLString + N'[Hidden] = case when is_hidden = 0 then ''no'' else ''yes'' end, '; + END + + SET @SQLString = @SQLString + N' + [Identity] = case when is_identity = 0 then ''no'' else ''yes'' end, + [TrimTrailingBlanks] = case ColumnProperty(object_id, ac.name, ''UsesAnsiTrim'') + when 1 then ''no'' + when 0 then ''yes'' + else ''(n/a)'' end, + [FixedLenNullInSource] = case + when type_name([ac].[system_type_id]) not in (''varbinary'',''varchar'',''binary'',''char'') + then ''(n/a)'' + when [ac].[is_nullable] = 0 then ''no'' else ''yes'' end, + [Collation] = [ac].[collation_name], + [ExtendedProperty] = [ep].[value] + FROM [sys].[all_columns] AS [ac] + INNER JOIN [sys].[types] AS [typ] ON [typ].[system_type_id] = [ac].[system_type_id] + LEFT JOIN sys.extended_properties ep ON ep.minor_id = ac.column_id + AND ep.major_id = ac.[object_id] + AND ep.[name] = @ExtendedPropertyName + AND ep.class = 1 + WHERE [object_id] = @ObjID + END'; + SET @ParmDefinition = N'@ObjID INT, @ExtendedPropertyName SYSNAME'; + EXEC sp_executesql @SQLString, @ParmDefinition, @ObjID = @ObjID, @ExtendedPropertyName = @ExtendedPropertyName; + + -- Identity & rowguid columns + IF @SysObj_Type IN ('S ','U ','V ','TF') + BEGIN + DECLARE @colname SYSNAME = NULL; + SET @SQLString = N'SELECT @colname = COL_NAME(@ObjID, column_id) + FROM sys.identity_columns + WHERE object_id = @ObjID;'; + SET @ParmDefinition = N'@ObjID INT, @colname SYSNAME OUTPUT'; + + EXEC sp_executesql @SQLString + ,@ParmDefinition + ,@ObjID + ,@colname OUTPUT; + + --Identity + IF (@colname IS NOT NULL) + SELECT + 'Identity' = @colname, + 'Seed' = IDENT_SEED(@ObjectName), + 'Increment' = IDENT_INCR(@ObjectName), + 'Not For Replication' = COLUMNPROPERTY(@ObjID, @colname, 'IsIDNotForRepl'); + ELSE + BEGIN + SET @Msg = 'No identity is defined on object %ls.'; + RAISERROR(@Msg, 10, 1, @ObjectName) WITH NOWAIT; + END + + -- Rowguid + SET @colname = NULL; + SET @SQLString = N'SELECT @colname = [name] + FROM sys.all_columns + WHERE [object_id] = @ObjID AND is_rowguidcol = 1;'; + SET @ParmDefinition = N'@ObjID INT, @colname SYSNAME OUTPUT'; + + EXEC sp_executesql @SQLString + ,@ParmDefinition + ,@ObjID + ,@colname OUTPUT; + + IF (@colname IS NOT NULL) + SELECT 'RowGuidCol' = @colname; + ELSE + BEGIN + SET @Msg = 'No rowguid is defined on object %ls.'; + RAISERROR(@Msg, 10, 1, @ObjectName) WITH NOWAIT; + END + END + + -- Display any procedure parameters + SET @SQLString = N'SELECT TOP (1) @HasParam = 1 FROM sys.all_parameters WHERE object_id = @ObjID'; + SET @ParmDefinition = N'@ObjID INT, @HasParam BIT OUTPUT'; + + EXEC sp_executesql @SQLString + ,@ParmDefinition + ,@ObjID + ,@HasParam OUTPUT; + + --If parameters exist, show them + IF @HasParam = 1 + BEGIN + SET @SQLString = N'SELECT + [Parameter_name] = [name], + [Type] = TYPE_NAME(user_type_id), + [Length] = max_length, + [Prec] = CASE WHEN TYPE_NAME(system_type_id) = ''uniqueidentifier'' THEN [precision] + ELSE OdbcPrec(system_type_id, max_length, [precision]) END, + [Scale] = ODBCSCALE(system_type_id, scale), + [Param_order] = parameter_id, + [Collation] = CONVERT([sysname], CASE WHEN system_type_id in (35, 99, 167, 175, 231, 239) + THEN SERVERPROPERTY(''collation'') END) + FROM sys.all_parameters + WHERE [object_id] = @ObjID;'; + SET @ParmDefinition = N'@ObjID INT'; + + EXEC sp_executesql @SQLString + ,@ParmDefinition + ,@ObjID; + END + + -- DISPLAY TABLE INDEXES & CONSTRAINTS + IF @SysObj_Type IN ('S ','U ') + BEGIN + EXEC sys.sp_objectfilegroup @ObjID; + EXEC sys.sp_helpindex @ObjectName; + EXEC sys.sp_helpconstraint @ObjectName,'nomsg'; + + SET @SQLString = N'SELECT @HasDepen = COUNT(*) + FROM sys.objects obj, sysdepends deps + WHERE obj.[type] =''V'' + AND obj.[object_id] = deps.id + AND deps.depid = @ObjID + AND deps.deptype = 1;'; + SET @ParmDefinition = N'@ObjID INT, @HasDepen INT OUTPUT'; + + EXEC sp_executeSQL @SQLString + ,@ParmDefinition + ,@ObjID + ,@HasDepen OUTPUT; + + IF @HasDepen = 0 + BEGIN + RAISERROR(15647,-1,-1,@ObjectName); -- No views with schemabinding for reference table '%ls'. + END + ELSE + BEGIN + SET @SQLString = N'SELECT DISTINCT [Table is referenced by views] = OBJECT_SCHEMA_NAME(obj.object_id) + ''.'' + obj.[name] + FROM sys.objects obj + INNER JOIN sysdepends deps ON obj.object_id = deps.id + WHERE obj.[type] =''V'' + AND deps.depid = @ObjID + AND deps.deptype = 1 + GROUP BY obj.[name], obj.object_id;'; + SET @ParmDefinition = N'@ObjID INT'; + + EXEC sp_executesql @SQLString + ,@ParmDefinition + ,@ObjID; + END + END +END; +GO + +EXEC sys.sp_addextendedproperty @name=N'Description', @value=N'Drop-in alternative to sp_help. Documentation at https://expresssql.lowlydba.com' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_helpme'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@ObjectName', @value=N'Target object. Default is all objects.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_helpme'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@ExtendedPropertyName', @value=N'Key for extended properties on objects. Default is ''Description''.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_helpme'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@SqlMajorVersion', @value=N'Used for unit testing purposes only.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_helpme'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@SqlMinorVersion', @value=N'Used for unit testing purposes only.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_helpme'; +GO diff --git a/Stored_Procedure/dbo.sp_sizeoptimiser.sql b/Stored_Procedure/dbo.sp_sizeoptimiser.sql new file mode 100644 index 00000000..b090bd54 --- /dev/null +++ b/Stored_Procedure/dbo.sp_sizeoptimiser.sql @@ -0,0 +1,1367 @@ +SET ANSI_NULLS ON; +GO + +SET QUOTED_IDENTIFIER ON; +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'Description' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_sizeoptimiser', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_sizeoptimiser'; + END +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'Description' , N'SCHEMA',N'dbo', N'TYPE',N'SizeOptimiserTableType', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'Description' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TYPE',@level1name=N'SizeOptimiserTableType'; + END +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@SqlMinorVersion' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_sizeoptimiser', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@SqlMinorVersion' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_sizeoptimiser'; + END +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@SqlMajorVersion' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_sizeoptimiser', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@SqlMajorVersion' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_sizeoptimiser'; + END +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@IndexNumThreshold' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_sizeoptimiser', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@IndexNumThreshold' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_sizeoptimiser'; + END +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@IncludeDatabases' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_sizeoptimiser', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@IncludeDatabases' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_sizeoptimiser'; + END +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@ExcludeDatabases' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_sizeoptimiser', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@ExcludeDatabases' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_sizeoptimiser'; + END +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@IncludeSysDatabases' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_sizeoptimiser', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@IncludeSysDatabases' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_sizeoptimiser'; + END +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@IncludeSSRSDatabases' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_sizeoptimiser', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@IncludeSSRSDatabases' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_sizeoptimiser'; + END +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@Verbose' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_sizeoptimiser', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@Verbose' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_sizeoptimiser'; + END +GO + +IF EXISTS (SELECT * FROM sys.fn_listextendedproperty(N'@IsExpress' , N'SCHEMA',N'dbo', N'PROCEDURE',N'sp_sizeoptimiser', NULL,NULL)) + BEGIN; + EXEC sys.sp_dropextendedproperty @name=N'@IsExpress' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_sizeoptimiser'; + END +GO + +/******************************/ +/* Cleanup existing versions */ +/******************************/ +IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sp_sizeoptimiser]')) + BEGIN + DROP PROCEDURE [dbo].[sp_sizeoptimiser]; + END; + +IF EXISTS (SELECT * FROM sys.types st JOIN sys.schemas ss ON st.schema_id = ss.schema_id WHERE st.name = N'SizeOptimiserTableType' AND ss.name = N'dbo') + BEGIN + DROP TYPE [dbo].[SizeOptimiserTableType]; + END; +GO + +/**************************************************************/ +/* Create user defined table type for database list parameter */ +/**************************************************************/ +IF NOT EXISTS (SELECT * FROM sys.types st JOIN sys.schemas ss ON st.schema_id = ss.schema_id WHERE st.name = N'SizeOptimiserTableType' AND ss.name = N'dbo') + BEGIN + CREATE TYPE [dbo].[SizeOptimiserTableType] AS TABLE( + [database_name] [sysname] NOT NULL, + PRIMARY KEY CLUSTERED ([database_name] ASC) WITH (IGNORE_DUP_KEY = OFF)); + END; +GO + +/***************************/ +/* Create stored procedure */ +/***************************/ +IF NOT EXISTS(SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sp_sizeoptimiser]')) + BEGIN + EXEC dbo.sp_executesql @statement = N'CREATE PROCEDURE [dbo].[sp_sizeoptimiser] AS'; + END; +GO + +ALTER PROCEDURE [dbo].[sp_sizeoptimiser] + @IndexNumThreshold SMALLINT = 10 + ,@IncludeDatabases [dbo].[SizeOptimiserTableType] READONLY + ,@ExcludeDatabases [dbo].[SizeOptimiserTableType] READONLY + ,@IncludeSysDatabases BIT = 0 + ,@IncludeSSRSDatabases BIT = 0 + ,@Verbose BIT = 1 + /* Parameters defined here for testing only */ + ,@IsExpress BIT = NULL + ,@SqlMajorVersion TINYINT = NULL + ,@SqlMinorVersion SMALLINT = NULL + +WITH RECOMPILE +AS + +/* +sp_sizeoptimiser - Recommends space saving measures for data footprints. + +Part of the DBA MultiTool http://dba-multitool.org + +Version: 20201110 + +MIT License + +Copyright (c) 2020 John McCall + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, +and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +========= + +Example: + + DECLARE @include SizeOptimiserTableType; + + INSERT INTO @include ([database_name]) + VALUES (N'WideWorldImporters'); + + EXEC [dbo].[sp_sizeoptimiser] @IncludeDatabases = @include +*/ + +BEGIN + SET NOCOUNT ON; + + BEGIN TRY + + DECLARE @HasTempStat BIT = 0 + ,@HasPersistedSamplePercent BIT = 0 + ,@CheckNumber TINYINT = 0 + ,@EngineEdition TINYINT + ,@CheckSQL NVARCHAR(MAX) = N'' + ,@Msg NVARCHAR(MAX) = N'' + ,@DbName SYSNAME = N'' + ,@TempCheckSQL NVARCHAR(MAX) = N'' + ,@BaseURL VARCHAR(1000) = 'http://dba-multitool.org/'; + + /* Validate @IndexNumThreshold */ + IF (@IndexNumThreshold < 1 OR @IndexNumThreshold > 999) + BEGIN + SET @Msg = '@IndexNumThreshold must be between 1 and 999.'; + RAISERROR(@Msg, 16, 1); + END + + /* Validate database list */ + IF (SELECT COUNT(*) FROM @IncludeDatabases) >= 1 AND (SELECT COUNT(*) FROM @ExcludeDatabases) >= 1 + BEGIN + SET @Msg = 'Both @IncludeDatabases and @ExcludeDatabases cannot be specified.'; + RAISERROR(@Msg, 16, 1); + END + + CREATE TABLE #Databases ( + [database_name] SYSNAME NOT NULL); + + /* Build database list if no parameters set */ + IF (SELECT COUNT(*) FROM @IncludeDatabases) = 0 AND (SELECT COUNT(*) FROM @ExcludeDatabases) = 0 + BEGIN + INSERT INTO #Databases + SELECT [sd].[name] + FROM [sys].[databases] AS [sd] + WHERE ([sd].[database_id] > 4 OR @IncludeSysDatabases = 1) + AND ([sd].[name] NOT IN ('ReportServer', 'ReportServerTempDB') OR @IncludeSSRSDatabases = 1) + AND DATABASEPROPERTYEX([sd].[name], 'UPDATEABILITY') = N'READ_WRITE' + AND DATABASEPROPERTYEX([sd].[name], 'USERACCESS') = N'MULTI_USER' + AND DATABASEPROPERTYEX([sd].[name], 'STATUS') = N'ONLINE'; + END; + /* Build database list from @IncludeDatabases */ + ELSE IF (SELECT COUNT(*) FROM @IncludeDatabases) >= 1 + BEGIN + INSERT INTO #Databases + SELECT [sd].[name] + FROM @IncludeDatabases AS [d] + INNER JOIN [sys].[databases] AS [sd] ON [sd].[name] COLLATE database_default = REPLACE(REPLACE([d].[database_name], '[', ''), ']', '') + WHERE DATABASEPROPERTYEX([sd].[name], 'UPDATEABILITY') = N'READ_WRITE' + AND DATABASEPROPERTYEX([sd].[name], 'USERACCESS') = N'MULTI_USER' + AND DATABASEPROPERTYEX([sd].[name], 'STATUS') = N'ONLINE'; + + IF (SELECT COUNT(*) FROM @IncludeDatabases) > (SELECT COUNT(*) FROM #Databases) + BEGIN + DECLARE @ErrorDatabaseList NVARCHAR(MAX); + + WITH ErrorDatabase AS( + SELECT [database_name] + FROM @IncludeDatabases + EXCEPT + SELECT [database_name] + FROM #Databases) + + SELECT @ErrorDatabaseList = ISNULL(@ErrorDatabaseList + N', ' + [database_name], [database_name]) + FROM ErrorDatabase; + + SET @Msg = 'Supplied databases do not exist or are not accessible: ' + @ErrorDatabaseList + '.'; + RAISERROR(@Msg, 16, 1); + END; + END; + /* Build database list from @ExcludeDatabases */ + ELSE IF (SELECT COUNT(*) FROM @ExcludeDatabases) >= 1 + BEGIN + INSERT INTO #Databases + SELECT [sd].[name] + FROM [sys].[databases] AS [sd] + WHERE NOT EXISTS (SELECT [d].[database_name] + FROM @IncludeDatabases AS [d] + WHERE [sd].[name] COLLATE database_default = REPLACE(REPLACE([d].[database_name], '[', ''), ']', '')) + AND DATABASEPROPERTYEX([sd].[name], 'UPDATEABILITY') = N'READ_WRITE' + AND DATABASEPROPERTYEX([sd].[name], 'USERACCESS') = N'MULTI_USER' + AND DATABASEPROPERTYEX([sd].[name], 'STATUS') = N'ONLINE' + AND [sd].[name] <> 'tempdb'; + END + + /* Find edition */ + IF (@IsExpress IS NULL AND CAST(SERVERPROPERTY('Edition') AS VARCHAR(50)) LIKE 'Express%') + BEGIN + SET @IsExpress = 1; + END; + ELSE IF (@IsExpress IS NULL) + BEGIN; + SET @IsExpress = 0; + END; + + /* Find engine edition */ + IF (@EngineEdition IS NULL) + BEGIN + SET @EngineEdition = CAST(SERVERPROPERTY('EditionEdition') AS TINYINT); + END; + + /* Find Version */ + IF (@SqlMajorVersion IS NULL) + BEGIN; + SET @SqlMajorVersion = CAST(SERVERPROPERTY('ProductMajorVersion') AS TINYINT); + END; + IF (@SqlMinorVersion IS NULL) + BEGIN; + SET @SqlMinorVersion = CAST(SERVERPROPERTY('ProductMinorVersion') AS SMALLINT); + END; + + /* Validate Version */ + IF (@SqlMajorVersion < 11) + BEGIN; + SET @Msg = 'SQL Server versions below 2012 are not supported, sorry!'; + RAISERROR(@Msg, 16, 1); + END; + + /* Check for is_temp value on statistics */ + IF 1 = (SELECT 1 FROM [sys].[all_columns] AS [ac] WHERE [ac].[name] = 'is_temporary' AND OBJECT_NAME([ac].[object_id]) = 'all_columns') + BEGIN; + SET @HasTempStat = 1; + END; + + /* Check for Persisted Sample Percent update */ + IF 1 = (SELECT 1 FROM [sys].[all_columns] AS [ac] WHERE [ac].[name] = 'persisted_sample_percent' AND OBJECT_NAME([ac].[object_id]) = 'dm_db_stats_properties') + BEGIN; + SET @HasPersistedSamplePercent = 1; + END; + + IF (@Verbose = 1) + BEGIN; + /* Print info */ + SET @Msg = 'sp_sizeoptimiser'; + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + SET @Msg = '------------'; + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + SET @Msg = CONCAT('Time: ', GETDATE()); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + SET @Msg = CONCAT('SQL Major Version: ', @SqlMajorVersion); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + SET @Msg = CONCAT('SQL Minor Version: ', @SqlMinorVersion); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + SET @Msg = CONCAT('Is Express Edition: ', @IsExpress); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + SET @Msg = CONCAT('Is feature "persisted sample percent" available: ', @HasPersistedSamplePercent); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + SET @Msg = CONCAT(CHAR(13), CHAR(10)); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + + /* Build temp tables */ + IF OBJECT_ID(N'tempdb..#results') IS NOT NULL + BEGIN; + DROP TABLE #results; + END; + + CREATE TABLE #results + ([check_num] INT NOT NULL, + [check_type] NVARCHAR(50) NOT NULL, + [db_name] SYSNAME NOT NULL, + [obj_type] SYSNAME NOT NULL, + [obj_name] NVARCHAR(400) NOT NULL, + [col_name] SYSNAME NULL, + [message] NVARCHAR(500) NULL, + [ref_link] NVARCHAR(500) NULL); + + IF OBJECT_ID('tempdb..#DuplicateIndex') IS NOT NULL + BEGIN; + DROP TABLE #DuplicateIndex; + END; + + CREATE TABLE #DuplicateIndex + ([check_type] NVARCHAR(50) NOT NULL + ,[obj_type] SYSNAME NOT NULL + ,[db_name] SYSNAME NOT NULL + ,[obj_name] SYSNAME NOT NULL + ,[col_name] SYSNAME NULL + ,[message] NVARCHAR(500) NULL + ,[object_id] INT NOT NULL + ,[index_id] INT NOT NULL); + + IF OBJECT_ID('tempdb..#OverlappingIndex') IS NOT NULL + BEGIN; + DROP TABLE #OverlappingIndex; + END; + + CREATE TABLE #OverlappingIndex + ([check_type] NVARCHAR(50) NOT NULL + ,[obj_type] SYSNAME NOT NULL + ,[db_name] SYSNAME NOT NULL + ,[obj_name] SYSNAME NOT NULL + ,[col_name] SYSNAME NULL + ,[message] NVARCHAR(500) NULL + ,[object_id] INT NOT NULL + ,[index_id] INT NOT NULL); + + /* Header row */ + INSERT INTO #results ([check_num], [check_type], [obj_type], [db_name], [obj_name], [col_name], [message], [ref_link]) + SELECT @CheckNumber + ,N'Lets do this' + ,N'Vroom vroom' + ,N'beep boop' + ,N'Off to the races' + ,N'Ready set go' + ,N'Thanks for using' + ,@BaseURL; + + /* Date & Time Data Type Usage */ + SET @CheckNumber = @CheckNumber + 1; + IF (@Verbose = 1) + BEGIN; + SET @Msg = CONCAT(N'Check ', @CheckNumber, ' - Date and Time Data Types'); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + BEGIN; + SET @CheckSQL = N''; + SELECT @CheckSQL = @CheckSQL + + N'USE ' + QUOTENAME([database_name]) + N'; + INSERT INTO #results ([check_num], [check_type], [obj_type], [db_name], [obj_name], [col_name], [message], [ref_link]) + SELECT @CheckNumber + ,N''Data Types'' + ,N''USER_TABLE'' + ,QUOTENAME(DB_NAME()) + ,QUOTENAME(SCHEMA_NAME([t].[schema_id])) + ''.'' + QUOTENAME([t].[name]) + ,QUOTENAME([c].[name]) + ,N''Columns storing date or time should use a temporal specific data type, but this column is using '' + ty.name + ''.'' + ,CONCAT(@BaseURL COLLATE database_default, ''time-based-formats'') + FROM [sys].[columns] AS [c] + INNER JOIN [sys].[tables] AS [t] on [t].[object_id] = [c].[object_id] + INNER JOIN [sys].[types] AS [ty] on [ty].[user_type_id] = [c].[user_type_id] + WHERE [c].[is_identity] = 0 --exclude identity cols + AND [t].[is_ms_shipped] = 0 --exclude sys table + AND ([c].[name] LIKE ''%date%'' OR [c].[name] LIKE ''%time%'') + AND [c].[name] NOT LIKE ''%UpdatedBy%'' + AND [c].[name] NOT LIKE ''%days%'' + AND [ty].[name] NOT IN (''datetime'', ''datetime2'', ''datetimeoffset'', ''date'', ''smalldatetime'', ''time'');' + FROM #Databases; + EXEC sp_executesql @CheckSQL, N'@CheckNumber TINYINT, @BaseURL VARCHAR(1000)', @CheckNumber = @CheckNumber, @BaseURL = @BaseURL; + END; --Date and Time Data Type Check + + /* Archaic varchar Lengths (255/256) */ + SET @CheckNumber = @CheckNumber + 1; + IF (@Verbose = 1) + BEGIN; + SET @Msg = CONCAT(N'Check ', @CheckNumber, ' - Archaic varchar Lengths'); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + BEGIN; + SET @CheckSQL = N''; + SELECT @CheckSQL = @CheckSQL + + N'USE ' + QUOTENAME([database_name]) + N'; WITH archaic AS ( + SELECT QUOTENAME(SCHEMA_NAME(t.schema_id)) + ''.'' + QUOTENAME(t.name) AS [obj_name] + ,QUOTENAME(c.name) AS [col_name] + ,N''Possible arbitrary variable length column in use. Is the '' + ty.name + N'' length of '' + CAST (c.max_length / 2 AS varchar(MAX)) + N'' based on requirements?'' AS [message] + ,CONCAT(@BaseURL COLLATE database_default, ''arbitrary-varchar-length'') AS [ref_link] + FROM sys.columns c + INNER JOIN sys.tables as t on t.object_id = c.object_id + INNER JOIN sys.types as ty on ty.user_type_id = c.user_type_id + WHERE c.is_identity = 0 --exclude identity cols + AND t.is_ms_shipped = 0 --exclude sys table + AND ty.name = ''NVARCHAR'' + AND c.max_length IN (510, 512) + UNION + SELECT QUOTENAME(SCHEMA_NAME(t.schema_id)) + ''.'' + QUOTENAME(t.name) + ,QUOTENAME(c.name) + ,N''Possible arbitrary variable length column in use. Is the '' + ty.name + N'' length of '' + CAST (c.max_length AS varchar(MAX)) + N'' based on requirements'' + ,CONCAT(@BaseURL COLLATE database_default, ''arbitrary-varchar-length'') + FROM sys.columns as c + INNER JOIN sys.tables as t on t.object_id = c.object_id + INNER JOIN sys.types as ty on ty.user_type_id = c.user_type_id + WHERE c.is_identity = 0 --exclude identity cols + AND t.is_ms_shipped = 0 --exclude sys table + AND ty.name = ''VARCHAR'' + AND c.max_length IN (255, 256)) + + INSERT INTO #results ([check_num], [check_type], [obj_type], [db_name], [obj_name], [col_name], [message], [ref_link]) + SELECT @CheckNumber + ,N''Data Types'' + ,N''USER_TABLE'' + ,QUOTENAME(DB_NAME()) + ,[obj_name] + ,[col_name] + ,[message] + ,[ref_link] + FROM [archaic];' + FROM #Databases; + EXEC sp_executesql @CheckSQL, N'@CheckNumber TINYINT, @BaseURL VARCHAR(1000)', @CheckNumber = @CheckNumber, @BaseURL = @BaseURL; + END; --Archaic varchar Lengths + + /* Unspecified VARCHAR Length */ + SET @CheckNumber = @CheckNumber + 1; + IF (@Verbose = 1) + BEGIN; + SET @Msg = CONCAT(N'Check ', @CheckNumber,' - Unspecified VARCHAR Length'); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + BEGIN; + SET @CheckSQL = N''; + SELECT @CheckSQL = @CheckSQL + + N'USE ' + QUOTENAME([database_name]) + '; + WITH UnspecifiedVarChar AS ( + SELECT QUOTENAME(SCHEMA_NAME(t.schema_id)) + ''.'' + QUOTENAME(t.name) AS [obj_name] + ,QUOTENAME(c.name) AS [col_name] + ,N''VARCHAR column without specified length, it should not have a length of '' + CAST (c.max_length AS varchar(10)) + '''' AS [message] + ,CONCAT(@BaseURL COLLATE database_default, ''unspecified-varchar-length'') AS [ref_link] + FROM sys.columns as c + INNER JOIN sys.tables as t on t.object_id = c.object_id + INNER JOIN sys.types as ty on ty.user_type_id = c.user_type_id + WHERE c.is_identity = 0 --exclude identity cols + AND t.is_ms_shipped = 0 --exclude sys table + AND ty.name IN (''VARCHAR'', ''NVARCHAR'') + AND c.max_length = 1) + + INSERT INTO #results ([check_num], [check_type], [obj_type], [db_name], [obj_name], [col_name], [message], [ref_link]) + SELECT @CheckNumber + ,N''Data Types'' + ,N''USER_TABLE'' + ,QUOTENAME(DB_NAME()) + ,[obj_name] + ,[col_name] + ,[message] + ,[ref_link] + FROM [UnspecifiedVarChar];' + FROM #Databases; + EXEC sp_executesql @CheckSQL, N'@CheckNumber TINYINT, @BaseURL VARCHAR(1000)', @CheckNumber = @CheckNumber, @BaseURL = @BaseURL; + END; --Unspecified VARCHAR Length + + /* Mad MAX - Varchar(MAX) */ + SET @CheckNumber = @CheckNumber + 1; + IF (@Verbose = 1) + BEGIN; + SET @Msg = CONCAT(N'Check ', @CheckNumber, ' - Mad MAX VARCHAR'); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + BEGIN; + SET @CheckSQL = N''; + SELECT @CheckSQL = @CheckSQL + + N'USE ' + QUOTENAME([database_name]) + N'; + INSERT INTO #results ([check_num], [check_type], [obj_type], [db_name], [obj_name], [col_name], [message], [ref_link]) + SELECT @CheckNumber + ,N''Data Types'' + ,N''USER_TABLE'' + ,QUOTENAME(DB_NAME()) + ,QUOTENAME(SCHEMA_NAME(t.schema_id)) + ''.'' + QUOTENAME(t.name) + ,QUOTENAME(c.name) + ,N''Column is NVARCHAR(MAX) which allows very large row sizes. Consider a character limit.'' + ,CONCAT(@BaseURL COLLATE database_default, ''mad-varchar-max'') + FROM sys.columns as c + INNER JOIN sys.tables as t on t.object_id = c.object_id + INNER JOIN sys.types as ty on ty.user_type_id = c.user_type_id + WHERE t.is_ms_shipped = 0 --exclude sys table + AND ty.[name] = ''nvarchar'' + AND c.max_length = -1;' + FROM #Databases; + EXEC sp_executesql @CheckSQL, N'@CheckNumber TINYINT, @BaseURL VARCHAR(1000)', @CheckNumber = @CheckNumber, @BaseURL = @BaseURL; + END; --NVARCHAR MAX Check + + /* NVARCHAR data type in Express */ + SET @CheckNumber = @CheckNumber + 1; + IF (@Verbose = 1) + BEGIN; + SET @Msg = CONCAT(N'Check ', @CheckNumber, ' - Use of NVARCHAR (EXPRESS)'); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + BEGIN; + IF (@IsExpress = 1) + BEGIN; + SET @CheckSQL = N''; + SELECT @CheckSQL = @CheckSQL + + N'USE ' + QUOTENAME([database_name]) + N'; + INSERT INTO #results ([check_num], [check_type], [obj_type], [db_name], [obj_name], [col_name], [message], [ref_link]) + SELECT @CheckNumber + ,N''Data Types'' + ,N''USER_TABLE'' + ,QUOTENAME(DB_NAME()) + ,QUOTENAME(SCHEMA_NAME([o].schema_id)) + ''.'' + QUOTENAME(OBJECT_NAME([o].object_id)) + ,QUOTENAME([ac].[name]) + ,N''nvarchar columns take 2x the space per char of varchar. Only use if you need Unicode characters.'' + ,CONCAT(@BaseURL COLLATE database_default, ''nvarchar-in-express'') + FROM [sys].[all_columns] AS [ac] + INNER JOIN [sys].[types] AS [t] ON [t].[user_type_id] = [ac].[user_type_id] + INNER JOIN [sys].[objects] AS [o] ON [o].object_id = [ac].object_id + WHERE [t].[name] = ''NVARCHAR'' + AND [o].[is_ms_shipped] = 0' + FROM #Databases; + EXEC sp_executesql @CheckSQL, N'@CheckNumber TINYINT, @BaseURL VARCHAR(1000)', @CheckNumber = @CheckNumber, @BaseURL = @BaseURL; + END; --NVARCHAR Use Check + ELSE IF (@Verbose = 1) --Skip check + BEGIN; + RAISERROR(' Skipping check, not Express...', 10, 1) WITH NOWAIT; + END; -- Skip check + END; --NVARCHAR Use Check + + /* FLOAT and REAL data types */ + SET @CheckNumber = @CheckNumber + 1; + IF (@Verbose = 1) + BEGIN; + SET @Msg =CONCAT(N'Check ', @CheckNumber, ' - Use of FLOAT/REAL data types'); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + BEGIN; + SET @CheckSQL = N''; + SELECT @CheckSQL = @CheckSQL + + N'USE ' + QUOTENAME([database_name]) + N'; + INSERT INTO #results ([check_num], [check_type], [obj_type], [db_name], [obj_name], [col_name], [message], [ref_link]) + SELECT @CheckNumber + ,N''Data Types'' + ,[o].[type_desc] + ,QUOTENAME(DB_NAME()) + ,QUOTENAME(SCHEMA_NAME([o].[schema_id])) + ''.'' + QUOTENAME([o].[name]) + ,QUOTENAME([ac].[name]) + ,N''Best practice is to use DECIMAL/NUMERIC instead of '' + UPPER([st].[name]) + '' for non floating point math.'' + ,CONCAT(@BaseURL COLLATE database_default, ''float-and-real-data-types'') + FROM [sys].[all_columns] AS [ac] + INNER JOIN [sys].[objects] AS [o] ON [o].[object_id] = [ac].[object_id] + INNER JOIN [sys].[systypes] AS [st] ON [st].[xtype] = [ac].[system_type_id] + WHERE [st].[name] IN (''FLOAT'', ''REAL'') + AND [o].[type_desc] = ''USER_TABLE'';' + FROM #Databases; + EXEC sp_executesql @CheckSQL, N'@CheckNumber TINYINT, @BaseURL VARCHAR(1000)', @CheckNumber = @CheckNumber, @BaseURL = @BaseURL; + END; -- FLOAT/REAL Check + + /* Deprecated data types (NTEXT, TEXT, IMAGE) */ + SET @CheckNumber = @CheckNumber + 1; + IF (@Verbose = 1) + BEGIN; + SET @Msg = CONCAT(N'Check ', @CheckNumber, ' - Deprecated data types'); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + BEGIN; + SET @CheckSQL = N''; + SELECT @CheckSQL = @CheckSQL + + N'USE ' + QUOTENAME([database_name]) + N'; + INSERT INTO #results ([check_num], [check_type], [obj_type], [db_name], [obj_name], [col_name], [message], [ref_link]) + SELECT @CheckNumber + ,N''Data Types'' + ,[o].[type_desc] + ,QUOTENAME(DB_NAME()) + ,QUOTENAME(SCHEMA_NAME(o.schema_id)) + ''.'' + QUOTENAME(o.name) + ,QUOTENAME(ac.name) + ,N''Deprecated data type in use: '' + st.name + ''.'' + ,CONCAT(@BaseURL COLLATE database_default, ''deprecated-data-types'') + FROM sys.all_columns AS ac + INNER JOIN sys.objects AS o ON o.object_id = ac.object_id + INNER JOIN sys.systypes AS st ON st.xtype = ac.system_type_id + WHERE st.name IN(''NEXT'', ''TEXT'', ''IMAGE'') + AND o.type_desc = ''USER_TABLE'';' + FROM #Databases; + EXEC sp_executesql @CheckSQL, N'@CheckNumber TINYINT, @BaseURL VARCHAR(1000)', @CheckNumber = @CheckNumber, @BaseURL = @BaseURL; + END; --Don't use deprecated data types check + + /* BIGINT for identity values in Express */ + SET @CheckNumber = @CheckNumber + 1; + IF (@Verbose = 1) + BEGIN; + SET @Msg = CONCAT(N'Check ', @CheckNumber, ' - BIGINT used for identity columns (EXPRESS)'); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + BEGIN; + IF (@IsExpress = 1) + BEGIN; + SET @CheckSQL = N''; + SELECT @CheckSQL = @CheckSQL + + N'USE ' + QUOTENAME([database_name]) + N'; + INSERT INTO #results ([check_num], [check_type], [obj_type], [db_name], [obj_name], [col_name], [message], [ref_link]) + SELECT @CheckNumber + ,N''Data Types'' + ,N''USER_TABLE'' + ,QUOTENAME(DB_NAME()) + ,QUOTENAME(SCHEMA_NAME(t.schema_id)) + ''.'' + QUOTENAME(t.name) + ,QUOTENAME(c.name) + ,N''BIGINT used on IDENTITY column in SQL Express. If values will never exceed 2,147,483,647 use INT instead.'' + ,CONCAT(@BaseURL COLLATE database_default, ''bigint-as-identity'') + FROM sys.columns as c + INNER JOIN sys.tables as t on t.object_id = c.object_id + INNER JOIN sys.types as ty on ty.user_type_id = c.user_type_id + WHERE t.is_ms_shipped = 0 --exclude sys table + AND ty.name = ''BIGINT'' + AND c.is_identity = 1;' + FROM #Databases; + EXEC sp_executesql @CheckSQL, N'@CheckNumber TINYINT, @BaseURL VARCHAR(1000)', @CheckNumber = @CheckNumber, @BaseURL = @BaseURL; + END; -- BIGINT for identity Check + ELSE IF (@Verbose = 1) --Skip check + BEGIN + RAISERROR(' Skipping check, not Express...', 10, 1) WITH NOWAIT; + END; ----Skip check + END; -- BIGINT for identity Check + + /* Numeric or decimal with 0 scale */ + SET @CheckNumber = @CheckNumber + 1; + IF (@Verbose = 1) + BEGIN; + SET @Msg = CONCAT(N'Check ', @CheckNumber, ' - NUMERIC or DECIMAL with scale of 0'); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + BEGIN; + SET @CheckSQL = N''; + SELECT @CheckSQL = @CheckSQL + + N'USE ' + QUOTENAME([database_name]) + N'; + INSERT INTO #results ([check_num], [check_type], [obj_type], [db_name], [obj_name], [col_name], [message], [ref_link]) + SELECT @CheckNumber + ,N''Data Types'' + ,[o].[type_desc] + ,QUOTENAME(DB_NAME()) + ,QUOTENAME(SCHEMA_NAME(o.schema_id)) + ''.'' + QUOTENAME(o.name) + ,QUOTENAME(ac.name) + ,N''Column is '' + UPPER(st.name) + ''('' + CAST(ac.precision AS VARCHAR) + '','' + CAST(ac.scale AS VARCHAR) + '')'' + + '' . Consider using an INT variety for space reduction since the scale is 0.'' + ,CONCAT(@BaseURL COLLATE database_default, ''numeric-or-decimal-0-scale'') + FROM sys.objects AS o + INNER JOIN sys.all_columns AS ac ON ac.object_id = o.object_id + INNER JOIN sys.systypes AS st ON st.xtype = ac.system_type_id + WHERE ac.scale = 0 + AND ac.precision < 19 + AND st.name IN(''DECIMAL'', ''NUMERIC'') + AND o.is_ms_shipped = 0;' + FROM #Databases; + EXEC sp_executesql @CheckSQL, N'@CheckNumber TINYINT, @BaseURL VARCHAR(1000)', @CheckNumber = @CheckNumber, @BaseURL = @BaseURL; + END; -- Numeric or decimal with 0 scale check + + /* Enum columns not implemented as foreign key */ + SET @CheckNumber = @CheckNumber + 1; + IF (@Verbose = 1) + BEGIN; + SET @Msg = CONCAT(N'Check ', @CheckNumber, ' - Enum columns not implemented as foreign key.'); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + BEGIN; + SET @CheckSQL = N''; + SELECT @CheckSQL = @CheckSQL + + N'USE ' + QUOTENAME([database_name]) + N'; + INSERT INTO #results ([check_num], [check_type], [obj_type], [db_name], [obj_name], [col_name], [message], [ref_link]) + SELECT @CheckNumber + ,N''Data Types'' + ,[o].[type_desc] + ,QUOTENAME(DB_NAME()) + ,QUOTENAME(SCHEMA_NAME(o.schema_id)) + ''.'' + QUOTENAME(o.name) + ,QUOTENAME(ac.name) + ,N''Column is potentially an enum that should be a foreign key to a normalized table for data integrity, space savings, and performance.'' + ,CONCAT(@BaseURL COLLATE database_default, ''enum-column-not-implemented-as-foreign-key'') + FROM sys.objects AS o + INNER JOIN sys.all_columns AS ac ON ac.object_id = o.object_id + INNER JOIN sys.systypes AS st ON st.xtype = ac.system_type_id + WHERE (ac.[name] LIKE ''%Type'' OR ac.[name] LIKE ''%Status'') + AND o.is_ms_shipped = 0 + AND [o].[type] = ''U'' + AND st.[name] IN (''nvarchar'', ''varchar'', ''char'');' + FROM #Databases; + EXEC sp_executesql @CheckSQL, N'@CheckNumber TINYINT, @BaseURL VARCHAR(1000)', @CheckNumber = @CheckNumber, @BaseURL = @BaseURL; + END; -- Enum columns not implemented as foreign key + + /* User DB or model db Growth set past 10GB - ONLY IF EXPRESS */ + SET @CheckNumber = @CheckNumber + 1; + IF (@Verbose = 1) + BEGIN; + SET @Msg = CONCAT(N'Check ', @CheckNumber, ' - Data file growth set past 10GB (EXPRESS)'); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + BEGIN; + IF (@IsExpress = 1) + BEGIN; + SET @CheckSQL = N''; + SELECT @CheckSQL = @CheckSQL + + N'USE ' + QUOTENAME([database_name]) + N'; + INSERT INTO #results ([check_num], [check_type], [obj_type], [db_name], [obj_name], [col_name], [message], [ref_link]) + SELECT @CheckNumber + ,N''File Growth'' + ,N''DATABASE'' + ,QUOTENAME(DB_NAME()) + ,QUOTENAME(DB_NAME(database_id)) + ,NULL + ,N''Database file '' + name + '' has a maximum growth set to '' + + CASE + WHEN max_size = -1 + THEN ''Unlimited'' + WHEN max_size > 0 + THEN CAST((max_size / 1024) * 8 AS VARCHAR(MAX)) + END + '', which is over the user database maximum file size of 10GB.'' + ,CONCAT(@BaseURL COLLATE database_default, ''database-growth-past-10GB'') + FROM sys.master_files mf + WHERE (max_size > 1280000 OR max_size = -1) -- greater than 10GB or unlimited + AND [mf].[database_id] > 5 + AND [mf].[data_space_id] > 0 -- limit doesn''t apply to log files;' + FROM #Databases; + EXEC sp_executesql @CheckSQL, N'@CheckNumber TINYINT, @BaseURL VARCHAR(1000)', @CheckNumber = @CheckNumber, @BaseURL = @BaseURL; + END; -- User DB or model db Growth check + ELSE IF (@Verbose = 1) --Skip check + BEGIN; + RAISERROR(' Skipping check, not Express...', 10, 1) WITH NOWAIT; + END; + END; -- User DB or model db Growth check + + /* User DB or model db growth set to % */ + SET @CheckNumber = @CheckNumber + 1; + IF (@Verbose = 1) + BEGIN; + SET @Msg = CONCAT(N'Check ', @CheckNumber, ' - Data file growth set to percentage.'); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + BEGIN; + IF (@EngineEdition <> 5) --Not Azure SQL + BEGIN + INSERT INTO #results ([check_num], [check_type], [obj_type], [db_name], [obj_name], [col_name], [message], [ref_link]) + SELECT @CheckNumber + ,N'File Growth' + ,N'DATABASE' + ,QUOTENAME(DB_NAME([sd].[database_id])) + ,[mf].[name] + ,NULL + ,N'Database file '+[mf].[name]+' has growth set to % instead of a fixed amount. This may grow quickly.' + ,CONCAT(@BaseURL, 'database-growth-type') + FROM [sys].[master_files] AS [mf] + INNER JOIN [sys].[databases] AS [sd] ON [sd].[database_id] = [mf].[database_id] + INNER JOIN #Databases AS [d] ON [d].[database_name] = [sd].[name] + WHERE [mf].[is_percent_growth] = 1 + AND [mf].[data_space_id] = 1; --ignore log files + END; + END; -- User DB or model db growth set to % Check + + /* Default fill factor (EXPRESS ONLY) */ + SET @CheckNumber = @CheckNumber + 1; + IF (@Verbose = 1) + BEGIN; + SET @Msg = CONCAT(N'Check ', @CheckNumber, ' - Non-default fill factor (EXPRESS)'); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + BEGIN; + IF(@IsExpress = 1) + BEGIN; + SET @CheckSQL = N''; + SELECT @CheckSQL = @CheckSQL + + N'USE ' + QUOTENAME([database_name]) + N'; + INSERT INTO #results ([check_num], [check_type], [obj_type], [db_name], [obj_name], [col_name], [message], [ref_link]) + SELECT @CheckNumber + ,N''Architecture'' + ,N''INDEX'' + ,QUOTENAME(DB_NAME()) + ,QUOTENAME(SCHEMA_NAME([o].[schema_id])) + ''.'' + QUOTENAME([o].[name]) + ''.'' + QUOTENAME([i].[name]) + ,NULL + ,N''Non-default fill factor on this index. Not inherently bad, but will increase table size more quickly.'' + ,CONCAT(@BaseURL COLLATE database_default, ''default-fill-factor'') + FROM [sys].[indexes] AS [i] + INNER JOIN [sys].[objects] AS [o] ON [o].[object_id] = [i].[object_id] + WHERE [i].[fill_factor] NOT IN(0, 100);' + FROM #Databases; + EXEC sp_executesql @CheckSQL, N'@CheckNumber TINYINT, @BaseURL VARCHAR(1000)', @CheckNumber = @CheckNumber, @BaseURL = @BaseURL; + END; -- Non-default fill factor check + ELSE IF (@Verbose = 1) --Skip check + BEGIN; + RAISERROR(' Skipping check, not Express...', 10, 1) WITH NOWAIT; + END; + END; --Default fill factor + + /* Number of indexes */ + SET @CheckNumber = @CheckNumber + 1; + IF (@Verbose = 1) + BEGIN; + SET @Msg = CONCAT('Check ', @CheckNumber, ' - Questionable number of indexes'); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + BEGIN; + SET @CheckSQL = N''; + SELECT @CheckSQL = @CheckSQL + + N'USE ' + QUOTENAME([database_name]) + N'; + INSERT INTO #results ([check_num], [check_type], [obj_type], [db_name], [obj_name], [col_name], [message], [ref_link]) + SELECT @CheckNumber + ,N''Architecture'' + ,N''INDEX'' + ,QUOTENAME(DB_NAME()) + ,QUOTENAME(SCHEMA_NAME(t.schema_id)) + ''.'' + QUOTENAME(t.name) + ,NULL + ,''There are '' + CAST(COUNT(DISTINCT(i.index_id)) AS VARCHAR) + '' indexes on this table taking up '' + CAST(CAST(SUM(s.[used_page_count]) * 8 / 1024.00 AS DECIMAL(10, 2)) AS VARCHAR) + '' MB of space.'' + ,CONCAT(@BaseURL COLLATE database_default, ''number-of-indexes'') + FROM sys.indexes AS i + INNER JOIN sys.tables AS t ON i.object_id = t.object_id + INNER JOIN sys.dm_db_partition_stats AS s ON s.object_id = i.object_id + AND s.index_id = i.index_id + WHERE t.is_ms_shipped = 0 --exclude sys table + AND i.type_desc = ''NONCLUSTERED'' --exclude clustered indexes from count + GROUP BY t.name, + t.schema_id + HAVING COUNT(DISTINCT(i.index_id)) > @IndexNumThreshold;' + FROM #Databases; + EXEC sp_executesql @CheckSQL, N'@IndexNumThreshold TINYINT, @CheckNumber TINYINT, @BaseURL VARCHAR(1000)', @IndexNumThreshold = @IndexNumThreshold, @CheckNumber = @CheckNumber, @BaseURL = @BaseURL; + END; -- Questionable number of indexes check + + /* Inefficient Indexes */ + SET @CheckNumber = @CheckNumber + 1; + IF (@Verbose = 1) + BEGIN; + SET @Msg = CONCAT(N'Check ', @CheckNumber, ' - Inefficient indexes'); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + BEGIN; + SET @CheckSQL = N''; + SELECT @CheckSQL = @CheckSQL + + N' USE ? ; + BEGIN + IF OBJECT_ID(''tempdb..#Indexes'') IS NOT NULL + BEGIN; + DROP TABLE [#Indexes]; + END; + IF OBJECT_ID(''tempdb..#IdxChecksum'') IS NOT NULL + BEGIN; + DROP TABLE [#IdxChecksum]; + END; + IF OBJECT_ID(''tempdb..#MatchingIdxInclChecksum'') IS NOT NULL + BEGIN; + DROP TABLE [#MatchingIdxInclChecksum]; + END; + IF OBJECT_ID(''tempdb..#MatchingIdxChecksum'') IS NOT NULL + BEGIN; + DROP TABLE [#MatchingIdxChecksum]; + END; ' + + + /* Retrieve all indexes */ + + N'SELECT ac.[name] AS [col_name] + ,row_number () OVER (PARTITION BY ind.[object_id], ind.index_id ORDER BY indc.index_column_id ) AS row_num + ,ind.index_id + ,ind.[object_id] + ,DENSE_RANK() OVER (ORDER BY ind.[object_id], ind.index_id) AS [index_num] + ,indc.is_included_column + ,NULL AS [ix_checksum] + ,NULL AS [ix_incl_checksum] + ,ao.[schema_id] + INTO #Indexes + FROM sys.indexes as [ind] + INNER JOIN sys.index_columns AS [indc] ON [ind].[object_id] = [indc].[object_id] AND ind.index_id = indc.index_id + INNER JOIN sys.all_columns as [ac] ON [ac].[column_id] = [indc].[column_id] and indc.[object_id] = ac.[object_id] + INNER JOIN sys.all_objects AS [ao] ON [ao].[object_id] = [ac].[object_id] + WHERE ao.is_ms_shipped = 0 + ORDER BY ind.[object_id]; + + DECLARE @Counter BIGINT = (SELECT 1); + DECLARE @MaxNumIndex BIGINT = (SELECT MAX(index_num) FROM #Indexes); ' + + + /* Iterate through each index, adding together columns for each */ + + N'WHILE @Counter <= @MaxNumIndex + BEGIN + DECLARE @IndexedColumns NVARCHAR(MAX) = N''''; + DECLARE @IndexedColumnsInclude NVARCHAR(MAX) = N''''; ' + + + /* Add together index columns */ + + N'SELECT @IndexedColumns += CAST([col_name] AS SYSNAME) + FROM #Indexes + WHERE is_included_column = 0 + AND index_num = @Counter + ORDER BY row_num; ' + + + /* Add together index + included columns */ + + N'SELECT @IndexedColumnsInclude += CAST([col_name] AS SYSNAME) + FROM #Indexes + WHERE index_num = @Counter + ORDER BY row_num; ' + + + /* Generate a checksum for index columns and index + included columns for each index */ + + N'UPDATE #Indexes + SET [ix_checksum] = CHECKSUM(@IndexedColumns), [ix_incl_checksum] = CHECKSUM(@IndexedColumnsInclude) + WHERE index_num = @Counter; + + SET @Counter += 1; + END; ' + + + /* Narrow down to one row per index */ + + N'SELECT DISTINCT [object_id], index_id, [ix_checksum], [ix_incl_checksum], [schema_id] + INTO #IdxChecksum + FROM #Indexes; ' + + + /* Find duplicate indexes */ + + N'SELECT COUNT(*) AS [num_dup_indexes], [ix_incl_checksum], [object_id] + INTO #MatchingIdxInclChecksum + FROM #IdxChecksum + GROUP BY [ix_incl_checksum], [object_id] + HAVING COUNT(*) > 1; ' + + + /* Find overlapping indexes with same indexed columns */ + + N'SELECT COUNT(*) AS [num_dup_indexes], [ix_checksum], [object_id] + INTO #MatchingIdxChecksum + FROM #IdxChecksum + GROUP BY [ix_checksum], [object_id] + HAVING COUNT(*) > 1 + + INSERT INTO #DuplicateIndex + SELECT N''Inefficient Indexes - Duplicate'' AS [check_type] + ,N''INDEX'' AS [obj_type] + ,QUOTENAME(DB_NAME()) AS [db_name] + ,QUOTENAME(SCHEMA_NAME([schema_id])) + ''.'' + QUOTENAME(OBJECT_NAME(ic.[object_id])) + ''.'' + QUOTENAME(i.[name]) AS [obj_name] + ,NULL AS [col_name] + ,''Indexes in group '' + CAST(DENSE_RANK() over (order by miic.[ix_incl_checksum]) AS VARCHAR(5)) + '' share the same indexed and any included columns.'' AS [message] + ,ic.[object_id] + ,ic.[index_id] + FROM #MatchingIdxInclChecksum AS miic + INNER JOIN #IdxChecksum AS ic ON ic.[object_id] = miic.[object_id] AND ic.[ix_incl_checksum] = miic.[ix_incl_checksum] + INNER JOIN sys.indexes AS [i] ON [i].[index_id] = ic.index_id AND i.[object_id] = ic.[object_id] + + INSERT INTO #OverlappingIndex + SELECT N''Inefficient Indexes - Overlapping'' AS [check_type] + ,N''INDEX'' AS [obj_type] + ,QUOTENAME(DB_NAME()) AS [db_name] + ,QUOTENAME(SCHEMA_NAME([schema_id])) + ''.'' + QUOTENAME(OBJECT_NAME(ic.[object_id])) + ''.'' + QUOTENAME(i.[name]) AS [obj_name] + ,NULL AS [col_name] + ,''Indexes in group '' + CAST(DENSE_RANK() OVER (order by mic.[ix_checksum]) AS VARCHAR(5)) + '' share the same indexed columns.'' AS [message] + ,ic.[object_id] + ,ic.[index_id] + FROM #MatchingIdxChecksum AS mic + INNER JOIN #IdxChecksum AS ic ON ic.[object_id] = mic.[object_id] AND ic.[ix_checksum] = mic.[ix_checksum] + INNER JOIN sys.indexes AS [i] ON [i].[index_id] = ic.index_id AND i.[object_id] = ic.[object_id] ' + + /* Dont include any indexes that are already identified as 100% duplicates */ + + N'WHERE NOT EXISTS (SELECT * FROM #DuplicateIndex AS [di] WHERE [di].[object_id] = ic.[object_id] AND di.index_id = ic.index_id); + END'; + + DECLARE [DB_Cursor] CURSOR LOCAL FAST_FORWARD + FOR SELECT QUOTENAME([database_name]) + FROM #Databases; + + OPEN [DB_Cursor]; + + FETCH NEXT FROM [DB_Cursor] + INTO @DbName; + + /* Run index query for each database */ + WHILE @@FETCH_STATUS = 0 + BEGIN; + SET @TempCheckSQL = REPLACE(@CheckSQL, N'?', @DbName); + EXEC sp_executesql @TempCheckSQL; + FETCH NEXT FROM [DB_Cursor] + INTO @DbName; + END; + CLOSE [DB_Cursor]; + DEALLOCATE [DB_Cursor]; + + /* Duplicate Indexes */ + INSERT INTO #results ([check_num], [check_type], [obj_type], [db_name], [obj_name], [col_name], [message], [ref_link]) + SELECT @CheckNumber + ,[check_type] + ,[obj_type] + ,[db_name] + ,[obj_name] + ,[col_name] + ,[message] + ,CONCAT(@BaseURL,'inefficient-indexes') + FROM #DuplicateIndex; + + /* Overlapping Indexes */ + INSERT INTO #results ([check_num], [check_type], [obj_type], [db_name], [obj_name], [col_name], [message], [ref_link]) + SELECT @CheckNumber + ,[check_type] + ,[obj_type] + ,[db_name] + ,[obj_name] + ,[col_name] + ,[message] + ,CONCAT(@BaseURL,'inefficient-indexes') + FROM #OverlappingIndex; + + END; -- Inefficient indexes check + + /* Sparse columns */ + SET @CheckNumber = @CheckNumber + 1; + IF (@Verbose = 1) + BEGIN; + SET @Msg = CONCAT(N'Check ', @CheckNumber, ' - Sparse column eligibility'); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + BEGIN; + IF OBJECT_ID('tempdb..#SparseTypes') IS NOT NULL + BEGIN; + DROP TABLE [#SparseTypes]; + END; + IF OBJECT_ID('tempdb..#Stats') IS NOT NULL + BEGIN; + DROP TABLE [#Stats]; + END; + IF OBJECT_ID('tempdb..#StatsHeaderStaging') IS NOT NULL + BEGIN; + DROP TABLE [#StatsHeaderStaging]; + END; + IF OBJECT_ID('tempdb..#StatHistogramStaging') IS NOT NULL + BEGIN; + DROP TABLE [#StatHistogramStaging]; + END; + + CREATE TABLE #SparseTypes ( + [ID] INT IDENTITY(1,1) NOT NULL, + [name] VARCHAR(20), + [user_type_id] INT, + [scale] TINYINT NULL, + [precision] TINYINT NOT NULL, + [threshold_null_perc] TINYINT NOT NULL); + + CREATE CLUSTERED INDEX cidx_#sparsetypes ON #SparseTypes([ID]); + + /* Reference values for when it makes sense to use the sparse feature based on 40% minimum space savings + including if those recommendations change based on scale / precision. Conservative estimates are used + when a column is in between the high and low values in the table. + https://docs.microsoft.com/en-us/sql/relational-databases/tables/use-sparse-columns?view=sql-server-2017#estimated-space-savings-by-data-type */ + INSERT INTO #SparseTypes ([name], [user_type_id], [scale], [precision], [threshold_null_perc]) + VALUES ('BIT',104, 0,0, 98), + ('TINYINT',48, 0,0, 86), + ('SMALLINT',52, 0,0, 76), + ('INT',56, 0,0, 64), + ('BIGINT',127, 0,0, 52), + ('REAL',59, 0,0, 64), + ('FLOAT',62, 0,0, 52), + ('SMALLMONEY',122, 0,0, 64), + ('MONEY',60, 0,0, 52), + ('SMALLDATETIME',58, 0,0, 64), + ('DATETIME',61, 0,0, 52), + ('UNIQUEIDENTIFIER',36, 0,0, 43), + ('DATE',40, 0,0, 69), + ('DATETIME2',42, 0,0, 57), + ('DATETIME2',42, 7,0, 52), + ('TIME',41, 0,0, 69), + ('TIME',41, 7,0, 60), + ('DATETIMEOFFSET',43, 0,0, 52), + ('DATETIMEOFFSET',43, 7,0, 49), + ('VARCHAR',167, 0,0, 60), + ('CHAR',175, 0,0, 60), + ('NVARCHAR',231, 0,0, 60), + ('NCHAR',239, 0,0, 60), + ('VARBINARY',165, 0,0, 60), + ('BINARY',173, 0,0, 60), + ('XML',241, 0,0, 60), + ('HIERARCHYID',128, 0,0, 60), + ('DECIMAL', 106, NULL, 1, 60), + ('DECIMAL', 106, NULL, 38, 42), + ('NUMERIC', 108, NULL, 1, 60), + ('NUMERIC', 108, NULL, 38, 42); + + --For STAT_HEADER data + CREATE TABLE #StatsHeaderStaging ( + [name] SYSNAME + ,[updated] DATETIME2(0) + ,[rows] BIGINT + ,[rows_sampled] BIGINT + ,[steps] INT + ,[density] DECIMAL(6,3) + ,[average_key_length] REAL + ,[string_index] VARCHAR(10) + ,[filter_expression] NVARCHAR(MAX) + ,[unfiltered_rows] BIGINT); + + --Check for extra persisted sample percent column + IF @HasPersistedSamplePercent = 1 + BEGIN; + ALTER TABLE #StatsHeaderStaging ADD [persisted_sample_percent] INT; + END; + + --For HISTOGRAM data + CREATE TABLE #StatHistogramStaging ( + [range_hi_key] NVARCHAR(MAX) + ,[range_rows] BIGINT + ,[eq_rows] DECIMAL(38,2) + ,[distinct_range_rows] BIGINT + ,[avg_range_rows] BIGINT); + + --For combined DBCC stat data (SHOW_STAT + HISTOGRAM) + CREATE TABLE #Stats ( + [stats_id] INT IDENTITY(1,1) + ,[db_name] SYSNAME + ,[stat_name] SYSNAME + ,[stat_updated] DATETIME2(0) + ,[rows] BIGINT + ,[rows_sampled] BIGINT + ,[schema_name] SYSNAME + ,[table_name] SYSNAME NULL + ,[col_name] SYSNAME NULL + ,[eq_rows] BIGINT NULL + ,[null_perc] AS CAST([eq_rows] AS DECIMAL (38,2)) / NULLIF([rows], 0) * 100 + ,[threshold_null_perc] SMALLINT); + + CREATE CLUSTERED INDEX cidx_#stats ON #Stats([stats_id]); + + SET @CheckSQL = + N' USE ?; + BEGIN + DECLARE @schemaName SYSNAME + ,@tableName SYSNAME + ,@statName SYSNAME + ,@colName SYSNAME + ,@threshold_null_perc SMALLINT; + + DECLARE @DBCCSQL NVARCHAR(MAX) = N''''; + DECLARE @DBCCStatSQL NVARCHAR(MAX) = N''''; + DECLARE @DBCCHistSQL NVARCHAR(MAX) = N''''; + + DECLARE [DBCC_Cursor] CURSOR LOCAL FAST_FORWARD + FOR + SELECT DISTINCT sch.name AS [schema_name] + ,t.name AS [table_name] + ,s.name AS [stat_name] + ,ac.name AS [col_name] + ,threshold_null_perc + FROM [sys].[stats] AS [s] + INNER JOIN [sys].[stats_columns] AS [sc] on sc.stats_id = s.stats_id + INNER JOIN [sys].[tables] AS [t] on t.object_id = s.object_id + INNER JOIN [sys].[schemas] AS [sch] on sch.schema_id = t.schema_id + INNER JOIN [sys].[all_columns] AS [ac] on ac.column_id = sc.column_id + AND [ac].[object_id] = [t].[object_id] + AND [ac].[object_id] = [sc].[object_id] + INNER JOIN [sys].[types] AS [typ] ON [typ].[user_type_id] = [ac].[user_type_id] + INNER JOIN [sys].[indexes] AS [i] ON [i].[object_id] = [t].[object_id] ' + + /* Special considerations for variable length data types */ + + N'INNER JOIN [#SparseTypes] AS [st] ON [st].[user_type_id] = [typ].[user_type_id] + AND (typ.name NOT IN (''DECIMAL'', ''NUMERIC'', ''DATETIME2'', ''TIME'', ''DATETIMEOFFSET'')) + OR (typ.name IN (''DECIMAL'', ''NUMERIC'') AND st.precision = ac.precision AND st.precision = 1) + OR (typ.name IN (''DECIMAL'', ''NUMERIC'') AND ac.precision > 1 AND st.precision = 38) + OR (typ.name IN (''DATETIME2'', ''TIME'', ''DATETIMEOFFSET'') AND st.scale = ac.scale AND st.scale = 0) + OR (typ.name IN (''DATETIME2'', ''TIME'', ''DATETIMEOFFSET'') AND ac.scale > 0 AND st.scale = 7) + WHERE [sc].[stats_column_id] = 1 + AND [s].[has_filter] = 0 + AND [s].[no_recompute] = 0 + AND [ac].[is_nullable] = 1 + AND NOT EXISTS (SELECT 1 -- Compressed tables not compatible with sparse cols + FROM [sys].[partitions] AS [p] + WHERE [p].[object_id] = [i].[object_id] + AND [p].[data_compression] > 0) '; + IF @HasTempStat = 1 + BEGIN; + SET @CheckSQL = @CheckSQL + N'AND [s].[is_temporary] = 0; '; + END; + + SET @CheckSQL = @CheckSQL + N' + OPEN [DBCC_Cursor]; + + FETCH NEXT FROM [DBCC_Cursor] + INTO @schemaName, @tableName, @statName, @colName, @threshold_null_perc; + + WHILE @@FETCH_STATUS = 0 + BEGIN; + DECLARE @SchemaTableName SYSNAME = QUOTENAME(@schemaName) + ''.'' + QUOTENAME(@tableName); ' + + + /* Build DBCC statistics queries */ + + N'SET @DBCCSQL = N''DBCC SHOW_STATISTICS(@SchemaTableName, @statName)''; + SET @DBCCStatSQL = @DBCCSQL + '' WITH STAT_HEADER, NO_INFOMSGS;''; + SET @DBCCHistSQL = @DBCCSQL + '' WITH HISTOGRAM, NO_INFOMSGS;''; ' + + + /* Stat Header temp table */ + + N'INSERT INTO #StatsHeaderStaging + EXEC sp_executesql @DBCCStatSQL + ,N''@SchemaTableName SYSNAME, @statName SYSNAME'' + ,@SchemaTableName = @SchemaTableName + ,@statName = @statName; ' + + + /* Histogram temp table */ + + N'INSERT INTO #StatHistogramStaging + EXEC sp_executesql @DBCCHistSQL + ,N''@SchemaTableName SYSNAME, @statName SYSNAME'' + ,@SchemaTableName = @SchemaTableName + ,@statName = @statName; + + INSERT INTO #Stats + SELECT DB_NAME() + ,[head].[name] + ,[head].[updated] + ,[head].[rows] + ,[head].[rows_sampled] + ,@schemaName + ,@tableName + ,@colName + ,[hist].[eq_rows] + ,@threshold_null_perc + FROM #StatsHeaderStaging head + CROSS APPLY #StatHistogramStaging hist + WHERE hist.range_hi_key IS NULL + AND hist.eq_rows > 0 + AND head.unfiltered_rows > 0 + AND head.rows > 1000; + + TRUNCATE TABLE #StatsHeaderStaging; + TRUNCATE TABLE #StatHistogramStaging; + + FETCH NEXT FROM DBCC_Cursor + INTO @schemaName, @tableName, @statName, @colName, @threshold_null_perc; + END; + CLOSE [DBCC_Cursor]; + DEALLOCATE [DBCC_Cursor]; + END;'; + + DECLARE [DB_Cursor] CURSOR LOCAL FAST_FORWARD + FOR SELECT QUOTENAME([database_name]) + FROM #Databases; + + OPEN [DB_Cursor]; + + FETCH NEXT FROM [DB_Cursor] + INTO @DbName; + + /* Run stat query for each database */ + WHILE @@FETCH_STATUS = 0 + BEGIN; + SET @TempCheckSQL = REPLACE(@CheckSQL, N'?', @DbName); + EXEC sp_executesql @TempCheckSQL; + FETCH NEXT FROM [DB_Cursor] + INTO @DbName; + END; + CLOSE [DB_Cursor]; + DEALLOCATE [DB_Cursor]; + + INSERT INTO #results ([check_num], [check_type], [obj_type], [db_name], [obj_name], [col_name], [message], [ref_link]) + SELECT @CheckNumber + ,N'Architecture' + ,N'USER_TABLE' + ,QUOTENAME([db_name]) + ,QUOTENAME([schema_name]) + '.' + QUOTENAME([table_name]) + ,QUOTENAME([col_name]) + ,N'Candidate for converting to a space-saving sparse column based on NULL distribution of more than ' + CAST([threshold_null_perc] AS VARCHAR(3))+ ' percent.' + ,CONCAT(@BaseURL, 'sparse-columns') + FROM #Stats + WHERE [null_perc] >= [threshold_null_perc]; + END; -- Sparse column check + + /* Heap Tables */ + SET @CheckNumber = @CheckNumber + 1; + IF (@Verbose = 1) + BEGIN; + SET @Msg = CONCAT(N'Check ', @CheckNumber, ' - Heap Tables'); + RAISERROR(@Msg, 10, 1) WITH NOWAIT; + END; + BEGIN + SET @CheckSQL = N''; + SELECT @CheckSQL = @CheckSQL + + N'USE ' + QUOTENAME([database_name]) + N'; + INSERT INTO #results ([check_num], [check_type], [obj_type], [db_name], [obj_name], [col_name], [message], [ref_link]) + SELECT @CheckNumber + ,N''Architecture'' + ,N''INDEX'' + ,QUOTENAME(DB_NAME()) + ,QUOTENAME(SCHEMA_NAME([t].[schema_id])) + ''.'' + QUOTENAME([t].[name]) + ,NULL + ,N''Heap tables can result in massive fragmentation and have additional indexing overhead.'' + ,CONCAT(@BaseURL COLLATE database_default, ''heap-tables'') + FROM [sys].[tables] AS [t] + INNER JOIN [sys].[indexes] AS [i] ON [i].[object_id] = [t].[object_id] + WHERE [i].[type] = 0' + FROM #Databases; + EXEC sp_executesql @CheckSQL, N'@CheckNumber TINYINT, @BaseURL VARCHAR(1000)', @CheckNumber = @CheckNumber, @BaseURL = @BaseURL; + END; --Heap Tables + + /* Wrap it up */ + SELECT [check_num] + ,[check_type] + ,[db_name] + ,[obj_type] + ,[obj_name] + ,[col_name] + ,[message] + ,[ref_link] + FROM #results + ORDER BY [check_num], [check_type], [db_name], [obj_type], [obj_name], [col_name], [message]; + + END TRY + + BEGIN CATCH; + BEGIN; + DECLARE @ErrorNumber INT = ERROR_NUMBER(); + DECLARE @ErrorLine INT = ERROR_LINE(); + DECLARE @ErrorMessage NVARCHAR(4000) = ERROR_MESSAGE(); + DECLARE @ErrorSeverity INT = ERROR_SEVERITY(); + DECLARE @ErrorState INT = ERROR_STATE(); + + RAISERROR(@ErrorMessage, @ErrorSeverity, @ErrorState) WITH NOWAIT; + SET @msg = CONCAT('Actual error number: ', @ErrorNumber); + RAISERROR(@msg, 16, 1); + SET @msg = CONCAT('Actual line number: ', @ErrorLine); + RAISERROR(@msg, 16, 1); + SET @msg = CONCAT('Check number: ', @CheckNumber); + RAISERROR(@msg, 16, 1); + END; + END CATCH; +END; +GO + +EXEC sys.sp_addextendedproperty @name=N'Description', @value=N'Recommends space saving and corrective data type measures based on SQL Server database schemas. Documentation at https://expresssql.lowlydba.com' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_sizeoptimiser'; +GO + +EXEC sys.sp_addextendedproperty @name=N'Description', @value=N'Required table type for sp_sizeoptimiser.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TYPE',@level1name=N'SizeOptimiserTableType'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@SqlMajorVersion', @value=N'Used for unit testing purposes only.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_sizeoptimiser'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@SqlMinorVersion', @value=N'Used for unit testing purposes only.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_sizeoptimiser'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@IndexNumThreshold', @value=N'Number of indexes to classify a table as having too many indexes on it. Default value is 10.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_sizeoptimiser'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@IncludeDatabases', @value=N'Which databases to run the script on in the form of a user defined table type. If not supplied, all accessible user databases are targeted. Cannot be used in conjunction with @ExcludeDatabases.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_sizeoptimiser'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@ExcludeDatabases', @value=N'Which databases to exclude in the form of a user defined table type. Cannot be used in conjunction with @IncludeDatabases.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_sizeoptimiser'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@IncludeSysDatabases', @value=N'Whether or not to include system databases in the script''s analysis. Default is 0.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_sizeoptimiser'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@IncludeSSRSDatabases', @value=N'Whether or not to include SQL Server Reporting Services databases in the script''s analysis. Default is 0.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_sizeoptimiser'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@Verbose', @value=N'Whether or not to print additional information during the script run. Default is 0.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_sizeoptimiser'; +GO + +EXEC sys.sp_addextendedproperty @name=N'@IsExpress', @value=N'Used for unit testing purposes only.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'PROCEDURE',@level1name=N'sp_sizeoptimiser'; +GO diff --git a/Stored_Procedure/dbo.usp_TableUnpivot.sql b/Stored_Procedure/dbo.usp_TableUnpivot.sql index 9e9105ed..4e1b6357 100644 --- a/Stored_Procedure/dbo.usp_TableUnpivot.sql +++ b/Stored_Procedure/dbo.usp_TableUnpivot.sql @@ -1,76 +1,108 @@ -IF OBJECT_ID('dbo.usp_TableUnpivot', 'P') IS NULL EXECUTE ('CREATE PROCEDURE dbo.usp_TableUnpivot as select 1'); +IF OBJECT_ID('dbo.usp_TableUnpivot', 'P') IS NULL +EXEC ('CREATE PROCEDURE dbo.usp_TableUnpivot AS SELECT 1'); go ALTER PROCEDURE dbo.usp_TableUnpivot ( - @databaseName SYSNAME = '', - @schemaName SYSNAME = 'dbo', - @tableName SYSNAME, - @unpivotColumns NVARCHAR(MAX) = '', - @constantColumns NVARCHAR(MAX) = '', - @excludeColumns NVARCHAR(MAX) = '', - @orderBYColumns NVARCHAR(MAX) = '', - @debug BIT = 0 - ) + @databaseName sysname = '', + @schemaName sysname = 'dbo', + @tableName sysname, + @unpivotColumns nvarchar(max) = '', + @constantColumns nvarchar(max) = '', + @excludeColumns nvarchar(max) = '', + @orderBYColumns nvarchar(max) = '', + @debug bit = 0 +) AS /* +CREATE TABLE dbo.CustomerPhones +( + CustomerID INT PRIMARY KEY, -- FK + Phone1 VARCHAR(32), + PhoneType1 CHAR(4), + Phone2 VARCHAR(32), + PhoneType2 CHAR(4), + Phone3 VARCHAR(32), + PhoneType3 CHAR(4) +); +INSERT INTO dbo.CustomerPhones (CustomerID, Phone1, PhoneType1, Phone2, PhoneType2, Phone3, PhoneType3) +VALUES + (1,'705-491-1111', 'cell', '705-491-1110', 'home', NULL,NULL), + (2,'613-492-2222', 'home', NULL, NULL, NULL, NULL), + (3,'416-493-3333', 'work', '416-493-3330', 'cell', '416-493-3339', 'home'); + EXECUTE [usp_TableUnpivot] @databaseName = '', @schemaName = 'dbo', - @tableName = 'TableName', - @unpivotColumns = 'UnpivotColumnName', /*!!! table columns list for unpivot with comma separator without spaces !!!*/ + @tableName = 'CustomerPhones', + @unpivotColumns = 'CustomerID', /*!!! table columns list for unpivot with comma separator without spaces !!!*/ @excludeColumns = 'TableNameID', /*!!! table columns list for excluding with comma separator without spaces !!!*/ @constantColumns = ', ''Constant1'' AS ConstantColumnName1, ''Constant2'' AS ConstantColumnName2', /*!!! constant values !!!*/ @oderByColumns = '', - @debug = 1; /*!!! only generate sql statement without executing it !!!*/ + @debug = 1; /*!!! only generate sql statement without executing it !!!*/ */ BEGIN -DECLARE @tableColumns NVARCHAR(MAX) = ''; -DECLARE @tableNameFull NVARCHAR(400) = CASE WHEN @databaseName = '' THEN '' ELSE QUOTENAME(@databaseName) + '.' END + QUOTENAME(@schemaName) + '.' + QUOTENAME(@tableName); -DECLARE @object_id INTEGER = OBJECT_ID(@tableNameFull); -DECLARE @sqlCommand NVARCHAR(MAX) = ''; -DECLARE @ParmDefinition NVARCHAR(500) = '@object_idIN INTEGER, @ColumnsOUT VARCHAR(MAX) OUTPUT'; -DECLARE @crlf NVARCHAR(5) = CHAR(13); - -IF @debug = 0 SET NOCOUNT ON ELSE PRINT '/******* Start Debug' + @crlf; - -IF @debug = 1 PRINT ISNULL('@tableNameFull = {' + CAST(@tableNameFull AS VARCHAR) + '}', '@tableNameFull = Null'); -IF @debug = 1 PRINT ISNULL('@object_id = {' + CAST(@object_id AS VARCHAR) + '}', '@object_id = Null'); - -SET @sqlCommand = CASE WHEN @databaseName = '' THEN '' ELSE N'USE ' + QUOTENAME(@databaseName) + N';' END + @crlf + - N'SELECT @ColumnsOUT = @ColumnsOUT + QUOTENAME(Name) + '',''' + @crlf + - N'FROM sys.columns sac ' + @crlf + - N'WHERE sac.object_id = @object_idIN' + @crlf + - N' AND Name NOT IN (''' + REPLACE(@unpivotColumns, N',', N''',''') + N''',''' - + REPLACE(@excludeColumns, N',', N''',''') + N''')' + @crlf + - N'ORDER BY Name;'; - -IF @debug = 1 PRINT ISNULL(N'@sqlCommand = {' + @crlf + @sqlCommand + @crlf + N'}', N'@sqlCommand = Null'); - -EXECUTE sp_executesql @sqlCommand, @ParmDefinition, @object_idIN = @object_id, @ColumnsOUT = @tableColumns OUTPUT SELECT @tableColumns; - -IF @debug = 1 PRINT ISNULL('@tableColumns = {' + @crlf + @tableColumns + @crlf + '}', '@tableColumns = Null'); - -SET @tableColumns = CASE WHEN LEN(@tableColumns) > 0 THEN LEFT(@tableColumns, LEN(@tableColumns) - 1) END; - -SET @sqlCommand = N'SELECT ' + @unpivotColumns + N', val, columns' + @constantColumns + @crlf + - N' FROM ' + @crlf + - N' (' + @crlf + - N' SELECT *' + @crlf + - N' FROM ' + @schemaName + '.' + @tableName + @crlf + - N') s' + @crlf + - N'UNPIVOT' + @crlf + - N' (' + @crlf + - N' val FOR columns IN (' + @tableColumns + ' )' + @crlf + - N' ) p' + @crlf + - CASE WHEN @orderBYColumns != '' THEN N'ORDER BY ' + @orderBYColumns ELSE '' END; - -IF @debug = 1 PRINT CAST(ISNULL('@sqlCommand = {' + @crlf + @sqlCommand + @crlf + '}' + @crlf, '@sqlCommand = Null' + @crlf) AS TEXT); - -IF @debug = 0 EXECUTE sp_executesql @sqlCommand; - -IF @debug = 0 SET NOCOUNT OFF ELSE PRINT 'End Debug *******/'; +BEGIN TRY + + DECLARE @tableColumns nvarchar(max) = ''; + DECLARE @tableNameFull nvarchar(400) = CASE WHEN @databaseName = '' THEN '' ELSE QUOTENAME(@databaseName) + '.' END + QUOTENAME(@schemaName) + '.' + QUOTENAME(@tableName); + DECLARE @object_id integer = OBJECT_ID(@tableNameFull); + DECLARE @sqlCommand nvarchar(max) = ''; + DECLARE @ParmDefinition nvarchar(500) = '@object_idIN INTEGER, @ColumnsOUT VARCHAR(MAX) OUTPUT'; + DECLARE @crlf nvarchar(5) = CHAR(13); + + IF @debug = 0 SET NOCOUNT ON ELSE PRINT '/******* Start Debug' + @crlf; + + IF @debug = 1 PRINT ISNULL('@tableNameFull = {' + CAST(@tableNameFull AS VARCHAR) + '}', '@tableNameFull = Null'); + IF @debug = 1 PRINT ISNULL('@object_id = {' + CAST(@object_id AS VARCHAR) + '}', '@object_id = Null'); + + SET @sqlCommand = CASE WHEN @databaseName = '' THEN '' ELSE N'USE ' + QUOTENAME(@databaseName) + N';' END + @crlf + + N'SELECT @ColumnsOUT = @ColumnsOUT + QUOTENAME(Name) + '',''' + @crlf + + N'FROM sys.columns sac ' + @crlf + + N'WHERE sac.object_id = @object_idIN' + @crlf + + N' AND Name NOT IN (''' + REPLACE(@unpivotColumns, N',', N''',''') + N''',''' + + REPLACE(@excludeColumns, N',', N''',''') + N''')' + @crlf + + N'ORDER BY Name;'; + + IF @debug = 1 PRINT ISNULL(N'@sqlCommand = {' + @crlf + @sqlCommand + @crlf + N'}', N'@sqlCommand = Null'); + + EXECUTE sp_executesql @sqlCommand, @ParmDefinition, @object_idIN = @object_id, @ColumnsOUT = @tableColumns OUTPUT SELECT @tableColumns; + + IF @debug = 1 PRINT ISNULL('@tableColumns = {' + @crlf + @tableColumns + @crlf + '}', '@tableColumns = Null'); + + SET @tableColumns = CASE WHEN LEN(@tableColumns) > 0 THEN LEFT(@tableColumns, LEN(@tableColumns) - 1) END; + + SET @sqlCommand = N'SELECT ' + @unpivotColumns + N', val, columns' + @constantColumns + @crlf + + N' FROM ' + @crlf + + N' (' + @crlf + + N' SELECT *' + @crlf + + N' FROM ' + @schemaName + '.' + @tableName + @crlf + + N') s' + @crlf + + N'UNPIVOT' + @crlf + + N' (' + @crlf + + N' val FOR columns IN (' + @tableColumns + ' )' + @crlf + + N' ) p' + @crlf + + CASE WHEN @orderBYColumns != '' THEN N'ORDER BY ' + @orderBYColumns ELSE '' END; + + IF @debug = 1 PRINT CAST(ISNULL('@sqlCommand = {' + @crlf + @sqlCommand + @crlf + '}' + @crlf, '@sqlCommand = Null' + @crlf) AS TEXT); + + IF @debug = 0 EXECUTE sp_executesql @sqlCommand; + + IF @debug = 0 SET NOCOUNT OFF ELSE PRINT 'End Debug *******/'; + END TRY + + BEGIN CATCH + PRINT(@crlf + + 'Error: ' + CONVERT(varchar(50), ERROR_NUMBER()) + + ', Severity: ' + CONVERT(varchar(5), ERROR_SEVERITY()) + + ', State: ' + CONVERT(varchar(5), ERROR_STATE()) + + ', Procedure: ' + ISNULL(ERROR_PROCEDURE(), '-') + + ', Line: ' + CONVERT(varchar(5), ERROR_LINE()) + + ', User name: ' + CONVERT(sysname, ORIGINAL_LOGIN()) + ); + PRINT(ERROR_MESSAGE() + @crlf + @crlf); + END CATCH; END -go +GO diff --git a/Stored_Procedure/dbo.usp_bcpUnloadSelect.sql b/Stored_Procedure/dbo.usp_bcpUnloadSelect.sql index cd461c78..f5a6a107 100644 --- a/Stored_Procedure/dbo.usp_bcpUnloadSelect.sql +++ b/Stored_Procedure/dbo.usp_bcpUnloadSelect.sql @@ -2,25 +2,25 @@ IF OBJECT_ID('dbo.usp_bcpUnloadSelect', 'P') IS NULL EXECUTE('CREATE PROCEDURE d GO ALTER PROCEDURE dbo.usp_bcpUnloadSelect( - @outputFilePath VARCHAR(255) -- The path can have from 1 through 255 characters, see documentation - , @serverName SYSNAME = @@SERVERNAME - , @sqlCommand VARCHAR(MAX) - , @fileName VARCHAR(300) = '' - , @field_term VARCHAR( 10) = '|' - , @fileExtension VARCHAR( 10) = 'txt' - , @codePage VARCHAR( 10) = 'C1251' + @outputFilePath varchar(255) /* The path can have from 1 through 255 characters, see documentation */ + , @serverName sysname = @@SERVERNAME + , @sqlCommand varchar(MAX) + , @fileName varchar(300) = '' + , @field_term varchar( 10) = '|' + , @fileExtension varchar( 10) = 'txt' + , @codePage varchar( 10) = 'C65001' /* C1251 - Cyrillic */ , @row_term VARCHAR( 10) = '\n' , @debug BIT = 0 ) AS /*-- -Official bcp documentation: http://technet.microsoft.com/en-us/library/ms162802.aspx +Official bcp documentation: https://docs.microsoft.com/en-us/sql/tools/bcp-utility In select statement use full table names: DATABASENAME.SCHEMANAME.TABLENAME -EXECUTE [NIIGAZ].[dbo].[usp_bcpUnloadSelect] +EXECUTE dbo.usp_bcpUnloadSelect @outputFilePath = 'd:\' , @serverName = '' - , @sqlCommand = 'SELECT * FROM DATABASENAME.SCHEMANAME.TABLENAME1 AS t1 INNER JOIN DATABASENAME.SCHEMANAME.TABLENAME2 AS t2 ON t1.Column1 = t2.Column1' - , @fileName = 'file_name.txt' + , @sqlCommand = 'SELECT TOP(1000) CHECKSUM(NEWID()) % 10000 FROM master.sys.objects AS s1 CROSS JOIN master.sys.objects AS s2' + , @fileName = 'file_name' , @field_term = '|' , @row_term = '\n' , @fileExtension = 'txt' @@ -28,23 +28,28 @@ EXECUTE [NIIGAZ].[dbo].[usp_bcpUnloadSelect] --*/ BEGIN BEGIN TRY - DECLARE @filePath VARCHAR(2000) = @outputFilePath + - CASE WHEN @fileName = '' THEN 'bcp_export_' ELSE @fileName END + - QUOTENAME(REPLACE(CONVERT(VARCHAR, GETDATE(), 126 ), ':', '_')) + - '.' + @fileExtension; - DECLARE @tsqlCommand VARCHAR(8000) = ''; - DECLARE @crlf VARCHAR(10) = CHAR(13) + CHAR(10); - IF @debug = 0 SET NOCOUNT ON ELSE PRINT '/******* Start Debug' + @crlf; + SET NOCOUNT ON; + + IF @debug = 1 PRINT '/******* Start Debug'; + + DECLARE @filePath VARCHAR(1000) = @outputFilePath + + CASE WHEN @fileName = '' THEN 'bcp_export_' + QUOTENAME(REPLACE(CONVERT(VARCHAR, GETDATE(), 126 ), ':', '_')) + ELSE @fileName END + + '.' + @fileExtension; + DECLARE @tsqlCommand VARCHAR(8000) = ''; + DECLARE @crlf VARCHAR(10) = CHAR(13) + CHAR(10); /* remove break lines from select statement */ SET @sqlCommand = REPLACE(REPLACE(@sqlCommand, CHAR(13), ' '), CHAR(10), ' '); /* remove duplicate spaces from select statement */ - SET @sqlCommand = REPLACE(REPLACE(REPLACE(@sqlCommand,' ','<>'),'><',''),'<>',' '); + SET @sqlCommand = REPLACE(REPLACE(REPLACE(@sqlCommand,' ','<>'), '><', ''), '<>', ' '); IF @debug = 1 - PRINT ISNULL('@filePath = {' + @crlf + @filePath + @crlf + '}', '@filePath = {Null}' + @crlf) - PRINT'@sqlCommand = {' + @crlf + @sqlCommand + @crlf + '}'; + BEGIN + PRINT ISNULL('@filePath = {' + @crlf + @filePath + @crlf + '}', '@filePath = {Null}' + @crlf); + PRINT'@sqlCommand = {' + @crlf + @sqlCommand + @crlf + '}'; + END SET @tsqlCommand = 'bcp "' + REPLACE(@sqlCommand, @crlf, ' ') + '" queryout "' + @filePath + '" -T -S ' + @serverName + ' -c -' + @codePage + ' -t"' + @field_term + '"' + @@ -55,12 +60,19 @@ BEGIN ELSE EXECUTE xp_cmdshell @tsqlCommand; - IF @debug = 0 SET NOCOUNT OFF ELSE PRINT @crlf + '--End Deubg*********/'; + IF @debug = 1 PRINT @crlf + '--End Deubg*********/'; END TRY BEGIN CATCH - EXECUTE dbo.usp_LogError; - EXECUTE dbo.usp_PrintError; - END CATCH -END -go + PRINT(@crlf + + 'Error: ' + CONVERT(varchar(50), ERROR_NUMBER()) + + ', Severity: ' + CONVERT(varchar(5), ERROR_SEVERITY()) + + ', State: ' + CONVERT(varchar(5), ERROR_STATE()) + + ', Procedure: ' + ISNULL(ERROR_PROCEDURE(), '-') + + ', Line: ' + CONVERT(varchar(5), ERROR_LINE()) + + ', User name: ' + CONVERT(sysname, ORIGINAL_LOGIN()) + ); + PRINT(ERROR_MESSAGE() + @crlf + @crlf); + END CATCH; +END; +GO diff --git a/User_Defined_Function/dbo.ConvertHexLSN.sql b/User_Defined_Function/dbo.ConvertHexLSN.sql new file mode 100644 index 00000000..f674c153 --- /dev/null +++ b/User_Defined_Function/dbo.ConvertHexLSN.sql @@ -0,0 +1,25 @@ +IF OBJECT_ID('dbo.udf_ConvertHexLSN') IS NULL + EXECUTE ('CREATE FUNCTION udf_ConvertHexLSN() RETURNS TABLE AS RETURN SELECT 1 AS A;'); +GO + + +ALTER FUNCTION dbo.udf_ConvertHexLSN( + @lsnc varchar(25) +) +/* +Author: Max Vernon +Original link: https://www.sqlserverscience.com/internals/convert-lsn-hex-decimal/ + +SELECT * FROM dbo.udf_ConvertHexLSN('00000268:0000356c:0001'); +*/ +RETURNS TABLE +WITH SCHEMABINDING +AS + RETURN + ( + SELECT TOP(1) + LSNd = CONVERT(varchar(8), CONVERT(int, CONVERT(varbinary(8), '0x' + CONVERT(varchar(10), LEFT(@lsnc, 8), 0), 1), 1)) + + ':' + CONVERT(varchar(8), CONVERT(int, CONVERT(varbinary(8), '0x' + CONVERT(varchar(10), SUBSTRING(@lsnc, 10, 8), 0), 1)), 1) + + ':' + CONVERT(varchar(8), CONVERT(int, CONVERT(varbinary(8), '0x' + CONVERT(varchar(10), RIGHT(@lsnc, 4), 0), 1), 1)) + ); +GO diff --git a/Utilities/README.md b/Utilities/README.md index 996d4775..628e4570 100644 --- a/Utilities/README.md +++ b/Utilities/README.md @@ -1,312 +1,433 @@ # Microsoft SQL Server Utilities and Tools -Useful free and paid Microsoft SQL Server utilities and tools - complete list of **277** SQL Server Utilities +Useful free and paid Microsoft SQL Server utilities and tools - complete list of **395** SQL Server Utilities Utility types (main purpose), in braces `{}` current counts: - - **[B]**: Backup solutions {6} - - **[BI]**: Business Intelligence Solutions {4} - - **[D]**: Documentation solutions {7} - - **[DA]**: Database Architecture {13} - - **[DC]**: Data compare {12} - - **[ETL]**: Extract Download Load (ETL) Tools {1} - - **[I]**: Internal SQL Server utilities (for example, bcp) {14} - - **[IDX]**: Index manager {3} - - **[G]**: Data generation {4} - - **[J]**: Job managers {3} - - **[M]**: Monitoring and alerting Tools {16} - - **[MG]**: Migration tool {26} - - **[MS]**: Management Studio (alternative for SSMS) {26} - - **[REC]**: Recovery tools {7} - - **[S]**: Search tools {3} - - **[SC]**: Structure compare {18} - - **[T]**: Testing tools {5} - - **[ST]**: Statistics utilities {3} - - **[?]**: Not yet classified {114} - -| Name/Description | Cross Database | Platform | Type | Official/Download page | Release | Author | License | Free version | Price | -|------------------------------------------------------------------|-------------------------------|-----------|----------|---------------------------------------------|------------|-----------------------|------------|----------------|------:| -| [SSMS](#ssms) | No | No | [MS] | [SSMS] | 2019-04-24 | Microsoft | | Yes | No | -| [bcp Utility](#bcp) | No | No | [I] | [bcp Utility] | 2012-02-11 | Microsoft | | Yes | No | -| [sqlcmd Utility](#sqlcmd-utility) | No | No | [I] | [sqlcmd Utility] | 2016-08-23 | Microsoft | | Yes | No | -| [mssql-cli](#mssql-cli) | No | Linux,Mac | [?] | [mssql-cli] | 2018-07-06 | Microsoft | [BSD-3] | Open Source | No | -| [Azure Data Studio](#ads) | No | Linux,Mac | [MS] | [Azure Data Studio] | 2019-05-08 | Microsoft | [MIT] | Open Source | No | -| [RML Utilities for SQL Server](#rml) | No | No | [T] | [RML Utilities for SQL Server] | 2014-12-12 | Microsoft | | Yes | No | -| [GraphView](#graphview) | No | No | [?] | [GraphView] | 2016-02-23 | Microsoft | | Yes | No | -| [Baseline Security Analyze](#baseline-security-analyze) | No | No | [?] | [Baseline Security Analyze] | 2015-01-09 | Microsoft | | Yes | No | -| [tablediff Utility](#tablediff-utility) | No | No | [I] | [tablediff Utility] | - | Microsoft | | Yes | No | -| [Microsoft Log Parser](#microsoft-log-parser) | No | No | [?] | [Microsoft Log Parser] | - | Microsoft | | Yes | No | -| [Log Parser Lizard GUI](#log-parser-lizard-gui) | Oracle,MySQL,PostgreSQL,Other | No | [MS] | [Log Parser Lizard GUI] | 2017-06-01 | Lizard Labs | | Yes | $59 | -| [Diskspd](#diskspd) | No | No | [T] | [Diskspd] | 2015-12-14 | Microsoft | | Yes | No | -| [HammerDB](#hammerdb) | No | No | [T] | [HammerDB] | 2015-05-04 | Open Source | | Yes | No | -| [Exchange Server Error Code Look-up](#error-code-look-up) | No | No | [?] | [Exchange Server Error Code Look-up] | 2004-05-10 | Microsoft | | Yes | No | -| [LINQPad](#linqpad) | No | No | [?] | [LINQPad] | 2016-01-02 | Joseph Albahari | | Non-commercial | $45 | -| [SqlDynamite](#sqldynamite) | No | No | [S] | [SqlDynamite] | 2016-04-06 | Anatoly Sova | | Yes | No | -| [SQL Server Data Tools](#ssdt) | No | No | [MS] | [SQL Server Data Tools] | 2018-04-10 | Microsoft | | Yes | No | -| [Database Health Monitor](#database-health-monitor) | No | No | [M] | [Database Health Monitor] | 2016-03-20 | Steve Stedman | | Yes | No | -| [SchemaDrift](#schemadrift) | No | No | [SC] | [SchemaDrift] | 2016-02-28 | Steve Stedman | | Yes | No | -| [Dbeaver](#dbeaver) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [MS] | [Dbeaver] | 2018-09-24 | Open Source | | Yes | No | -| [HeidiSQL](#heidisql) | Oracle,MySQL,PostgreSQL,Other | No | [MS] | [HeidiSQL] | 2017-12-19 | Open Source | | Yes | No | -| [SQLExecStats](#sqlexecstats) | No | No | [ST] | [SQLExecStats] | 2016-02-08 | Joe Chang | | Yes | No | -| [ExpressProfiler](#expressprofiler) | No | No | [?] | [ExpressProfiler] | 2016-02-15 | Chris Moore | | Yes | No | -| [Data Migration Assistant](#data-migration-assistant) | No | No | [MG] | [Data Migration Assistant] | 2017-03-15 | Microsoft | | Yes | No | -| [SQL Server Migration Assistant for Sybase](#sybasetosql) | No | No | [MG] | [Migration Assistant for Sybase] | 2017-02-17 | Microsoft | | Yes | No | -| [dta Utility](#dta-utility) | No | No | [I] | [dta Utility] | - | Microsoft | | Yes | No | -| [osql Utility](#osql-utility) | No | No | [I] | [osql Utility] | - | Microsoft | | Yes | No | -| [sqldiag Utility](#sqldiag-utility) | No | No | [I] | [sqldiag Utility] | - | Microsoft | | Yes | No | -| [sqldumper Utility](#sqldumper-utility) | No | No | [I] | [sqldumper Utility] | - | Microsoft | | Yes | No | -| [SqlLocalDB Utility](#sqllocaldb-utility) | No | No | [I] | [SqlLocalDB Utility] | - | Microsoft | | Yes | No | -| [sqllogship Utility](#sqllogship-utility) | No | No | [I] | [sqllogship Utility] | - | Microsoft | | Yes | No | -| [sqlservr Application](#sqlservr-application) | No | No | [I] | [sqlservr Application] | - | Microsoft | | Yes | No | -| [sqlps Utility](#sqlps-utility) | No | No | [I] | [sqlps Utility] | - | Microsoft | | Yes | No | -| [sqlmaint Utility](#sqlmaint-utility) | No | No | [I] | [sqlmaint Utility] | - | Microsoft | | Yes | No | -| [Ssms Utility](#ssms-utility) | No | No | [I] | [Ssms Utility] | - | Microsoft | | Yes | No | -| [dtexec Utility](#dtexec-utility) | No | No | [I] | [dtexec Utility] | - | Microsoft | | Yes | No | -| [SQL Server 2016 Report Builder](#report-builder-2016) | No | No | [?] | [SQL Server 2016 Report Builder] | 2016-09-16 | Microsoft | | Yes | No | -| [SQL Server 2005 Best Practices Analyzer](#bpa-2005) | No | No | [?] | [BPA 2005] | 2008-08-13 | Microsoft | | Yes | No | -| [SQL Server 2000 Best Practices Analyzer](#bpa-2000) | No | No | [?] | [BPA 2000] | 2010-04-26 | Microsoft | | Yes | No | -| [SQL Server 2008 R2 Best Practices Analyzer](#bpa-2008) | No | No | [?] | [BPA 2008] | 2010-06-18 | Microsoft | | Yes | No | -| [SQL Server 2012 Best Practices Analyzer](#bpa-2012) | No | No | [?] | [BPA 2012] | 2012-06-04 | Microsoft | | Yes | No | -| [DLM Dashboard](#dlm-dashboard) | No | No | [M] | [DLM Dashboard] | 2016-04-27 | Red Gate | | Yes | No | -| [Red Gate SQL Compare](#red-gate-sql-compare) | No | No | [DC] | [Red Gate SQL Compare] | 2016-10-31 | Red Gate | | No | $495 | -| [Red Gate SQL Data Compare](#red-gate-sql-data-compare) | No | No | [SC] | [Red Gate SQL Data Compare] | 2016-05-09 | Red Gate | | No | $495 | -| [Red Gate SQL Prompt](#red-gate-sql-prompt) | No | No | [MS] | [Red Gate SQL Prompt] | 2016-04-28 | Red Gate | | No | $369 | -| [Red Gate SQL Monitor](#red-gate-sql-monitor) | No | No | [M] | [Red Gate SQL Monitor] | 2015-10-15 | Red Gate | | No | $1495 | -| [Red Gate SQL Backup Pro](#red-gate-sql-backup-pro) | No | No | [B] | [Red Gate SQL Backup Pro] | 2014-07-08 | Red Gate | | No | $995 | -| [Red Gate SQL Doc](#red-gate-sql-doc) | No | No | [D] | [Red Gate SQL Doc] | 2016-04-26 | Red Gate | | No | $369 | -| [Red Gate SQL Data Generator](#red-gate-sql-data-generator) | No | No | [G] | [Red Gate SQL Data Generator] | 2016-04-26 | Red Gate | | No | $369 | -| [Red Gate SQL Dependency Tracker](#sql-dependency-tracker) | No | No | [?] | [Red Gate SQL Dependency Tracker] | 2016-04-26 | Red Gate | | No | $369 | -| [Red Gate SQL Multi Script](#red-gate-sql-multi-script) | No | No | [?] | [Red Gate SQL Multi Script] | 2016-04-15 | Red Gate | | No | $245 | -| [Red Gate SQL Index Manager](#red-gate-sql-index-manager) | No | No | [IDX] | [Red Gate SQL Index Manager] | ? | Red Gate | | No | $149 | -| [Red Gate SQL Comparison SDK](#red-gate-sql-comparison-sdk) | No | No | [DC],[SC]| [Red Gate SQL Comparison SDK] | 2016-02-22 | Red Gate | | No | $895 | -| [Red Gate SQL Clone](#red-gate-sql-clone) | No | No | [?] | [Red Gate SQL Clone] | 2017-02-27 | Red Gate | | No | $6955 | -| [Red Gate SQL Provision](#red-gate-sql-provision) | No | No | [?] | [Red Gate SQL Provision] | 2018-02-26 | Red Gate | | No | $2955 | -| [Red Gate Data Masker](#red-gate-data-masker) | Oracle | No | [?] | [Red Gate SQL Data Masker] | 2018-02-26 | Red Gate | | No | $2395 | -| [DLM Automation](#dlm-automation) | No | No | [?] | [DLM Automation] | ? | Red Gate | | No | ? | -| [ReadyRoll](#readyroll) | No | No | [?] | [ReadyRoll] | 2016-01-03 | Red Gate | | No | $345 | -| [Rapid Database Extractor](#rapid-database-extractor) | Oracle | No | [?] | [Rapid Database Extractor] | 2016-11-03 | Idera | | Yes | No | -| [SQL XEvent Profiler](#sql-xevent-profiler) | No | No | [?] | [SQL XEvent Profiler] | 2014-03-14 | Idera | | Yes | No | -| [SQL Check](#sql-check) | No | No | [?] | [SQL Check] | 2015-09-24 | Idera | | Yes | No | -| [SQL Fragmentation Analyzer](#sql-fragmentation-analyzer) | No | No | [?] | [SQL Fragmentation Analyzer] | 2012-11-16 | Idera | | Yes | No | -| [SQL Heat Map](#sql-heat-map) | No | No | [?] | [SQL Heat Map] | 2016-01-27 | Idera | | Yes | No | -| [SQL Hekaton Memory Check](#sql-hekaton-memory-check) | No | No | [?] | [SQL Hekaton Memory Check] | 2015-06-10 | Idera | | Yes | No | -| [SQL Page Viewer](#sql-page-viewer) | No | No | [?] | [SQL Page Viewer] | 2014-08-25 | Idera | | Yes | No | -| [SQL Update Statistics](#sql-update-statistics) | No | No | [ST] | [SQL Update Statistics] | 2015-12-14 | Idera | | Yes | No | -| [SQL Statistics Aggregator](#sql-statistics-aggregator) | No | No | [ST] | [SQL Statistics Aggregator] | 2015-05-18 | Idera | | Yes | No | -| [SQL Backup Status Reporter](#sql-backup-status-reporter) | No | No | [B] | [SQL Backup Status Reporter] | 2015-08-07 | Idera | | Yes | No | -| [SQL Integrity Check](#sql-integrity-check) | No | No | [?] | [SQL Integrity Check] | 2013-08-26 | Idera | | Yes | No | -| [SQL Job Manager](#sql-job-manager) | No | No | [J] | [SQL Job Manager] | 2012-03-19 | Idera | | Yes | No | -| [Azure SQL Database Backup](#azure-sql-database-backup) | No | No | [B] | [Azure SQL Database Backup] | 2012-10-02 | Idera | | Yes | No | -| [SQL Column Search](#sql-column-search) | No | No | [S] | [SQL Column Search] | 2015-11-17 | Idera | | Yes | No | -| [SQL Permissions Extractor](#sql-permissions-extractor) | No | No | [?] | [SQL Permissions Extractor] | 2015-08-07 | Idera | | Yes | No | -| [SQL BI Check](#sql-bi-check) | No | No | [BI] | [SQL BI Check] | 2016-04-13 | Idera | | Yes | No | -| [SQL Inventory Check](#sql-inventory-check) | No | No | [?] | [SQL Inventory Check] | 2016-03-24 | Idera | | Yes | No | -| [SQL Diagnostic Manager](#sql-diagnostic-manager) | No | No | [?] | [SQL Diagnostic Manager] | ? | Idera | | No | $1747 | -| [SQL Safe Backup](#sql-safe-backup) | No | No | [B] | [SQL Safe Backup] | 2016-09-08 | Idera | | No | $907 | -| [SQL Compliance Manager](#sql-compliance-manager) | No | No | [?] | [SQL Compliance Manager] | 2015-09-08 | Idera | | No | $2657 | -| [SQL Inventory Manager](#sql-inventory-manager) | No | No | [?] | [SQL Inventory Manager] | 2016-04-22 | Idera | | No | $3195 | -| [SQL Virtual Database](#sql-virtual-database) | No | No | [?] | [SQL Virtual Database] | 2016-03-24 | Idera | | No | $625 | -| [SQL Secure](#sql-secure) | No | No | [?] | [SQL Secure] | 2016-04-19 | Idera | | No | $907 | -| [SQL Doctor](#sql-doctor) | No | No | [?] | [SQL Doctor] | 2015-12-17 | Idera | | No | $625 | -| [SQL Admin Toolset](#sql-admin-toolset) | No | No | [?] | [SQL Admin Toolset] | 2016-01-13 | Idera | | No | $395 | -| [SQL Defrag Manager](#sql-defrag-manager) | No | No | [?] | [SQL Defrag Manager] | 2016-03-10 | Idera | | No | $1495 | -| [DBArtisan](#dbartisan) | No | No | [?] | [DBArtisan] | ? | Idera | | No | $3122 | -| [SQL BI Manager](#sql-bi-manager) | No | No | [BI] | [SQL BI Manager] | 2015-09-08 | Idera | | No | $697 | -| [SQL Enterprise Job Manager](#sql-enterprise-job-manager) | No | No | [J] | [SQL Enterprise Job Manager] | 2015-09-08 | Idera | | No | $697 | -| [DB Optimizer](#db-optimizer) | No | No | [?] | [DB Optimizer] | ? | Idera | | No | $1420 | -| [SQL Query Store Optimizer](#sql-query-store-optimizer) | No | No | [?] | [SQL Query Store Optimizer] | 2016-07-01 | Idera | | Yes | No | -| [Rapid SQL](#rapid-sql) | Oracle,MySQL,PostgreSQL,Other | No | [MS] | [Rapid SQL] | ? | Idera | | No | $710 | -| [SQL Comparison Toolset](#sql-comparison-toolset) | No | No | [DC],[SC]| [SQL Comparison Toolset] | ? | Idera | | No | $745 | -| [ER/Studio Data Architect](#erstudio-data-architect) | Oracle,MySQL,PostgreSQL,Other | No | [DA] | [ER/Studio Data Architect] | | Idera | | No | $1287 | -| [DB Change Manager](#db-change-manager) | Oracle,MySQL,PostgreSQL,Other | No | [SC] | [DB Change Manager] | ? | Idera | | No | $1420 | -| [Uptime Infrastructure Monitor](#uim) | No | Linux | [?] | [Uptime Infrastructure Monitor] | ? | Idera | | No | ? | -| [dbForge Schema Compare](#dbforge-schema-compare) | No | No | [SC] | [dbForge Schema Compare] | 2018-12-21 | Devart | Shareware | No | $150 | -| [dbForge Data Compare](#dbforge-data-compare) | No | No | [DC] | [dbForge Data Compare] | 2018-12-21 | Devart | Shareware | No | $150 | -| [dbForge Data Generator](#dbforge-data-generator) | No | No | [G] | [dbForge Data Generator] | 2018-12-21 | Devart | Shareware | No | $250 | -| [dbForge Query Builder](#dbforge-query-builder) | No | No | [?] | [dbForge Query Builder] | 2018-12-21 | Devart | Shareware | No | $100 | -| [dbForge Event Profiler](#dbforge-event-profiler) | No | No | [M] | [dbForge Event Profiler] | 2018-12-21 | Devart | Freeware | Yes | No | -| [dbForge SQL Decryptor](#dbforge-sql-decryptor) | No | No | [?] | [dbForge SQL Decryptor] | 2018-12-21 | Devart | Freeware | Yes | No | -| [dbForge Studio](#dbforge-studio) | No | No | [MS] | [dbForge Studio] | 2018-12-21 | Devart | Shareware | Yes | $250 | -| [dbForge Fusion](#dbforge-fusion) | No | No | [?] | [dbForge Fusion] | 2018-12-21 | Devart | Shareware | No | $150 | -| [dbForge Documenter](#dbforge-documenter) | No | No | [D] | [dbForge Documenter] | 2018-12-21 | Devart | Shareware | No | $150 | -| [Devart Excel Add-in for SQL Server](#devart-excel-addin) | No | No | [?] | [Devart Excel Add-in for SQL Server] | 2017-09-13 | Devart | Shareware | No | $100 | -| [dbMonitor](#dbmonitor) | Oracle,MySQL,PostgreSQL,Other | No | [M] | [dbMonitor] | 2012-11-01 | Devart | Freeware | Yes | No | -| [Minion Enterprise](#minion-enterprise) | No | No | [?] | [Minion Enterprise] | ? | MinionWare | | No | $1500 | -| [SQL Server Compression Estimator](#compression-estimator) | No | No | [?] | [SQL Server Compression Estimator] | 2011-06-02 | Bob Tavlor | | Yes | No | -| [ClearTrace](#cleartrace) | No | No | [?] | [ClearTrace] | 2016-07-07 | Bill Graziano | | Yes | No | -| [Dell Security Explorer](#dell-security-explorer) | No | No | [?] | [Dell Security Explorer] | 2015-06-25 | Dell | | No | $850 | -| [Dell LiteSpeed for SQL Server](#dell-litespeed-for-sql-server) | No | No | [?] | [Dell LiteSpeed for SQL Server] | 2015-07-31 | Dell | | No | ? | -| [Dell Toad for SQL Server](#dell-toad-for-sql-server) | No | No | [MS] | [Dell Toad for SQL Server] | 2015-05-12 | Dell | | No | ? | -| [Dell Spotlight on SQL Server Enterprise](#dell-spotlight) | No | No | [?] | [Dell Spotlight] | 2016-03-10 | Dell | | No | $2561 | -| [Dell Foglight](#dell-foglight) | No | No | [?] | [Dell Foglight] | 2015-09-22 | Dell | | No | ? | -| [Dell Discovery Wizard](#dell-discovery-wizard) | No | No | [?] | [Dell Discovery Wizard] | 2011-09-22 | Dell | | Yes | No | -| [Dell Enterprise Reporter](#dell-enterprise-reporter) | No | No | [?] | [Dell Enterprise Reporter] | ? | Dell | | No | $511 | -| [SQL Scripter](#sql-scripter) | No | No | [?] | [SQL Scripter] | 2013-02-24 | Thomas Hinsenkamp | | No | €99 | -| [Simple Dynamic Scheduler](#simple-dynamic-scheduler) | No | No | [?] | [Simple Dynamic Scheduler] | 2016-05-02 | Miljan Radovic | | Yes | No | -| [ApexSQL Audit](#apexsql-audit) | No | No | [?] | [ApexSQL Audit] | 2017-07-11 | ApexSQL | | No | $1699 | -| [ApexSQL Backup](#apexsql-backup) | No | No | [B] | [ApexSQL Backup] | 2017-10-12 | ApexSQL | | No | $499 | -| [ApexSQL Defrag](#apexsql-defrag) | No | No | [IDX] | [ApexSQL Defrag] | 2017-06-29 | ApexSQL | | No | $499 | -| [ApexSQL Log](#apexsql-log) | No | No | [?] | [ApexSQL Log] | 2017-05-24 | ApexSQL | | No | $1999 | -| [ApexSQL Monitor](#apexsql-monitor) | No | No | [M] | [ApexSQL Monitor] | 2017-10-05 | ApexSQL | | No | $499 | -| [ApexSQL Plan](#apexsql-plan) | No | No | [?] | [ApexSQL Plan] | 2018-04-05 | ApexSQL | | Yes | No | -| [ApexSQL Propagate](#apexsql-propagate) | No | No | [?] | [ApexSQL Propagate] | 2017-09-25 | ApexSQL | | Yes | No | -| [ApexSQL Recover](#apexsql-recover) | No | No | [REC] | [ApexSQL Recover] | 2017-10-26 | ApexSQL | | No | $1999 | -| [ApexSQL Build](#apexsql-build) | No | No | [?] | [ApexSQL Build] | 2017-05-15 | ApexSQL | | No | $399 | -| [ApexSQL Clean](#apexsql-clean) | No | No | [?] | [ApexSQL Clean] | 2017-09-28 | ApexSQL | | No | $399 | -| [ApexSQL Data Diff](#apexsql-data-diff) | No | No | [DC] | [ApexSQL Data Diff] | 2017-10-26 | ApexSQL | | No | $399 | -| [ApexSQL Decrypt](#apexsql-decrypt) | No | No | [?] | [ApexSQL Decrypt] | 2017-08-16 | ApexSQL | | Yes | No | -| [ApexSQL Diff](#apexsql-diff) | No | No | [SC] | [ApexSQL Diff] | 2017-10-26 | ApexSQL | | No | $399 | -| [ApexSQL Doc](#apexsql-doc) | No | No | [D] | [ApexSQL Doc] | 2017-09-06 | ApexSQL | | No | $299 | -| [ApexSQL Generate](#apexsql-generate) | No | No | [G] | [ApexSQL Generate] | 2017-07-13 | ApexSQL | | No | $499 | -| [ApexSQL Script](#apexsql-script) | No | No | [?] | [ApexSQL Script] | 2016-05-10 | ApexSQL | | No | $249 | -| [ApexSQL Trigger](#apexsql-trigger) | No | No | [?] | [ApexSQL Trigger] | 2017-06-01 | ApexSQL | | No | $1999 | -| [ApexSQL Trigger Veiwer](#apexsql-trigger-viewer) | No | No | [?] | [ApexSQL Trigger Viewer] | 2017-06-01 | ApexSQL | | Yes | No | -| [ApexSQL Snapshot Utility](#apexsql-snapshot-utility) | No | No | [?] | [ApexSQL Snapshot Utility] | 2016-01-12 | ApexSQL | | Yes | No | -| [ApexSQL Model](#apexsql-model) | No | No | [DA] | [ApexSQL Model] | 2019-05-22 | ApexSQL | | Yes | No | -| [ApexSQL Analyze](#apexsql-analyze) | No | No | [?] | [ApexSQL Analyze] | 2017-12-13 | ApexSQL | | No | $299 | -| [ApexSQL BI Monitor](#apexsql-bi-monitor) | No | No | [BI],[M] | [ApexSQL BI Monitor] | 2018-05-18 | ApexSQL | | No | $499 | -| [ApexSQL VM Monitor](#apexsql-vm-monitor) | No | No | [M] | [ApexSQL VM Monitor] | 2018-05-09 | ApexSQL | | No | $999 | -| [ApexSQL Job](#apexsql-job) | No | No | [J] | [ApexSQL Job] | 2018-03-29 | ApexSQL | | No | $499 | -| [ApexSQL Enforce](#apexsqlL-enforce) | No | No | [?] | [ApexSQL Enforce] | 2018-07-19 | ApexSQL | | No | $299 | -| [DBBest T-SQL Analyzer](#dbbest-t-sql-analyzer) | No | No | [?] | [DBBest T-SQL Analyzer] | 2015-03-13 | DBBest | | No | $89 | -| [DBBest Database Compare Suite](#dbbest-database-compare-suite) | No | No | [SC],[DC]| [DBBest Database Compare Suite] | 2015-09-04 | DBBest | | No | $349 | -| [Advanced Query Tool](#advanced-query-tool) | No | No | [?] | [Advanced Query Tool] | 2015-03-18 | Cardett Associates | | No | $180 | -| [SqlDiffFramework](#sqldiffframework) | No | No | [SC] | [SqlDiffFramework] | 2012-04-17 | Michael Sorens | | Yes | No | -| [DataGrip](#datagrip) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [MS] | [DataGrip] | 2017-02-21 | Jet Brains | | No | $89 | -| [Pssdiag and Sqldiag Manager](#pssdiag-and-sqldiag-manager) | No | No | [?] | [Pssdiag and Sqldiag Manager] | 2017-01-06 | Jack Li | | Yes | No | -| [SQL Nexus Tool](#sql-nexus-tool) | No | No | [?] | [SQL Nexus Tool] | 2016-11-20 | Jack Li | | Yes | No | -| [DBSophic Qure Profiler](#dbsophic-qure-profiler) | No | No | [?] | [DBSophic Qure Profiler] | ? | DBSophic | | No | $300 | -| [DBSophic Qure Optimizer](#dbsophic-qure-optimizer) | No | No | [?] | [DBSophic Qure Optimizer] | ? | DBSophic | | No | ? | -| [RestoreChecker](#restorechecker) | No | No | [?] | [RestoreChecker] | 2015-01-15 | SQLServerUtilities | | No | $99 | -| [SQLScripter](#sqlscripter) | No | No | [?] | [SQLScripter] | 2009-08-24 | SQLServerUtilities | | No | $99 | -| [SQLC](#sqlc) | No | No | [DC],[SC]| [SQLC] | 2017-11-19 | David Ingleton | | Yes | No | -| [Database Performance Analyzer](#dpa-solarwinds) | Oracle, MySQL, Other | Linux | [M] | [Database Performance Analyzer] | ? | SolarWinds | | No | $1995 | -| [Database Performance Analyzer for MSSQL](#dpa-solarwinds-mssql) | No | No | [M] | [Database Performance Analyzer for MSSQL] | ? | SolarWinds | | No | $1995 | -| [SQL Enlight](#sql-enlight) | No | No | [MS] | [SQL Enlight] | 2016-04-25 | UbitSoft | | No | $295 | -| [Aireforge Studio](#aireforge-studio) | No | No | [MG],[SC]| [Aireforge Studio] | 2017-06-21 | AireForge | | Yes | $299 | -| [HexaTier](#hexatier) | No | No | [?] | [HexaTier] | ? | HexaTier | | No | ? | -| [SoftTree SQL Assistant](#softtree-sql-assistant) | Oracle,MySQL,PostgreSQL,Other | No | [MS] | [SoftTree SQL Assistant] | 2017-12-17 | SoftTree | | No | $215 | -| [DB Audit and Security 360](#db-audit-and-security-360) | Oracle,MySQL,Other | No | [?] | [DB Audit and Security 360] | 2015-02-07 | SoftTree | | No | $499 | -| [EMS SQL Management Studio](#ems-management-studio) | No | No | [MS] | [EMS SQL Management Studio] | 2016-05-26 | EMS | | No | $257 | -| [EMS SQL Backup](#ems-sql-backup) | No | No | [B] | [EMS SQL Backup] | 2016-04-13 | EMS | | Yes | $82 | -| [EMS SQL Administrator](#ems-sql-administrator) | No | No | [?] | [EMS SQL Administrator] | 2015-04-14 | EMS | | Yes | $135 | -| [EMS SQL Manager](#ems-sql-manager) | No | No | [?] | [EMS SQL Manager] | 2016-05-26 | EMS | | Yes | $135 | -| [EMS Data Export](#ems-data-export) | No | No | [?] | [EMS Data Export] | 2016-04-29 | EMS | | No | $47 | -| [EMS Data Import](#ems-data-import) | No | No | [?] | [EMS Data Import] | 2016-04-14 | EMS | | No | $47 | -| [EMS Data Pump](#ems-data-pump) | No | No | [?] | [EMS Data Pump] | 2016-11-03 | EMS | | No | $47 | -| [EMS Data Generator](#ems-generator) | No | No | [G] | [EMS Data Generator] | 2010-07-10 | EMS | | No | $47 | -| [EMS DB Comparer](#ems-bd-comparer) | No | No | [SC] | [EMS DB Comparer] | 2015-07-24 | EMS | | No | $47 | -| [EMS DB Extract](#ems-bd-extract) | No | No | [?] | [EMS DB Extract] | 2008-10-16 | EMS | | No | $47 | -| [EMS SQL Query](#ems-sql-query) | No | No | [?] | [EMS SQL Query] | 2012-03-29 | EMS | | No | $47 | -| [EMS Data Comparer](#ems-data-comparer) | No | No | [DC] | [EMS Data Comparer] | 2012-11-16 | EMS | | No | $47 | -| [NitroAccelerator](#nitroaccelerator) | No | No | [?] | [NitroAccelerator] | 2016-07-10 | Nitrosphere | | No | $1265 | -| [ERwin Data Modeler](#erwin-data-modeler) | Oracle,MySQL,PostgreSQL,Other | No | [DA] | [ERwin Data Modeler] | 2016-06-03 | ERwin | | No | $810 | -| [Toad Data Modeler](#toad-data-modeler) | Oracle,MySQL,PostgreSQL,Other | No | [DA] | [Toad Data Modeler] | 2016-06-16 | Dell | | No | $562 | -| [SQL Power Architect](#sql-power-architect) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [DA] | [SQL Power Architect] | 2016-02-11 | SQLPower | | Yes | $995 | -| [DbWrench](#dbwrench) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [DA] | [DbWrench] | 2016-07-06 | Nizana Systems | | No | $99 | -| [Navicat Data Modeler](#navicat-data-modeler) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [DA] | [Navicat Data Modeler] | 2016-08-01 | PremiumSoft | | No | $199 | -| [DeZign for Databases](#dezign-for-databases) | Oracle,MySQL,PostgreSQL,Other | No | [DA] | [DeZign for Databases] | 2016-04-25 | Datanamic | | No | $259 | -| [ERDesigner NG](#erdesigner-ng) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [DA] | [ERDesigner NG] | 2013-04-10 | Mirko Sertic | | Open Source | No | -| [Vertabelo](#vertabelo) | Oracle,MySQL,PostgreSQL,Other | Online | [DA] | [Vertabelo] | ? | Vertabelo | | No | $948 | -| [dbDiffo](#dbdiffo) | Oracle,MySQL,PostgreSQL,Other | Online | [DA] | [dbDiffo] | ? | Contenet Ltd | | Yes | No | -| [SQL DXP](#sql-dxp) | Oracle,MySQL | No | [DC],[SC]| [SQL DXP] | 2016-06-20 | SQL Delta | | No | $530 | -| [Aqua Data Studio](#aqua-data-studio) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [MS] | [Aqua Data Studio] | 2016-07-06 | AquaFold | | No | $499 | -| [RazorSQL](#razorsql) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [MS] | [RazorSQL] | 2016-09-29 | Richardson Software | | No | $100 | -| [SQL Pretty Printer](#sql-pretty-printer) | No | No | [?] | [SQL Pretty Printer] | 2016-02-19 | Gudu Software | | No | $50 | -| [Database .NET](#database-net) | Oracle,MySQL,PostgreSQL,Other | No | [MS],[SC]| [Database .NET] | 2018-08-20 | fish's dotNET | | Non-commercial | $69 | -| [dbMigration .NET](#dbmegration-net) | Oracle,MySQL,PostgreSQL,Other | No | [DC],[SC]| [dbMigration .NET] | 2018-08-20 | fish's dotNET | | Non-commercial | $49 | -| [Is It SQL](#is-it-sql) | No | No | [M] | [Is It SQL] | 2017-04-06 | Bill Graziano | | Non-commercial | No | -| [Database Experimentation Assistant Technical Preview 2](#dea) | No | No | [T] | [Database Experimentation Assistant] | 2017-03-24 | Microsoft | | Yes | No | -| [Data Platform Studio](#dps) | No | No | [MG] | [Data Platform Studio] | ? | Red Gate Software | | Yes | ? | -| [Flyway](#flyway) | Oracle,MySQL,PostgreSQL,Other | No | [MG] | [Flyway] | 2018-01-30 | boxfuse | [Apache] | Open Source | $950 | -| [Liquibase](#liquibase) | Oracle,MySQL,PostgreSQL,Other | No | [MG] | [Liquibase] | 2018-04-11 | Liquibase | [Apache] | Open Source | No | -| [My Batis](#my-batis) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [MG] | [My Batis] | 2018-03-20 | My Batis | [Apache] | Open Source | No | -| [SentryOne Plan Explorer](#sentryone-plan-explorer) | No | No | [?] | [SentryOne Plan Explorer] | 2017-05-25 | SentryOne | | Yes | No | -| [SQL Sentry](#sql-sentry) | No | No | [M] | [SQL Sentry] | 2016-12-07 | SentryOne | | No | ? | -| [DBmaestro TeamWork](#dbmaestro-teamwork) | Oracle | No | [?] | [DBmaestro TeamWork] | ? | DBmaestro | | No | ? | -| [xSQL Schema Compare](#xsql-schema-compare) | No | No | [SC] | [xSQL Schema Compare] | 2017-03-01 | xSQL Software | Shareware | Yes | $399 | -| [xSQL Data Compare](#xsql-data-compare) | No | No | [DK] | [xSQL Data Compare] | 2017-06-26 | xSQL Software | Shareware | Yes | $399 | -| [xSQL Script Executor](#xsql-script-executor) | MySQL,DB2,SQL Server CE | No | [?] | [xSQL Script Executor] | 2015-02-25 | xSQL Software | Freeware | Yes | $249 | -| [xSQL Builder](#xsql-builder) | No | No | [?] | [xSQL Builder] | 2017-03-15 | xSQL Software | Shareware | No | $799 | -| [xSQL Documenter](#xsql-documenter) | Oracle,MySQL,SQLite,Other | No | [D] | [xSQL Documenter] | 2017-01-04 | xSQL Software | Shareware | No | $199 | -| [xSQL Profiler](#xsql-profiler) | No | No | [?] | [xSQL Profiler] | 2017-06-28 | xSQL Software | Shareware | Yes | $999 | -| [xSQL Schema Compare SDK](#xsql-schema-compare-sdk) | No | No | [SC] | [xSQL Schema Compare SDK] | 2017-10-25 | xSQL Software | Shareware | No | $1499 | -| [xSQL RSS Reporter](#xsql-rss-reporter) | No | No | [D] | [xSQL RSS Reporter] | 2014-11-25 | xSQL Software | Shareware | No | $169 | -| [xSQL Database Searcher](#xsql-database-sercher) | No | No | [S] | [xSQL Database Searcher] | 2017-05-09 | xSQL Software | Freeware | Yes | No | -| [Cloud-based DB Monitoring Platform](#cbmp) | No | Mobile | [M] | [Cloud-based DB Monitoring Platform] | ? | SQLTreeo | | No | €180 | -| [SchemaCrawler](#schema-crawler) | Oracle,MySQL,PostgreSQL,Other | Yes | [D],[SC] | [SchemaCrawler] | 2017-02-27 | Sualeh Fatehi | | Open Source | No | -| [SA MaaS Microsoft SQL Server](#sa-maas) | No | No | [M] | [SA MaaS Microsoft SQL Server] | ? | SENTINELAGENT | | No | ? | -| [CatCompare v2](#cat-compare) | No | No | [?] | [CatCompare v2] | 2017-01-07 | Andy Leonard | | No | $295 | -| [SSIS Catalog Compare v2.0 Bundle](#catalog-compare-bundle) | No | No | [?] | [SSIS Catalog Compare v2.0 Bundle] | 2017-01-06 | Andy Leonard | | No | $495 | -| [MS Kerberos Configuration Manager](#mkcm) | No | No | [?] | [MS Kerberos Configuration Manager] | 2017-01-31 | Microsoft | | Yes | No | -| [Spotlight](#spotlight) | No | No | [M] | [Spotlight] | ? | Quest Software | | Yes | ? | -| [DBConvert Studio](#dbconvert-studio) | Oracle,MySQL,PostgreSQL,Other | No | [MG] | [DBConvert Studio] | 2017-03-01 | DMSoft Technologies | | No | $499 | -| [DbDefence](#dbdefence) | No | No | [?] | [DbDefence] | 2017-03-01 | ActiveCrypt Software | | Yes | $698 | -| [SQL Server Migration Assistant for MySQL](#ssma-mysql) | MySQL | No | [MG] | [SQL Server Migration Assistant for MySQL] | 2017-02-17 | Microsoft | | Yes | No | -| [sqlcmd for Mac and Linux](#sqlcmd) | No | Linux,Mac | [?] | [sqlcmd for Mac and Linux] | 2017-01-26 | Soheil Rashidi | | Open Source | No | -| [SQL Migrator](#sql-migrator) | No | No | [MG] | [SQL Migrator] | ? | Datamate Technology | | ? | ? | -| [MS FoxPro to MS SQL Migration and Sync](#foxpro-sqlserver) | No | No | [MG] | [MS FoxPro to MS SQL Migration and Sync] | 2013-10-08 | DMSoft Technologies | | No | $149 | -| [MySQL to MS SQL Migration and Sync](#mysql-sqlserver) | No | No | [MG] | [MySQL to MS SQL Migration and Sync] | 2013-10-08 | DMSoft Technologies | | No | $149 | -| [Oracle to MS SQL Migration and Sync](#oracle-sqlserver) | No | No | [MG] | [Oracle to MS SQL Migration and Sync] | 2013-10-09 | DMSoft Technologies | | No | $149 | -| [PostgreSQL to MS SQL Migration and Sync](#postgresql-sqlserver) | No | No | [MG] | [PostgreSQL to MS SQL Migration and Sync] | 2013-10-08 | DMSoft Technologies | | No | $149 | -| [MS Excel to MS SQL Migration](#msexcel-sqlserver) | No | No | [MG] | [MS Excel to MS SQL Migration] | 2013-09-23 | DMSoft Technologies | | No | $149 | -| [SQLite to MS SQL Migration and Sync](#sqllite-sqlserver) | No | No | [MG] | [SQLite to MS SQL Migration and Sync] | 2014-05-08 | DMSoft Technologies | | No | $149 | -| [IBM DB2 to MS SQL Migration and Sync](#db2-sqlserver) | No | No | [MG] | [IBM DB2 to MS SQL Migration and Sync] | 2013-09-09 | DMSoft Technologies | | No | $149 | -| [MS Access to MS SQL Migration and Sync](#access-sqlserver) | No | No | [MG] | [MS Access to MS SQL Migration and Sync] | 2013-10-08 | DMSoft Technologies | | No | $149 | -| [Firebird to MS SQL Migration and Sync](#firebird-sqlserver) | No | No | [MG] | [Firebird to MS SQL Migration and Sync] | 2013-09-11 | DMSoft Technologies | | No | $149 | -| [SQLines SQL Converter](#sqllines-converter) | No | No | [MG] | [SQLines SQL Converter] | ? | Dmtolpeko | | Open Source | No | -| [SQLite & SQL Server Compact Toolbox](#sqlite-sqlserver-toolbox) | No | No | [?] | [SQLite & SQL Server Compact Toolbox] | ? | ErikEJ | | Open Source | No | -| [SqlPad](#sqlpad) | Postgres,MySQL,Crate,Vertica | No | [MS] | [SqlPad] | ? | Rickbergfalk | | Open Source | No | -| [Html-query-plan](#html-query-plan) | No | No | [?] | [Html-query-plan] | ? | JustinPealing | | Open Source | No | -| [SqlQueryStress](#sql-query-stress) | No | No | [?] | [SqlQueryStress] | ? | Adam Machanic | | Open Source | No | -| [SQL Server Migration Assistant for DB2](#ssma-db2) | DB2 | No | [MG] | [SQL Server Migration Assistant for DB2] | 2017-02-17 | Microsoft | | Yes | No | -| [SQL Server Migration Assistant for Oracle](#ssma-oracle) | Oracle | No | [MG] | [SQL Server Migration Assistant for Oracle] | 2017-02-17 | Microsoft | | Yes | No | -| [SQL Server Migration Assistant for Access](#ssma-access) | Access | No | [MG] | [SQL Server Migration Assistant for Access] | 2017-02-17 | Microsoft | | Yes | No | -| [mssql for Visual Studio Code](#mssql-for-vs-code) | No | Linux,Mac | [MS] | [mssql for Visual Studio Code] | 2017-05-02 | Microsoft | | Open Source | No | -| [Microsoft Assessment and Planning](#map) | No | No | [?] | [Microsoft Assessment and Planning] | 2017-02-10 | Microsoft | | Yes | No | -| [mssql-scripter](#mssql-scripter) | No | Linux,Mac | [?] | [mssql-scripter] | ? | Microsoft | | Open Source | No | -| [DBFS](#dbfs) | No | Linux | [M] | [DBFS] | ? | Microsoft | | Open Source | No | -| [comparator](#pumpet-comparator) | Oracle,MySQL,PostgreSQL,Other | No | [DC] | [comparator] | 2017-06-06 | Pumpet | [LGPL-3.0] | Open Source | No | -| [Navicat for SQL Server](#navicat-for-sql-server) | No | Mac | [MS] | [Navicat for SQL Server] | 2017-06-14 | PremiumSoft | | No | $699 | -| [Navicat Premium](#navicat-premium) | Oracle,MySQL,PostgreSQL,Other | Mac | [MS] | [Navicat Premium] | 2017-06-14 | PremiumSoft | | No | $1299 | -| [DbVisualizer](#dbvisualizer) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [MS],[DA]| [DbVisualizer] | 2017-08-22 | DbVis Software AB. | | Yes | $197 | -| [DbSchema](#dbschema) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [DA] | [DbSchema] | 2017-06-19 | Wise Coders Solutions | | Yes | $127 | -| [DBGhost](#dbghost) | No | No | [?] | [DBGhost] | 2017-01-31 | Innovartis Ltd | | No | £430 | -| [SQLAutomate](#sqlautomate) | Oracle,MySQL,Other | No | [?] | [SQLAutomate] | 2017-06-19 | OnLine ToolWorks     | | No | $99 | -| [BimlExpress](#bimlexpress) | No | No | [?] | [BimlExpress] | ? | Varigence   | | No | No | -| [BIDS Helper](#bidshelper) | No | No | [?] | [BIDS Helper] | 2015-03-17 | Microsoft   | | Open Source | No | -| [Azure Data Warehouse Migration Utility](#azure-migration) | No | No | [MG] | [Azure Data Warehouse Migration Utility] | ? | Microsoft | | ? | ? | -| [Dell Benchmark Factory](#dell-benchmark-factory) | Oracle,MySQL,Other | No | [T] | [Dell Benchmark Factory] | ? | Quest Software | | No | $4413 | -| [manduka](#maduka) | Oracle | Linux,Mac | [?] | [manduka] | 2017-03-08 | Virtusa Corporation | | Yes | No | -| [PowerBI Desktop](#powerbi-desktop) | Oracle,MySQL,PostgreSQL,Other | No | [BI] | [PowerBI Desktop] | 2017-07-11 | Microsoft | | Yes | ? | -| [Stellar Phoenix SQL Database Repair](#stellar-phoenix) | No | No | [REC] | [Stellar Phoenix SQL Database Repair] | 2017-07-05 | Stellar Technology | | No | $349 | -| [DataNumen SQL Recovery](#datanumen-sql-recovery) | No | No | [REC] | [DataNumen SQL Recovery] | 2017-03-20 | DataNumen | | No | $500 | -| [Recovery Toolbox for SQL Server](#recovery-toolbox) | No | No | [REC] | [Recovery Toolbox for SQL Server] | ? | Recovery Toolbox | Shareware | No | $99 | -| [SQL MDF Viewer](#sql-mdf-viewer) | No | No | [?] | [SQL MDF Viewer] | ? | SysTools | Shareware | No | $129 | -| [SQL MDF Recovery Tool](#sql-mdf-recovery-tool) | No | No | [REC] | [SQL MDF Recovery Tool] | ? | SysTools | Shareware | No | $129 | -| [SQL Passord Recovery](#sql-password-recovery) | No | No | [REC] | [SQL Passord Recovery] | ? | SysTools | Shareware | No | $69 | -| [SQL Decryptor](#sql-decryptor) | No | No | [?] | [SQL Decryptor] | ? | SysTools | Shareware | No | $69 | -| [SQL Backup Database Recovery](#sql-backup-database-recovery) | No | No | [REC] | [SQL Backup Database Recovery] | ? | SysTools | Shareware | No | $149 | -| [SQL Log File Viewer](#sql-log-file-viewer) | No | No | [?] | [SQL Log File Viewer] | ? | SysTools | Shareware | No | $999 | -| [DAX Studio](#dax-studio) | No | No | [?] | [DAX Studio] | ? | Sqlbi | Freeware | Yes | No | -| [SQL Cop](#sql-cop) | No | No | [?] | [SQL Cop] | ? | LessThanDot | Freeware | Yes | No | -| [Dataedo](#dataedo) | Oracle,MySQL | No | [D] | [Dataedo] | 2017-09-15 | Logic Systems | Shareware | Yes | $239 | -| [Azure Database Migration Service](#azure-db-migration) | Oracle,MySQL, Other | Online | [MG] | [Azure Database Migration Service] | 2017-12-01 | Microsoft | | Yes | No | -| [FlowHeater](#flowheater) | Oracle,MySQL,PostgreSQL,Other | No | [ETL] | [FlowHeater] | 2017-10-02 | FlowHeater GmbH | Shareware | No | $79 | -| [EDIS](#edis) | No | No | [ETL] | [EDIS] | ? | SQL ETL | Shareware | Yes | $599 | -| [SchemaSpy](#schemaspy) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [D] | [SchemaSpy] | 2018-08-05 | Rafal Kasa | [MIT] | Open Source | No | -| [Adminer](#adminer) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [MS] | [Adminer] | 2018-02-20 | Jakub Vrána | [Apache] | Open Source | No | -| [Full Convert](#full-convert) | Oracle,MySQL,PostgreSQL,Other | No | [MG] | [Full Convert] | 2018-08-20 | Spectral Core | Shareware | Yes | $699 | -| [Replicator](#replicator) | Oracle,MySQL,PostgreSQL,Other | No | [DC] | [Replicator] | 2018-08-20 | Spectral Core | Shareware | Yes | $699 | -| [JackDB](#jackdb) | Oracle,MySQL,PostgreSQL,Other | Online | [MS] | [JackDB] | ? | JackDB | | No | $48 | -| [SQL Workbench](#sql-workbench) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [MS] | [SQL Workbench] | 2018-08-20 | Thomas Kellerer | | Yes | No | -| [Valentina Studio](#valentina-studio) | MySQL,PostgreSQL,Other | Linux,Mac | [MS] | [Valentina Studio] | 2018-09-24 | Paradigma Software | | Yes | $200 | -| [SQL Plus Dot Net](#sql-plus-dot-net) | No | No | [?] | [SQL Plus Dot Net] | ? | SQL+.NET | | No | ? | -| [SQLIndexManager](#sqlindexmanager) | No | No | [IDX] | [SQLIndexManager] | 2019-05-19 | Sergey Syrovatchenko | | Open Source | No | - +- **[B]**: Backup solutions {17} +- **[BI]**: Business Intelligence Solutions {4} +- **[D]**: Documentation solutions {8} +- **[DA]**: Database Architecture {20} +- **[DC]**: Data compare {15} +- **[ETL]**: Extract Download Load (ETL) Tools {9} +- **[I]**: Internal SQL Server utilities (for example, bcp) {15} +- **[IDX]**: Index manager {3} +- **[G]**: Data generation {4} +- **[J]**: Job managers {4} +- **[M]**: Monitoring and alerting Tools {28} +- **[MG]**: Migration tool {31} +- **[MS]**: Management Studio (alternative for SSMS) {33} +- **[REC]**: Recovery tools {13} +- **[S]**: Search tools {7} +- **[SEC]**: Security tools {7} +- **[SC]**: Structure compare {21} +- **[ST]**: Statistics utilities {3} +- **[T]**: Testing tools {7} +- **[?]**: Not yet classified {156} + +| Name/Description | Cross Database | Platform | Type | Official/Download page | Release | Author | License | Free version | Price | +|------------------------------------------------------------------|-------------------------------|-----------|----------|----------------------------------------------------|------------|-------------------------|------------|----------------|------:| +| [SSMS](#ssms) | No | No | [MS] | [SSMS] | 2020-10-27 | Microsoft | Freeware | Yes | No | +| [Azure Data Studio](#ads) | PostgreSQL | Linux,Mac | [MS] | [Azure Data Studio] | 2020-11-12 | Microsoft | [MIT] | Open Source | No | +| [bcp Utility](#bcp) | No | No | [I] | [bcp Utility] | 2012-02-11 | Microsoft | | Yes | No | +| [sqlcmd Utility](#sqlcmd-utility) | No | No | [I] | [sqlcmd Utility] | 2016-08-23 | Microsoft | | Yes | No | +| [mssql-cli](#mssql-cli) | No | Linux,Mac | [?] | [mssql-cli] | 2020-05-01 | Microsoft | [BSD-3] | Open Source | No | +| [RML Utilities for SQL Server](#rml) | No | No | [T] | [RML Utilities for SQL Server] | 2014-12-12 | Microsoft | | Yes | No | +| [GraphView](#graphview) | No | No | [?] | [GraphView] | 2016-02-23 | Microsoft | | Yes | No | +| [Baseline Security Analyze](#baseline-security-analyze) | No | No | [SEC] | [Baseline Security Analyze] | 2015-01-09 | Microsoft | | Yes | No | +| [tablediff Utility](#tablediff-utility) | No | No | [I] | [tablediff Utility] | - | Microsoft | | Yes | No | +| [Microsoft Log Parser](#microsoft-log-parser) | No | No | [?] | [Microsoft Log Parser] | - | Microsoft | | Yes | No | +| [Log Parser Lizard GUI](#log-parser-lizard-gui) | Oracle,MySQL,PostgreSQL,Other | No | [MS] | [Log Parser Lizard GUI] | 2017-06-01 | Lizard Labs | | Yes | $59 | +| [Diskspd](#diskspd) | No | No | [T] | [Diskspd] | 2015-12-14 | Microsoft | | Yes | No | +| [HammerDB](#hammerdb) | No | No | [T] | [HammerDB] | 2015-05-04 | Open Source | | Yes | No | +| [Exchange Server Error Code Look-up](#error-code-look-up) | No | No | [?] | [Exchange Server Error Code Look-up] | 2004-05-10 | Microsoft | | Yes | No | +| [LINQPad](#linqpad) | No | No | [?] | [LINQPad] | 2016-01-02 | Joseph Albahari | | Non-commercial | $45 | +| [SqlDynamite](#sqldynamite) | No | No | [S] | [SqlDynamite] | 2016-04-06 | Anatoly Sova | | Yes | No | +| [SQL Server Data Tools](#ssdt) | No | No | [MS] | [SQL Server Data Tools] | 2018-04-10 | Microsoft | | Yes | No | +| [Database Health Monitor](#database-health-monitor) | No | No | [M] | [Database Health Monitor] | 2019-12-01 | Steve Stedman | | Yes | No | +| [SchemaDrift](#schemadrift) | No | No | [SC] | [SchemaDrift] | 2016-02-28 | Steve Stedman | | Yes | No | +| [Dbeaver](#dbeaver) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [MS] | [Dbeaver] | 2020-11-29 | Open Source | | Yes | No | +| [HeidiSQL](#heidisql) | MySQL,PostgreSQL,Other | No | [MS] | [HeidiSQL] | 2020-11-02 | Open Source | | Yes | No | +| [SQLExecStats](#sqlexecstats) | No | No | [ST] | [SQLExecStats] | 2016-02-08 | Joe Chang | | Yes | No | +| [ExpressProfiler](#expressprofiler) | No | No | [?] | [ExpressProfiler] | 2016-02-15 | Chris Moore | | Yes | No | +| [Data Migration Assistant](#data-migration-assistant) | No | No | [MG] | [Data Migration Assistant] | 2020-04-23 | Microsoft | | Yes | No | +| [SQL Server Migration Assistant for Sybase](#sybasetosql) | No | No | [MG] | [Migration Assistant for Sybase] | 2017-02-17 | Microsoft | | Yes | No | +| [dta Utility](#dta-utility) | No | No | [I] | [dta Utility] | - | Microsoft | | Yes | No | +| [osql Utility](#osql-utility) | No | No | [I] | [osql Utility] | - | Microsoft | | Yes | No | +| [sqldiag Utility](#sqldiag-utility) | No | No | [I] | [sqldiag Utility] | - | Microsoft | | Yes | No | +| [sqldumper Utility](#sqldumper-utility) | No | No | [I] | [sqldumper Utility] | - | Microsoft | | Yes | No | +| [SqlLocalDB Utility](#sqllocaldb-utility) | No | No | [I] | [SqlLocalDB Utility] | - | Microsoft | | Yes | No | +| [sqllogship Utility](#sqllogship-utility) | No | No | [I] | [sqllogship Utility] | - | Microsoft | | Yes | No | +| [sqlservr Application](#sqlservr-application) | No | No | [I] | [sqlservr Application] | - | Microsoft | | Yes | No | +| [sqlps Utility](#sqlps-utility) | No | No | [I] | [sqlps Utility] | - | Microsoft | | Yes | No | +| [sqlmaint Utility](#sqlmaint-utility) | No | No | [I] | [sqlmaint Utility] | - | Microsoft | | Yes | No | +| [SSMS Utility](#ssms-utility) | No | No | [I] | [SSMS Utility] | - | Microsoft | | Yes | No | +| [dtexec Utility](#dtexec-utility) | No | No | [I] | [dtexec Utility] | - | Microsoft | | Yes | No | +| [adutil Utility](#adutil-utility) | No | Linux | [I] | [adutil Utility] | 2020-10-30 | Microsoft | | Yes | No | +| [SQL Server 2016 Report Builder](#report-builder-2016) | No | No | [?] | [SQL Server 2016 Report Builder] | 2016-09-16 | Microsoft | | Yes | No | +| [SQL Server 2005 Best Practices Analyzer](#bpa-2005) | No | No | [?] | [BPA 2005] | 2008-08-13 | Microsoft | | Yes | No | +| [SQL Server 2000 Best Practices Analyzer](#bpa-2000) | No | No | [?] | [BPA 2000] | 2010-04-26 | Microsoft | | Yes | No | +| [SQL Server 2008 R2 Best Practices Analyzer](#bpa-2008) | No | No | [?] | [BPA 2008] | 2010-06-18 | Microsoft | | Yes | No | +| [SQL Server 2012 Best Practices Analyzer](#bpa-2012) | No | No | [?] | [BPA 2012] | 2012-06-04 | Microsoft | | Yes | No | +| [Elastic database tools](#elastic-database-tools) | No | No | [?] | [Elastic database tools] | ? | Microsoft | | Yes | No | +| [Microsoft Sync Framework](#microsoft-sync-framework) | No | No | [?] | [Microsoft Sync Framework] | 2020-04-22 | Microsoft | | Yes | No | +| [Query Performance Insight for Azure SQL Database](#query-perf) | No | No | [?] | [Query Performance Insight for Azure SQL Database] | ? | Microsoft | | Yes | No | +| [Microsoft Assessment and Planning (MAP) Toolkit](#map) | No | No | [MG] | [Microsoft Assessment and Planning (MAP) Toolkit] | 2020-05-26 | Microsoft | | Yes | No | +| [DLM Dashboard](#dlm-dashboard) | No | No | [M] | [DLM Dashboard] | 2016-04-27 | Red Gate | | Yes | No | +| [Red Gate SQL Compare](#red-gate-sql-compare) | No | No | [DC] | [Red Gate SQL Compare] | 2016-10-31 | Red Gate | | No | $495 | +| [Red Gate SQL Data Compare](#red-gate-sql-data-compare) | No | No | [SC] | [Red Gate SQL Data Compare] | 2016-05-09 | Red Gate | | No | $495 | +| [Red Gate SQL Monitor](#red-gate-sql-monitor) | No | No | [M] | [Red Gate SQL Monitor] | 2015-10-15 | Red Gate | | No | $1495 | +| [Red Gate SQL Backup Pro](#red-gate-sql-backup-pro) | No | No | [B] | [Red Gate SQL Backup Pro] | 2014-07-08 | Red Gate | | No | $995 | +| [Red Gate SQL Doc](#red-gate-sql-doc) | No | No | [D] | [Red Gate SQL Doc] | 2016-04-26 | Red Gate | | No | $369 | +| [Red Gate SQL Data Generator](#red-gate-sql-data-generator) | No | No | [G] | [Red Gate SQL Data Generator] | 2016-04-26 | Red Gate | | No | $369 | +| [Red Gate SQL Dependency Tracker](#sql-dependency-tracker) | No | No | [?] | [Red Gate SQL Dependency Tracker] | 2016-04-26 | Red Gate | | No | $369 | +| [Red Gate SQL Multi Script](#red-gate-sql-multi-script) | No | No | [?] | [Red Gate SQL Multi Script] | 2016-04-15 | Red Gate | | No | $245 | +| [Red Gate SQL Index Manager](#red-gate-sql-index-manager) | No | No | [IDX] | [Red Gate SQL Index Manager] | ? | Red Gate | | No | $149 | +| [Red Gate SQL Comparison SDK](#red-gate-sql-comparison-sdk) | No | No | [DC],[SC]| [Red Gate SQL Comparison SDK] | 2016-02-22 | Red Gate | | No | $895 | +| [Red Gate SQL Clone](#red-gate-sql-clone) | No | No | [?] | [Red Gate SQL Clone] | 2017-02-27 | Red Gate | | No | $6955 | +| [Red Gate SQL Provision](#red-gate-sql-provision) | No | No | [?] | [Red Gate SQL Provision] | 2018-02-26 | Red Gate | | No | $2955 | +| [Red Gate Data Masker](#red-gate-data-masker) | Oracle | No | [?] | [Red Gate SQL Data Masker] | 2018-02-26 | Red Gate | | No | $2395 | +| [DLM Automation](#dlm-automation) | No | No | [?] | [DLM Automation] | ? | Red Gate | | No | ? | +| [ReadyRoll](#readyroll) | No | No | [?] | [ReadyRoll] | 2016-01-03 | Red Gate | | No | $345 | +| [Rapid Database Extractor](#rapid-database-extractor) | Oracle | No | [?] | [Rapid Database Extractor] | 2016-11-03 | Idera | | Yes | No | +| [SQL XEvent Profiler](#sql-xevent-profiler) | No | No | [?] | [SQL XEvent Profiler] | 2014-03-14 | Idera | | Yes | No | +| [SQL Check](#sql-check) | No | No | [?] | [SQL Check] | 2015-09-24 | Idera | | Yes | No | +| [SQL Fragmentation Analyzer](#sql-fragmentation-analyzer) | No | No | [?] | [SQL Fragmentation Analyzer] | 2012-11-16 | Idera | | Yes | No | +| [SQL Heat Map](#sql-heat-map) | No | No | [?] | [SQL Heat Map] | 2016-01-27 | Idera | | Yes | No | +| [SQL Hekaton Memory Check](#sql-hekaton-memory-check) | No | No | [?] | [SQL Hekaton Memory Check] | 2015-06-10 | Idera | | Yes | No | +| [SQL Page Viewer](#sql-page-viewer) | No | No | [?] | [SQL Page Viewer] | 2014-08-25 | Idera | | Yes | No | +| [SQL Update Statistics](#sql-update-statistics) | No | No | [ST] | [SQL Update Statistics] | 2015-12-14 | Idera | | Yes | No | +| [SQL Statistics Aggregator](#sql-statistics-aggregator) | No | No | [ST] | [SQL Statistics Aggregator] | 2015-05-18 | Idera | | Yes | No | +| [SQL Backup Status Reporter](#sql-backup-status-reporter) | No | No | [B] | [SQL Backup Status Reporter] | 2015-08-07 | Idera | | Yes | No | +| [SQL Integrity Check](#sql-integrity-check) | No | No | [?] | [SQL Integrity Check] | 2013-08-26 | Idera | | Yes | No | +| [SQL Job Manager](#sql-job-manager) | No | No | [J] | [SQL Job Manager] | 2012-03-19 | Idera | | Yes | No | +| [Azure SQL Database Backup](#azure-sql-database-backup) | No | No | [B] | [Azure SQL Database Backup] | 2012-10-02 | Idera | | Yes | No | +| [SQL Column Search](#sql-column-search) | No | No | [S] | [SQL Column Search] | 2015-11-17 | Idera | | Yes | No | +| [SQL Permissions Extractor](#sql-permissions-extractor) | No | No | [?] | [SQL Permissions Extractor] | 2015-08-07 | Idera | | Yes | No | +| [SQL BI Check](#sql-bi-check) | No | No | [BI] | [SQL BI Check] | 2016-04-13 | Idera | | Yes | No | +| [SQL Inventory Check](#sql-inventory-check) | No | No | [?] | [SQL Inventory Check] | 2016-03-24 | Idera | | Yes | No | +| [SQL Diagnostic Manager](#sql-diagnostic-manager) | No | No | [?] | [SQL Diagnostic Manager] | ? | Idera | | No | $1747 | +| [SQL Safe Backup](#sql-safe-backup) | No | No | [B] | [SQL Safe Backup] | 2016-09-08 | Idera | | No | $907 | +| [SQL Compliance Manager](#sql-compliance-manager) | No | No | [?] | [SQL Compliance Manager] | 2015-09-08 | Idera | | No | $2657 | +| [SQL Inventory Manager](#sql-inventory-manager) | No | No | [?] | [SQL Inventory Manager] | 2016-04-22 | Idera | | No | $3195 | +| [SQL Virtual Database](#sql-virtual-database) | No | No | [?] | [SQL Virtual Database] | 2016-03-24 | Idera | | No | $625 | +| [SQL Secure](#sql-secure) | No | No | [?] | [SQL Secure] | 2016-04-19 | Idera | | No | $907 | +| [SQL Doctor](#sql-doctor) | No | No | [?] | [SQL Doctor] | 2015-12-17 | Idera | | No | $625 | +| [SQL Admin Toolset](#sql-admin-toolset) | No | No | [?] | [SQL Admin Toolset] | 2016-01-13 | Idera | | No | $395 | +| [SQL Defrag Manager](#sql-defrag-manager) | No | No | [?] | [SQL Defrag Manager] | 2016-03-10 | Idera | | No | $1495 | +| [DBArtisan](#dbartisan) | No | No | [?] | [DBArtisan] | ? | Idera | | No | $3122 | +| [SQL BI Manager](#sql-bi-manager) | No | No | [BI] | [SQL BI Manager] | 2015-09-08 | Idera | | No | $697 | +| [SQL Enterprise Job Manager](#sql-enterprise-job-manager) | No | No | [J] | [SQL Enterprise Job Manager] | 2015-09-08 | Idera | | No | $697 | +| [DB Optimizer](#db-optimizer) | No | No | [?] | [DB Optimizer] | ? | Idera | | No | $1420 | +| [SQL Query Store Optimizer](#sql-query-store-optimizer) | No | No | [?] | [SQL Query Store Optimizer] | 2016-07-01 | Idera | | Yes | No | +| [Rapid SQL](#rapid-sql) | Oracle,MySQL,PostgreSQL,Other | No | [MS] | [Rapid SQL] | ? | Idera | | No | $710 | +| [SQL Comparison Toolset](#sql-comparison-toolset) | No | No | [DC],[SC]| [SQL Comparison Toolset] | ? | Idera | | No | $745 | +| [ER/Studio Data Architect](#erstudio-data-architect) | Oracle,MySQL,PostgreSQL,Other | No | [DA] | [ER/Studio Data Architect] | | Idera | | No | $1287 | +| [DB Change Manager](#db-change-manager) | Oracle,MySQL,PostgreSQL,Other | No | [SC] | [DB Change Manager] | ? | Idera | | No | $1420 | +| [Uptime Infrastructure Monitor](#uim) | No | Linux | [?] | [Uptime Infrastructure Monitor] | ? | Idera | | No | ? | +| [Powershell Scripts](#powershell-scripts) | No | No | [?] | [Powershell Scripts] | ? | Idera | | No | ? | +| [SQL Data Profiler](#sql-data-profiler) | No | No | [?] | [SQL Data Profiler] | ? | Idera | | No | ? | +| [SQL Instance Check](#sql-instance-check) | No | No | [M] | [SQL Instance Check] | ? | Idera | | Yes | ? | +| [dbForge Schema Compare](#dbforge-schema-compare) | No | No | [SC] | [dbForge Schema Compare] | 2019-10-10 | Devart | Shareware | No | $150 | +| [dbForge Data Compare](#dbforge-data-compare) | No | No | [DC] | [dbForge Data Compare] | 2019-10-10 | Devart | Shareware | No | $150 | +| [dbForge Data Generator](#dbforge-data-generator) | No | No | [G] | [dbForge Data Generator] | 2019-10-10 | Devart | Shareware | No | $250 | +| [dbForge Query Builder](#dbforge-query-builder) | No | No | [?] | [dbForge Query Builder] | 2019-10-10 | Devart | Shareware | No | $100 | +| [dbForge Event Profiler](#dbforge-event-profiler) | No | No | [M] | [dbForge Event Profiler] | 2019-10-10 | Devart | Freeware | Yes | No | +| [dbForge SQL Decryptor](#dbforge-sql-decryptor) | No | No | [SEC] | [dbForge SQL Decryptor] | 2017-09-19 | Devart | Freeware | Yes | No | +| [dbForge Studio](#dbforge-studio) | No | No | [MS] | [dbForge Studio] | 2019-10-10 | Devart | Shareware | Yes | $250 | +| [dbForge Fusion](#dbforge-fusion) | No | No | [?] | [dbForge Fusion] | 2019-11-08 | Devart | Shareware | No | $150 | +| [dbForge Documenter](#dbforge-documenter) | No | No | [D] | [dbForge Documenter] | 2020-04-23 | Devart | Shareware | No | $150 | +| [dbForge SSIS Data Flow Components](#dbforge-ssis) | Oracle,MySQL,PostgreSQL,Other | No | [?] | [dbForge SSIS Data Flow Components] | 2020-03-31 | Devart | Shareware | No | $500 | +| [dbForge DevOps Automation for SQL Server](#dbforge-devops) | No | No | [?] | [dbForge DevOps Automation for SQL Server] | 2020-01-27 | Devart | Shareware | No | $900 | +| [dbForge Complete](#dbforge-complete) | No | No | [?] | [dbForge Complete] | 2020-09-01 | Devart | Shareware | No | $199 | +| [dbForge SQL Azure Backup](#dbforge-sql-azure-backup) | No | No | [B] | [dbForge SQL Azure Backup] | 2013-04-18 | Devart | Freeware | Yes | No | +| [Devart Transaction Log](#devart-transaction-log) | No | No | [B] | [Devart Transaction Log] | 2020-10-19 | Devart | Freeware | No | $600 | +| [Devart Excel Add-in for SQL Server](#devart-excel-addin) | No | No | [?] | [Devart Excel Add-in for SQL Server] | 2020-04-13 | Devart | Shareware | No | $250 | +| [dbMonitor](#dbmonitor) | Oracle,MySQL,PostgreSQL,Other | No | [M] | [dbMonitor] | 2012-11-01 | Devart | Freeware | Yes | No | +| [SQL Server Compression Estimator](#compression-estimator) | No | No | [?] | [SQL Server Compression Estimator] | 2011-06-02 | Bob Tavlor | | Yes | No | +| [ClearTrace](#cleartrace) | No | No | [M] | [ClearTrace] | 2016-07-07 | Bill Graziano | | Yes | No | +| [ClearTraceXE](#cleartracexe) | No | No | [M] | [ClearTraceXE] | 2019-09-04 | Bill Graziano | | Yes | No | +| [Security Explorer](#security-explorer) | No | No | [SEC] | [Security Explorer] | 2015-06-25 | Quest Software | | No | $850 | +| [LiteSpeed for SQL Server](#litespeed-for-sql-server) | No | No | [?] | [LiteSpeed for SQL Server] | 2015-07-31 | Quest Software | | No | ? | +| [Toad for SQL Server](#toad-for-sql-server) | No | No | [MS] | [Toad for SQL Server] | 2015-05-12 | Quest Software | | No | ? | +| [Quest Spotlight on SQL Server Enterprise](#quest-spotlight) | No | No | [?] | [Quest Spotlight] | 2016-03-10 | Quest Software | | No | $2561 | +| [Quest Foglight](#quest-foglight) | Oracle,MySQL,PostgreSQL,Other | No | [?] | [Quest Foglight] | 2019-08-29 | Quest Software | | No | $8203 | +| [Quest Enterprise Reporter](#quest-enterprise-reporter) | No | No | [?] | [Quest Enterprise Reporter] | ? | Quest Software | | No | $511 | +| [SQL Scripter](#sql-scripter) | No | No | [?] | [SQL Scripter] | 2013-02-24 | Thomas Hinsenkamp | | No | €99 | +| [Simple Dynamic Scheduler](#simple-dynamic-scheduler) | No | No | [?] | [Simple Dynamic Scheduler] | 2016-05-02 | Miljan Radovic | | Yes | No | +| [ApexSQL Audit](#apexsql-audit) | No | No | [?] | [ApexSQL Audit] | 2017-07-11 | ApexSQL | | No | $1699 | +| [ApexSQL Backup](#apexsql-backup) | No | No | [B] | [ApexSQL Backup] | 2017-10-12 | ApexSQL | | No | $499 | +| [ApexSQL Defrag](#apexsql-defrag) | No | No | [IDX] | [ApexSQL Defrag] | 2017-06-29 | ApexSQL | | No | $499 | +| [ApexSQL Log](#apexsql-log) | No | No | [?] | [ApexSQL Log] | 2017-05-24 | ApexSQL | | No | $1999 | +| [ApexSQL Monitor](#apexsql-monitor) | No | No | [M] | [ApexSQL Monitor] | 2017-10-05 | ApexSQL | | No | $499 | +| [ApexSQL Plan](#apexsql-plan) | No | No | [?] | [ApexSQL Plan] | 2019-12-02 | ApexSQL | | Yes | No | +| [ApexSQL Propagate](#apexsql-propagate) | No | No | [?] | [ApexSQL Propagate] | 2020-02-19 | ApexSQL | | Yes | No | +| [ApexSQL Recover](#apexsql-recover) | No | No | [REC] | [ApexSQL Recover] | 2017-10-26 | ApexSQL | | No | $1999 | +| [ApexSQL Build](#apexsql-build) | No | No | [?] | [ApexSQL Build] | 2017-05-15 | ApexSQL | | No | $399 | +| [ApexSQL Clean](#apexsql-clean) | No | No | [?] | [ApexSQL Clean] | 2017-09-28 | ApexSQL | | No | $399 | +| [ApexSQL Data Diff](#apexsql-data-diff) | No | No | [DC] | [ApexSQL Data Diff] | 2017-10-26 | ApexSQL | | No | $399 | +| [ApexSQL Decrypt](#apexsql-decrypt) | No | No | [SEC] | [ApexSQL Decrypt] | 2020-03-12 | ApexSQL | | Yes | No | +| [ApexSQL Diff](#apexsql-diff) | No | No | [SC] | [ApexSQL Diff] | 2017-10-26 | ApexSQL | | No | $399 | +| [ApexSQL Doc](#apexsql-doc) | No | No | [D] | [ApexSQL Doc] | 2017-09-06 | ApexSQL | | No | $299 | +| [ApexSQL Generate](#apexsql-generate) | No | No | [G] | [ApexSQL Generate] | 2017-07-13 | ApexSQL | | No | $499 | +| [ApexSQL Script](#apexsql-script) | No | No | [?] | [ApexSQL Script] | 2016-05-10 | ApexSQL | | No | $249 | +| [ApexSQL Trigger](#apexsql-trigger) | No | No | [?] | [ApexSQL Trigger] | 2017-06-01 | ApexSQL | | No | $1999 | +| [ApexSQL Trigger Veiwer](#apexsql-trigger-viewer) | No | No | [?] | [ApexSQL Trigger Viewer] | 2017-06-01 | ApexSQL | | Yes | No | +| [ApexSQL Snapshot Utility](#apexsql-snapshot-utility) | No | No | [?] | [ApexSQL Snapshot Utility] | 2016-01-12 | ApexSQL | | Yes | No | +| [ApexSQL Model](#apexsql-model) | No | No | [DA] | [ApexSQL Model] | 2019-05-22 | ApexSQL | | Yes | No | +| [ApexSQL Analyze](#apexsql-analyze) | No | No | [?] | [ApexSQL Analyze] | 2017-12-13 | ApexSQL | | No | $299 | +| [ApexSQL BI Monitor](#apexsql-bi-monitor) | No | No | [BI],[M] | [ApexSQL BI Monitor] | 2018-05-18 | ApexSQL | | No | $499 | +| [ApexSQL VM Monitor](#apexsql-vm-monitor) | No | No | [M] | [ApexSQL VM Monitor] | 2018-05-09 | ApexSQL | | No | $999 | +| [ApexSQL Job](#apexsql-job) | No | No | [J] | [ApexSQL Job] | 2018-03-29 | ApexSQL | | No | $499 | +| [ApexSQL Enforce](#apexsqlL-enforce) | No | No | [?] | [ApexSQL Enforce] | 2018-07-19 | ApexSQL | | No | $299 | +| [ApexSQL CI/CD toolkit](#apexsql-ci-cd) | No | No | [?] | [ApexSQL CI/CD toolkit] | 2020-05-21 | ApexSQL | | Yes | No | +| [ApexSQL Compare](#apexsql-compare) | No | No | [?] | [ApexSQL Compare] | 2020-03-17 | ApexSQL | | Yes | No | +| [ApexSQL Complete](#apexsql-complete) | No | No | [?] | [ApexSQL Complete] | 2020-05-28 | ApexSQL | | Yes | No | +| [ApexSQL Refactor](#apexsql-refactor) | No | No | [?] | [ApexSQL Refactor] | 2020-06-09 | ApexSQL | | Yes | No | +| [ApexSQL Search](#apexsql-search) | No | No | [S] | [ApexSQL Search] | 2020-07-30 | ApexSQL | | Yes | No | +| [ApexSQL Source Control](#apexsql-source-control) | No | No | [?] | [ApexSQL Source Control] | 2020-01-20 | ApexSQL | | No | $299 | +| [DBBest T-SQL Analyzer](#dbbest-t-sql-analyzer) | No | No | [?] | [DBBest T-SQL Analyzer] | 2015-03-13 | DBBest | | No | $89 | +| [DBBest Database Compare Suite](#dbbest-database-compare-suite) | No | No | [SC],[DC]| [DBBest Database Compare Suite] | 2015-09-04 | DBBest | | No | $349 | +| [Advanced Query Tool](#advanced-query-tool) | No | No | [?] | [Advanced Query Tool] | 2015-03-18 | Cardett Associates | | No | $180 | +| [SqlDiffFramework](#sqldiffframework) | No | No | [SC] | [SqlDiffFramework] | 2012-04-17 | Michael Sorens | | Yes | No | +| [DataGrip](#datagrip) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [MS] | [DataGrip] | 2017-02-21 | Jet Brains | | No | $89 | +| [Pssdiag and Sqldiag Manager](#pssdiag-and-sqldiag-manager) | No | No | [?] | [Pssdiag and Sqldiag Manager] | 2017-01-06 | Jack Li | | Yes | No | +| [SQL Nexus Tool](#sql-nexus-tool) | No | No | [?] | [SQL Nexus Tool] | 2016-11-20 | Jack Li | | Yes | No | +| [DBSophic Qure Profiler](#dbsophic-qure-profiler) | No | No | [?] | [DBSophic Qure Profiler] | ? | DBSophic | | No | $300 | +| [DBSophic Qure Optimizer](#dbsophic-qure-optimizer) | No | No | [?] | [DBSophic Qure Optimizer] | ? | DBSophic | | No | ? | +| [RestoreChecker](#restorechecker) | No | No | [?] | [RestoreChecker] | 2015-01-15 | SQLServerUtilities | | No | $99 | +| [SQLScripter](#sqlscripter) | No | No | [?] | [SQLScripter] | 2009-08-24 | SQLServerUtilities | | No | $99 | +| [SQLC](#sqlc) | No | No | [DC],[SC]| [SQLC] | 2017-11-19 | David Ingleton | | Yes | No | +| [Database Performance Analyzer](#dpa-solarwinds) | Oracle, MySQL, Other | Linux | [M] | [Database Performance Analyzer] | ? | SolarWinds | | No | $1995 | +| [Database Performance Analyzer for MSSQL](#dpa-solarwinds-mssql) | No | No | [M] | [Database Performance Analyzer for MSSQL] | ? | SolarWinds | | No | $1995 | +| [SQL Enlight](#sql-enlight) | No | No | [MS] | [SQL Enlight] | 2016-04-25 | UbitSoft | | No | $295 | +| [Aireforge Studio](#aireforge-studio) | No | No | [MG],[SC]| [Aireforge Studio] | 2019-08-08 | AireForge | | Yes | $299 | +| [HexaTier](#hexatier) | No | No | [?] | [HexaTier] | ? | HexaTier | | No | ? | +| [SoftTree SQL Assistant](#softtree-sql-assistant) | Oracle,MySQL,PostgreSQL,Other | No | [MS] | [SoftTree SQL Assistant] | 2017-12-17 | SoftTree | | No | $215 | +| [DB Audit and Security 360](#db-audit-and-security-360) | Oracle,MySQL,Other | No | [SEC] | [DB Audit and Security 360] | 2015-02-07 | SoftTree | | No | $499 | +| [EMS SQL Management Studio](#ems-management-studio) | No | No | [MS] | [EMS SQL Management Studio] | 2016-05-26 | EMS | | No | $257 | +| [EMS SQL Backup](#ems-sql-backup) | No | No | [B] | [EMS SQL Backup] | 2016-04-13 | EMS | | Yes | $82 | +| [EMS SQL Administrator](#ems-sql-administrator) | No | No | [?] | [EMS SQL Administrator] | 2015-04-14 | EMS | | Yes | $135 | +| [EMS SQL Manager](#ems-sql-manager) | No | No | [?] | [EMS SQL Manager] | 2016-05-26 | EMS | | Yes | $135 | +| [EMS Data Export](#ems-data-export) | No | No | [?] | [EMS Data Export] | 2016-04-29 | EMS | | No | $47 | +| [EMS Data Import](#ems-data-import) | No | No | [?] | [EMS Data Import] | 2016-04-14 | EMS | | No | $47 | +| [EMS Data Pump](#ems-data-pump) | No | No | [?] | [EMS Data Pump] | 2016-11-03 | EMS | | No | $47 | +| [EMS Data Generator](#ems-generator) | No | No | [G] | [EMS Data Generator] | 2010-07-10 | EMS | | No | $47 | +| [EMS DB Comparer](#ems-bd-comparer) | No | No | [SC] | [EMS DB Comparer] | 2015-07-24 | EMS | | No | $47 | +| [EMS DB Extract](#ems-bd-extract) | No | No | [?] | [EMS DB Extract] | 2008-10-16 | EMS | | No | $47 | +| [EMS SQL Query](#ems-sql-query) | No | No | [?] | [EMS SQL Query] | 2012-03-29 | EMS | | No | $47 | +| [EMS Data Comparer](#ems-data-comparer) | No | No | [DC] | [EMS Data Comparer] | 2012-11-16 | EMS | | No | $47 | +| [NitroAccelerator](#nitroaccelerator) | No | No | [?] | [NitroAccelerator] | 2016-07-10 | Nitrosphere | | No | $1265 | +| [ERwin Data Modeler](#erwin-data-modeler) | Oracle,MySQL,PostgreSQL,Other | No | [DA] | [ERwin Data Modeler] | 2016-06-03 | ERwin | | No | $810 | +| [Luna Modeler](#luna-modeler) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [DA] | [Luna Modeler] | 2022-10-05 | Ideamerit | | No | $99 | +| [Toad Data Point](#toad-data-point) | Oracle,MySQL,PostgreSQL,Other | No | [?] | [Toad Data Point] | 2016-06-16 | Quest Software | | No | ? | +| [SQL Power Architect](#sql-power-architect) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [DA] | [SQL Power Architect] | 2016-02-11 | SQLPower | | Yes | $995 | +| [DbWrench](#dbwrench) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [DA] | [DbWrench] | 2019-09-17 | Nizana Systems | | No | $99 | +| [Navicat Data Modeler](#navicat-data-modeler) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [DA] | [Navicat Data Modeler] | 2016-08-01 | PremiumSoft | | No | $199 | +| [DeZign for Databases](#dezign-for-databases) | Oracle,MySQL,PostgreSQL,Other | No | [DA] | [DeZign for Databases] | 2019-04-01 | Datanamic | | No | €29/mo| +| [ERDesigner NG](#erdesigner-ng) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [DA] | [ERDesigner NG] | 2013-04-10 | Mirko Sertic | | Open Source | No | +| [Vertabelo](#vertabelo) | Oracle,MySQL,PostgreSQL,Other | Online | [DA] | [Vertabelo] | ? | Vertabelo | | No | $948 | +| [dbDiffo](#dbdiffo) | Oracle,MySQL,PostgreSQL,Other | Online | [DA] | [dbDiffo] | ? | Contenet Ltd | | Yes | No | +| [SQL DXP](#sql-dxp) | Oracle,MySQL | No | [DC],[SC]| [SQL DXP] | 2016-06-20 | SQL Delta | | No | $530 | +| [Aqua Data Studio](#aqua-data-studio) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [MS] | [Aqua Data Studio] | 2016-07-06 | AquaFold | | No | $499 | +| [RazorSQL](#razorsql) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [MS] | [RazorSQL] | 2019-09-26 | Richardson Software | | No | $100 | +| [SQL Pretty Printer](#sql-pretty-printer) | No | No | [?] | [SQL Pretty Printer] | 2016-02-19 | Gudu Software | | No | $50 | +| [Database .NET](#database-net) | Oracle,MySQL,PostgreSQL,Other | No | [MS],[SC]| [Database .NET] | 2018-08-20 | fish's dotNET | | Non-commercial | $69 | +| [dbMigration .NET](#dbmegration-net) | Oracle,MySQL,PostgreSQL,Other | No | [DC],[SC]| [dbMigration .NET] | 2018-08-20 | fish's dotNET | | Non-commercial | $49 | +| [Is It SQL](#is-it-sql) | No | No | [M] | [Is It SQL] | 2017-04-06 | Bill Graziano | | Non-commercial | No | +| [Database Experimentation Assistant](#dea) | No | No | [T] | [Database Experimentation Assistant] | 2020-03-20 | Microsoft | | Yes | No | +| [Data Platform Studio](#dps) | No | No | [MG] | [Data Platform Studio] | ? | Red Gate Software | | Yes | ? | +| [Flyway](#flyway) | Oracle,MySQL,PostgreSQL,Other | No | [MG] | [Flyway] | 2018-01-30 | boxfuse | [Apache] | Open Source | $950 | +| [Liquibase](#liquibase) | Oracle,MySQL,PostgreSQL,Other | No | [MG] | [Liquibase] | 2018-04-11 | Liquibase | [Apache] | Open Source | No | +| [My Batis](#my-batis) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [MG] | [My Batis] | 2018-03-20 | My Batis | [Apache] | Open Source | No | +| [SentryOne Plan Explorer](#sentryone-plan-explorer) | No | No | [?] | [SentryOne Plan Explorer] | 2017-05-25 | SentryOne | | Yes | No | +| [SQL Sentry](#sql-sentry) | No | No | [M] | [SQL Sentry] | 2016-12-07 | SentryOne | | No | ? | +| [DBmaestro TeamWork](#dbmaestro-teamwork) | Oracle | No | [?] | [DBmaestro TeamWork] | ? | DBmaestro | | No | ? | +| [xSQL Schema Compare](#xsql-schema-compare) | No | No | [SC] | [xSQL Schema Compare] | 2017-03-01 | xSQL Software | Shareware | Yes | $399 | +| [xSQL Data Compare](#xsql-data-compare) | No | No | [DK] | [xSQL Data Compare] | 2017-06-26 | xSQL Software | Shareware | Yes | $399 | +| [xSQL Script Executor](#xsql-script-executor) | MySQL,DB2,SQL Server CE | No | [?] | [xSQL Script Executor] | 2015-02-25 | xSQL Software | Freeware | Yes | $249 | +| [xSQL Builder](#xsql-builder) | No | No | [?] | [xSQL Builder] | 2017-03-15 | xSQL Software | Shareware | No | $799 | +| [xSQL Documenter](#xsql-documenter) | Oracle,MySQL,SQLite,Other | No | [D] | [xSQL Documenter] | 2017-01-04 | xSQL Software | Shareware | No | $199 | +| [xSQL Profiler](#xsql-profiler) | No | No | [?] | [xSQL Profiler] | 2017-06-28 | xSQL Software | Shareware | Yes | $999 | +| [xSQL Schema Compare SDK](#xsql-schema-compare-sdk) | No | No | [SC] | [xSQL Schema Compare SDK] | 2017-10-25 | xSQL Software | Shareware | No | $1499 | +| [xSQL RSS Reporter](#xsql-rss-reporter) | No | No | [D] | [xSQL RSS Reporter] | 2014-11-25 | xSQL Software | Shareware | No | $169 | +| [xSQL Database Searcher](#xsql-database-sercher) | No | No | [S] | [xSQL Database Searcher] | 2017-05-09 | xSQL Software | Freeware | Yes | No | +| [Cloud-based DB Monitoring Platform](#cbmp) | No | Mobile | [M] | [Cloud-based DB Monitoring Platform] | ? | SQLTreeo | | No | €180 | +| [SchemaCrawler](#schema-crawler) | Oracle,MySQL,PostgreSQL,Other | Yes | [D],[SC] | [SchemaCrawler] | 2017-02-27 | Sualeh Fatehi | | Open Source | No | +| [SA MaaS Microsoft SQL Server](#sa-maas) | No | No | [M] | [SA MaaS Microsoft SQL Server] | ? | SENTINELAGENT | | No | ? | +| [SSIS Framework](#ssis-framework) | No | No | [ETL] | [SSIS Framework] | 2017-01-07 | Andy Leonard | | Yes | ? | +| [SSIS Catalog Browser](#ssis-browser) | No | No | [ETL] | [SSIS Catalog Browser] | 2019-04-23 | Andy Leonard | | Yes | No | +| [BimlExpress Metadata Framework](#bimlexpress) | No | No | [?] | [BimlExpress Metadata Framework] | 2017-01-06 | Andy Leonard | | Yes | No | +| [MS Kerberos Configuration Manager](#mkcm) | No | No | [?] | [MS Kerberos Configuration Manager] | 2017-01-31 | Microsoft | | Yes | No | +| [Spotlight](#spotlight) | No | No | [M] | [Spotlight] | ? | Quest Software | | Yes | ? | +| [DBConvert Studio](#dbconvert-studio) | Oracle,MySQL,PostgreSQL,Other | No | [MG] | [DBConvert Studio] | 2020-05-11 | Slotix | | No | $499 | +| [DbDefence](#dbdefence) | No | No | [?] | [DbDefence] | 2017-03-01 | ActiveCrypt Software | | Yes | $698 | +| [SQL Server Migration Assistant for MySQL](#ssma-mysql) | MySQL | No | [MG] | [SQL Server Migration Assistant for MySQL] | 2017-02-17 | Microsoft | | Yes | No | +| [sqlcmd for Mac and Linux](#sqlcmd) | No | Linux,Mac | [?] | [sqlcmd for Mac and Linux] | 2017-01-26 | Soheil Rashidi | | Open Source | No | +| [SQL Migrator](#sql-migrator) | No | No | [MG] | [SQL Migrator] | ? | Datamate Technology | | ? | ? | +| [MS FoxPro to MS SQL Migration and Sync](#foxpro-sqlserver) | No | No | [MG] | [MS FoxPro to MS SQL Migration and Sync] | 2019-04-25 | Slotix | | No | $149 | +| [MySQL to MS SQL Migration and Sync](#mysql-sqlserver) | No | No | [MG] | [MySQL to MS SQL Migration and Sync] | 2018-10-03 | Slotix | | No | $149 | +| [Oracle to MS SQL Migration and Sync](#oracle-sqlserver) | No | No | [MG] | [Oracle to MS SQL Migration and Sync] | 2020-02-12 | Slotix | | No | $149 | +| [PostgreSQL to MS SQL Migration and Sync](#postgresql-sqlserver) | No | No | [MG] | [PostgreSQL to MS SQL Migration and Sync] | 2019-10-24 | Slotix | | No | $149 | +| [MS Excel to MS SQL Migration](#msexcel-sqlserver) | No | No | [MG] | [MS Excel to MS SQL Migration] | 2018-02-23 | Slotix | | No | $149 | +| [SQLite to MS SQL Migration and Sync](#sqllite-sqlserver) | No | No | [MG] | [SQLite to MS SQL Migration and Sync] | 2016-08-18 | Slotix | | No | $149 | +| [IBM DB2 to MS SQL Migration and Sync](#db2-sqlserver) | No | No | [MG] | [IBM DB2 to MS SQL Migration and Sync] | 2019-07-09 | Slotix | | No | $149 | +| [MS Access to MS SQL Migration and Sync](#access-sqlserver) | No | No | [MG] | [MS Access to MS SQL Migration and Sync] | 2020-01-15 | Slotix | | No | $149 | +| [Firebird to MS SQL Migration and Sync](#firebird-sqlserver) | No | No | [MG] | [Firebird to MS SQL Migration and Sync] | 2016-08-18 | Slotix | | No | $149 | +| [SQLines SQL Converter](#sqllines-converter) | No | No | [MG] | [SQLines SQL Converter] | ? | Dmtolpeko | | Open Source | No | +| [SQLite & SQL Server Compact Toolbox](#sqlite-sqlserver-toolbox) | No | No | [?] | [SQLite & SQL Server Compact Toolbox] | ? | ErikEJ | | Open Source | No | +| [SqlPad](#sqlpad) | Postgres,MySQL,Crate,Vertica | No | [MS] | [SqlPad] | ? | Rickbergfalk | | Open Source | No | +| [Html-query-plan](#html-query-plan) | No | No | [?] | [Html-query-plan] | ? | JustinPealing | | Open Source | No | +| [SqlQueryStress](#sql-query-stress) | No | No | [?] | [SqlQueryStress] | ? | Adam Machanic | | Open Source | No | +| [SQL Server Migration Assistant for DB2](#ssma-db2) | DB2 | No | [MG] | [SQL Server Migration Assistant for DB2] | 2017-02-17 | Microsoft | | Yes | No | +| [SQL Server Migration Assistant for Oracle](#ssma-oracle) | Oracle | No | [MG] | [SQL Server Migration Assistant for Oracle] | 2017-02-17 | Microsoft | | Yes | No | +| [SQL Server Migration Assistant for Access](#ssma-access) | Access | No | [MG] | [SQL Server Migration Assistant for Access] | 2017-02-17 | Microsoft | | Yes | No | +| [SQL Server Migration Assistant for SAP ASE](#ssma-sap) | SAP ASE | No | [MG] | [SQL Server Migration Assistant for SAP ASE] | 2020-06-29 | Microsoft | | Yes | No | +| [mssql for Visual Studio Code](#mssql-for-vs-code) | No | Linux,Mac | [MS] | [mssql for Visual Studio Code] | 2017-05-02 | Microsoft | | Open Source | No | +| [mssql-scripter](#mssql-scripter) | No | Linux,Mac | [?] | [mssql-scripter] | ? | Microsoft | | Open Source | No | +| [DBFS](#dbfs) | No | Linux | [M] | [DBFS] | ? | Microsoft | | Open Source | No | +| [comparator](#pumpet-comparator) | Oracle,MySQL,PostgreSQL,Other | No | [DC] | [comparator] | 2017-06-06 | Pumpet | [LGPL-3.0] | Open Source | No | +| [Navicat for SQL Server](#navicat-for-sql-server) | No | Mac | [MS] | [Navicat for SQL Server] | 2017-06-14 | PremiumSoft | | No | $699 | +| [Navicat Premium](#navicat-premium) | Oracle,MySQL,PostgreSQL,Other | Mac | [MS] | [Navicat Premium] | 2017-06-14 | PremiumSoft | | No | $1299 | +| [DbVisualizer](#dbvisualizer) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [MS],[DA]| [DbVisualizer] | 2017-08-22 | DbVis Software AB. | | Yes | $197 | +| [DbSchema](#dbschema) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [DA] | [DbSchema] | 2017-06-19 | Wise Coders Solutions | | Yes | $127 | +| [DBGhost](#dbghost) | No | No | [?] | [DBGhost] | 2017-01-31 | Innovartis Ltd | | No | £430 | +| [SQLAutomate](#sqlautomate) | Oracle,MySQL,Other | No | [?] | [SQLAutomate] | 2017-06-19 | OnLine ToolWorks     | | No | $99 | +| [BimlExpress](#bimlexpress) | No | No | [?] | [BimlExpress] | ? | Varigence   | | No | No | +| [BI Developer Extensions](#bi-developer-extensions) | No | No | [?] | [BI Developer Extensions] | 2019-04-29 | Microsoft   | | Open Source | No | +| [Azure Data Warehouse Migration Utility](#azure-migration) | No | No | [MG] | [Azure Data Warehouse Migration Utility] | ? | Microsoft | | ? | ? | +| [Benchmark Factory](#benchmark-factory) | Oracle,MySQL,Other | No | [T] | [Benchmark Factory] | ? | Quest Software | | No | $4413 | +| [manduka](#manduka) | Oracle | Linux,Mac | [?] | [manduka] | 2017-03-08 | Virtusa Corporation | | Yes | No | +| [PowerBI Desktop](#powerbi-desktop) | Oracle,MySQL,PostgreSQL,Other | No | [BI] | [PowerBI Desktop] | 2017-07-11 | Microsoft | | Yes | ? | +| [Stellar Phoenix SQL Database Repair](#stellar-phoenix) | No | No | [REC] | [Stellar Phoenix SQL Database Repair] | 2017-07-05 | Stellar Technology | | No | $349 | +| [DataNumen SQL Recovery](#datanumen-sql-recovery) | No | No | [REC] | [DataNumen SQL Recovery] | 2017-03-20 | DataNumen | | No | $500 | +| [Recovery Toolbox for SQL Server](#recovery-toolbox) | No | No | [REC] | [Recovery Toolbox for SQL Server] | ? | Recovery Toolbox | Shareware | No | $99 | +| [SQL MDF Viewer](#sql-mdf-viewer) | No | No | [?] | [SQL MDF Viewer] | ? | SysTools | Shareware | No | $129 | +| [SQL MDF Recovery Tool](#sql-mdf-recovery-tool) | No | No | [REC] | [SQL MDF Recovery Tool] | ? | SysTools | Shareware | No | $129 | +| [SQL Passord Recovery](#sql-password-recovery) | No | No | [REC] | [SQL Passord Recovery] | ? | SysTools | Shareware | No | $69 | +| [SQL Decryptor](#sql-decryptor) | No | No | [SEC] | [SQL Decryptor] | ? | SysTools | Shareware | No | $69 | +| [SQL Backup Database Recovery](#sql-backup-database-recovery) | No | No | [REC] | [SQL Backup Database Recovery] | ? | SysTools | Shareware | No | $149 | +| [SQL Log File Viewer](#sql-log-file-viewer) | No | No | [?] | [SQL Log File Viewer] | ? | SysTools | Shareware | No | $999 | +| [DAX Studio](#dax-studio) | No | No | [?] | [DAX Studio] | ? | Sqlbi | Freeware | Yes | No | +| [SQL Cop](#sql-cop) | No | No | [?] | [SQL Cop] | ? | LessThanDot | Freeware | Yes | No | +| [Dataedo](#dataedo) | Oracle,MySQL | No | [D] | [Dataedo] | 2017-09-15 | Logic Systems | Shareware | Yes | $239 | +| [Azure Database Migration Service](#azure-db-migration) | Oracle,MySQL, Other | Online | [MG] | [Azure Database Migration Service] | 2017-12-01 | Microsoft | | Yes | No | +| [FlowHeater](#flowheater) | Oracle,MySQL,PostgreSQL,Other | No | [ETL] | [FlowHeater] | 2017-10-02 | FlowHeater GmbH | Shareware | No | $79 | +| [EDIS](#edis) | No | No | [ETL] | [EDIS] | ? | SQL ETL | Shareware | Yes | $599 | +| [SchemaSpy](#schemaspy) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [D] | [SchemaSpy] | 2018-08-05 | Rafal Kasa | [MIT] | Open Source | No | +| [Adminer](#adminer) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [MS] | [Adminer] | 2019-08-27 | Jakub Vrána | [Apache] | Open Source | No | +| [Full Convert](#full-convert) | Oracle,MySQL,PostgreSQL,Other | No | [MG] | [Full Convert] | 2018-08-20 | Spectral Core | Shareware | Yes | $699 | +| [Replicator](#replicator) | Oracle,MySQL,PostgreSQL,Other | No | [DC] | [Replicator] | 2018-08-20 | Spectral Core | Shareware | Yes | $699 | +| [JackDB](#jackdb) | Oracle,MySQL,PostgreSQL,Other | Online | [MS] | [JackDB] | ? | JackDB | | No | $48 | +| [SQL Workbench](#sql-workbench) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [MS] | [SQL Workbench] | 2018-08-20 | Thomas Kellerer | | Yes | No | +| [Valentina Studio](#valentina-studio) | MySQL,PostgreSQL,Other | Linux,Mac | [MS] | [Valentina Studio] | 2018-09-24 | Paradigma Software | | Yes | $200 | +| [SQL Plus Dot Net](#sql-plus-dot-net) | No | No | [?] | [SQL Plus Dot Net] | ? | SQL+.NET | | No | ? | +| [SQLIndexManager](#sqlindexmanager) | No | No | [IDX] | [SQLIndexManager] | 2019-05-19 | Sergey Syrovatchenko | | Open Source | No | +| [JAMS Enterprise Job Scheduling](#jams-job) | No | No | [J] | [JAMS Enterprise Job Scheduling] | 2019-08-20 | HelpSystems | | No | ? | +| [Stitch Data Loader](#stitch) | Oracle,MySQL,PostgreSQL,Other | Online | [ETL] | [Stitch Data Loader] | 2019-09-20 | Talend | | No | ? | +| [Talend Data Integration](#talend-integration) | Oracle,MySQL,PostgreSQL,Other | Mac | [ETL] | [Talend Data Integration] | 2019-06-20 | Talend | [Apache] | Yes | ? | +| [Talend Data Preparation](#talend-preparation) | Oracle,MySQL,PostgreSQL,Other | Mac | [ETL] | [Talend Data Preparation] | 2018-06-05 | Talend | [Apache] | Yes | ? | +| [Pentaho Data Integration](#pentaho) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [ETL] | [Pentaho Data Integration] | 2019-06-20 | Hitachi Vantara | Shareware | No | ? | +| [Studio3T](#studio3t) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [MG] | [Studio3T] | 2019-09-19 | Studio 3T | Shareware | No | $150 | +| [SQLGrease](#sqlgrease) | No | Online | [M] | [SQLGrease] | 2019-09-20 | SQLGrease | Shareware | No | $948 | +| [QuickDBD](#quickdbd) | Oracle,MySQL,PostgreSQL,Other | Online | [DA] | [QuickDBD] | ? | Dovetail Technologies | | Yes | $95 | +| [DB Designer](#dbdesigner) | Oracle,MySQL,PostgreSQL,Other | Online | [DA] | [DB Designer] | ? | DB Designer | | Yes | $180 | +| [ESF Database Migration Toolkit](#esf) | Oracle,MySQL,PostgreSQL,Other | No | [MG] | [ESF Database Migration Toolkit] | 2019-10-23 | DBSofts Inc | Shareware | No | $322 | +| [MS SQL Migration Toolkit](#msskit) | Oracle,MySQL,PostgreSQL,Other | No | [MG] | [MS SQL Migration Toolkit] | 2019-04-22 | Intelligent Converters | Shareware | No | $99 | +| [DatabasesSpy](#databasespy) | Oracle,MySQL,PostgreSQL,Other | No | [MS] | [DatabaseSpy] | 2019-10-09 | Altova | Shareware | No | €109 | +| [DiffDog](#diffdog) | Oracle,MySQL,PostgreSQL,Other | No | [DC],[SC]| [DiffDog] | 2019-10-09 | Altova | Shareware | No | €109 | +| [ERBuilder data modeler](#erbuilder) | Oracle,MySQL,PostgreSQL,Other | No | [DA] | [ERBuilder data modeler] | 2019-11-14 | Softbuilder | | Yes | $99 | +| [SQLDatabaseStudio](#sqldatabasestudio) | No | No | [MS] | [SQLDatabaseStudio] | 2017-05-10 | Jan Pivarcek | | Yes | $215 | +| [Enterprise Architect](#ea) | Oracle,MySQL,PostgreSQL,Other | Online | [DA] | [Enterprise Architect] | 2019-10-31 | Sparx Systems Pty Ltd | Shareware | No | $225 | +| [MogwaiERDesignerNG](#mogwai) | Oracle,MySQL,PostgreSQL | No | [DA] | [MogwaiERDesignerNG] | 2019-08-22 | Mirko Sertic | [LGPL-3.0] | Open Source | No | +| [Xcase](#xcase) | Oracle,MySQL,PostgreSQL,Other | No | [DA] | [Xcase] | 2018-06-19 | Resolution Software | Shareware | No | $799 | +| [Oracle SQL Developer Data Modeler](#oracle-modeler) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [DA] | [Oracle SQL Developer Data Modeler] | 2019-08-01 | Oracle | Shareware | Yes | No | +| [Exportizer](#exportizer) | Oracle,MySQL,PostgreSQL,Other | No | [MG] | [Exportizer] | 2019-11-17 | Vitaliy Levchenko | Shareware | No | $29 | +| [Reportizer](#reportizer) | Oracle,MySQL,PostgreSQL,Other | No | [?] | [Reportizer] | 2019-09-10 | Vitaliy Levchenko | Shareware | No | $39 | +| [Database Tour](#database-tour) | Oracle,MySQL,PostgreSQL,Other | No | [MS] | [Database Tour] | 2019-11-20 | Vitaliy Levchenko | Shareware | No | $49 | +| [Ispirer MnMATK](#mnmatk) | Oracle,MySQL,PostgreSQL,Other | No | [MG] | [Ispirer MnMATK] | ? | Ispirer Systems | Shareware | No | ? | +| [SQL Database Recovery](#sql-database-recovery) | No | No | [REC] | [SQL Database Recovery] | 2019-09-10 | KernelApps Private | Shareware | No | $399 | +| [SysTools SQL Log Analyzer](#log-analzyer) | No | No | [M][REC] | [SysTools SQL Log Analyzer] | 2019-01-01 | SysTools | Shareware | No | $999 | +| [SysTools SQL Server Recovery Manager](#systools-rec-manager) | No | No | [REC] | [SysTools SQL Log Analyzer] | 2017-01-01 | SysTools | Shareware | No | $1499 | +| [SysTools SQL Recovery](#systools-recovery) | No | No | [REC] | [SysTools SQL Recovery] | 2019-01-01 | SysTools | Shareware | No | $249 | +| [SQL Backup Recovery](#systools-backup-recovery) | No | No | [REC] | [SQL Backup Recovery] | 2018-01-01 | SysTools | Shareware | No | $149 | +| [SysTools SQL Password Recovery](#systools-password-recovery) | No | No | [REC] | [SysTools SQL Password Recovery] | 2018-01-01 | SysTools | Shareware | No | $69 | +| [SysTools SQL Decryptor](#systools-sql-decryptor) | No | No | [SEC] | [SysTools SQL Decryptor] | 2019-01-01 | SysTools | Shareware | No | $69 | +| [SysTools SQL Server Database Migrator](#systools-migrator) | No | No | [MG] | [SysTools SQL Server Database Migrator] | 2018-01-01 | SysTools | Shareware | No | $249 | +| [SQL Server to Azure Database Migrator](#systools-azure) | No | No | [MG] | [SQL Server to Azure Database Migrator] | 2018-01-01 | SysTools | Shareware | No | $169 | +| [Commvault Complete Backup & Recovery](#commvault) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [B] | [Commvault Complete Backup & Recovery] | 2019-12-31 | Commvault | Shareware | No | ? | +| [Veeam Backup & Replication](#veeam) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [B] | [Veeam Backup & Replication] | 2019-12-31 | Veeam | Shareware | No | $600 | +| [Veeam Explorer for Microsoft SQL Server](#veeam-explorer) | ? | ? | [B] | [Veeam Explorer for Microsoft SQL Server] | ? | Veeam | Shareware | No | ? | +| [Database Modeling Excel](#database-modeling-excel) | Oracle,MySQL,PostgreSQL,Other | No | [DA] | [Database Modeling Excel] | ? | Yang Ning (Steven) | [BSD-3] | Open Source | No | +| [DBAchecks](#dbachecks) | No | No | [?] | [DBAchecks] | ? | sqlcollaborative | [MIT] | Open Source | No | +| [DBComparer](#dbcomparer) | No | No | [DC],[SC]| [DBComparer] | ? | DBComparer | | Yes | No | +| [DbViewSharp](#dbviewsharp) | No | No | [MS] | [DbViewSharp] | 2014-08-08 | David Moore | [MIT] | Yes | No | +| [DTSQL](#dtsql) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [?] | [DTSQL] | 2017-08-18 | DigerTech Inc | Shareware | Yes | $69 | +| [MSKerberos Configuration Manager](#mskerberos-config-manager) | No | No | [DC],[SC]| [MSKerberos Configuration Manager] | 2020-02-25 | Microsoft | | Yes | No | +| [Partition Management](#partition-management) | No | No | [?] | [Partition Management] | ? | ? | | Open Source | No | +| [PSDatabaseClone](#psdatabaseclone) | No | No | [?] | [PSDatabaseClone] | 2018-07-27 | Sander Stad | | Open Source | No | +| [Pssdiag&Sqldiag Manager](#pssdiag-sqldiag-manager) | No | No | [?] | [Pssdiag&Sqldiag Manager] | 2020-05-04 | Jack Li | | Open Source | No | +| [SQuirreL SQL Client](#squirrelsql-client) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [MS] | [SQuirreL SQL Client] | 2020-04-30 | Colin Bell | | Yes | No | +| [Data Synchronisation Studio](#data-synchronisation-studio) | No | No | [?] | [Data Synchronisation Studio] | 2020-05-26 | Simego Ltd | | No | $999 | +| [SQL Converter](#sql-converter) | No | No | [?] | [SQL Converter] | 2015-12-15 | Alaa Ben Fatma | | Yes | No | +| [SQLDBSearch](#sqldbsearch) | No | No | [S] | [SQLDBSearch] | ? | Mohamed Bouarroudj | | Yes | No | +| [SQLDBSize](#sqldbsize) | No | No | [?] | [SQLDBSize] | ? | Mohamed Bouarroudj | | Yes | No | +| [SQLines Data](#sqlines-data) | Oracle,MySQL,PostgreSQL,Other | Linux |[MG],[ETL]| [SQLines Data] | 2019-05-29 | SQLines | | Open Source | No | +| [SqlDbAid](#sqldbaid) | No | No | [?] | [SqlDbAid] | 2018-02-10 | Miken | | Yes | No | +| [sqlectron](#sqlectron) | Oracle,MySQL,PostgreSQL,Other | Linux,Mac | [?] | [sqlectron] | 2018-09-06 | sqlectron | | Open Source | No | +| [SQL ExecStats](#sql-execstats) | No | No | [?] | [SQL ExecStats] | ? | Elemental Inc | | Yes | No | +| [SQL-FineBuild](#sql-finebuild) | No | No | [?] | [SQL-FineBuild] | 2017-10-28 | Edward Vassie | | Open Source | No | +| [SQL Health Monitor](#sql-health-monitor) | No | No | [M] | [SQL Health Monitor] | ? | ManageEngine | | Yes | No | +| [SQLPRep](#sqlprep) | No | No | [?] | [SQLPRep] | ? | Consequential Solutions | | Yes | No | +| [SQL Server Monitoring](#sql-server-monitoring) | No | No | [M] | [SQL Server Monitoring] | ? | Spiceworks | | Yes | No | +| [SQL Server Storage manager](#sql-server-storage-manager) | No | No | [M] | [SQL Server Storage manager] | ? | Lepide Software | | Yes | No | +| [SysKit Pulse](#syskit-pulse) | No | No | [M] | [SysKit Pulse] | ? | SysKit Ltd | | Yes | No | +| [WhatsUp SQL Server Monitor](#whatsup-sql-server-monitor) | No | No | [M] | [WhatsUp SQL Server Monitor] | ? | Ipswitch | | Yes | No | +| [POPSQL](#popsql) | Oracle,MySQL,PostgreSQL,Other | Online | [MS] | [POPSQL] | 2020-08-01 | PopSQL | | Yes | $10 | +| [Azure Blob Studio 2011](#azure-blob-studio-2011) | No | No | [?] | [Azure Blob Studio 2011] | 2010-12-25 | Alessandro Del Sole | | Yes | No | +| [Azure Explorer](#azure-explorer) | No | No | [?] | [Azure Explorer] | ? | Monza Cloud | | Yes | No | +| [Azure SQL Agent](#azure-sql-agent) | No | No | [?] | [Azure SQL Agent] | ? | ? | [MIT] | Open Source | No | +| [Azure SQL Database DTU Calculator](#azure-sql-dtu-calculator) | No | No | [?] | [Azure SQL Database DTU Calculator] | ? | Justin Henriksen | [MIT] | Open Source | No | +| [Azure SQL Database Stress Test Tool](#azure-sql-stress-test) | No | No | [T] | [Azure SQL Database Stress Test Tool] | ? | Kiyoaki Tsurutani | [MIT] | Open Source | No | +| [Azure SQL Dev Cloner](#azure-sql-dev-cloner) | No | No | [?] | [Azure SQL Dev Cloner] | ? | ? | [MIT] | Open Source | No | +| [Azure User Management Console](#azure-user-management-console) | No | No | [?] | [Azure User Management Console] | ? | ? | [Apache] | Open Source | No | +| [CloudMonix SQL Azure Database Management](#cloudmonix-azure-man)| No | No | [?] | [CloudMonix SQL Azure Database Management] | ? | CloudMonix | | No | $15 | +| [DB Ghost Change Manager Professional](#db-ghost-change-manager) | No | No | [?] | [DB Ghost Change Manager Professional] | ? | Innovartis Ltd | | No | £430 | +| [MSSQL-Maestro](#mssql-maestro) | No | No | [MS] | [MSSQL-Maestro] | 2017-06-29 | SQL Maestro Group | | No | $229 | +| [MSSQLMerge](#mssqlmerge) | No | No | [DC],[SC]| [MSSQLMerge] | 2021-02-26 | Konstantin Semenenkov | | Yes | $75 | +| [SQL Backup and FTP](#sql-backup-and-ftp) | MySQL,PostgreSQL | Linux | [B] | [SQL Backup and FTP] | ? | Pranas.NET | | Yes | $129 | +| [SQL Bak](#sql-bak) | MySQL,PostgreSQL | Linux | [B] | [SQL Bak] | ? | Pranas.NET | | Yes | $9 | +| [SQL Bulk Tools](#sql-bulk-tools) | No | No | [?] | [SQL Bulk Tools] | ? | Greg Taylor | [MIT] | Open Source | No | +| [SQL Data Examiner](#sql-data-examiner) | Oracle,MySQL,PostgreSQL | No | [?] | [SQL Data Examiner] | ? | Intelligent Database Solutions | | No | $400 | +| [SQL Examiner](#sql-examiner) | Oracle,MySQL,PostgreSQL | No | [?] | [SQL Examiner] | ? | Intelligent Database Solutions | | No | $400 | +| [SQL Database Backup](#sql-database-backup) | No | No | [B] | [SQL Database Backup] | ? | Richard Astbury | [MIT] | Open Source | No | +| [SQL Database Copy](#sql-database-copy) | No | No | [MG] | [SQL Database Copy] | 2017-07-25 | ryanovic | [MIT] | Open Source | No | +| [SQL Delta Duo for SQL Server](#sql-delta-duo-for-sql-server) | No | No | [?] | [SQL Delta Duo for SQL Server] | ? | The Australian Software Company | | No | $370 | +| [SQL Trace Replay](#sql-trace-replay) | No | No | [?] | [SQL Trace Replay] | ? | Mikhail Shilkov | [MIT] | Open Source | No | +| [SQL Workload Profiler](#sql-workload-profiler) | No | No | [?] | [SQL Workload Profiler] | 2014-10-01 | Chris Bailiss | | Yes | No | +| [SQLDBdiff](#sqldbdiff) | No | Linux | [?] | [SQLDBdiff] | ? | SQLDBtools | | Yes | $60 | +| [SQL Backup Master](#sql-backup-master) | No | No | [B] | [SQL Backup Master] | ? | Key Metric Software | | Yes | $49 | +| [Handy Backup Server](#handy-backup-server) | Oracle,MySQL,PostgreSQL,Other | Linux | [B] | [Handy Backup Server] | 2019-03-11 | Novosoft | | No | $39 | +| [EaseUS Todo Backup Server](#easeus-todo-backup-server) | No | No | [B] | [EaseUS Todo Backup Server] | ? | EaseUS | | No | $39 | +| [SqlBackupFree](#sqlbackupfree) | No | No | [B] | [SqlBackupFree] | ? | pranas.net | | Yes | No | +| [ERDPlus](#erdplus) | No | No | [?] | [ERDPlus] | 2020-05-24 | ERDPlus | | ? | ? | +| [SentryOne Test](#sentryone-test) | No | No | [T] | [SentryOne Test] | ? | SQL Sentry | | No | $828 | +| [Code Quality and Security for T-SQL](#sonarsource) | No | No | [?] | [Code Quality and Security for T-SQL] | ? | SonarSource | | No | €120 | +| [DBBALANCE](#dbbalance) | Oracle,MySQL,PostgreSQL,Other | No | [?] | [DBBALANCE] | ? | DBBalance | | No | ? | +| [Convert SQL to Excel](#convert-sql-to-excel) | No | No | [?] | [Convert SQL to Excel] | 2015-10-09 | MSSQL.TOOLS | | Yes | No | +| [Search string in Schema](#search-string-in-schema) | No | No | [S] | [Search string in Schema] | 2015-10-09 | MSSQL.TOOLS | | Yes | No | +| [Search string in SQL](#search-string-in-sql) | No | No | [S] | [Search string in SQL] | 2015-10-09 | MSSQL.TOOLS | | Yes | No | +| [SQL Table Scripter](#sql-table-scripter) | No | No | [?] | [SQL Table Scripter] | 2015-10-09 | MSSQL.TOOLS | | Yes | No | +| [SQLCLR Util](#sqlclr-util) | No | No | [?] | [SQLCLR Util] | 2015-10-09 | MSSQL.TOOLS | | Yes | No | +| [Image To SQL](#image-to-sql) | No | No | [?] | [Image To SQL] | 2015-10-09 | MSSQL.TOOLS | | Yes | No | +| [dbdiagram](#dbdiagram) | No | No | [?] | [dbdiagram] | ? | holistics.io | | Yes | $9/mo | +| [Beekeeper Studio](#beekeeper) | MySQL,PostgreSQL,Other | Linux,Mac | [MS] | [Beekeeper Studio] | 2020-11-21 | Beekeeper Studio | [MIT] | Yes | No | +| [Babelfish for Aurora PostgreSQL](#babelfish) | No | Online | [?] | [Babelfish for Aurora PostgreSQL] | 2020-12-01 | Amazon | [Apache] | Open Source | No | +| [DBA Dash](#dbadash) | No | No | [M] | [DBA Dash] | - | Trimble | [MIT] | Open Source | No | +| [SQLWATCH](#sqlwatch) | No | No | [M] | [SQLWATCH] | - | Marcin Gminski | [MIT] | Open Source | No | ## SSMS Download page: [SSMS]
-Release date: 2018-12-21
+Release date: 2020-10-27
Support Version: 2005-2019/Azure
Author: Microsoft
Free version: Yes
@@ -317,6 +438,33 @@ SSMS combines a broad group of graphical tools with a number of rich script edit This release features improved compatibility with previous versions of SQL Server, a stand-alone web installer, and toast notifications within SSMS when new releases become available. + +## Azure Data Studio +Download page: [Azure Data Studio]
+Release date: 2020-11-12
+Support Version: 2008-2019/Azure
+Author: Microsoft
+Free version: Yes
+Price: No + +Azure Data Studio (previously SQL Operations Studio) is a data management tool that enables working with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux. + +[Azure Data Studio List of Extensions](https://github.com/Microsoft/azuredatastudio/wiki/List-of-Extensions) + + - Cross-Platform DB management for Windows, macOS and Linux with simple XCopy deployment + - SQL Server Connection Management with Connection Dialog, Server Groups, and Registered Servers + - Object Explorer supporting schema browsing and contextual command execution + - T-SQL Query Editor with advanced coding features such as autosuggestions, error diagnostics, tooltips, formatting and peek definition + - Query Results Viewer with advanced data grid supporting large result sets, export to JSON\CSV\Excel, query plan and charting + - Management Dashboard supporting customizable widgets with drill-through actionable insights + - Visual Data Editor that enables direct row insertion, update and deletion into tables + - Backup and Restore dialogs that enables advanced customization and remote filesystem browsing, configured tasks can be executed or scripted + - Task History window to view current task execution status, completion results with error messages and task T-SQL scripting + - Scripting support to generate CREATE, SELECT and DROP statements for database objects + - Workspaces with full Git integration and Find In Files support to managing T-SQL script libraries + - Modern light-weight shell with theming, user settings, full screen support, integrated terminal and numerous other features + + ## bcp Utility Download page: [bcp Utility]
@@ -349,46 +497,19 @@ The bcp utility can be used to import large numbers of new rows into SQL Server ## mssql-cli Download page: [mssql-cli]
-Release date: 2018-07-06
-Support Version: 2008-2017/Azure
+Release date: 2020-01-05
+Support Version: 2008-2019/Azure
Author: Microsoft
Free version: Open Source
Price: No Interactive command line query tool for SQL Server. - - Auto-completion - - Syntax highlighting - - Query history - - Configuration file support - - Multi-line queries - - - -## Azure Data Studio -Download page: [Azure Data Studio]
-Release date: 2019-05-18
-Support Version: 2008-2019/Azure
-Author: Microsoft
-Free version: Yes
-Price: No - -Azure Data Studio (previously SQL Operations Studio) is a data management tool that enables working with SQL Server, Azure SQL DB and SQL DW from Windows, macOS and Linux. - -[Azure Data Studio List of Extensions](https://github.com/Microsoft/azuredatastudio/wiki/List-of-Extensions) - - - Cross-Platform DB management for Windows, macOS and Linux with simple XCopy deployment - - SQL Server Connection Management with Connection Dialog, Server Groups, and Registered Servers - - Object Explorer supporting schema browsing and contextual command execution - - T-SQL Query Editor with advanced coding features such as autosuggestions, error diagnostics, tooltips, formatting and peek definition - - Query Results Viewer with advanced data grid supporting large result sets, export to JSON\CSV\Excel, query plan and charting - - Management Dashboard supporting customizable widgets with drill-through actionable insights - - Visual Data Editor that enables direct row insertion, update and deletion into tables - - Backup and Restore dialogs that enables advanced customization and remote filesystem browsing, configured tasks can be executed or scripted - - Task History window to view current task execution status, completion results with error messages and task T-SQL scripting - - Scripting support to generate CREATE, SELECT and DROP statements for database objects - - Workspaces with full Git integration and Find In Files support to managing T-SQL script libraries - - Modern light-weight shell with theming, user settings, full screen support, integrated terminal and numerous other features +- Auto-completion +- Syntax highlighting +- Query history +- Configuration file support +- Multi-line queries ## RML Utilities for SQL Server @@ -561,7 +682,7 @@ With SSDT, you can design and deploy any SQL Server content type with the same e ## Database Health Monitor Download page: [Database Health Monitor]
-Release date: 2016-03-20
+Release date: 2019-12-01
Support Version: 2008/2012/2014/2016
Author: Steve Stedman
Free version: Yes
@@ -586,26 +707,26 @@ SchemaDrift is a SQL Server database comparison tool that allows you to compare ## DBeaver Download page: [DBeaver]
-Release date: 2018-09-24
-Support Version: 2005-2017
+Release date: 2020-11-29
+Support Version: 2005-2019
Author: Open Source
Free version: Yes
Price: No -Free multi-platform database tool for developers, SQL programmers, database administrators and analysts. -Supports all popular databases: MySQL, PostgreSQL, SQLite, Oracle, DB2, SQL Server, Sybase, MongoDB, Cassandra, etc +Free multi-platform database tool for developers, database administrators, analysts and all people who need to work with databases. +Supports all popular databases: MySQL, PostgreSQL, SQLite, Oracle, DB2, SQL Server, Sybase, MS Access, Teradata, Firebird, Apache Hive, Phoenix, Presto, etc. ## HeidiSQL Download page: [HeidiSQL]
-Release date: 2017-12-19
-Support Version: 2005-2017
+Release date: 2020-11-02
+Support Version: 2005-2019
Author: Open Source
Free version: Yes
Price: No -HeidiSQL is a useful and reliable tool designed for web developers using the popular MySQL server, Microsoft SQL databases and PostgreSQL. +HeidiSQL is a useful and reliable tool designed for web developers using the popular MariaDB, MySQL, Microsoft SQL, PostgreSQL and SQLite. It enables you to browse and edit data, create and edit tables, views, procedures, triggers and scheduled events. Also, you can export structure and data either to SQL file, clipboard or to other servers. @@ -641,7 +762,7 @@ ExpressProfiler (aka **SqlExpress Profiler**) is a simple and fast replacement f ## Data Migration Assistant Download page: [Data Migration Assistant]
-Release date: 2017-03-15
+Release date: 2020-04-23
Support Version: 2005/2008/2008R2/2012/2014/2016/Azure
Author: Microsoft
Free version: Yes
@@ -793,14 +914,14 @@ Avoid using this feature in new development work, and plan to modify application ## Ssms Utility -Download page: [Ssms Utility]
+Download page: [SSMS Utility]
Release date: -
Support Version: 2005/2008/2008R2/2012/2014/2016
Author: Microsoft
Free version: Yes
Price: No -The Ssms utility opens SQL Server Management Studio. +The SSMS utility opens SQL Server Management Studio. If specified, Ssms also establishes a connection to a server, and opens queries, scripts, files, projects, and solutions. You can specify files that contain queries, projects, or solutions. Files that contain queries are automatically connected to a server if connection information is provided and the file type is associated with that type of server. @@ -822,6 +943,18 @@ The dtexec utility provides access to all the package configuration and executio The dtexec utility lets you load packages from these sources: the Integration Services server, an .ispac project file, a Microsoft SQL Server database, the SSIS Package Store, and the file system. +## adutil Utility + +Download page: [adutil Utility]
+Release date: -
+Support Version: 2017-2019
+Author: Microsoft
+Free version: Yes
+Price: No + +Configure Active Directory authentication with SQL Server on Linux. + + ## SQL Server 2016 Report Builder Download page: [SQL Server 2016 Report Builder]
@@ -935,18 +1068,6 @@ Price: $495 SQL Data Compare is the industry-standard tool for comparing and deploying SQL Server database contents -## Red Gate SQL Prompt - -Download page: [Red Gate SQL Prompt]
-Release date: 2016-04-28
-Support Version: 2005/2008/2012/2014
-Author: Red Gate
-Free version: No
-Price: $369 - -Write, format and refactor SQL effortlessly - - ## Red Gate SQL Monitor Download page: [Red Gate SQL Monitor]
@@ -1675,10 +1796,28 @@ Price: ? - Streamline incident management with native ServiceNow integration +## SQL Data Profiler + +Download page: [SQL Data Profiler]
+Release date: ?
+Support Version: 2008-2019
+Author: Idera
+Free version: No
+Price: ? + + - Profile data in SQL Server tables + - Analyze subsets of data types at a time + - Adjust profiling thresholds to customize the analysis + - Display summary of data in selected table and its columns + - Receive recommendations based on data per column + - View summary of value distribution per column + - Export results to plain text file format + + ## dbForge Schema Compare Download page: [dbForge Schema Compare]
-Release date: 2018-12-21
+Release date: 2019-10-10
Support Version: 2005-2019/Amazon/Azure
Author: Devart
Free version: No
@@ -1691,8 +1830,8 @@ You can compare your SQL Server databases, analyze differences and synchronize y ## dbForge Data Compare -Download page: [dbForge Schema Compare]
-Release date: 2018-12-21
+Download page: [dbForge Data Compare]
+Release date: 2019-10-10
Support Version: 2005-2019/Amazon/Azure
Author: Devart
Free version: No
@@ -1706,7 +1845,7 @@ and effortlessly synchronize data via a convenient wizard with additional option ## dbForge Data Generator Download page: [dbForge Data Generator]
-Release date: 2018-12-21
+Release date: 2019-10-10
Support Version: 2005-2019/Amazon/Azure
Author: Devart
Free version: No
@@ -1720,7 +1859,7 @@ dbForge Data Generator for SQL Server can save your time and effort by populatin ## dbForge Query Builder Download page: [dbForge Query Builder]
-Release date: 2018-12-21
+Release date: 2019-10-10
Support Version: 2005-2019/Amazon/Azure
Author: Devart
Free version: No
@@ -1735,7 +1874,7 @@ But even experienced users can save a lot of time on routine work. ## dbForge Event Profiler Download page: [dbForge Event Profiler]
-Release date: 2018-12-21
+Release date: 2019-10-10
Support Version: 2005-2019
Author: Devart
Free version: Yes
@@ -1749,7 +1888,7 @@ You can use this information to identify and troubleshoot many SQL Server-relate ## dbForge SQL Decryptor Download page: [dbForge SQL Decryptor]
-Release date: 2018-12-21
+Release date: 2017-09-19
Support Version: 2005-2019
Author: Devart
Free version: Yes
@@ -1761,7 +1900,7 @@ Decrypt SQL Server Procedures, Functions, Triggers, and Views ## dbForge Studio Download page: [dbForge Studio]
-Release date: 2018-12-21
+Release date: 2019-10-10
Support Version: 2005-2019/Amazon/Azure
Author: Devart
Free version: Yes
@@ -1777,7 +1916,7 @@ Price: $249 ## dbForge Fusion Download page: [dbForge Fusion]
-Release date: 2018-12-21
+Release date: 2019-11-08
Support Version: 2005-2019/Amazon/Azure
Author: Devart
Free version: No
@@ -1791,7 +1930,7 @@ It provides an easier way to explore and maintain existing databases, design com ## dbForge Documenter Download page: [dbForge Documenter]
-Release date: 2018-12-21
+Release date: 2020-04-23
Support Version: 2005-2019
Author: Devart
Free version: No
@@ -1802,33 +1941,41 @@ This tool automatically generates documentation of an entire SQL Server database The tool includes a wide range of options to customize the generated documentation to meet your specific requirements. -## Devart Excel Add-in for SQL Server - -Download page: [Devart Excel Add-in for SQL Server]
-Release date: 2017-09-13
-Support Version: 2005/2008/2008R2/2012/2014/2016
+## dbForge SSIS Data Flow Components + +Download page: [dbForge SSIS Data Flow Components]
+Release date: 2020-03-31
+Support Version: 2014-2019
Author: Devart
Free version: No
-Price: $100 +Price: $500 -Devart Excel Add-ins allow you to work with database and cloud data in Microsoft Excel as with usual Excel spreadsheets. +Devart SSIS Data Flow Components provide easy to set up cost-effective data integration using SSIS ETL engine. +They provide high performance data loading, convenient component editors, SQL support for cloud data sources and lots of data source specific features. -## Minion Enterprise - -Download page: [Minion Enterprise]
-Release date: ?
-Support Version: 2008/2008R2/2012
-Author: MinionWare
+## dbForge DevOps Automation for SQL Server + +Download page: [dbForge DevOps Automation for SQL Server]
+Release date: 2020-04-13
+Support Version: 2014-2019
+Author: Devart
+Free version: No
+Price: $900 + +dbForge DevOps Automation for SQL Server is a cutting-edge solution that takes conventional database development and deployment to a whole new level. + + +## Devart Excel Add-in for SQL Server + +Download page: [Devart Excel Add-in for SQL Server]
+Release date: 2019-12-11
+Support Version: 2005-2019
+Author: Devart
Free version: No
-Price: $1500 +Price: $250 -Minion Enterprise was designed by database administrators (DBAs) specifically to address the issues that waste the most time and cause the most problems. -Minion shrinks dozens of those one-at-a-time tasks down to a central process. And, it does this without the usual overhead of monitoring software. -When you install Minion Enterprise, it automatically begins gathering data from instances across your enterprise. -That single repository of data allows you to centrally audit, alert, report, and investigate your entire environment. -Even better, it opens up a new world of central management: audit SQL and AD security, clone user permissions across servers, -standardize and enforce SQL Server settings, automate error log searches, and so very much more. +Devart Excel Add-ins allow you to work with database and cloud data in Microsoft Excel as with usual Excel spreadsheets. ## SQL Server Compression Estimator @@ -1850,21 +1997,38 @@ You can then use that information to perhaps choose a less aggresive compression Download page: [ClearTrace]
Release date: 2016-07-07
-Support Version: 2008/2012/2014/2016
+Support Version: 2000-2017
Author: Bill Graziano
Free version: Yes
Price: No -ClearTrace imports SQL Server 2016, SQL Server 2014, SQL Server 2012, SQL Server 2008, SQL Server 2005, SQL Server 2000 trace -and Profiler files into SQL Server and displays summary performance information. +ClearTrace imports SQL Server 2017, 2016, 2014, 2012, 2008, 2005, 2000 trace and Profiler files into SQL Server and displays summary performance information. +- Summarize SQL Server Query Performance +- Enhance SQL Server Performance Tuning -## Dell Security Explorer - -Download page: [Dell Security Explorer]
-Release date: 2015-06-25
-Support Version: 2008/2012/2014
-Author: Dell
+ +## ClearTraceXE + +Download page: [ClearTraceXE]
+Release date: 2019-09-04
+Support Version: 2008-2017
+Author: Bill Graziano
+Free version: Yes
+Price: No + +ClearTrace for Extended Events imports extended event files from SQL Server 2017, 2016, 2014, 2012, 2008. + +- Summarize SQL Server Query Performance +- Enhance SQL Server Performance Tuning + + +## Security Explorer + +Download page: [Security Explorer]
+Release date: 2008-2017
+Support Version: 2019-08-29
+Author: Quest Software
Free version: No
Price: $850 @@ -1873,12 +2037,12 @@ Plus, it complements Microsoft tools by solving key SQL Server challenges, so yo It also makes it easy to manage change, resolve issues quickly and promote the highest levels of code quality, performance and maintainability. -## Dell LiteSpeed for SQL Server - -Download page: [Dell Security Explorer]
-Release date: 2015-07-31
-Support Version: 2008/2012/2014
-Author: Dell
+## LiteSpeed for SQL Server + +Download page: [LiteSpeed for SQL Server]
+Release date: 2019-08-29
+Support Version: 2008-2017
+Author: Quest Software
Free version: No
Price: ? @@ -1887,12 +2051,12 @@ operations across the entire enterprise. Easily manage and monitor SQL Server pr With LiteSpeed, a complete workbench of SQL Server recovery tools are at your fingertips so you can get data back online — fast. -## Dell Toad for SQL Server - -Download page: [Dell Toad for SQL Server]
-Release date: 2015-05-12
-Support Version: 2008/2008R2/2012/2014
-Author: Dell
+## Toad for SQL Server + +Download page: [Toad for SQL Server]
+Release date: 2019-08-29
+Support Version: 2008-2017
+Author: Quest Software
Free version: No
Price: ? @@ -1903,12 +2067,12 @@ Unlike native tools, Security Explorer provides the ability to back up and resto Security Explorer provides on-the-fly reports to help meet auditing requirements. -## Dell Spotlight - -Download page: [Dell Spotlight]
-Release date: 2016-03-10
-Support Version: 2008/2008R2/2012/2014
-Author: Dell
+## Quest Spotlight + +Download page: [Quest Spotlight]
+Release date: 2019-08-29
+Support Version: 2008-2017
+Author: Quest Software
Free version: No
Price: $2561 @@ -1920,12 +2084,12 @@ an integrated Xpert tuning module and mobile device support, Spotlight on SQL Server Enterprise makes it easier than ever to obtain the data you need to ensure the health of your SQL Server databases. -## Dell Foglight - -Download page: [Dell Foglight]
-Release date: 2015-09-22
-Support Version: 2008/2008R2/2012/2014
-Author: Dell
+## Quest Foglight + +Download page: [Quest Foglight]
+Release date: 2019-08-29
+Support Version: 2008-2017
+Author: Quest Software
Free version: No
Price: ? @@ -1935,34 +2099,16 @@ multi-platform environments – even when you use native or third-party tools Get a wealth of information at a fraction of the impact of conventional collection methods. -## Dell Discovery Wizard - -Download page: [Dell Foglight]
-Release date: 2011-09-22
-Support Version: 2008/2008R2/2012/2014
-Author: Dell
-Free version: Yes
-Price: No - - - Take inventory of your network databases, including data amounts - - Choose the databases you want to consolidate - - Review database history, including installation and creation dates - - Find the SQL Server versions and service packs currently deployed - - Identify names of servers, instances and operating systems - - Learn the identity of your end users - - -## Dell Enterprise Reporter - -Download page: [Dell Enterprise Reporter]
+## Quest Enterprise Reporter + +Download page: [Quest Enterprise Reporter]
Release date: ?
-Support Version: 2008/2008R2/2012/2014
-Author: Dell
+Support Version: 2008-2017
+Author: Quest Software
Free version: No
Price: $511 -Dell Enterprise Reporter for SQL Server provides ad-hoc reporting for visibility database security configuration, -including users and logins, roles and database permissions +Quest Enterprise Reporter for SQL Server provides ad-hoc reporting for visibility database security configuration, including users and logins, roles and database permissions. ## SQL Scripter @@ -2088,7 +2234,7 @@ Price: $499 ## ApexSQL Plan Download page: [ApexSQL Plan]
-Release date: 2018-04-05
+Release date: 2019-12-02
Support Version: 2008-2017
Author: ApexSQL
Free version: Yes
@@ -2107,7 +2253,7 @@ Price: No ## ApexSQL Propagate Download page: [ApexSQL Propagate]
-Release date: 2017-09-25
+Release date: 2020-02-19
Support Version: 2008-2017
Author: ApexSQL
Free version: Yes
@@ -2183,7 +2329,7 @@ Price: $599 ## ApexSQL Decrypt Download page: [ApexSQL Decrypt]
-Release date: 2017-08-16
+Release date: 2020-03-12
Support Version: 2008-2017
Author: ApexSQL
Free version: Yes
@@ -2426,6 +2572,96 @@ Price: $299 - Generate SQL to fix violations +## ApexSQL CI/CD toolkit + +Download page: [ApexSQL CI/CD toolkit]
+Release date: 2020-05-21
+Support Version: 2005-2017
+Author: ApexSQL
+Free version: Yes
+Price: No + + - Build from source control + - Include static data in builds + - Generate synthetic test data + - Automatically run SQL unit tests + - Add a data change audit trail + - Document and report on changes + - Create a data sync script + - Create a schema sync script + - Plug into popular build servers + - Enforce SQL coding standards + - Work with all popular SC systems + - Trigger manually or automatically + + +## ApexSQL Compare + +Download page: [ApexSQL Compare]
+Release date: 2020-03-17
+Support Version: 2005-2017
+Author: ApexSQL
+Free version: Yes
+Price: No + + - Two-way SQL code compare + - SSMS and Visual Studio integration + - Char-by-char compare + - Windows Explorer integration + - Line-by-line compare + - File and folder compare + - Block-by-block compare + - Database object compare + - Syntax highlighting + - Ignore script options + - HTML results report + - Automation and scheduling + + +## ApexSQL Complete + +Download page: [ApexSQL Complete]
+Release date: 2020-05-28
+Support Version: 2005-2017
+Author: ApexSQL
+Free version: Yes
+Price: No + + - Automatically complete SQL statements + - Review an object's script and description + - Improve productivity with snippets + - Identify the structure of complex SQL queries + - Keep track of all your tabs + - Log every executed query + - Easily navigate to SQL objects + - Check queries in test mode + - Color query tabs by environment + - Search and export query results + - Create CRUD procedures + - Guard against queries that may damage data + + +## ApexSQL Refactor + +Download page: [ApexSQL Refactor]
+Release date: 2020-06-09
+Support Version: 2005-2019
+Author: ApexSQL
+Free version: Yes
+Price: No + + - SQL formatter with over 160 options + - Qualify objects and expand wildcards + - Encapsulate SQL into procedures + - Add surrogate keys + - Replace one-to-many relationships + - Change procedure parameters + - Safely rename SQL objects + - Locate & highlight unused variables + - Format SQL objects + - Obfuscate SQL + + ## DBBest T-SQL Analyzer Download page: [DBBest T-SQL Analyzer]
@@ -2643,8 +2879,8 @@ Price: $295 ## Aireforge Studio Download page: [Aireforge Studio]
-Release date: 2017-06-21
-Support Version: 2008/2012/2014/2016/Azure
+Release date: 2019-08-08
+Support Version: 2008-2019/Azure
Author: AireForge
Free version: Yes
Price: $299 @@ -2877,21 +3113,32 @@ Price: $810 ERwin Data Modeler is an industry-leading data modeling solution that provides a simple, visual interface to manage your complex data environment -## Toad Data Modeler - -Download page: [Toad Data Modeler]
+## Luna Modeler + +Download page: [Luna Modeler]
+Release date: 2022-10-05
+Support Version: 2019/2022
+Author: Ideamerit
+Free version: No
+Price: $99 + +Luna Modeler is a database design and data modeling tool for relational databases. With Luna Modeler, you can create ER diagrams, design and visualize database structures, generate SQL scripts, and document your data models. + + +## Toad Data Point + +Download page: [Toad Data Point]
Release date: 2016-06-16
-Support Version: 2008/2012/2014
-Author: Dell
+Support Version: 2008-2017
+Author: Quest Software
Free version: No
-Price: $562 +Price: ? -Easily create high-quality data models. Toad Data Modeler enables you to rapidly deploy accurate changes to data structures across more than 20 different platforms. -It allows you to construct logical and physical data models, compare and synchronize models, quickly generate complex SQL/DDL, create and modify scripts, as well as reverse and forward engineer both databases and data warehouse systems +Query and Reporting Software Tool for Data Analysts ## SQL Power Architect - + Download page: [SQL Power Architect]
Release date: 2016-02-11
Support Version: 2008/2012/2014
@@ -2906,8 +3153,8 @@ It allows users to reverse-engineer existing databases, perform data profiling o ## DbWrench Download page: [DbWrench]
-Release date: 2016-07-06
-Support Version: 2008/2012/2014
+Release date: 2019-09-17
+Support Version: 2008-2017
Author: Nizana Systems
Free version: No
Price: $99 @@ -2933,11 +3180,11 @@ It allows you to visually design database structures, perform reverse/forward en ## DeZign for Databases Download page: [DeZign for Databases]
-Release date: 2016-04-25
-Support Version: 2008/2012/2014
+Release date: 2019-04-01
+Support Version: 2008-2017
Author: Datanamic
Free version: No
-Price: $259 +Price: €29/month DeZign for Databases is an intuitive database design and modeling tool for developers and DBA's that can help you model, create and maintain databases. The software uses entity relationship diagrams (ERDs, data models) to graphically design databases and automatically generates the most popular SQL and desktop database. @@ -3010,9 +3257,9 @@ It supports all major database vendors, works on all major operating systems and ## RazorSQL Download page: [RazorSQL]
-Release date: 2016-09-29
-Support Version: 2008/2012/2014/2016
-Author: Richardson Software
+Release date: 2019-09-26
+Support Version: 2008-2019
+Author: Richardson Software
Free version: No
Price: $100 @@ -3081,10 +3328,10 @@ Price: No - Can run with no installation or it can be run as a service -## Database Experimentation Assistant Technical Preview 2 +## Database Experimentation Assistant Download page: [Database Experimentation Assistant]
-Release date: 2017-03-24
+Release date: 2020-03-20
Support Version: 2005/2008/2012/2014/2016
Author: Microsoft
Free version: Yes
@@ -3387,29 +3634,45 @@ SA MaaS Microsoft SQL Server for on-premise and virtual Microsoft SQL servers ga diagnostics to help network admins and DBAs keep SQL servers running at peak performance and find the logs they need. -## CatCompare v2 - -Download page: [CatCompare v2]
-Release date: 2017-01-07
+## SSIS Framework + +Download page: [SSIS Framework]
+Release date: 2019-01-07
Support Version: ?
Author: Andy Leonard
-Free version: No
-Price: $295 - -CatCompare provides automate-able command-line management of SSIS Catalog project configuration, deployment, migration, code promotion, and comparison. - +Free version: Yes
+Price: ? -## SSIS Catalog Compare v2.0 Bundle - -Download page: [SSIS Catalog Compare v2.0 Bundle]
+- Orchestrate SSIS Applications +- Execute SSIS Applications with a single command +- SSIS Catalog-integrated execution +- Works with SSMS Catalog Reporting +- Works with DILM Suite Catalog Reports +- SSIS Catalog-integrated logging +- SSIS Framework Reporting +- Restart SSIS Applications at Failed Application Package +- Application Package Parameter Support +- Metadata-Driven Data Tap Support +- Application Package Environment (References) Support +- Application Package Property Override Support +- Execute SSIS Applications / Packages on Different / Several Servers +- Support for “Enterprise Data Integration Farm” SSIS Scale-Out +- Enterprise Data Integration Reporting + + +## BimlExpress Metadata Framework + +Download page: [BimlExpress Metadata Framework]
Release date: 2017-01-06
Support Version: ?
Author: Andy Leonard
-Free version: No
-Price: $495 +Free version: Yes
+Price: No -Deploying SSIS Catalog Projects help deploying environments, references, mappings, and overrides. -The SSIS Catalog Compare Version 2.0 Bundle includes SSIS Catalog Compare and CatCompare, a CLI (Command-Line Interface) utility. +The BimlExpress Metadata Framework version 2 uses Business Intelligence Markup Language (Biml) to: +- Read metadata stored in a SQL Server database. +- Build SSIS projects that create the target database, schemas, and tables. +- Build an SSIS project that contains one SSIS package per table, plus a Controller package that executes each table-package. ## MS Kerberos Configuration Manager @@ -3439,11 +3702,11 @@ Can diagnose SQL Server performance issues quickly and accurately, ensuring a he ## DBConvert Studio Download page: [DBConvert Studio]
-Release date: 2017-03-01
-Support Version: ?
-Author: DMSoft Technologies
+Release date: 2020-05-11
+Support Version: 1.7.5
+Author: Slotix
Free version: Yes
-Price: 499 +Price: $499 DBConvert Studio Software combines familiar and powerful features from the mature DBConvert and DBSync product series along with a redesigned and improved UI. The following scenarios are available: @@ -3507,7 +3770,7 @@ Automatically upgrade objects within a SQL Server Instance from lower to higher Download page: [MS FoxPro to MS SQL Migration and Sync]
Release date: 2013-10-08
Support Version: 2005/2008/2012/Azure
-Author: DMSoft Technologies
+Author: Slotix
Free version: No
Price: $149 @@ -3522,7 +3785,7 @@ Approximately 1 Million of records from FoxPro to MSSQL Server with "Bulk" optio Download page: [MySQL to MS SQL Migration and Sync]
Release date: 2013-10-08
Support Version: 2005/2008/2012/Azure
-Author: DMSoft Technologies
+Author: Slotix
Free version: No
Price: $149 @@ -3540,7 +3803,7 @@ Integrated Data Types Mapping feature helps to find and map similar data types b Download page: [Oracle to MS SQL Migration and Sync]
Release date: 2013-10-09
Support Version: 2005/2008/2012/Azure
-Author: DMSoft Technologies
+Author: Slotix
Free version: No
Price: $149 @@ -3556,7 +3819,7 @@ Our tool easily handles huge databases and tables. A clear easy-to-use wizard in Download page: [PostgreSQL to MS SQL Migration and Sync]
Release date: 2013-10-08
Support Version: 2005/2008/2012/Azure
-Author: DMSoft Technologies
+Author: Slotix
Free version: No
Price: $149 @@ -3573,7 +3836,7 @@ Our software will save you hours of learning SQL commands as any large PostgreSQ Download page: [MS Excel to MS SQL Migration]
Release date: 2013-09-23
Support Version: 2005/2008/2012/Azure
-Author: DMSoft Technologies
+Author: Slotix
Free version: No
Price: $149 @@ -3589,7 +3852,7 @@ Saving data into a MS SQL Dump for export to MS SQL database Download page: [SQLite to MS SQL Migration and Sync]
Release date: 2014-05-08
Support Version: 2005/2008/2012/Azure
-Author: DMSoft Technologies
+Author: Slotix
Free version: No
Price: $149 @@ -3605,7 +3868,7 @@ If you have any restrictions on direct access to MS SQL server our product provi Download page: [IBM DB2 to MS SQL Migration and Sync]
Release date: 2013-09-09
Support Version: 2005/2008/2012/Azure
-Author: DMSoft Technologies
+Author: Slotix
Free version: No
Price: $149 @@ -3619,7 +3882,7 @@ Optionally target SQL Dump file may be generated if you haven’t a direct acces Download page: [IBM DB2 to MS SQL Migration and Sync]
Release date: 2013-10-08
Support Version: 2005/2008/2012/Azure
-Author: DMSoft Technologies
+Author: Slotix
Free version: No
Price: $149 @@ -3633,7 +3896,7 @@ The program allows migrating MS Access queries to MSSQL views automatically with Download page: [Firebird to MS SQL Migration and Sync]
Release date: 2013-09-11
Support Version: 2005/2008/2012/Azure
-Author: DMSoft Technologies
+Author: Slotix
Free version: No
Price: $149 @@ -3741,6 +4004,19 @@ Price: No Microsoft SQL Server Migration Assistant (SSMA) for Access is a tool to automate migration from Access database(s) to SQL Server and Azure SQL DB. +## SQL Server Migration Assistant for SAP ASE + +Download page: [SQL Server Migration Assistant for SAP ASE]
+Release date: 2020-06-29
+Support Version: 2012/2014/2016/2019/Azure
+Author: Microsoft
+Free version: Yes
+Price: No + +Microsoft SQL Server Migration Assistant (SSMA) for SAP ASE is a tool to automate migration from SAP ASE database(s) to SQL Server, Azure SQL Database and Azure SQL Database Managed Instance. +SSMA for SAP ASE is designed to support migration from SAP ASE version 11.9 and higher. + + ## mssql for Visual Studio Code Download page: [mssql for Visual Studio Code]
@@ -3759,11 +4035,11 @@ mssql for Visual Studio Code an extension for developing Microsoft SQL Server, A - Customizable extension options including command shortcuts and more -## Microsoft Assessment and Planning +## Microsoft Assessment and Planning (MAP) Toolkit -Download page: [Microsoft Assessment and Planning]
-Release date: 2017-02-10
-Support Version: 2008/2008R2/2012
+Download page: [Microsoft Assessment and Planning (MAP) Toolkit]
+Release date: 2020-05-26
+Support Version: 2008-2019
Author: Microsoft
Free version: Yes
Price: No @@ -3771,6 +4047,9 @@ Price: No The Microsoft Assessment and Planning Toolkit makes it easy to assess your current IT infrastructure for a variety of technology migration projects. This Solution Accelerator provides a powerful inventory, assessment, and reporting tool to simplify the migration planning process. +[Microsoft Assessment and Planning (MAP) Toolkit Wiki](https://social.technet.microsoft.com/wiki/contents/articles/1640.microsoft-assessment-and-planning-map-toolkit-getting-started.aspx) +[Microsoft Assessment and Planning (MAP) Toolkit Download]:https://www.microsoft.com/en-us/download/details.aspx?id=7826 + ## mssql-scripter @@ -3907,10 +4186,10 @@ BimlExpress Visual Studio Add-in built specifically to work with SQL Server 2016 - Updates are released more rapidly to work with the most current versions of SQL Server. -## BIDS Helper - -Download page: [BIDS Helper]
-Release date: 2015-03-17
+## BI Developer Extensions + +Download page: [BI Developer Extensions]
+Release date: 2019-04-29
Support Version: ?
Author: Microsoft
Free version: Open Source
@@ -3933,9 +4212,9 @@ During schema migration, the tool automatically maps the corresponding schema fr After the schema has been migrated, the tools provides the option to move data with automatically generated scripts. - -## Dell Benchmark Factory -Download page: [Dell Benchmark Factory]
+ +## Benchmark Factory +Download page: [Benchmark Factory]
Release date: ?
Support Version: 2008/2012/2014/2016/Azure
Author: Quest Software
@@ -4204,7 +4483,7 @@ It is free software that is distributed under the terms of the MIT License. ## Adminer Download page: [Adminer]
-Release date: 2018-02-20
+Release date: 2019-08-27
Support Version: 2005-2017
Author: Adminer
Free version: Open Source
@@ -4304,11 +4583,1656 @@ Price: No Analyze and fix index fragmentation for SQL Server / Azure -[SSMS]:https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms -[bcp Utility]:https://docs.microsoft.com/en-us/sql/tools/bcp-utility -[sqlcmd Utility]:https://docs.microsoft.com/en-us/sql/tools/sqlcmd-utility -[mssql-cli]:https://github.com/dbcli/mssql-cli -[Azure Data Studio]:https://github.com/Microsoft/azuredatastudio + +## JAMS Enterprise Job Scheduling +Download page: [JAMS Enterprise Job Scheduling]
+Release date: 2019-08-20
+Support Version: 2008-2019
+Author: HelpSystems
+Free version: No
+Price: ? + +Take control of SQL Agent sprawl. Automate smarter with JAMS and regain control over your critical SQL Server batch processes. + +- Monitor SQL Server Job Progress +- Customize SQL Job Schedules (Dates, times, triggers, dependencies and more) +- Send Alerts + + + +## Stitch Data Loader +Download page: [Stitch Data Loader]
+Release date: 2019-09-20
+Support Version: 2008-2019/Azure
+Author: Talend
+Free version: No
+Price: ? + +Stitch makes it simple to load data from dozens of cloud sources into cloud data warehouses and data lakes in minutes. + + + +## Talend Data Integration +Download page: [Talend Data Integration]
+Release date: 2019-06-20
+Support Version: 2008-2019/Azure
+Author: Talend
+Free version: Yes
+Price: ? + +Talend Data Integration an enterprise data integration software to connect, access, and transform any data across the cloud or on-premises. + + + +## Talend Data Preparation +Download page: [Talend Data Preparation]
+Release date: 2018-06-05
+Support Version: 2008-2019/Azure
+Author: Talend
+Free version: Yes
+Price: ? + +Talend Data Preparation empowers anyone to quickly prepare data for trusted insights throughout the organization. + + + +## Pentaho Data Integration +Download page: [Talend Data Integration]
+Release date: 2019-06-20
+Support Version: 2008-2019/Azure
+Author: Hitachi Vantara
+Free version: No
+Price: ? + +This end-to-end platform meets all data integration challenges. Its intuitive drag-and-drop graphical interface simplifies the creation of self-documented data pipelines. +For data transformation, easily use push-down processing to scale out compute platforms, such as Apache Hadoop. + + + +## Studio3T +Download page: [Studio3T]
+Release date: 2019-09-19
+Support Version: 2008-2019
+Author: Studio 3T
+Free version: No
+Price: $149 + +Speed up tasks like query building, data exploration, import/export, code generation, and more – with or without the knowledge of the MongoDB query language. +MongoDB from and to migrations with many RDBMS. + + + +## SQLGrease +Download page: [SQLGrease]
+Release date: 2019-09-20
+Support Version: 2008-2019/Azure/RDS
+Author: SQLGrease
+Free version: No
+Price: $948 + +SQLGrease was built from the ground up specifically for monitoring SQL Server. +Using the newest monitoring features in SQL Server, SQLGrease collects detailed information with extremely low overhead. + + +## QuickDBD + +Download page: [QuickDBD]
+Release date: ?
+Support Version: ?
+Author: Dovetail Technologies Ltd
+Free version: Yes
+Price: $95 + +Draw databases diagrams by typing online and collaborating. + + +## DB Designer + +Download page: [DB Designer]
+Release date: ?
+Support Version: ?
+Author: DB Designer
+Free version: Yes
+Price: $180 + +All The Features You Need For Database Design – Simple But Powerful. + + +## ESF Database Migration Toolkit + +Download page: [ESF Database Migration Toolkit]
+Release date: 2019-10-23
+Support Version: 2008-2017
+Author: DBSofts Inc
+Free version: No
+Price: $322 + +ESF Database Migration Toolkit is the most popular toolkit to help people migrate data across various database formats, supporting Oracle, MySQL, MariaDB, SQL Server, PostgreSQL, IBM DB2, IBM Informix, InterSystems Caché, Teradata, Visual Foxpro, SQLite, FireBird, InterBase, Microsoft Access, Microsoft Excel, Paradox, Lotus, dBase, CSV/Text and so on. + + +## MS SQL Migration Toolkit + +Download page: [MS SQL Migration Toolkit]
+Release date: 2019-04-22
+Support Version: 2008-2017
+Author: Intelligent Converters
+Free version: No
+Price: $99 + +MS SQL Migration Toolkit is a software pack to convert any data source to Microsoft SQL Server or Azure SQL and vice versa. The product has high performance because it does not use ODBC or any other middleware software. +Command line support allows to script, automate and schedule the conversion. + + +## DatabaseSpy + +Download page: [DatabaseSpy]
+Release date: 2019-10-09
+Support Version: 2008-2019
+Author: Altova
+Free version: No
+Price: €109 + +Altova DatabaseSpy is the unique multi-database query and design tool that even generates elegant charts directly from query results. + + +## DiffDog + +Download page: [DatabaseSpy]
+Release date: 2019-10-09
+Support Version: 2008-2019
+Author: Altova
+Free version: No
+Price: €109 + +Altova DiffDog® 2020 is a powerful diff/merge tool for files, folders, and databases. +This easy-to-use synchronization tool quickly compares and merges text or source code files, Microsoft Word documents, directories, CSV files, databases, and XML Schemas via its intuitive visual interface. +It indicates differences, intelligently merges content, and creates XSLT to convert XML data. + + +## ERBuilder data modeler + +Download page: [ERBuilder data modeler]
+Release date: 2019-11-14
+Support Version: 2008-2019/AzureSQL
+Author: Softbuilder
+Free version: Yes
+Price: $99 + +ERBuilder Data Modeler allows developers to graphically design databases by using entity relationship diagrams, and automatically generates the most popular SQL databases. +It also allows developers to easily deploy databases by offering a sophisticated visual data modeling environment. + + +## SQLDatabaseStudio + +Download page: [SQLDatabaseStudio]
+Release date: 2017-05-10
+Support Version: 2008-2017
+Author: Jan Pivarcek
+Free version: Yes
+Price: $215 + +- Attention to the details is what makes SQL Database Studio (SDS) perfect. SDS automates repetitive tasks such as filtering, sorting, searching and much more. You can stay focused on problem you are solving and be more productive. +- Start Up in No Time +- Smart and Modern IDE + + +## Enterprise Architect + +Download page: [Enterprise Architect]
+Release date: 2019-10-31
+Support Version: 2008-2017
+Author: Sparx Systems Pty Ltd
+Free version: No
+Price: $225 + +Integrated modeling platform. +Enterprise Architect, t's built-in Data Modeling tools and profiles extend UML to provide an intuitive mapping from the database concepts of tables and relationships onto the UML concepts of classes and associations. These extensions also enable you to model database keys, triggers, constraints, RI and other relational database features. +Enterprise Architect supports modeling of database schema and automatic generation of DDL scripts for eleven DBMS targets out-of-the-box: DB2, Firebird, MS Access, MySQL, MS SQL Server, Oracle, PostgreSQL + + +## MogwaiERDesignerNG + +Download page: [MogwaiERDesignerNG]
+Release date: 2019-08-22
+Support Version: 2008-2017
+Author: Mirko Sertic
+Free version: Yes
+Price: No + +Java 2D & 3D visual entity relationship design & modeling (ERD,SQL) for Oracle, MSSQL, Postgres and MySQL. + +The Mogwai ERDesigner is an entity relationship modeling/design tool(ERD) such as ERWin and co. +The only difference is that it is Open Source and does not cost anything. +It was designed to make database modeling as easy as it can be and to support the developer in the whole development process, from database design to schema and code generation. + + +## Xcase + +Download page: [Xcase]
+Release date: 2018-06-19
+Support Version: 2008-2017
+Author: Resolution Software Ltd
+Free version: No
+Price: $799 + +Xcase is a complete database design tool engineered to help you accomplish all your database-related tasks – from database design to modeling to daily modifications – with greater speed, higher quality, and better adherence to best practices. Its powerful automation and graphics features quickly and accurately complete tasks throughout the entire life cycle of your database, freeing you to focus on database strategy. + + +## Oracle SQL Developer Data Modeler + +Download page: [Oracle SQL Developer Data Modeler]
+Release date: 2019-08-01
+Support Version: 2008-2017
+Author: Oracle
+Free version: Yes
+Price: No + +Oracle SQL Developer Data Modeler is a free graphical tool that enhances productivity and simplifies data modeling tasks. +Using Oracle SQL Developer Data Modeler users can create, browse and edit, logical, relational, physical, multi-dimensional, and data type models. +The Data Modeler provides forward and reverse engineering capabilities and supports collaborative development through integrated source code control. +The Data Modeler can be used in both traditional and in Cloud environments. + + +## Exportizer + +Download page: [Exportizer]
+Release date: 2019-11-17
+Support Version: 2008-2017
+Author: Vitaliy Levchenko
+Free version: No
+Price: $29 + +You can export dbf to txt, csv to dbf, Paradox to xls, and make several other data conversions. +Beside that, in Exportizer Pro or Exportizer Enterprise, it is possible to export DB2 to xlsx, SQLite to dBase, Access to HTML, Excel to Access, migrate Interbase to SQL Server, FDB to Excel, Oracle to PostgreSQL, and much more. + + +## Reportizer + +Download page: [Reportizer]
+Release date: 2019-09-10
+Support Version: 2008-2017
+Author: Vitaliy Levchenko
+Free version: No
+Price: $39 + +Reportizer is a software tool to create database and file reports. +With Reportizer, you can create professional reports in a couple of minutes! + + +## Database Tour + +Download page: [Database Tour]
+Release date: 2019-11-20
+Support Version: 2008-2017
+Author: Vitaliy Levchenko
+Free version: No
+Price: $49 + +Database Tour is a multi-functional database tool for Windows. +In addition, Database Tour Pro provides powerful command line and reporting functionality. + + +## Ispirer MnMATK + +Download page: [Ispirer MnMATK]
+Release date: 2019-10-23
+Support Version: 2008-2017
+Author: Ispirer Systems
+Free version: No
+Price: ? + +Ispirer Migration and Modernization Assessment Toolkit (Ispirer MnMATK) is designed to collect statistical information about your database or application, as well as better realize the size of a migration project. +The software provides a full report on the number of tables, the amount of data, the number of database objects, and the number of lines of code in each type of database object. +The toolkit consists of Migration Assessment Wizard designed to collect and evaluate information about the database, and Migration Assessment Studio designed to collect and evaluate information about the application. + + +## SQL Database Recovery + +Download page: [SQL Database Recovery]
+Release date: 2019-09-10
+Support Version: 2008-2019
+Author: KernelApps Private
+Free version: No
+Price: $399 + +Repair corrupt and damaged MS SQL database files. + + +## SysTools SQL Log Analyzer + +Download page: [SysTools SQL Log Analyzer]
+Release date: 2019-01-01
+Support Version: 2000-2019
+Author: SysTools
+Free version: No
+Price: $999 + +SysTools SQL Log Analyzer - To Read & Analyze SQL Server Log File (.ldf) Transactions +- Complete analyses of SQL transaction Log (.ldf) file to identify critical changes in record +- Open, Read & Analyze all Microsoft SQL transactions: Insert, Update & Delete +- SQL LDF File Recovery to restore the modified database back into SQL Server +- Forensic Investigator can track who modified SQL table records with details provide by Log Analyzer +- Quick Scan to deeply examine log file & provide full visibility to database records +- Open & Analyze all operation of a transaction(LDF) file Without MS SQL Server application +- SQL Log Analyzer works on both Online & Offline SQL Database Environment +- Support to fetch & view records from Live SQL database environment +- Support For Advance SQL Data Type : Datetime2, datetimeoffset, sql_variant, hierarchyid, geometry & geography data types +- Dynamic Filters to export only Selective transaction records after complete analyses +- Display LDF information in SQL Scripts, CSV file or directly export to any SQL Server database +- Auto-locate MDF to read database schema of scanned Log File while opting Offline DB Option +- Provide support to Unicode (Collation) property after exporting database + + +## SysTools SQL Server Recovery Manager + +Download page: [SysTools SQL Server Recovery Manager]
+Release date: 2017-01-01
+Support Version: 2000-2016
+Author: SysTools
+Free version: No
+Price: $1499 + +- Recover & Export SQL Database: Primary (MDF) and Secondary (NDF) +- Analyze SQL Server LOG database transactions +- Scan, recover & Export database from corrupt SQL Server Backup File +- Recover & Reset SQL User Password from master.mdf file +- Decrypt Encryption of SQL Server Scripts & Database from Live Environ +- Recover Data from all Database Files : master.mdf/.ndf/.bak/.ldf etc. + + +## SysTools SQL Recovery + +Download page: [SysTools SQL Recovery]
+Release date: 2019-01-01
+Support Version: 2000-2019
+Author: SysTools
+Free version: No
+Price: $249 + +- Quick & Advanced Scan To Repair SQL Database : Both Primary & Secondary +- SQL Recovery Software will Recover Deleted SQL Server Database Table's Data +- Scan & Recover Multiple NDF Files (Secondary Database) +- Scan & Recover Triggers, Rules, Functions, Tables, Stored Procedures +- Export File into SQL Server Database or as SQL Server Compatible Scripts Using SQL Database Repair Tool +- Auto Fetches SQL Server Name while Exporting to SQL Server Database +- Desired Items Selection to Save File with Schema or Schema & Data Both +- Option to preview deleted records in red colour +- Support ASCII and Unicode XML datatype +- Recover data from Wallet Ransomware affected .mdf files. + + +## SysTools SQL Recovery + +Download page: [SysTools SQL Recovery]
+Release date: 2018-01-01
+Support Version: 2000-2017
+Author: SysTools
+Free version: No
+Price: $149 + +- Recover & Preview Tables, Views, Procedures, Triggers, Functions, Columns +- Supports to repair corrupt SQL Backup file without any modification +- Recover MDF & NDF files Saved within SQL Backup File +- Option of Auto-Detect to detect the version of SQL .bak file +- 2 Export Options: SQL Server Database or SQL Server Compatible Script +- Supports XML Data type in MS SQL server 2017, 2016, 2014, 2012, 2008 +- No File Size Limitation: Tested with 1.4 TB of SQL .bak file + + +## SysTools SQL Password Recovery + +Download page: [SysTools SQL Password Recovery]
+Release date: 2018-01-01
+Support Version: 2000-2017
+Author: SysTools
+Free version: No
+Price: $149 + +- Reset both Individual User & SA passwords from SQL master.mdf file +- Installation of MS SQL Server is not mandatory to reset SA password +- SQL Server services should be stopped while loading master.mdf file +- Recover & Reset SQL password of any length or type without any fail +- Provide facility to set new password for User Login within a software +- Capable to recover Multilingual Password of MDF Files successfully +- SQL Server SA Password Recovery can install on Windows OS + + +## SysTools SQL Decryptor + +Download page: [SysTools SQL Decryptor]
+Release date: 2019-01-01
+Support Version: 2000-2019
+Author: SysTools
+Free version: No
+Price: $69 + +- Remove encryption from complete MS SQL database +- Supports Dual Login Mode : Windows & SQL Server Authentication +- SQL Server credentials required to decrypt SQL database file +- Option Export SQL database: SQL Server & Compatible Scripts +- Able to Decrypt SQL Stored Procedure, Triggers, Functions, Views. +- SQL Server should be installed on machine for decryption +- Dedicated Admin Connection (DAC) is required to run the utility + + +## SysTools SQL Server Database Migrator + +Download page: [SysTools SQL Server Database Migrator]
+Release date: 2018-01-01
+Support Version: 2000-2017
+Author: SysTools
+Free version: No
+Price: $249 + +- Migrate Corrupted SQL Server Database from SQL Server 2008 to 2012, 2014, 2016, 2017 +- Move Tables, Functions, SPs etc from One database to Another In all SQL Server +- Migrate Database Objects (Tables, Functions, Stored Procedures etc) from One Server to Another +- Creates .sql Script File of All Database Objects of an MDF File One by One +- Migrate SQL Database Objects from One Server to Another With Only Schema +- Copy SQL Server Database from One Server to Another With Schema & Data +- Move & Export SQL Server Database on an Existing Database or as a New Database. + + +## SQL Server to Azure Database Migrator + +Download page: [SQL Server to Azure Database Migrator]
+Release date: 2018-01-01
+Support Version: 2000-2017
+Author: SysTools
+Free version: No
+Price: $169 + +- Able to Move all SQL database objects : Tables, Triggers, Stored Procedures etc. +- Migrate corrupted / inaccessible SQL database to Azure Database +- Preview all database components before migrating SQL Database to Azure +- Auto-detect SQL Server version while migrating data to Azure SQL database +- Allows to migrate selected data items 'With Schema' or 'With Schema & Data' option +- Provides facility to Migrate NDF file data to Azure SQL database +- Allows to Migrate deleted records to SQL Azure cloud database + + +## Commvault Complete Backup & Recovery + +Download page: [Commvault Complete Backup & Recovery]
+Release date: 2019-12-31
+Support Version: 2008-2019
+Author: Commvault
+Free version: No
+Price: ? + +Complete coverage starts and ends here. Commvault Complete Backup & Recovery is a single, powerful solution for data protection – wherever your data lives. +[Supported Technologies](https://www.commvault.com/supported-technologies) + + +## Veeam Backup & Recovery + +Download page: [Veeam Backup & Replication]
+Release date: 2019-12-31
+Support Version: 2008-2019
+Author: Veeam
+Free version: No
+Price: $600 + +Veeam Backup & Replication™ delivers Intelligent Data Management for ALL your virtual, physical and cloud-based workloads. +Through a single management console, you can manage fast, flexible and reliable backup, recovery and replication of all your applications and data to eliminate legacy backup solutions forever. + + +## Database Modeling Excel + +Download page: [Database Modeling Excel] +Release date: ? +Support Version: ? +Author: Yang Ning (Steven) +Free version: Yes +Prise: No + +The database modeling utility is a Microsoft Office Excel workbook which can help you to design databases. +It supports DB2, MariaDB, MySQL, Oracle, PostgreSQL, SQLite and SQL Server. +In the workbook, you can define database, generate DDL scripts, and import database definition from existing databases. + + +## DBAchecks + +Download page: [DBAchecks] +Release date: ? +Support Version: ? +Author: sqlcollaborative +Free version: Yes +Prise: No + +This open source module allows us to crowd-source our checklists using Pester tests. Such checks include: + - Backups are being performed + - Identity columns are not about to max out + - Servers have access to backup paths + - Database integrity checks are being performed and corruption does not exist + - Disk space is not about to run out + - All enabled jobs have succeeded + + +## DBComparer + +Download page: [DBComparer] +Release date: ? +Support Version: 2005-2008 +Author: DBComparer +Free version: Yes +Prise: No + + - Automate compare database + - Compare all database objects or selected ones only + - Compare database by all or selected properties of objects only + - A wide variety of options for comparison + - Compare databases using all or selected object properties + - Advanced visual build tree interface for an intuitive visual representation of any differences + - Built-in text differences control with SQL syntax highlighting + + +## DbViewSharp + +Download page: [DbViewSharp] +Release date: 2014-08-08 +Support Version: 2005 – 2014 +Author: David Moore +Free version: Yes +Prise: No + +DbViewSharp is a very useful application that is designed to provide you with a means of exploring and managing SQL databases. + + +## DTSQL + +Download page: [DTSQL] +Release date: 2017-08-18 +Support Version: ? +Author: DigerTech Inc +Free version: Yes +Prise: $69 + +DtSQL is an universal database tool for developers and database administrators to Query, Edit, Browse, and Manage database objects. +It can access most databases and can be used on all major operating systems. + + +## MSKerberos Configuration Manager + +Download page: [MSKerberos Configuration Manager] +Release date: 2020-02-25 +Support Version: 2008 – 2019 +Author: Microsoft +Free version: Yes +Prise: No + +Microsoft Kerberos Configuration Manager for SQL Server is a diagnostic tool that helps troubleshoot Kerberos related connectivity issues with SQL Server, SQL Server Reporting Services, and SQL Server Analysis Services. + + +## Partition Management + +Download page: [Partition Management] +Release date: ? +Support Version: ? +Author: ? +Free version: Yes +Prise: No + + - Remove all the data from one partition by switching it out to a staging table. It creates the required staging table. + - Create a staging table for loading data into a partition. The staging table can be created with or without indexes -- if created without indexes this utility provides a separate command to create appropriate indexes on the staging table, before SWITCHing it into the partitioned table. + + +## Powershell Scripts + +Download page: [Powershell Scripts] +Release date: ? +Support Version: 2008-2017 +Author: Idera +Free version: Yes +Prise: No + + - 147 sample PowerShell scripts to manage SQL Server and Azure SQL Database + - Scripts to initialize PowerShell modules + - Scripts for Database Engine, and for Analysis, Integration and Reporting Services + - Support for SQL Server 2016 and 2017, and Windows Server 2016 + - 15 New scripts for Azure SQL Database + + +## PSDatabaseClone + +Download page: [PSDatabaseClone] +Release date: ? +Support Version: ? +Author: Sander Stad +Free version: Yes +Prise: No + +PSDatabaseClone is a PowerShell module dedicated to the provisioning of databases using virtual disk technology. + + +## Pssdiag&Sqldiag Manager + +Download page: [Pssdiag&Sqldiag Manager] +Release date: 2020-05-04 +Support Version: ? +Author: Jack Li +Free version: Yes +Prise: No + +Pssdiag/Sqldiag Manager is a graphic interface that provides customization capabilities to collect data for SQL Server using sqldiag collector engine. The data collected can be used by SQL Nexus tool which help you troubleshoot SQL Server performance problems. This is the same tool Microsoft SQL Server support engineers use to for data collection to troubleshoot customer's performance problems. + + +## SQuirreL SQL Client + +Download page: [SQuirreL SQL Client] +Release date: 2020-04-30 +Support Version: ? +Author: Colin Bell, Gerd Wagner +Free version: Yes +Prise: No + +SQuirreL SQL Client is a JAVA-based database administration tool for JDBC compliant databases. It allows you to view the database structure and issue SQL commands. It provides an editor that offers code completion and syntax highlighting for standard SQL. + + +## Data Synchronisation Studio + +Download page: [Data Synchronisation Studio] +Release date: 2020-05-26 +Support Version: SQL Server 2014 or higher +Author: Simego Ltd +Free version: No +Prise: $999 + +The complete package for data integration and automation for SQL. + - Import + Export + - Data Reconciliation + - Data Preview + - Transformation + - Lookups + - Connection Library + - Schedule + + +## SQL Converter + +Download page: [SQL Converter] +Release date: 2015-12-15 +Support Version: ? +Author: Alaa Ben Fatma +Free version: Yes +Prise: No + +SQL Converter is the utility, allowing one to extract information from source servers selectively and save it to a variety of formats. + + +## SQLDBSearch + +Download page: [SQLDBSearch] +Release date: ? +Support Version: 2000-2019 +Author: Mohamed Bouarroudj +Free version: Yes +Prise: No + +SQLDBSearch is a SQL Server tool that lets you easily and quickly search for database objects or SQL statements across your databases. + + +## SQLDBSize + +Download page: [SQLDBSize] +Release date: ? +Support Version: 2000-2019 +Author: Mohamed Bouarroudj +Free version: Yes +Prise: No + +SQLDBSize is a SQL Server tool that allows you to display graphically the size used or reserved by tables, indexes, databases, transaction logs and physical files. + + +## SQLines Data + +Download page: [SQLines Data] +Release date: 2019-05-29 +Support Version: ? +Author: SQLines +Free version: Yes +Prise: No + +SQLines Data is an open source, scalable, parallel high performance data transfer and schema conversion tool that you can use for database migrations and ETL processes. + + +## SSqlDbAid + +Download page: [SqlDbAid] +Release date: 2018-02-10 +Support Version: 2005+ +Author: Miken +Free version: Yes +Prise: No + + - Text search inside code definition with highlitghting + - DBA reports (missing indexes, missing foreign key indexes, indexes status, top queries, table MBytes) + - One file per object or single file scripts (tables, views, triggers, procedures, functions, indexes...) + - Select, Insert and Update scripts + - Table data insert script creation + - Table/View data export + - Offline database compare tool + + +## sqlectron + +Download page: [sqlectron] +Release date: 2018-09-06 +Support Version: ? +Author: sqlectron +Free version: Yes +Prise: No + +A simple and lightweight SQL client with cross database and platform support. + + +## SQL ExecStats + +Download page: [SQL ExecStats] +Release date: ? +Support Version: ? +Author: Elemental Inc +Free version: Yes +Prise: No + +ExecStats started out with a focus on execution plan analysis with cross-referencing index usage to the SQL. Formerly separate programs for performance monitoring and server system architecture discovery via WMI have now been integrated into ExecStats. + + +## SQL-FineBuild + +Download page: [SQL-FineBuild] +Release date: 2017-10-28 +Support Version: 2005-2017 +Author: Edward Vassie +Free version: Yes +Prise: No + +SQL FineBuild provides 1-click install and best-practice configuration on Windows of SQL Server 2017 down to SQL Server 2005. + + +## SQL Health Monitor + +Download page: [SQL Health Monitor] +Release date: ? +Support Version: 2000-2014 +Author: Edward Vassie +Free version: Yes +Prise: No + + - Keep a tab on the performance parameters of both default and named instances + - Get a dashboard view of system resources used & MS SQL performance parameters + - Fetch the status of Winodws services related to your MS SQL Server + - Keep an eye on buffer, memory, lock and latch details of your MS SQL Server + - Generate real time performance reports in PDF format and Email it from the tool + + +## SQL Instance Check + +Download page: [SQL Instance Check] +Release date: ? +Support Version: 2008-2019 +Author: Idera +Free version: Yes +Prise: No + + + - Monitor 20 key performance metrics + - See throughput of varying types + - See "heartbeat" statistics at different intervals + - Up and running in minutes with easy installation wizard + - No agents required + - Connect to cloud and run in cloud (provisional) + + +## SQLPRep + +Download page: [SQLPRep] +Release date: ? +Support Version: ? +Author: Consequential Solutions +Free version: Yes +Prise: No + +SQLPRep 2015 aka SQL Performance Report is our newest software product that takes any TSQL and produces a concise, readable, highlighted performance report allowing you to greatly reduce your time spent in developing, debugging, optimising, testing and reviewing TSQL. + + +## SQL Server Monitoring + +Download page: [SQL Server Monitoring] +Release date: ? +Support Version: 2005 and higher +Author: Spiceworks +Free version: Yes +Prise: No + + - Auto collect data about the server + - Instantly access health info on the data + - Create multiple widgets to monitor what you want + - Monitor SQL Server size, connection, speed & more + + +## SQL Server Storage manager + +Download page: [SQL Server Storage manager] +Release date: ? +Support Version: ? +Author: Lepide Software +Free version: Yes +Prise: No + + - Removes the need to writing complex SQL Servers and stored procedures + - Provides real time alerts based on easy to configure criteria + - Provides a centralized platform to create consolidated reports of all SQL resources + - Provides simple graphical displays showing all elements of your SQL servers + + +## SysKit Pulse + +Download page: [SysKit Pulse] +Release date: ? +Support Version: ? +Author: SysKit Ltd +Free version: Yes +Prise: No + + - Track servers via interactive live dashboards. + - Server Auto-Discover Wizard + - Performance Counters Check + - A simplified way of looking at your servers. + + +## WhatsUp SQL Server Monitor + +Download page: [WhatsUp SQL Server Monitor] +Release date: ? +Support Version: ? +Author: Ipswitch +Free version: Yes +Prise: No + +The WhatsUp SQL Server Monitor is a free tool that shows off Ipswitch monitoring technology you can use to catch problems before they begin to affect users. + + +## YourSqlDba + +Download page: [YourSqlDba] +Release date: 2020-05-05 +Support Version: ? +Author: Maurice Pelchat +Free version: Yes +Prise: No + +YourSqlDba script creates a database named YourSqlDba packed with T-SQL modules (function, stored procedures, and views) on the server where it is run. +You don't need to be concerned by all of them, albeit some of them are interesting tools for exceptional day-to-day DBA tasks, out of regular maintenance tasks. + + +## POPSQL + +Download page: [POPSQL] +Release date: 2020-08-01 +Support Version: 2008-2019 +Author: POPSQL +Free version: Yes +Prise: $10 + +Collaborative SQL editor for your team. +Write queries, visualize data, and share your results. + + +## ApexSQL Search + +Download page: [ApexSQL Search]
+Release date: 2020-07-30
+Support Version: SQL Server 2005 and higher
+Author: ApexSQL
+Free version: Yes
+Price: No + + - Search for SQL objects + - Quickly find data in SQL tables + - Edit extended properties + - Easily navigate to result objects + - Rename SQL objects safely + - Export results to HTML, CSV and Excel + + +## ApexSQL Source Control + +Download page: [ApexSQL Source Control]
+Release date: 2020-01-20
+Support Version: SQL Server 2005 and higher
+Author: ApexSQL
+Free version: No
+Price: $299 + + - Integrate SQL source control directly into SSMS + - Use dedicated or shared development models + - View conflicts and resolve directly in the UI + - View a detailed history of changes + - Lock objects to prevent overwrites + - Set team policies for check outs and locks + - Apply changes with dependency aware scripts + - Create and apply labels from source control + - Create branch or merge branches directly from SSMS + - Associate a changeset with a TFS work item + + +## Azure Blob Studio 2011 + +Download page: [Azure Blob Studio 2011]
+Release date: 2010-12-25
+Support Version: ?
+Author: Alessandro Del Sole
+Free version: Yes
+Price: No + +Azure Blob Studio is a tool for managing files in the Windows Azure's Blob Storage +You can: + - Work with both the developer and on-line accounts + - Create containers (folders) + - Upload multiple blobs (files) + - Remove containers + - Remove multiple blobs + - Retrieve URI for each blob + - Copy the blob's URI to the clipboard right-clicking the Blob's name + - Retrieve metadata + - Open blobs via URI + + +## Azure Explorer + +Download page: [Azure Explorer]
+Release date: ?
+Support Version: ?
+Author: Monza Cloud
+Free version: Yes
+Price: No + + - Manage Azure blobs like local files + - Support for common blob operations + - Built for users with thousands of blob containers + - Designed for Microsoft Azure + + +## Azure SQL Agent + +Download page: [Azure SQL Agent]
+Release date: ?
+Support Version: ?
+Author: ?
+Free version: Yes
+Price: No + +Command line agent to automatically add your current public IP address to the Azure SQL firewall + + +## Azure SQL Database DTU Calculator + +Download page: [Azure SQL Database DTU Calculator]
+Release date: ?
+Support Version: ?
+Author: Justin Henriksen
+Free version: Yes
+Price: No + +This calculator will help you determine the number of DTUs for your existing SQL Server database(s) as well as a recommendation of the minimum performance level and service tier that you need before you migrate to Azure SQL Database. + + +## Azure SQL Database Stress Test Tool + +Download page: [Azure SQL Database Stress Test Tool]
+Release date: ?
+Support Version: ?
+Author: Kiyoaki Tsurutani
+Free version: Yes
+Price: No + +Azure SQL Database Stress Test Tool + + +## Azure SQL Dev Cloner + +Download page: [Azure SQL Dev Cloner]
+Release date: ?
+Support Version: ?
+Author: ?
+Free version: Yes
+Price: No + +Command line tool for cloning an Azure SQL Database from website instance to another. It optionally allows the target to be a Deployment Slot. + + +## Azure User Management Console + +Download page: [Azure User Management Console]
+Release date: ?
+Support Version: ?
+Author: ?
+Free version: Yes
+Price: No + +AUMC is a User Graphic Interface (GUI) that manages the users and logins of an Azure SQL database. The tool is simply convertin + + +## CloudMonix SQL Azure Database Management + +Download page: [CloudMonix SQL Azure Database Management]
+Release date: ?
+Support Version: ?
+Author: CloudMonix
+Free version: No
+Price: $15 + +CloudMonix monitors Azure SQL Databases by tracking their key performance indicators retrieved from Azure Management API and Dynamic Management Views. In addition, CloudMonix allows to automate maintenance tasks and automatically scale the database performance tier according to load. + +## DB Ghost Change Manager Professional + +Download page: [DB Ghost Change Manager Professional]
+Release date: ?
+Support Version: 2000-2019, Azure
+Author: Innovartis Ltd
+Free version: No
+Price: £430 + + - Scripts all object types into individual DROP/CREATE scripts, ready for check in to source control. + - Scripts data into boilerplate INSERT scripts. + - Builds databases from individual object scripts. + - Highlights syntax, dependency and data errors. + - Creates a single script for the database build that can be reused. + - Can synchronize two databases making them match precisely. + - Can synchronize an existing database to a set of base schema creation scripts in your Source Management System. This means that your Source Management System itself provides a complete audit trail. + - Can insert custom scripts at the end of the build, before and after the synch process. + - Creates a script of the differences between two databases or base schema scripts and a target database. + - Handles all types of database object and all complex interactions. + - Intuitive, straightforward wizard based interface. + - SessionSave facility lets you save your wizard answers for later reuse. + + +## dbForge Complete + +Download page: [dbForge Complete]
+Release date: 2020-09-01
+Support Version: 2000-2019, Azure
+Author: Devart
+Free version: No
+Price: $199 + + - Speed up SQL query writing with IntelliSense-style SQL code completion + - Beautify T-SQL code and unify code standards with smart SQL Formatter + - Get the essential information on DB objects while you are writing a code + - Format your SQL query right in Management Studio or Visual Studio + - Use rich SQL code snippet collection, manage and modify the existing snippets or create your own templates + - Navigate through the SQL document easily and synchronize it with the code + - Rename tables, columns, procedures, and functions safely with automatic correction of references to the renamed objects + - Boost your productivity significantly with convenient tabs and windows, as well as intuitive SQL statements management + + +## dbForge SQL Azure Backup + +Download page: [dbForge SQL Azure Backup]
+Release date: 2013-04-18
+Support Version: ?
+Author: Devart
+Free version: Yes
+Price: No + + - Create a copy of your SQL Azure database on local SQL Server + - Make an archive copy on your local hard drive + - Restore SQL Azure database from archive + - Schedule periodic backups to your Azure Blob storage + + +## Devart Transaction Log + +Download page: [Devart Transaction Log]
+Release date: 2020-10-16
+Support Version: 2008-2019
+Author: Devart
+Free version: No
+Price: $600 + +dbForge Transaction Log for SQL Server is a powerful transaction log reader tool and `.ldf` file viewer. +With its help, you can view and analyze SQL Server transaction logs and recover data from them. +The tool provides detailed information about all data changes in your database and gives you the ability to revert unwanted transactions on different levels depending on your current needs. + + +## Elastic database tools + +Download page: [Elastic database tools]
+Release date: ?
+Support Version: Azure
+Author: Microsoft
+Free version: Yes
+Price: No + +The elastic database client library helping you run a sample app. The sample app creates a simple sharded application and explores key capabilities of the Elastic Database Tools feature of Azure SQL Database. It focuses on use cases for shard map management, data-dependent routing, and multi-shard querying. The client library is available for .NET as well as Java. + + +## Microsoft Sync Framework + +Download page: [Microsoft Sync Framework]
+Release date: 2020-04-22
+Support Version: Azure
+Author: Microsoft
+Free version: Yes
+Price: No + +Microsoft Sync Framework is a comprehensive synchronization platform that enables collaboration and offline scenarios for applications, services, and devices. +Sync Framework 2.1 introduces new features that let you synchronize a SQL Server or SQL Server Compact database on your computer with a SQL Azure database. This release also introduces parameter-based filtering, the ability to remove synchronization scopes and templates from a database, and performance enhancements to make synchronization faster and easier. + + +## MSSQL-Maestro + +Download page: [MSSQL-Maestro]
+Release date: 2017-06-29
+Support Version: from 7.0 to 2019, Azure 11 and 12
+Author: SQL Maestro Group
+Free version: No
+Price: $229 + +Complete and powerful database management, admin and development tool for Microsoft SQL Server and Microsoft Azure SQL Database. + + +## MSSQLMerge + +Download page: [MSSQLMerge]
+Release date: 2021-02-26
+Support Version: 2008-2019, Azure
+Author: Konstantin Semenenkov
+Free version: Yes
+Price: $75 + +MssqlMerge is an easy to use diff & merge tool for Microsoft SQL Server databases. This tool allows users to compare and import/export the most common database programming objects and the data between any two databases. + + +## SQL Backup and FTP + +Download page: [SQL Backup and FTP]
+Release date: ?
+Support Version: ?
+Author: Pranas.NET
+Free version: Yes
+Price: $129 + +SQLBackupAndFTP is SQL Server, MySQL and PostgreSQL backup software that runs scheduled backups (full, differential or transaction log) of SQL Server or SQL Server Express databases (any version), runs file/folder backup, zips and encrypts the backups, stores them on a network or on an FTP server or in the cloud (Amazon S3 and others we're constantly adding more), removes old backups, and sends an e-mail confirmation on the job's success or failure. + + +## SQL Bak + +Download page: [SQL Bak]
+Release date: ?
+Support Version: ?
+Author: Pranas.NET
+Free version: Yes
+Price: $9 + + - Schedule and restore sql backup from any web browser on any device + - Send backups to a folder, FTP, Dropbox, Google Drive, OneDrive, Amazon S3 and more + - Monitor database performance and receive email alerts + - Install our app on Windows or Linux, connect to sqlbak.com, then manage backups via the web + + +## SQL Bulk Tools + +Download page: [SQL Bulk Tools]
+Release date: ?
+Support Version: ?
+Author: Greg Taylor
+Free version: Yes
+Price: No + +## SQL Data Examiner + +Download page: [SQL Data Examiner]
+Release date: ?
+Support Version: ?
+Author: Intelligent Database Solutions
+Free version: No
+Price: $400 + + - Migrate data between database servers + - Verify data migration success + - Consolidate data from slave databases to a master database + - Perform one-way master-slave or slave-master replication + + +## SQL Examiner + +Download page: [SQL Examiner]
+Release date: ?
+Support Version: ?
+Author: Intelligent Database Solutions
+Free version: No
+Price: $400 + + - Speed up the deployment of schema updates + - Eliminate a chance of a human error + - Quickly compare databases and find all the differences + - Work with MSSQL, Oracle, PostgreSQL, MySQL + - Keep your database schema under Source Control + - Set up a scheduled comparison and synchronization + - Performs cross-platform comparison and synchronization + + + +## SQL Database Backup + +Download page: [SQL Database Backup]
+Release date: ?
+Support Version: ?
+Author: Richard Astbury
+Free version: Yes
+Price: No + +Windows Azure SQL Database Backup Utility. +This utility will take a copy of your SQL Database, and once the copy has completed, will make a backup of the database to blob storage using the bacpac format. + + +## SQL Database Copy + +Download page: [SQL Database Copy]
+Release date: 2017-07-25
+Support Version: ?
+Author: ryanovic
+Free version: Yes
+Price: No + +Simple console tool uses SMO scripting capabilities and SqlBulkCopy for schema and data migration between different instances. +Available options: + - SQL Server database to Azure SQL database + - SQL Server database to SQL Server database + + +## SQL Delta Duo for SQL Server + +Download page: [SQL Delta Duo for SQL Server]
+Release date: ?
+Support Version: ?
+Author: The Australian Software Company
+Free version: No
+Price: $370 + +Compare and Sync Schema and Data for SQL Server databases. + + +## SQL Trace Replay + +Download page: [SQL Trace Replay]
+Release date: ?
+Support Version: ?
+Author: Mikhail Shilkov
+Free version: Yes
+Price: No + +Tool to capture and replay traces between SQL Server instances (and to Azure SQL Database in particular) + + +## SQL Workload Profiler + +Download page: [SQL Workload Profiler]
+Release date: 2014-10-01
+Support Version: 2008+, Azure
+Author: Chris Bailiss
+Free version: Yes
+Price: No + +SQL Workload Profiler is a free tool for capturing and logging workload performance information from SQL Server. Performance statistics can be captured minute-by-minute (or more frequently if you want, up to every ten seconds, depending on the type/size of workload). Data can be analysed as it is being collected and/or saved for later analysis. Workload Profiler supports both (on-premise) SQL Server and Azure SQL Database. + + +## SQLDBdiff + +Download page: [SQLDBdiff]
+Release date: ?
+Support Version: 2005-2019, Azure
+Author: SQLDBtools
+Free version: No
+Price: $60 + + - Tables and columns (with the possibility to respect or not columns order); + - Views (including their indexes and triggers); + - Stored procedures; + - User defined functions; + - Triggers; + - PK and Indexes (with the possibility to include or not statistic indexes); + - Relationships (FK); + - CHECK Constraints; + - Default Constraints; + - User Defined Data Type & User Defined Table Type + - DDL Triggers; + - Synonyms; + - In-Memory table + - System versioning (Temporal type) + - Permissions; + - User and Roles; + - Database properties; + - SQL Server properties. + + +## SQL Backup Master + +Download page: [SQL Backup Master]
+Release date: ?
+Support Version: 2005-2019
+Author: Key Metric Software
+Free version: Yes
+Price: $49 + + - Supports full, differential, and transaction log backups + - Simple yet powerful backup job scheduling + - Built-in email notifications for backup job successes, failures, and warnings + - Back up to local folders, network folders, or attached storage devices + - Back up to FTP servers with first-class FTP, SFTP, & FTPS support + - Back up to Dropbox, Google Drive, Box, Amazon S3, OneDrive, & Azure + + +## Handy Backup Server + +Download page: [Handy Backup Server]
+Release date: 2019-03-11
+Support Version: 2005-2019
+Author: Novosoft
+Free version: Yes
+Price: $39 + + - Automating All Operations + - Native and Generic Database Backup + - Other Server Data Backup + - Saving Snapshots of Virtual Machines + - Using Modern Local and Online Data Storages + - Dealing with OS older than Windows Server 2019 or other + + +## Veeam Explorer for Microsoft SQL Server + +Download page: [Veeam Explorer for Microsoft SQL Server]
+Release date: ?
+Support Version: ?
+Author: Veeam
+Free version: No
+Price: ? + + - Full database and table level recovery + - Perform quick point-in-time restore + - Delegate restore tasks to SQL DBAs + - Part of Veeam Backup & Replication + - Recover one or multiple databases simultaneously from a single-pass image level backup + - Restore entire Microsoft SQL databases down to the table level + - Microsoft SQL log backup provides transaction log replay to restore to a specific point in time + + +## EaseUS Todo Backup Server + +Download page: [EaseUS Todo Backup Server]
+Release date: ?
+Support Version: ?
+Author: EaseUS
+Free version: No
+Price: $39 + + - Add new backup tasks on disk, partition, system, mail and other data + - Select a source system/disk/partition, target a location to store copies and clone fast + - Create a bootable WinPE/Linux bootable USB/DVD/CD to restart the system from it + - Check backup logs, replicate backup issues, and restore data from exact backup files + - P2V copy, P2V recovery, P2V conversion. Clone, restore, and convert backup to the virtual machine + + +## SqlBackupFree + +Download page: [SqlBackupFree]
+Release date: ?
+Support Version: ?
+Author: pranas.net
+Free version: Yes
+Price: No + + - Schedule SQL Server Database Backups. Full backups + - Compress (zip) the backups + - Send backups to FTP, local, network folder or HDD drive + - Send e-mail confirmation on job success or failure + + +## ERDPlus + +Download page: [ERDPlus]
+Release date: ?
+Support Version: ?
+Author: ERDPlus
+Free version: ?
+Price: ? + +A database modeling tool for creating Entity Relationship Diagrams, Relational Schemas, Star Schemas, and SQL DDL statements. + + +## SentryOne Test + +Download page: [SentryOne Test]
+Release date: ?
+Support Version: ?
+Author: SQL Sentry
+Free version: No
+Price: $828 + + - Quickly build tests with wizards + - Simplify unit testing + - Build tests within Visual Studio + - Create custom testing modules + - Reconcile and verify data + - Conduct BI testing + + +## Query Performance Insight for Azure SQL Database + +Download page: [Query Performance Insight for Azure SQL Database]
+Release date: ?
+Support Version: Azure
+Author: Microsoft
+Free version: Yes
+Price: No + + - Deeper insight into your databases resource (DTU) consumption + - Details on top database queries by CPU, duration, and execution count (potential tuning candidates for performance improvements) + - The ability to drill down into details of a query, to view the query text and history of resource utilization + - Annotations that show performance recommendations from database advisors + + +## Code Quality and Security for T-SQL + +Download page: [Code Quality and Security for T-SQL]
+Release date: ?
+Support Version: ?
+Author: SonarSource
+Free version: Yes
+Price: €120 + +SonarSource provides static code analysis for T-SQL projects. Based on our own T-SQL compiler front-end, it uses the most advanced techniques (pattern matching, program flow analysis) to analyze code and find Code Smells, Bugs, and Security Vulnerabilities. As with everything we develop at SonarSource, it was built on the principles of depth, accuracy, and speed. + +## DBBALANCE + +Download page: [DBBALANCE]
+Release date: ?
+Support Version: ?
+Author: DBBalance
+Free version: No
+Price: ? + + - Data and Schema Synchronization + - Data and Schema Comparison + - Database Migration + - Database Development + + +## Convert SQL to Excel + +Download page: [Convert SQL to Excel]
+Release date: 2015-10-09
+Support Version: 2000-2014
+Author: MSSQL.TOOLS
+Free version: Yes
+Price: No + + - Easy way to convert SQL table or a subset of table to Excel. No programming. + - Convert / export a SQL Table to Excel file (.xlsx or .xls format) + - Convert multiple tables (multiple query results) to multiple Excel worksheets. + - Allow flexible TSQL query which can have multiple SELECT statements or other complex query statements. + - Supports command line execution (unattended mode). Useful for periodical scheduling. + - Allow user defined Excel worksheet names. + + +## Search string in Schema + +Download page: [Search string in Schema]
+Release date: 2015-10-09
+Support Version: 2005-2012
+Author: MSSQL.TOOLS
+Free version: Yes
+Price: No + + - This tool searches tables, columns, views, stored procedures, XPs, functions, triggers, constraints and SQL Agent Jobs in a database to find a given string. + - Simply input target server, target database, search keyword and you will get fast search results! + - Supports filterng by object type or schema user + - Supports easy switch between multiple SQL Servers. + - Supports SQL Agent Jobs search. + + +## Search string in SQL + +Download page: [Search string in SQL]
+Release date: 2015-10-09
+Support Version: 2005-2008
+Author: MSSQL.TOOLS
+Free version: Yes
+Price: No + +This tool helps you to search all columns of all tables in a database for a string keyword. In order to increase performance, it examines string type columns only in all tables to search for a given keyword. + + +## SQL Table Scripter + +Download page: [SQL Table Scripter]
+Release date: 2015-10-09
+Support Version: 2005, 2008
+Author: MSSQL.TOOLS
+Free version: Yes
+Price: No + +- Generates a CREATE SQL script for a table. +- Script can include all DRI (declarative referential integrity) such as Foreign Key, Constraints for the table. +- Script can include Indexes for the table. +- Generates INSERT SQL scripts for table data (optionally). + + +## SQLCLR Util + +Download page: [SQLCLR Util]
+Release date: 2015-10-09
+Support Version: 2005-2019r
+Author: MSSQL.TOOLS
+Free version: Yes
+Price: No + +- generates DLL file from SQL CLR assembly in the SQL Server. When creating SQL CLR assembly with its DLL file, SQL Server saves the DLL binary into SQL Server system table. This tool help you to recreate DLL file easily from the SQL Server system table. +- generates CREATE ASSEMBLY script from a DLL file. Once CREATE script is generated, one can run the script without physical .DLL file. This method will be useful when one has no permission to access physical disk on the server because there is no need to copy the file to server. + + +## Image To SQL + +Download page: [Image To SQL]
+Release date: 2015-10-09
+Support Version: 2005,2008 or later
+Author: MSSQL.TOOLS
+Free version: Yes
+Price: No + +- Save any image file such as `.JPG`, `.PNG`, `.BMP`, `.GIF` to SQL Server table. +- Image file is saved to any varbinary column (or image column) +- User can specify input image file and table/column target in easy UI. +- User can specify where to save image file by setting primary key value(s) of the user table in easy UI. + + +## dbdiagram + +Download page: [dbdiagram]
+Release date: ?
+Support Version: ?
+Author: holistics.io
+Free version: Yes
+Price: $9/mo + +A free, simple tool to draw ER diagrams by just writing code. Designed for developers and data analysts. + +- Generate SQL statements +- Export to Images and PDFs +- One Click Sharing +- Integrate with your SQL Databases +- Integrate with Popular Web Frameworks + + +## Beekeeper Studio + +Download page: [Beekeeper Studio]
+Release date: 2020-10-19
+Support Version: 2008-2019
+Author: Beekeeper Studio
+Free version: Yes
+Price: No + +Modern and easy to use SQL client for MySQL, Postgres, SQLite, SQL Server, and more. Linux, MacOS, and Windows. + +- Autocomplete SQL query editor with syntax highlighting +- Tabbed interface, so you can multitask +- Sort and filter table data to find just what you need +- Sensible keyboard-shortcuts +- Save queries for later +- Query run-history, so you can find that one query you got working 3 days ago +- Default dark theme + + +## Babelfish for Aurora PostgreSQL + +Download page: [Babelfish for Aurora PostgreSQL]
+Release date: 2020-12-01
+Support Version: 2008-2019
+Author: Amazon
+Free version: Yes
+Price: No + +Babelfish is a new translation layer for Amazon Aurora PostgreSQL that enables Aurora to understand commands from applications written for Microsoft SQL Server. + + +## DBA Dash + +Download page: [DBA Dash]
+Release date: 2022-01-13
+Support Version: 2005-2019
+Author: Trimble
+Free version: Yes
+Price: No + +DBA Dash is a tool for SQL Server DBAs to assist with daily checks, performance monitoring and change tracking. +- Waits, Running Queries, Performance Counters, CPU, IO, Object Execution, Extended Events, Azure DB +- Configuration, Trace Flags, Hardware, Patching, Schema +- HA/DR, Backups, Last Good DBCC, Drive Space, Agent Jobs, Corruption, Alerts + +## SQLWATCH + +Download page: [SQLWATCH]
+Release date: 2018-09-16
+Support Version: 2008-2019
+Author: Marcin Gminski
+Free version: Yes
+Price: No + +SQLWATCH is an Open Source (MIT License) Real-Time monitoring solution for SQL Server +- Grafana and Power BI Dashboards +- Real Time Alerts and Actions +- Central Repository +- Infinite scalability. SQLWATCH can collect data locally on the local SQL Server or into a central repository. + +[SSMS]:https://docs.microsoft.com/sql/ssms/download-sql-server-management-studio-ssms +[Azure Data Studio]:https://github.com/Microsoft/azuredatastudio +[bcp Utility]:https://docs.microsoft.com/sql/tools/bcp-utility +[sqlcmd Utility]:https://docs.microsoft.com/sql/tools/sqlcmd-utility +[mssql-cli]:https://github.com/dbcli/mssql-cli [RML Utilities for SQL Server]:https://www.microsoft.com/en-us/download/details.aspx?id=4511 [GraphView]:https://github.com/Microsoft/GraphView [Baseline Security Analyze]:https://www.microsoft.com/en-us/download/details.aspx?id=7558 @@ -4323,23 +6247,24 @@ Analyze and fix index fragmentation for SQL Server / Azure [SQL Server Data Tools]:https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt [Database Health Monitor]:http://databasehealth.com/download/ [SchemaDrift]:http://databasehealth.com/schemadrift/ -[Dbeaver]:http://dbeaver.jkiss.org/ -[HeidiSQL]:http://www.heidisql.com +[Dbeaver]:https://dbeaver.io +[HeidiSQL]:https://www.heidisql.com [SQLExecStats]:http://www.qdpma.com/ExecStats/SQLExecStats.html [ExpressProfiler]:https://expressprofiler.codeplex.com/ -[Migration Assistant for Sybase]:https://msdn.microsoft.com/en-us/library/hh302795(v=sql.130).aspx -[Data Migration Assistant]:https://blogs.msdn.microsoft.com/datamigration/dma/ -[dta Utility]:https://msdn.microsoft.com/en-us/library/ms162812.aspx -[osql Utility]:https://msdn.microsoft.com/en-us/library/ms162806.aspx -[sqldiag Utility]:https://msdn.microsoft.com/en-us/library/ms162833.aspx -[sqldumper Utility]:https://support.microsoft.com/en-us/kb/917825 -[SqlLocalDB Utility]:https://msdn.microsoft.com/en-us/library/hh212961.aspx -[sqllogship Utility]:https://msdn.microsoft.com/en-us/library/bb283327.aspx -[sqlservr Application]:https://msdn.microsoft.com/en-us/library/ms162819.aspx -[sqlps Utility]: https://msdn.microsoft.com/en-us/library/cc280450.aspx -[sqlmaint Utility]: https://msdn.microsoft.com/en-us/library/ms162827.aspx -[Ssms Utility]: https://msdn.microsoft.com/en-us/library/ms162825.aspx -[dtexec Utility]: https://msdn.microsoft.com/en-us/library/hh231187.aspx +[Migration Assistant for Sybase]:https://docs.microsoft.com/en-us/sql/ssma/sybase/sql-server-migration-assistant-for-sybase-sybasetosql +[Data Migration Assistant]:https://docs.microsoft.com/en-us/sql/dma/dma-overview +[dta Utility]:https://docs.microsoft.com/en-us/sql/tools/dta/dta-utility +[osql Utility]:https://docs.microsoft.com/en-us/sql/tools/osql-utility +[sqldiag Utility]:https://docs.microsoft.com/en-us/sql/tools/sqldiag-utility +[sqldumper Utility]:https://docs.microsoft.com/en-us/troubleshoot/sql/tools/use-sqldumper-generate-dump-file +[SqlLocalDB Utility]:https://docs.microsoft.com/en-us/sql/tools/sqllocaldb-utility +[sqllogship Utility]:https://docs.microsoft.com/en-us/sql/tools/sqllogship-application +[sqlservr Application]:https://docs.microsoft.com/en-us/sql/tools/sqlservr-application +[sqlps Utility]:https://docs.microsoft.com/en-us/sql/tools/sqlps-utility +[sqlmaint Utility]:https://docs.microsoft.com/en-us/sql/tools/sqlmaint-utility +[SSMS Utility]:https://docs.microsoft.com/en-us/sql/ssms/ssms-utility +[dtexec Utility]:https://docs.microsoft.com/en-us/sql/integration-services/packages/dtexec-utility +[adutil Utility]:https://docs.microsoft.com/sql/linux/sql-server-linux-ad-auth-adutil-tutorial [SQL Server 2016 Report Builder]:https://www.microsoft.com/en-us/download/details.aspx?id=53613 [DLM Dashboard]:http://www.red-gate.com/products/dlm/dlm-dashboard/ [Red Gate SQL Compare]:http://www.red-gate.com/products/sql-development/sql-compare/ @@ -4393,6 +6318,7 @@ Analyze and fix index fragmentation for SQL Server / Azure [SQL Comparison Toolset]:https://www.idera.com/productssolutions/sqlserver/sqlcomparisontoolset [ER/Studio Data Architect]:https://www.idera.com/er-studio-data-architect-software [DB Change Manager]:https://www.idera.com/database-change-management +[SQL Data Profiler]:https://www.idera.com/productssolutions/freetools/sql-data-profiler [dbForge Schema Compare]: https://www.devart.com/dbforge/sql/schemacompare/ [dbForge Data Compare]: https://www.devart.com/dbforge/sql/datacompare/ [dbForge Data Generator]: https://www.devart.com/dbforge/sql/data-generator/ @@ -4402,24 +6328,23 @@ Analyze and fix index fragmentation for SQL Server / Azure [dbForge Studio]:https://www.devart.com/dbforge/sql/studio/ [dbForge Fusion]:https://www.devart.com/dbforge/sql/fusion/ [dbForge Documenter]:https://www.devart.com/dbforge/sql/documenter/ -[dbForge Developer Bundle]:https://www.devart.com/dbforge/sql/developer-bundle/ -[dbForge Compare Bundle for SQL Server]:https://www.devart.com/dbforge/sql/compare-bundle/ +[dbForge SSIS Data Flow Components]:https://www.devart.com/ssis/ +[dbForge DevOps Automation for SQL Server]:https://www.devart.com/dbforge/sql/database-devops/ [Devart Excel Add-in for SQL Server]:https://www.devart.com/excel-addins/sql-server.html [dbMonitor]:https://www.devart.com/dbmonitor/download.html [BPA 2005]: https://www.microsoft.com/en-us/download/details.aspx?id=23864 [BPA 2000]: https://www.microsoft.com/en-us/download/details.aspx?id=15691 [BPA 2008]: https://www.microsoft.com/en-us/download/details.aspx?id=15289 [BPA 2012]: https://www.microsoft.com/en-us/download/details.aspx?id=29302 -[Minion Enterprise]:http://minionware.net/enterprise/ [SQL Server Compression Estimator]:http://ssce.codeplex.com [ClearTrace]:http://www.scalesql.com/cleartrace/download.html -[Dell Security Explorer]:http://software.dell.com/products/security-explorer/ -[Dell LiteSpeed for SQL Server]:http://software.dell.com/products/litespeed-for-sql-server/ -[Dell Toad for SQL Server]:http://software.dell.com/products/toad-for-sql-server/ -[Dell Spotlight]:http://software.dell.com/products/spotlight-on-sql-server-enterprise/ -[Dell Foglight]:http://software.dell.com/products/foglight-for-cross-platform-databases/ -[Dell Discovery Wizard]:http://software.dell.com/products/discovery-wizard-for-sql-server/ -[Dell Enterprise Reporter]:http://software.dell.com/products/enterprise-reporter-for-sql-server/ +[ClearTraceXE]:http://www.scalesql.com/cleartrace/download.html +[Security Explorer]:https://www.quest.com/products/security-explorer/ +[LiteSpeed for SQL Server]:https://www.quest.com/products/litespeed-for-sql-server/ +[Toad for SQL Server]:https://www.quest.com/products/toad-for-sql-server/ +[Quest Spotlight]:https://www.quest.com/products/spotlight-on-sql-server-enterprise/ +[Quest Foglight]:https://www.quest.com/products/foglight-for-cross-platform-databases/ +[Quest Enterprise Reporter]:https://www.quest.com/enterprise-reporter/ [SQL Scripter]:http://www.sqlscripter.com/ [Simple Dynamic Scheduler]:http://www.codeproject.com/Articles/1096104/Simple-Dynamic-Scheduler [ApexSQL Audit]:http://www.apexsql.com/sql_tools_audit.aspx @@ -4447,6 +6372,10 @@ Analyze and fix index fragmentation for SQL Server / Azure [ApexSQL VM Monitor]:https://www.apexsql.com/sql_tools_vm_monitor.aspx [ApexSQL Job]:https://www.apexsql.com/sql_tools_job.aspx [ApexSQL Enforce]:https://www.apexsql.com/sql_tools_enforce.aspx +[ApexSQL CI/CD toolkit]:https://www.apexsql.com/sql-tools-devops.aspx +[ApexSQL Compare]:https://www.apexsql.com/sql-tools-compare.aspx +[ApexSQL Complete]:https://www.apexsql.com/sql-tools-complete.aspx +[ApexSQL Refactor]:https://www.apexsql.com/sql-tools-refactor.aspx [DBBest T-SQL Analyzer]:https://www.dbbest.com/products/t-sql-analyzer [DBBest Database Compare Suite]:https://www.dbbest.com/products/database-compare-suite/ [Advanced Query Tool]:http://www.querytool.com/ @@ -4480,7 +6409,8 @@ Analyze and fix index fragmentation for SQL Server / Azure [EMS Data Comparer]:http://www.sqlmanager.net/en/products/mssql/datacomparer [NitroAccelerator]:http://nitrosphere.com/nitroaccelerator/ [ERwin Data Modeler]:http://erwin.com/products/data-modeler -[Toad Data Modeler]:https://software.dell.com/products/toad-data-modeler/ +[Luna Modeler]:https://www.datensen.com/luna-modeler-for-relational-databases.html +[Toad Data Point]:https://www.quest.com/products/toad-data-point/ [SQL Power Architect]:http://www.sqlpower.ca/page/architect [DbWrench]:http://www.dbwrench.com/ [Navicat Data Modeler]:https://www.navicat.com/products/navicat-data-modeler @@ -4495,7 +6425,7 @@ Analyze and fix index fragmentation for SQL Server / Azure [Database .NET]:http://fishcodelib.com/Database.htm [dbMigration .NET]:http://fishcodelib.com/dbMigration.htm [Is It SQL]:http://www.scalesql.com/isitsql -[Database Experimentation Assistant]:https://blogs.msdn.microsoft.com/datamigration/2017/03/24/dea-2-0-release-overview-database-experimentation-assistant +[Database Experimentation Assistant]:https://www.microsoft.com/en-us/download/details.aspx?id=54090 [Data Platform Studio]:http://www.red-gate.com/products/azure-development/data-platform-studio [Flyway]:https://flywaydb.org [Liquibase]:http://www.liquibase.org @@ -4515,8 +6445,9 @@ Analyze and fix index fragmentation for SQL Server / Azure [Cloud-based DB Monitoring Platform]:https://www.sqltreeo.com [SchemaCrawler]:http://sualeh.github.io/SchemaCrawler/index.html [SA MaaS Microsoft SQL Server]:http://sentinelagent.com/maas/microsoft-sql-server -[CatCompare v2]:https://dilmsuite.com/downloads/cat-compare-v2 -[SSIS Catalog Compare v2.0 Bundle]:https://dilmsuite.com/downloads/ssis-catalog-compare-v2-bundle +[SSIS Framework]:https://dilmsuite.com/ssis-framework-editions/ +[SSIS Catalog Browser]:https://dilmsuite.com/product/catalog-browser/ +[BimlExpress Metadata Framework]:https://dilmsuite.com/product/biml-express-metadata-framework/ [MS Kerberos Configuration Manager]:https://www.microsoft.com/en-us/download/details.aspx?id=39046 [Spotlight]:https://www.spotlightessentials.com/home/Console [DBConvert Studio]:https://dbconvert.com/dbconvert-studio @@ -4543,7 +6474,7 @@ Analyze and fix index fragmentation for SQL Server / Azure [SQL Server Migration Assistant for Oracle]:https://www.microsoft.com/en-us/download/details.aspx?id=54258 [SQL Server Migration Assistant for Access]:https://www.microsoft.com/en-us/download/details.aspx?id=54255 [mssql for Visual Studio Code]:https://github.com/Microsoft/vscode-mssql -[Microsoft Assessment and Planning]:https://www.sqlshack.com/how-to-use-microsoft-assessment-and-planning-map-toolkit-for-sql-server +[Microsoft Assessment and Planning (MAP) Toolkit]:https://www.sqlshack.com/how-to-use-microsoft-assessment-and-planning-map-toolkit-for-sql-server [mssql-scripter]:https://github.com/Microsoft/sql-xplat-cli [DBFS]:https://github.com/Microsoft/dbfs [comparator]:https://github.com/Pumpet/comparator @@ -4554,9 +6485,9 @@ Analyze and fix index fragmentation for SQL Server / Azure [DBGhost]:http://www.dbghost.com [SQLAutomate]:http://www.sqlautomate.com [BimlExpress]:https://www.varigence.com/BimlExpress -[BIDS Helper]:https://bidshelper.codeplex.com +[BI Developer Extensions]:https://bideveloperextensions.github.io [Azure Data Warehouse Migration Utility]:https://docs.microsoft.com/en-us/azure/sql-data-warehouse/sql-data-warehouse-migrate-migration-utility -[Dell Benchmark Factory]:https://www.quest.com/products/benchmark-factory +[Benchmark Factory]:https://www.quest.com/products/benchmark-factory [manduka]:http://www.manduka.tech/#/home [PowerBI Desktop]:https://powerbi.microsoft.com/en-us/desktop/ [Stellar Phoenix SQL Database Repair]:https://www.stellarinfo.com/sql-recovery.php @@ -4583,6 +6514,119 @@ Analyze and fix index fragmentation for SQL Server / Azure [Valentina Studio]:https://www.valentina-db.com [SQL Plus Dot Net]:https://sqlplusweb.azurewebsites.net [SQLIndexManager]:https://github.com/sergeysyrovatchenko/SQLIndexManager +[JAMS Enterprise Job Scheduling]:https://info.jamsscheduler.com/jams-sql-wla-rethink +[Stitch Data Loader]:https://www.talend.com/products/data-loader/ +[Talend Data Integration]:https://www.talend.com/products/data-integration/ +[Talend Data Preparation]:https://www.talend.com/products/data-preparation/ +[Pentaho Data Integration]:https://www.hitachivantara.com/en-us/products/data-management-analytics/pentaho-data-integration.html +[Studio3T]:https://studio3t.com/ +[SQLGrease]:https://sqlgrease.com +[QuickDBD]:https://www.quickdatabasediagrams.com/ +[DB Designer]:https://www.dbdesigner.net +[ESF Database Migration Toolkit]:https://www.dbsofts.com/ +[MS SQL Migration Toolkit]:https://www.convert-in.com/msskit.htm +[DatabaseSpy]:https://www.altova.com/databasespy +[DiffDog]:https://www.altova.com/diffdog +[ERBuilder data modeler]:https://soft-builder.com/ +[SQLDatabaseStudio]:https://www.sqldatabasestudio.com/ +[Enterprise Architect]:https://sparxsystems.com/products/ea/index.html +[MogwaiERDesignerNG]:https://github.com/mirkosertic/MogwaiERDesignerNG +[Xcase]:https://www.xcase.com/ +[Oracle SQL Developer Data Modeler ]:https://www.oracle.com/database/technologies/appdev/datamodeler.html +[Exportizer]:https://www.vlsoftware.net/exportizer/ +[Reportizer]:https://www.reportizer.net/ +[Database Tour]:https://www.databasetour.net/ +[Ispirer MnMATK]:https://www.ispirer.com/download/download-sqlways-assessment +[SQL Database Recovery]:https://www.nucleustechnologies.com/sql-recovery.html +[SysTools SQL Log Analyzer]:https://www.systoolsgroup.com/sql-log-analyzer.html +[SysTools SQL Server Recovery Manager]:https://www.systoolsgroup.com/sql-server-recovery-manager.html +[SysTools SQL Recovery]:https://www.systoolsgroup.com/sql-recovery.html +[SQL Backup Recovery]:https://www.systoolsgroup.com/sql-backup-recovery.html +[SysTools SQL Password Recovery]:https://www.systoolsgroup.com/sql-password-recovery.html +[SysTools SQL Decryptor]:https://www.systoolsgroup.com/sql-decryptor.html +[SysTools SQL Server Database Migrator]:https://www.systoolsgroup.com/sql-server/migration/ +[SQL Server to Azure Database Migrator]:https://www.systoolsgroup.com/sql-server/azure/ +[Commvault Complete Backup & Recovery]:https://www.commvault.com/complete-backup +[Veeam Backup & Replication]:https://www.veeam.com/ru/vm-backup-recovery-replication-software.html +[Database Modeling Excel]:https://github.com/snyang/Database-Modeling-Excel +[DBAchecks]:https://github.com/sqlcollaborative/dbachecks +[DBComparer]:https://dbcomparer.com/default.aspx +[DbViewSharp]:https://www.softpedia.com/get/Internet/Servers/Database-Utils/DbViewSharp.shtml +[DTSQL]:http://www.dtsql.com/database_tools.htm +[MSKerberos Configuration Manager]:https://www.microsoft.com/en-us/download/details.aspx?id=39046 +[Partition Management]:https://archive.codeplex.com/?p=sqlpartitionmgmt +[Powershell Scripts]:https://www.idera.com/productssolutions/freetools/sqlpowershellscripts +[PSDatabaseClone]:https://psdatabaseclone.org/# +[Pssdiag&Sqldiag Manager]:https://github.com/microsoft/DiagManager/releases +[SQuirreL SQL Client]:http://squirrelsql.org +[Data Synchronisation Studio]:https://www.simego.com/solutions/sql +[SQL Converter]:https://sourceforge.net/projects/sql-converter +[SQLDBSearch]:https://www.sqldbtools.com/tools/sqldbsearch +[SQLDBSize]:https://www.sqldbtools.com/tools/sqldbsize +[SQLines Data]:http://www.sqlines.com/sqldata +[SqlDbAid]:http://sqlapproach.blogspot.com/2010/06/sqldbaid.html +[sqlectron]:https://sqlectron.github.io +[SQL ExecStats]:http://www.qdpma.com/execstats/sqlexecstats.html +[SQL-FineBuild]:https://github.com/SQL-FineBuild/v3.4 +[SQL Health Monitor]:https://www.manageengine.com/sql-performance-monitor/sql-server-monitoring-index.html +[SQL Instance Check]:https://www.idera.com/productssolutions/freetools +[SQLPRep]:https://www.csqls.com/products +[SQL Server Migration Assistant for SAP ASE]:https://www.microsoft.com/en-us/download/details.aspx?id=54256 +[SQL Server Backup]:https://ola.hallengren.com/sql-server-backup.html +[SQL Server Integrity Check]:https://ola.hallengren.com/sql-server-integrity-check.html +[SQL Server Monitoring]:https://www.spiceworks.com/free-sql-server-monitoring-tool +[SQL Server Storage manager]:https://www.lepide.com/sql-storage-manager +[SysKit Pulse]:https://www.syskit.com/products/insights-lite +[WhatsUp SQL Server Monitor]:https://www.ipswitch.com/resources/free-tools/whatsup-sql-server-monitor +[POPSQL]:https://popsql.com/ +[ApexSQL Search]:https://www.apexsql.com/sql-tools-search.aspx +[ApexSQL Source Control]:https://www.apexsql.com/sql-tools-source-control.aspx +[Azure Blob Studio 2011]:https://marketplace.visualstudio.com/items?itemName=AlessandroDelSoleMVP.AzureBlobStudio2011 +[Azure Explorer]:https://monzacloud.com/azure-cloud-explorer +[Azure SQL Agent]:https://www.npmjs.com/package/azure-sql-agent +[Azure SQL Database DTU Calculator]:https://dtucalculator.azurewebsites.net +[Azure SQL Database Stress Test Tool]:https://github.com/kiyoaki/AzurePerformanceTesting +[Azure SQL Dev Cloner]:https://github.com/cleanchoice/azure-sql-dev-cloner +[Azure User Management Console]:https://www.openhub.net/p/aumc +[CloudMonix SQL Azure Database Management]:https://cloudmonix.com/features/azure-management/sql-azure-database-monitoring +[DB Ghost Change Manager Professional]:http://www.dbghost.com/products/ChangeManager.aspx +[dbForge Complete]:https://www.devart.com/dbforge/sql/sqlcomplete +[dbForge SQL Azure Backup]:https://www.devart.com/dbforge/sql/sqlazurebackup +[Devart Transaction Log]:https://www.devart.com/dbforge/sql/transaction-log/ +[Elastic database tools]:https://docs.microsoft.com/en-us/azure/azure-sql/database/elastic-scale-get-started +[Microsoft Sync Framework]:https://www.microsoft.com/en-us/download/details.aspx?id=23217 +[MSSQL-Maestro]:https://www.sqlmaestro.com/products/mssql/maestro/about +[MSSQLMerge]:https://db-merge-tools.net/microsoft-sql-server-diff-merge-overview.html +[SQL Backup and FTP]:https://sqlbackupandftp.com +[SQL Bak]:https://sqlbak.com +[SQL Bulk Tools]:https://github.com/olegil/SqlBulkTools +[SQL Data Examiner]:https://www.sqlaccessories.com/sql-data-examiner +[SQL Examiner]:https://www.sqlaccessories.com/sql-examiner +[SQL Database Backup]:https://github.com/richorama/SQLDatabaseBackup +[SQL Database Copy]:https://github.com/ryanovic/SqlDatabaseCopy +[SQL Delta Duo for SQL Server]:https://sqldelta.com/products +[SQL Trace Replay]:https://github.com/mikhailshilkov/sql-trace-replay +[SQL Backup Master]:https://www.sqlbackupmaster.com +[Handy Backup Server]:https://www.handybackup.net/handybackup-server.shtml +[Veeam Explorer for Microsoft SQL Server]:https://www.veeam.com/microsoft-sql-server-explorer.html +[EaseUS Todo Backup Server]:https://www.easeus.com/backup-software/tb-enterprise.html +[SqlBackupFree]:http://sqlbackupfree.com +[ERDPlus]:https://erdplus.com +[SentryOne Test]:https://www.sentryone.com/products/sentryone-test +[Query Performance Insight for Azure SQL Database]:https://docs.microsoft.com/en-us/azure/azure-sql/database/query-performance-insight-use +[Code Quality and Security for T-SQL]:https://www.sonarsource.com/tsql +[DBBALANCE]:http://www.dbbalance.com +[Convert SQL to Excel]:http://mssql.tools/sql/Convert-SQL-to-Excel +[Search string in Schema]:http://mssql.tools/sql/Search-string-in-Schema +[Search string in SQL]:http://mssql.tools/sql/Search-string-in-SQL +[SQL Table Scripter]:http://mssql.tools/sql/SQL-Table-Scripter +[SQLCLR Util]:http://mssql.tools/sql/SQLCLR-Util +[Image To SQL]:http://mssql.tools/sql/Image-To-SQL +[dbdiagram]:https://dbdiagram.io/home +[Beekeeper Studio]:https://github.com/beekeeper-studio/beekeeper-studio +[Babelfish for Aurora PostgreSQL]:https://aws.amazon.com/rds/aurora/babelfish/ +[DBA Dash]:https://github.com/trimble-oss/dba-dash +[SQLWATCH]:https://sqlwatch.io [LGPL-3.0]:http://www.gnu.org/licenses/lgpl-3.0.txt [MIT]:https://opensource.org/licenses/MIT