|
42 | 42 |
|
43 | 43 | .LINK |
44 | 44 | https://github.com/gwalkey |
| 45 | +
|
| 46 | +.Changelog |
| 47 | + GBW - March 5, 2025 - Added Partition Functions and Schemes |
45 | 48 | |
46 | 49 | #> |
47 | 50 |
|
@@ -278,6 +281,8 @@ Convertto-Html -head $head -Body "$myHtml1" -Title "Database Summary" -PostCont |
278 | 281 | "13) Full-Text Catalogs" | Out-File "$FullFolderPath\Database_Reconstruction_Hints.txt" -Encoding ascii -Append |
279 | 282 | "14) Table Triggers" | Out-File "$FullFolderPath\Database_Reconstruction_Hints.txt" -Encoding ascii -Append |
280 | 283 | "15) Database Triggers" | Out-File "$FullFolderPath\Database_Reconstruction_Hints.txt" -Encoding ascii -Append |
| 284 | +"16) Partition Functions" | Out-File "$FullFolderPath\Database_Reconstruction_Hints.txt" -Encoding ascii -Append |
| 285 | +"17) Partition Schemes" | Out-File "$FullFolderPath\Database_Reconstruction_Hints.txt" -Encoding ascii -Append |
281 | 286 |
|
282 | 287 | # Add your favorite options from |
283 | 288 | # https://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.scriptingoptions.aspx |
@@ -387,6 +392,8 @@ foreach($sqlDatabase in $srv.databases) |
387 | 392 | $DBColumnEncryptionKey_path = "$output_path\ColumnEncryptionKeys\" |
388 | 393 | $DBColumnMasterKey_path = "$output_path\ColumnMasterKeys\" |
389 | 394 | $DBRole_path = "$output_path\DBRoles\" |
| 395 | + $PartitionFunction_path = "$output_path\PartitionFunctions\" |
| 396 | + $PartitionScheme_path = "$output_path\PartitionSchemes\" |
390 | 397 |
|
391 | 398 |
|
392 | 399 | # -------------------------------- |
@@ -562,7 +569,6 @@ foreach($sqlDatabase in $srv.databases) |
562 | 569 | $Users = $db.Users | Where-object { -not $_.IsSystemObject } |
563 | 570 | CopyObjectsToFiles $Users $Users_path |
564 | 571 |
|
565 | | - |
566 | 572 | # Views |
567 | 573 | Write-Host "$fixedDBName - Views" |
568 | 574 | $views = $db.Views | Where-object { -not $_.IsSystemObject } |
@@ -603,6 +609,16 @@ foreach($sqlDatabase in $srv.databases) |
603 | 609 | $Synonyms = $db.Synonyms |
604 | 610 | CopyObjectsToFiles $Synonyms $Synonyms_path |
605 | 611 |
|
| 612 | + # Partition Functions |
| 613 | + Write-Host "$fixedDBName - Partition Functions" |
| 614 | + $PartFunctions = $db.PartitionFunctions |
| 615 | + CopyObjectsToFiles $PartFunctions $PartitionFunction_path |
| 616 | + |
| 617 | + # Partition Schemes |
| 618 | + Write-Host "$fixedDBName - Partition Schemes" |
| 619 | + $PartSchemes = $db.PartitionSchemes |
| 620 | + CopyObjectsToFiles $PartSchemes $PartitionScheme_path |
| 621 | + |
606 | 622 | # List Filegroups, Files and Path |
607 | 623 | Write-Host "$fixedDBName - FileGroups" |
608 | 624 |
|
|
0 commit comments