Created
October 31, 2021 16:58
-
-
Save alevyinroc/2a846b680280126b48f5ab00e0bba1a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
process { | |
$SqlInstance = "MyServer"; | |
$SourceDb = "MySourceDb"; | |
$TargetDb = "MyTargetTb"; | |
$TableList = @("Table1","Table2","Table3","Table4"); | |
foreach ($Table in $TableList) { | |
Start-ThreadJob -ThrottleLimit 4 -ArgumentList $SqlInstance, $SourceDb, $TargetDb, $Table -ScriptBlock { | |
param($SqlInstance, | |
$Source | |
$Destination | |
$TableName) | |
Copy-DbaDbTableData -SqlInstance $SqlInstance -Database $Source -Destination $Destination -Table $TableName; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment