Getting the Paths for All Database Files in a SQL Server Instance
Here’s a quick T-SQL tip on getting the paths for all database files in a SQL Server instance. The T-SQL Tip You can get the list of paths for all database files (both data and log files) using the undocumented SQL Server stored procedure sp_MSforeachdb. You can use the below T-SQL statement: exec sp_MSforeachdb @command1=”USE … Read more…