question

arielman2304-0180 avatar image
0 Votes"
arielman2304-0180 asked Cathyji-msft edited

sqlpackage DeployReport xml corrupted

Hi
I'm running the below command using powershell script:

 $sqlpackagereport = Start-Process -FilePath sqlpackage.exe -ArgumentList '/Action:DeployReport','/SourceFile:"Database Services\bin\Release\Database Services.dacpac"',"/TargetServerName:${Env}","/TargetDatabaseName:${Target}","/OutputPath:Report.xml" -wait -PassThru -Credential $Cred
 $sqlpackagereport.WaitForExit()
 $sqlpackagereport

but when I'm trying to open Report.xml in the server, I get this exception:

     This XML file does not appear to have any style information associated with it. The document tree is shown below.
 <DeploymentReport xmlns="http://schemas.microsoft.com/sqlserver/dac/DeployReport/2012/02">
 <Alerts/>
 ...
 </DeploymentReport>




sql-server-general
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Cathyji-msft avatar image
0 Votes"
Cathyji-msft answered arielman2304-0180 edited

Hi @arielman2304-0180,

"/OutputPath:Report.xml"

I am not familiar with powershell. Did the file location for storing XML report is correct? The location did not point a folder, only report file name.

OutputPath – The path where the XML report will be stored after it is generated

If we using cmd, below is an example to general XML report.

104547-screenshot-2021-06-11-113046.jpg

You can try to use cmd to explore actions and tasks in the SQLPackage, please refer to the blog Exploring actions and tasks in the SQLPackage Utility to get detail example information.


If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar queries.




· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@Cathyji-msft , I just tested it without powershell, and I got empty xml:

  <?xml version="1.0" encoding="utf-8"?><DeploymentReport xmlns="http://schemas.microsoft.com/sqlserver/dac/DeployReport/2012/02"><Alerts /></DeploymentReport>


my command is:

 sqlpackage /action:DeployReport /SourceFile:"Database Services\bin\Debug\Database Services.dacpac" /TargetServerName:TEST05,123 /TargetDatabaseName:test /OutputPath:"DeployReport.xml"


0 Votes 0 ·
Cathyji-msft avatar image
0 Votes"
Cathyji-msft answered Cathyji-msft edited

Hi @arielman2304-0180,

I just tested it without powershell, and I got empty xml

Using cmd?

sqlpackage /action:DeployReport /SourceFile:"Database Services\bin\Debug\Database Services.dacpac" /TargetServerName:TEST05,123 /TargetDatabaseName:test /OutputPath:"DeployReport.xml"

Why the source file location and output path location did not point to a folder? Try to add like C:\ or D:\ in the file location.


If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar queries.

· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I tried the below but still gets empty:

  sqlpackage /action:DeployReport /SourceFile:"Database Services\bin\Debug\Database Services.dacpac" /TargetConnectionString:"Data Source=TEST05,123;Integrated Security=True;Persist Security Info=False;Pooling=False;MultipleActiveResultSets=False;Connect Timeout=60;Encrypt=False;TrustServerCertificate=False;Initial catalog=test" /OutputPath:"C:\git\Report.xml"
0 Votes 0 ·

Hi @arielman2304-0180,

Try below cmd;

 sqlpackage /action:DeployReport /SourceFile:"C:Database Services\bin\Debug\Database Services.dacpac" /TargetConnectionString"server=TEST05;database=123;integrated security=true"/OutputPath:"C:\git\Report.xml"


0 Votes 0 ·

Nope... still the same

0 Votes 0 ·
Show more comments