MSSQL server index fragmentation check code snippet I had in my archive. It shows what indices would be good to add, and also shows the most CPU intense queries. A nice SQL optimization toolkit.
Continue reading Index fragmentation in MSSQL ServerTag: sql
Force drop database when in use
In development and testing environments we quite often have to drop databases and re-create them from scratch. It’s a little bit annoying when you need to right on click the database in SQL Management Studio, select Delete, and even put a tick on “Close existing connections” to be able to delete the database when it’s in use.
Continue reading Force drop database when in useSelect all tables from database
A quick reminder on how to select all tables from a MSSQL database. These two queries below can select all tables from any database including master database.
Continue reading Select all tables from database