Replay a T-SQL batch against all databases

It’s been quite a lot since I last posted on this blog and I apologize with my readers, both of them :-). Today I would like to share with you a handy script I coded recently during a SQL Server health check. One of the tools I find immensely valuable for conducting a SQL Server assessment is Glenn Berry’s SQL Server Diagnostic Information Queries. The script contains several queries that can help you collect and analyze a whole lot of information about a SQL Server instance and I use it quite a lot. [Read More]

Backup all user databases with TDPSQL

Stanislav Kamaletdin (twitter) today asked on #sqlhelp how to backup all user databases with TDP for SQL Server: My first thought was to use the “*” wildcard, but this actually means all databases, not just user databases. I ended up adapting a small batch file I’ve been using for a long time to take backups of all user databases with full recovery model: @ECHO OFF SQLCMD -E -Q "SET NOCOUNT ON; SELECT name FROM sys. [Read More]