SQL Server: Disable/Remove Indexes Across Servers/Databases Using PowerShell & dbatools

This is something I had to do today. In this blog post, I am going to show you how you can disable or remove indexes matching certain name criteria or other condition(s) across multiple servers and databases in various tables. Usually, this is a very painful process if done by hand but with the fantastic … Continue reading SQL Server: Disable/Remove Indexes Across Servers/Databases Using PowerShell & dbatools

Advertisement

SQL Server: DROP All But A Few Tables With PowerShell (or DROP ALL)

Recently, I received a request to backup a dozen tables or so tables out of 12 thousand tables. I had to retain all the indexes, statistics etc. The goal was to hand this over to the vendor for analysis as a database backup. I could have copied the selected tables over to a new database … Continue reading SQL Server: DROP All But A Few Tables With PowerShell (or DROP ALL)