Monthly Archives: February 2023

Clear mssql cache

If you for example need to test a query against two SQL servers hardware, its a good idea to clear the cache first.
This query can do this:

DBCC DROPCLEANBUFFERS; 

-- Removes all elements from the plan cache.

DBCC FREEPROCCACHE;

-- Displays the number of milliseconds required to parse, compile, and execute each statement.

SET STATISTICS TIME ON; 

-- Display information regarding the amount of disk activity generated by Transact-SQL statements.

SET STATISTICS IO ON; 

Computer won’t join Azure AD

When going to Settings -> Accounts -> Access work or school, og push the “connect” buttom. I could just see that the popup, asking for my mail address, just popup, but then disapear again very quick.

Starting a powershell with administrative rights, and type in the command

Get-AppXPackage | foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}

And let it run, it toke 1-3 minutes to complete, but when it completed i could push the buttom, and the popup show just fine.

Again this is a danish screenshot.