In this post I demo a script I put together to count NULLs in all columns of a given table in SQL Server and store the results in a table. …
Scripts
-
-
This is a brief post containing a query that lists object dependencies in SQL Server for either a specific object or for the entire database. Intro Figuring out object dependencies …
-
In this post I demo a query to get connection information in SQL Server aggregated by database, host, client and login name. Intro I’ve spent some time this week working …
- ScriptsSQL ServerTips And Tricks
Migrate the sa password to another instance without knowing it
by Vlad DrumeaThis is a brief post showing how to migrate the sa password to another SQL Server instance without knowing it. Backstory I recently had to tear down an instance and …
-
This post demos a script I put together to help move SQL Server database files to another drive and folder by generating PowerShell and T-SQL commands. I’ve decided to make …
-
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 …
- 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 …