Skip to content

Commit

Permalink
Fix Copy-DbaSysDbUserObject to include indexes (#8668)
Browse files Browse the repository at this point in the history
The Copy-DbaSysDbUserObject function was missing the Indexes = true
option when the -Classic switch is not on.

Co-authored-by: Vince Iacoboni <VIacoboni@bethel.jw.org>
  • Loading branch information
sqlslinger and Vince Iacoboni authored Dec 12, 2022
1 parent 2a20242 commit 75627ad
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions functions/Copy-DbaSysDbUserObject.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ function Copy-DbaSysDbUserObject {
$transfer = New-Object Microsoft.SqlServer.Management.Smo.Transfer $smodb
$null = $transfer.CopyAllObjects = $false
$null = $transfer.Options.WithDependencies = $true
$null = $transfer.Options.Indexes = $true
$null = $transfer.ObjectList.Add($table)
if ($PSCmdlet.ShouldProcess($destServer, "Attempting to add table $table to $systemDb")) {
try {
Expand Down

0 comments on commit 75627ad

Please sign in to comment.