Random collection of scripts I sometimes use, and some I didn't want to lose š¤·
DISCLAIMER: Worked on my machine (at one point, maybe)
- setupDb.py - Create a new MSSQL image, installing some helpful extras.
- backupDatabase.sql - TSQL script to shrink DB log file, defrag indexes, and take a db backup.
- checkIndexFragmentation.sql - TSQL script to check index fragmentation on all tables.
- checkQueryCache.sql - TSQL script to check slow running queries via MSSQL DMVs.
- monitorForDeadlockEvents.sql - TSQL to add a new extended event to the server which watches for Deadlocks occurring.