Bit of a quick post this morning, continuing the theme of using powershell to standardise your SQL Server estate. This one is on using PS to collect data on which global trace flags are running on your servers.
Personally, I think that standardisation of a SQL Server is an important part of the DBA role; it should start by ensuring that instances are standardised, with the same naming convention and set of configurations added, and go all the way through to coding practices and object naming convention. It’s important not to miss off database creation from this list.
As part of a review of the indexes across my new workplace’s estate, I wanted to get all the indexes scripted up into re-runnable scripts which could then be loaded into source control. However, considering the number of databases, tables and indexes, doing this manually would be both time consuming and mind numbingly boring; as such, I decided to create a powershell function to do this.