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 Development (2000)
 restoring with just .mdf and .ndf

Author  Topic 

pug2694328
Posting Yak Master

166 Posts

Posted - 2007-08-03 : 17:08:48
I'm attempting to restore a database to SQL Server 2000.

All I have is the .mdf and .ndf files.

Is there a way to accomplish this?

JBZ
Starting Member

1 Post

Posted - 2007-08-03 : 18:46:05
Stored procedure sp_attach_single_file_db shoulb be able to build new .ldf file for you.

Julia
Go to Top of Page

pug2694328
Posting Yak Master

166 Posts

Posted - 2007-08-03 : 19:06:19
Hi Julia,
I've tried that proc, and hit some problems.
Here's my code
sp_attach_single_file_db 
@DBName = N'A007A1A1'
, @physname = N'C:\Sprint_Fonview\A007A1A1.mdf'


And I hit these errors:
Msg 5105, Level 16, State 5, Line 1
Device activation error. The physical file name 'D:\LDR1OUT\A007A1A1\A007A1A1.NDF' may be incorrect.
Device activation error. The physical file name 'D:\LDR1OUT\A007A1A1.LDF' may be incorrect.
Msg 1813, Level 16, State 2, Line 1
Could not open new database 'A007A1A1'. CREATE DATABASE is aborted.


It's strange that it's looking in drive d:, excepting that I did pull the data from a cd drive before uploading it to the server c drive.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2007-08-03 : 23:34:27
Sql was looking for other two files. You can attach single file only if detached the db cleanly.
Go to Top of Page

pug2694328
Posting Yak Master

166 Posts

Posted - 2007-08-06 : 10:13:04
Thx rmiao,

So just to confirm, there's no way to restore this data from these files?
Go to Top of Page

Jim77
Constraint Violating Yak Guru

440 Posts

Posted - 2007-08-06 : 10:19:54
I read somewhere once that you need to use the sp_detach_db on the same file before you can get the sp_attach_single_file_db to work properly.
Go to Top of Page
   

- Advertisement -