SQL Server Administration

Getting the Paths for All Database Files in a SQL Server Instance

Getting the Paths for All Database Files in a SQL Server Instance

Here’s a quick 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 [?]; SELECT CAST(DB_NAME() AS VARCHAR(50)) AS DBName, CAST(physical_name AS VARCHAR(150)) as…

SQL Server 2008 R2 Service Pack Installation Fails – Element not found. (Exception from HRESULT: 0x80070490)

In case you are trying to install a SQL Server 2008 R2 service pack in a clustered SQL Server environment and the installation fails reporting something similar to the below: Final result: The patch installer has failed to update the shared features. To determine the reason for failure, review the…