Azure automatic tuning was just enabled on multiple databases and I would like to get all index creation scripts which was successfully implemented by azure auto tuning in multiple databases. Is there a good way scrip out all indexes at one's with some PowerShell or sql?
I know I can View scripts in recommendations window for every new index and script out manually one by one from there, but it's not convenient as there is multiple databases and lot's now indexes.
Index recommendations are captured in the sys.dm_db_tuning_recommendations DMV even if the CREATE and DROP index options are not enabled. You can script what’s captured in the DMV and automate implementation of recommendations,
If you manually implement the recommendation using scripts, SQL Server does not perform any validation. If you implement the recommendation via the Portal (using the Apply button) or REST API, then it will be executed as if it were an automatic action, and validation will be performed (and the index could be automatically reverted if there’s a regression).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With