Error 3702: cannot drop database because it is currently in use. Set it to SINGLE_USER WITH ROLLBACK IMMEDIATE, then drop it. Best kept for demo servers.
SQL SERVER – Reducing CXPACKET Wait Stats for High Transactional Database
Reducing CXPACKET wait stats on a high transactional database: what CXPACKET means, and when lowering the degree of parallelism really helps.
SQL SERVER – Get All the Information of Database using sys.databases
A handy script from Matteo that uses sys.databases to show plenty of database information, like status, data and log file counts and their sizes in MB.
CURRENT_DATE, || and Other Small T-SQL Changes in SQL Server 2025
Use CURRENT_DATE, string concatenation, optional SUBSTRING length and bigint DATEADD in SQL Server 2025 with clear examples and checks.
SQL SERVER – Get Database Backup History for a Single Database
A reader script by aasim abdullah to get database backup history for a single database: backup file, size, time taken, LSNs and the type of each backup.
A Bill of Materials With a Recursive CTE
Expand a bill of materials with a recursive CTE, multiply quantities across levels, trace component paths, and guard against cycles.






