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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Database Attach Problem

Author  Topic 

adlo
Posting Yak Master

108 Posts

Posted - 2004-08-31 : 09:35:45
I am trying to restore a database from a mdf file but I cannot attach it because I don't have the log (ldf) file.

Using
sp_attach_db DatabaseName, 'C:\data\DatabaseName.MDF'
Server: Msg 1813, Level 16, State 2, Line 1
Could not open new database 'DatabaseName'. CREATE DATABASE is aborted.
Device activation error. The physical file name 'C:\data\Database_Log.LDF' may be incorrect.

mr_mist
Grunnio

1870 Posts

Posted - 2004-08-31 : 09:46:56
sp_attach_single_file_db [ @dbname = ] 'dbname'
, [ @physname = ] 'physical_name'



-------
Moo. :)
Go to Top of Page

adlo
Posting Yak Master

108 Posts

Posted - 2004-08-31 : 10:38:18
Sorry, still gives me the same message.
:-(
Go to Top of Page

mr_mist
Grunnio

1870 Posts

Posted - 2004-08-31 : 10:41:13
I think if you get that message from single file attach, it means that the DB was not detached cleanly and you need the log.

-------
Moo. :)
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-08-31 : 13:03:07
adlo, please post the command that you used. The one that you ran with sp_attach_single_file_db.

Tara
Go to Top of Page
   

- Advertisement -