Posts

Showing posts from October, 2022

Hey, I rewrote UNION by way of UNPIVOT

Yesterday a team mate of mine asked me to review a piece of SQL script that looked like a good candidate for UNPIVOT. Below is the amended version of that code (I obfuscated the data and added a simple data initialization using the WITH clause): ;with u as ( -- data setup select * from ( values(1, 1, 1, 1), (2, 1, 1, 0), (3, 1, 0, 0), (4, 0, 0, 0) ) t(UserID, HasDbSkills, HasBackendSkills, HasFrontEndSkills) ) select * from ( select UserID, 0 as SkillType, 1 as DevelopmentSkill from u where HasDbSkills = 1 union select UserID, 1 as SkillType, 1 as DevelopmentSkill from u where HasBackendSkills = 1 union select UserID, 2 as SkillType, 1 as DevelopmentSkill from u where HasFrontEndSkills = 1 ) t(UserID, SkillType, DevelopmentSkill) order by UserID, SkillType Indeed, after a quick analysis, this script turned out to be ripe for UNPIVOT:

Clean up app uninstall failing with error 0x80070490

Over recently I've been busy building the MSIX package for our WPF application. I would configure the pipeline, run it, fail, and start over. At a moment I found myself unable to uninstall the package I built and installed on my Windows 10 machine, as it wasn't listed in the Programs. When I tried to reinstall the app using the new, valid installer I got the message saying: App installation failed with error message: Deployment Add operation with target volume C: on Package x from: y_1.0.0_neutral__8wekyb3d8bbwe failed with error 0x80070490. I searched for a solution on  stackoverflow , learn microsoft and some other resources but to no avail. And boomer! a super simple solution emerged from the back of my mind: Remove-AppxPackage y_1.0.0_neutral__8wekyb3d8bbwe In all likelihood  Remove-AppxPackage  picks up the installation package and runs the uninstall but it's just an educated guess I cannot back by any code or expert comments. That's all folks! PS A quick referen