Skip to content

Commit

Permalink
Merge branch 'development' into test_refactoring_3
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee committed Sep 18, 2024
2 parents eaa1099 + a85b606 commit 192633f
Show file tree
Hide file tree
Showing 10 changed files with 129 additions and 113 deletions.
44 changes: 43 additions & 1 deletion bin/dbatools-buildref-index.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"LastUpdated": "2024-07-10T00:00:00",
"LastUpdated": "2024-09-11T00:00:00",
"Data": [
{
"Version": "8.0.47",
Expand Down Expand Up @@ -4119,6 +4119,10 @@
"Version": "13.0.6441",
"KBList": "5040946"
},
{
"Version": "13.0.6445",
"KBList": "5042207"
},
{
"Version": "13.0.7000",
"KBList": "5014242"
Expand All @@ -4139,6 +4143,10 @@
"Version": "13.0.7037",
"KBList": "5040944"
},
{
"Version": "13.0.7040",
"KBList": "5042209"
},
{
"Version": "14.0.1",
"Name": "2017"
Expand Down Expand Up @@ -4204,6 +4212,10 @@
"Version": "14.0.2056",
"KBList": "5040942"
},
{
"Version": "14.0.2060",
"KBList": "5042217"
},
{
"CU": "CU1",
"Version": "14.0.3006",
Expand Down Expand Up @@ -4399,6 +4411,10 @@
"Version": "14.0.3471",
"KBList": "5040940"
},
{
"Version": "14.0.3475",
"KBList": "5042215"
},
{
"Version": "15.0.1000",
"Name": "2019"
Expand Down Expand Up @@ -4448,6 +4464,10 @@
"Version": "15.0.2116",
"KBList": "5040986"
},
{
"Version": "15.0.2120",
"KBList": "5042214"
},
{
"CU": "CU1",
"Version": "15.0.4003",
Expand Down Expand Up @@ -4608,6 +4628,15 @@
"Version": "15.0.4382",
"KBList": "5040948"
},
{
"CU": "CU28",
"Version": "15.0.4385",
"KBList": "5039747"
},
{
"Version": "15.0.4390",
"KBList": "5042749"
},
{
"Version": "16.0.100",
"Name": "2022"
Expand Down Expand Up @@ -4645,6 +4674,10 @@
"Version": "16.0.1121",
"KBList": "5040936"
},
{
"Version": "16.0.1125",
"KBList": "5042211"
},
{
"CU": "CU1",
"Version": "16.0.4003",
Expand Down Expand Up @@ -4725,6 +4758,15 @@
{
"Version": "16.0.4131",
"KBList": "5040939"
},
{
"CU": "CU14",
"Version": "16.0.4135",
"KBList": "5038325"
},
{
"Version": "16.0.4140",
"KBList": "5042578"
}
]
}
Binary file modified bin/dbatools-index.json
Binary file not shown.
3 changes: 2 additions & 1 deletion bin/diagnosticquery/SQLServerDiagnosticQueries_2022.sql
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dbatools.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
RootModule = 'dbatools.psm1'

# Version number of this module.
ModuleVersion = '2.1.20'
ModuleVersion = '2.1.23'

# ID used to uniquely identify this module
GUID = '9d139310-ce45-41ce-8e8b-d76335aa1789'
Expand Down
17 changes: 11 additions & 6 deletions public/Export-DbaUser.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ function Export-DbaUser {

$stepCounter = 0
foreach ($dbuser in $users) {
# Clear output for each user
$outsql = @()
$sql = ""

if ($GenerateFilePerUser) {
if ($null -eq $usersProcessed[$dbuser.Name]) {
Expand All @@ -264,7 +267,12 @@ function Export-DbaUser {
}
}

Write-ProgressHelper -TotalSteps $users.Count -Activity "Exporting from $($db.Name)" -StepNumber ($stepCounter++) -Message "Generating script ($FilePath) for user $dbuser"
if ($Passthru) {
$progressMessage = "Generating script for user $dbuser"
} else {
$progressMessage = "Generating script ($FilePath) for user $dbuser"
}
Write-ProgressHelper -TotalSteps $users.Count -Activity "Exporting from $($db.Name)" -StepNumber ($stepCounter++) -Message $progressMessage

#setting database
if (((Test-Bound ScriptingOptionsObject) -and $ScriptingOptionsObject.IncludeDatabaseContext) -or - (Test-Bound ScriptingOptionsObject -Not)) {
Expand Down Expand Up @@ -366,7 +374,7 @@ function Export-DbaUser {
$withGrant = " WITH GRANT OPTION"
$grantDatabasePermission = 'GRANT'
} else {
$withGrant = " "
$withGrant = ""
$grantDatabasePermission = $databasePermission.PermissionState.ToString().ToUpper()
}
if ($Template) {
Expand Down Expand Up @@ -526,7 +534,7 @@ function Export-DbaUser {
$withGrant = " WITH GRANT OPTION"
$grantObjectPermission = 'GRANT'
} else {
$withGrant = " "
$withGrant = ""
$grantObjectPermission = $objectPermission.PermissionState.ToString().ToUpper()
}
if ($Template) {
Expand Down Expand Up @@ -573,9 +581,6 @@ function Export-DbaUser {
$sql | Out-File -Encoding:$Encoding -FilePath $FilePath -Append
}
}
# Clear variables for next user
$outsql = @()
$sql = ""
} else {
$sql
}
Expand Down
8 changes: 4 additions & 4 deletions public/Get-DbaDbccHelp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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()]
Expand Down Expand Up @@ -105,4 +105,4 @@ function Get-DbaDbccHelp {

}
}
}
}
4 changes: 2 additions & 2 deletions public/Get-DbaLatchStatistic.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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]
Expand Down
Loading

0 comments on commit 192633f

Please sign in to comment.