0
데이터베이스를 $from
에서 으로 업데이트하려면 dacservice.deploy
을 실행해야합니다. powershell : 시퀀스에서 여러 dacservice.deploy 호출을 실행하는 방법
#deploy
For ($i=$from; $i -le $to; $i++) {
$dacpacFileName = $dacpacPathName + $i + '.dacpac'
Write-Output "-----------------------------------------------------------------------"
Write-Output "Deploying... $dacpacFileName to $databaseServerName\$targetDatabaseName"
Write-Output "-----------------------------------------------------------------------"
#dacpac
$dp = [Microsoft.SqlServer.Dac.DacPackage]::Load($dacpacFileName)
#options
$options = New-Object Microsoft.SqlServer.Dac.DacDeployOptions
$options.GenerateSmartDefaults="True"
$options.BlockOnPossibleDataLoss="False"
$options.IncludeTransactionalScripts = "True"
#deploy
$dacService.Deploy($dp, $targetDatabaseName, $upgradeExisting, $options)
}
는 현재
dacService.Deploy
어떤 이유에서 병렬로 실행 : 여기 내 PS 스크립트입니다.
어쨌든
하나씩을 실행하는 데 그것을 물어?
PS : 나는 sqlPackage.exe
으로 수행 할 수 있습니다
#deploy
For ($i=$from; $i -le $to; $i++) {
$dacpacFileName = $dacpacPathName + $i + '.dacpac'
Write-Output "-----------------------------------------------------------------------"
Write-Output "Deploying... $dacpacFileName to $databaseServerName\$targetDatabaseName"
Write-Output "-----------------------------------------------------------------------"
& $sqlPackageExePath /a:Publish /sf:$dacpacFileName /tdn:$targetDatabaseName /TargetServerName:$databaseServerName /p:GenerateSmartDefaults=true
Write-host "Finished"
}