Utilizzando Powershell è possibile eseguire il deployment su Istanze SQL in locale standard o Istanza SQL di Azure. La stringa di connessione e altre proprietà saranno alimentati dai PublishProfile
$PublishPath = "Path for the log"
$dacpac = "dbname.dacpac"
$publishProfile = "dbname.xml" # Publish profile xml for Publishing the database project
# Generate Deploy Report
$DeployReport = ".\sqlpackage.exe /Action:DeployReport /Sourcefile:$dacpac /pr:'$publishProfile' /outputpath:$PublishPath"
Invoke-Expression $DeployReport
# Generate Script Report
$GenerateScript = ".\sqlpackage.exe /Action:Script /Sourcefile:$dacpac /pr:'$publishProfile' /outputpath:$PublishPath"
Invoke-Expression $GenerateScript
# Database Publish
$publish = ".\sqlpackage.exe /Action:Publish /Sourcefile:$dacpac /pr:'$publishProfile'"
Invoke-Expression $publish | Out-File $PublishPath
fonte
2015-04-18 04:38:05
Esempi di utilizzo sqlpackage.exe: http://stackoverflow.com/questions/8371879/deploy-sql-server-2012-db-project-via -command-line-sql-server-data-tools-ctp4/8376809 # 8376809 – Keith