Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jooorj
Posting Yak Master
126 Posts |
Posted - 2011-09-25 : 08:01:40
|
| Please tell me how to resolve this problem.I had tiered I can not attach Database from MDF file.what should I do ? |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-25 : 08:04:35
|
| why? whats the error message you got when you tried to connect? do you have all the files that make up the db?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
jooorj
Posting Yak Master
126 Posts |
Posted - 2011-09-25 : 08:13:43
|
| Msg 5173, Level 16, State 1, Line 6One or more files do not match the primary file of the database. If you are attempting to attach a database, retry the operation with the correct files. If this is an existing database, the file may be corrupted and should be restored from a backup.Log file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\mail_log.ldf' does not match the primary file. It may be from a different database or the log may have been rebuilt previously.Msg 1813, Level 16, State 2, Line 6Could not open new database 'Mail'. CREATE DATABASE is aborted. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-25 : 08:20:04
|
| can you post your attach command? or are you using wizard?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
vmvadivel
Yak Posting Veteran
69 Posts |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2011-09-25 : 13:00:25
|
| You're mixing files from multiple databases. Specifically the ldf file that you are trying to use does not belong to that database. Find the correct files and attach those.--Gail ShawSQL Server MVP |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2011-09-25 : 13:02:28
|
quote: Originally posted by vmvadivel If so then try out the steps explained in this thread - http://stackoverflow.com/questions/773059/how-to-recover-database-from-mdf-in-sql-server-2005
A lot of the advice on that thread is extremely dangerous.--Gail ShawSQL Server MVP |
 |
|
|
|
|
|