I often use my blog as a personal archive, and this post is for me to quickly find a script I use at customers that have not set up a proper SQL maintenance plan for indexes and statistics. This script will evaluate each index in the database, and determine if it should be reindexed or rebuilt based on how fragmented they are.
I have very good experience in doing this, and it really increases performance the Dynamics AX 2012 databases.
-- Ensure a USE <databasename> statement has been...(read more)
↧