Create an empty SQL server database with same name & layout.
Now shutdown the services of SQL server.
Move the database file into newly created empty database file that you want to attach.
Start the SQL server database.
Probably, your database will go in suspect mode.
Now ALTER your database and set database in emergency mode.
Run DBCC CHECKDB command on your database with and repair clause, It will give you a repair clause and again run DBCC CHECKDB with repair_allow_data_loss. You will probably loose some data or records of your SQL server database.
Please click the Mark as answer button and vote as helpful if this reply solves your problem