Pretty sure the property is called TargetDatabase not TargetDatabaseName like you have in your commands. Have you tried the second option but with "TargetDatabase" in place of "TargetDatabaseName". Note that is the property in the error message.
Override properties of SQL publish profile with MSBuild
I am trying to override the TargetDatabaseName property of my sql publish file, but I cannot get it to work.
I searched on the internet and I found two (old) Microsoft forum pages where someone gave an answer how it should work, but trying that same solution fails.
The two pages are the following:
Has anyone gotten this to work?
I have tried the following commands:
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild" /t:publish /p:SqlPublishProfilePath=BuildFile.publish.xml /p:Publish_TargetDatabaseName="BuildDB"
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\MSBuild" /t:publish /p:SqlPublishProfilePath=BuildFile.publish.xml /p:TargetDatabaseName="BuildDB"
But in both cases I get the error "Deploy error Deploy72002: Property TargetDatabase
must be specified"
SQL Server | Other
1 answer
Sort by: Most helpful
-
Greg Low 1,985 Reputation points Microsoft Regional Director2024-02-19T22:46:24.0166667+00:00