有没有其他人遇到类似的问题,如下所述?
我在使用Powershell部署SQL Server 2012 dacpac数据库升级时遇到问题.详情如下所示:
它是为sql server 2012构建的dacpac文件,当我以管理员身份登录时,我试图通过Powershell从命令行运行它来应用于sql server 2012数据库.
使用"4"参数调用"Deploy"的异常:"无法确定域的身份." 在... so.ps1:17 char:8 + $ d.Deploy($ dp,$ TargetDatabase,$ true,$ DeployOptions)
编辑过的脚本(日志记录和文字更改)如下:
[System.Reflection.Assembly]::LoadFrom("C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin\Microsoft.SqlServer.Dac.dll") | Out-Null
$d = new-object Microsoft.SqlServer.Dac.DacServices ("... Connection string ...")
$TargetDatabase = "databasename"
$fullDacPacPath = "c:\temp\...\databasename.dacpac"
# Load dacpac from file & deploy to database named pubsnew
$dp = [Microsoft.SqlServer.Dac.DacPackage]::Load($fullDacPacPath)
$DeployOptions = new-object Microsoft.SqlServer.Dac.DacDeployOptions
$DeployOptions.IncludeCompositeObjects = $true
$DeployOptions.IgnoreFileSize = $false
$DeployOptions.IgnoreFilegroupPlacement = $false
$DeployOptions.IgnoreFileAndLogFilePath = $false
$DeployOptions.AllowIncompatiblePlatform = $true
$d.Deploy($dp, $TargetDatabase,$true,$DeployOptions)
Run Code Online (Sandbox Code Playgroud)
以下是一些支持信息: