This post contains a short SQL Server query to get storage info for the disks hosting your instance’s database files without having to RDP into its host VM. The query …
Scripts
-
- Home LabPowerShellScriptsSQL Server
Automate SQL Server installation using PowerShell
by Vlad DrumeaIn this post I cover a script I’ve been using to automate SQL Server installation with PowerShell in my home lab. As opposed to my previous blog post that demos …
-
This brief post contains a script that can help switch a whole SQL Server instance, model and all user databases, to SIMPLE recovery. The script is useful in case of …
-
This is a brief post containing a script you can use to delete extra tempdb data files and avoid the “file not empty” (Msg 5042) error. I’ve occasionally ran into …
-
In this post I cover a script I’ve put together for measuring storage write speeds in SQL Server, namely against database data files. This is meant to help get an …
-
This post contains a script that I’ve written and used a few times when I’ve needed to search for a string in an entire SQL Server database. You can find …
-
This is a brief post containing a script to grant permissions on functions and stored procedures to a database user or role in SQL Server. Every few months I end …
-
While working on updating the PSBlitz script that retrieves statistics info for a SQL Server database, I’ve decided I should also make it available in a blog post and add …
-
This post contains a script I’ve put together to get database sizes in SQL Server along with some additional info like file counts per file types and their sizes in …
-
This is just a brief post containing a script to get table sizes in SQL Server, along with some other information like table type, number of records, partition count, compression …