Forum Discussion
Junwoo_Jo
Aug 24, 2025Copper Contributor
SQL Server 2019 – Repeated Recovery Mode and Backup Failure After Server Shutdown
Hello, We are currently using SQL Server 2019 Standard Edition in our company. Recently, our server experienced a complete shutdown due to a lightning strike. After the incident, one of our database...
SivertSolem
Aug 26, 2025Iron Contributor
When attempting to move the database by copying the MDF (data) file, did you remember to also copy the ldf (log) file?
In my experience, all files used by the database are required in order to attach it to a different server.
This T-SQL Query will print out the location of files related to each of the databases on your instance.
SELECT d.name DatabaseName, f.name LogicalName,
f.physical_name AS PhysicalName,
f.type_desc FileType
FROM sys.master_files f
INNER JOIN sys.databases d ON d.database_id = f.database_id
GO