I cannot count the hours I have lost initially – later, every time that tiny little error appeared, I would remember that the solution had been easy. Time to finally write a note to myself!
When sealing a SCOM Management Pack Solution using Visual Studio Authoring Extensions, the following error would appear in the output window:
The "PackageToBundle" task failed unexpectedly. Microsoft.Deployment.WindowsInstaller.BadQuerySyntaxException: SQL query syntax invalid or unsupported. at Microsoft.Deployment.WindowsInstaller.Database.OpenView(String sqlFormat, Object args) at Microsoft.EnterpriseManagement.Packaging.DataAccess.Insert(String query, Object args) at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() Done building project "my.ConnectedMG.Library.mpproj" -- FAILED.
The solution in my case: Check each Management Packs’ LanguagePack. I would get above error when using certain special characters in the Name or Description element (e.g. single quotes). After removing those from the LanguagePack, the MP seals just nicely.