Migrating Servers to Azure – Activating Windows

Recently I have migrated several servers from Vultr to Microsoft Azure. As part of this migration, windows became un-activated – most likely because Vultr runs it’s own KMS service and it is no longer able to contact the server: In order to resolve this, I changed the product key to…

SQL Server – Identify Unused Indexes

Within SQL Server an index is used to optimise the reading of data from the database. However the side effect of having such an index is reduced write speed for inserts and updates. This is because SQL Server will need to update and maintain the index. Running the below SQL…

Windows 10 – Missing Taskbar Icons

Had a very odd issue with Windows 10 and taskbar menu items missing: After lots of research, I’ve partially fixed this by running the following from an elevated command prompt: for /R "%APPDATA%\Microsoft\Windows\Start Menu\Programs\" %f in (.lnk) do copy /b "%f"+,, "%f" 1>nul for /R "%ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs\" %f in (.lnk)…

Azure SQL Database View Running Transactions / Blocking

With the Azure SQL Database, sometimes you want to view the current running transactions. Unfortunately there is no GUI as such like there is with normal SQL Server (right click, “Activity Monitor”), however it can be grabbed by executing sys.dm_exec_requests. The following SQL is very useful as it shows details…

Azure SQL Database Index Size

Recently I’ve been doing some work on optimising indexes within Azure SQL Database. The following SQL from Daniel is very useful in showing the status of all the current indexes within a SQL Database. The SQL works for both SQL Server 2014 onwards, plus Azure SQL Database. I have not…

Delete Duplicate Records – Leave Only 1 Behind MS SQL

Recently I’ve had to delete duplicate records from the Record Link table in Microsoft Dynamics Nav. Using the following SQL, (which uses the OVER clause for partitioning) this deletes all duplicate records, leaving the first unique item behind. The SQL can be updated easily to function for other tables /…

Microsoft Dynamics NAV – View All Active Sessions

With Microsoft Dynamics Nav, there are various ways of viewing all the active sessions within the system. The easiest of which is the “Sessions” page within the software itself: The downside of this, is that it only shows active sessions on the tier which the user is connected. This is…

Convert MS SQL Query to MySQL Automatically

With a recent project, I’ve had to reproduce a table from a Microsoft SQL Database into a MySQL Database. The table had lots of fields and would be very time consuming to write the SQL to create the table, but luckily I came across this tool to convert MSSQL to…

SQL Server – Find Last Backup Date/Time

With SQL server and 3rd party backup software, it can sometimes be difficult to tell when the last SQL backup has been taken and if the backup software has actually performed the backup or not. There are 3 main backup types in SQL Server: Full Incremental Transaction Log The following…