diff --git a/bin/dbatools-buildref-index.json b/bin/dbatools-buildref-index.json index aed16e1f62..bf209caf06 100644 --- a/bin/dbatools-buildref-index.json +++ b/bin/dbatools-buildref-index.json @@ -1,5 +1,5 @@ { - "LastUpdated": "2024-07-10T00:00:00", + "LastUpdated": "2024-07-24T00:00:00", "Data": [ { "Version": "8.0.47", @@ -4725,6 +4725,11 @@ { "Version": "16.0.4131", "KBList": "5040939" + }, + { + "CU": "CU14", + "Version": "16.0.4135", + "KBList": "5038325" } ] } diff --git a/bin/dbatools-index.json b/bin/dbatools-index.json index 9cfb076553..df1c5240e9 100644 Binary files a/bin/dbatools-index.json and b/bin/dbatools-index.json differ diff --git a/bin/diagnosticquery/SQLServerDiagnosticQueries_2022.sql b/bin/diagnosticquery/SQLServerDiagnosticQueries_2022.sql index dc91c47f67..4fae6f54ec 100644 --- a/bin/diagnosticquery/SQLServerDiagnosticQueries_2022.sql +++ b/bin/diagnosticquery/SQLServerDiagnosticQueries_2022.sql @@ -1,7 +1,7 @@ -- SQL Server 2022 Diagnostic Information Queries -- Glenn Berry --- Last Modified: July 10, 2024 +-- Last Modified: July 24, 2024 -- https://glennsqlperformance.com/ -- https://sqlserverperformance.wordpress.com/ -- YouTube: https://bit.ly/2PkoAM1 @@ -81,6 +81,7 @@ SELECT @@SERVERNAME AS [Server Name], @@VERSION AS [SQL Server and OS Version In -- 16.0.4120.1 CU12 + GDR 4/9/2024 https://support.microsoft.com/en-us/topic/kb5036343-description-of-the-security-update-for-sql-server-2022-cu12-april-9-2024-e11a0715-435f-42be-89ff-4b3d8f9734fc -- 16.0.4125.3 CU13 5/16/2024 https://learn.microsoft.com/en-us/troubleshoot/sql/releases/sqlserver-2022/cumulativeupdate13 -- 16.0.4131.2 CU13 + GDR 7/9/2024 https://support.microsoft.com/en-us/topic/kb5040939-description-of-the-security-update-for-sql-server-2022-cu13-july-9-2024-16a61a81-926c-46a5-b6c0-edbca541f2f6 +-- 16.0.4135.4 CU14 7/23/2024 https://learn.microsoft.com/en-us/troubleshoot/sql/releases/sqlserver-2022/cumulativeupdate14 -- What's new in SQL Server 2022 (16.x) -- https://bit.ly/3MJEjR1 diff --git a/dbatools.psd1 b/dbatools.psd1 index 9193f2c405..62d62a356f 100644 --- a/dbatools.psd1 +++ b/dbatools.psd1 @@ -11,7 +11,7 @@ RootModule = 'dbatools.psm1' # Version number of this module. - ModuleVersion = '2.1.20' + ModuleVersion = '2.1.22' # ID used to uniquely identify this module GUID = '9d139310-ce45-41ce-8e8b-d76335aa1789' diff --git a/public/Get-DbaDbccHelp.ps1 b/public/Get-DbaDbccHelp.ps1 index f2cdbaaa02..9a53c239d1 100644 --- a/public/Get-DbaDbccHelp.ps1 +++ b/public/Get-DbaDbccHelp.ps1 @@ -47,12 +47,12 @@ function Get-DbaDbccHelp { .EXAMPLE PS C:\> Get-DbaDbccHelp -SqlInstance SQLInstance -Statement FREESYSTEMCACHE -Verbose | Format-List - Runs the command DBCC HELP(FREESYSTEMCACHE) WITH NO_INFOMSGS against the SQL Server instance SQLInstance + Runs the command DBCC HELP(FREESYSTEMCACHE) WITH NO_INFOMSGS against the SQLInstance SQL Server instance. .EXAMPLE - PS C:\> Get-DbaDbccHelp -SqlInstance LensmanSB -Statement WritePage -IncludeUndocumented | Format-List + PS C:\> Get-DbaDbccHelp -SqlInstance SQLInstance -Statement WritePage -IncludeUndocumented | Format-List - Sets TraeFlag 2588 on for session and then runs the command DBCC HELP(WritePage) WITH NO_INFOMSGS against the SQL Server instance SQLInstance + Sets Trace Flag 2588 on for the session and then runs the command DBCC HELP(WritePage) WITH NO_INFOMSGS against the SQLInstance SQL Server instance. #> [CmdletBinding()] @@ -105,4 +105,4 @@ function Get-DbaDbccHelp { } } -} \ No newline at end of file +} diff --git a/public/Get-DbaLatchStatistic.ps1 b/public/Get-DbaLatchStatistic.ps1 index 69d767cb6f..59a48208a0 100644 --- a/public/Get-DbaLatchStatistic.ps1 +++ b/public/Get-DbaLatchStatistic.ps1 @@ -95,7 +95,7 @@ function Get-DbaLatchStatistic { [latch_class], [wait_time_ms] / 1000.0 AS [WaitS], [waiting_requests_count] AS [WaitCount], - Case WHEN SUM ([wait_time_ms]) OVER() = 0 THEN NULL ELSE 100.0 * [wait_time_ms] / SUM ([wait_time_ms]) OVER() END AS [Percentage], + CASE WHEN SUM([wait_time_ms]) OVER() > 0 THEN 100.0 * [wait_time_ms] / SUM([wait_time_ms]) OVER() END AS [Percentage], ROW_NUMBER() OVER(ORDER BY [wait_time_ms] DESC) AS [RowNum] FROM sys.dm_os_latch_stats WHERE [latch_class] NOT IN (N'BUFFER') @@ -105,7 +105,7 @@ function Get-DbaLatchStatistic { CAST (MAX ([W1].[WaitS]) AS DECIMAL(14, 2)) AS [WaitSeconds], MAX ([W1].[WaitCount]) AS [WaitCount], CAST (MAX ([W1].[Percentage]) AS DECIMAL(14, 2)) AS [Percentage], - CAST ((MAX ([W1].[WaitS]) / MAX ([W1].[WaitCount])) AS DECIMAL (14, 4)) AS [AvgWaitSeconds], + CAST (CASE WHEN MAX([W1].[WaitCount]) > 0 THEN MAX([W1].[WaitS]) / MAX([W1].[WaitCount]) END AS DECIMAL (14, 4)) AS [AvgWaitSeconds], CAST ('https://www.sqlskills.com/help/latches/' + MAX ([W1].[latch_class]) as XML) AS [URL] FROM [Latches] AS [W1] INNER JOIN [Latches] AS [W2] diff --git a/public/Test-DbaDbRecoveryModel.ps1 b/public/Test-DbaDbRecoveryModel.ps1 index 9a83dafb5d..822b5cbbfe 100644 --- a/public/Test-DbaDbRecoveryModel.ps1 +++ b/public/Test-DbaDbRecoveryModel.ps1 @@ -98,9 +98,9 @@ function Test-DbaDbRecoveryModel { WHEN d.recovery_model = 1 AND drs.last_log_backup_lsn IS NOT NULL THEN 1 ELSE 0 END AS IsReallyInFullRecoveryModel - FROM sys.databases AS D + FROM sys.databases AS d INNER JOIN sys.database_recovery_status AS drs - ON D.database_id = drs.database_id + ON d.database_id = drs.database_id WHERE d.recovery_model = $recoveryCode" if ($Database) { @@ -152,4 +152,4 @@ function Test-DbaDbRecoveryModel { } } } -} \ No newline at end of file +}