If you try to attach a database using “sp_attach_db” or “sp_attach_single_file_db”, you may face the below error.
The reason is that “mdf” file you are trying to attach is from sql server 2008 R2 enterprise edition and you are trying to restore on a standard/express edition.
File activation failure. The physical file name "F:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\
MSSQL\Log\xxx.ldf" may be incorrect.
New log file 'l:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\
MSSQL\Data\xxx_log.LDF' was created.
Msg 33117, Level 16, State 2, Line 1
Transparent Data Encryption is not available in the edition of this SQL Serverinstance. See books online for more details on feature support in different SQLServer editions.
Msg 1801, Level 16, State 3, Line 1
Database 'xxx already exists. Choose a different database name.