I was attempting to restore a SQL database from a .bak file when QA complained about incorrect Logical Name. Resolving it was a 2 step process:
1. Get the Physical Name and the Logical Name by:
RESTORE FILELISTONLY FROM DISK='C:\DB.BAK'
Note down the LogicalName for both the MDF and the LDF file and restore the DB using:
2. RESTORE DATABASE DAM FROM DISK='C:\DB.BAK' WITH MOVE 'DB_DATA_Data' to 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\DB_DATA_Data.mdf', MOVE 'DB_DATA_Log' to 'C:\Program Files\Microsoft SQL Server\MSSQL\Data\DB_DATA_Log.ldf'