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
 General SQL Server Forums
 New to SQL Server Programming
 attached database

Author  Topic 

eia72
Starting Member

9 Posts

Posted - 2006-03-01 : 02:29:09
how can i attached MDF file only without .log and data only

shallu1_gupta
Constraint Violating Yak Guru

394 Posts

Posted - 2006-03-01 : 02:32:51
use
sp_attach_single_file_db 'DBname' ,'MDF File'
Go to Top of Page

eia72
Starting Member

9 Posts

Posted - 2006-03-01 : 02:42:27
use
sp_attach_single_file_db 'DBname' ,'MDF File'


how can i do this command?
can you give me step by step instruction?
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-03-01 : 02:56:37
use enterprise manager,
right click on the databases node
choose to attach database
follow the onscreen instruction



--------------------
keeping it simple...
Go to Top of Page

eia72
Starting Member

9 Posts

Posted - 2006-03-01 : 03:05:20
my Log file is corrupted and unrecoverable to attach,
i only have the mdf file and the data file
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2006-03-01 : 03:08:12
doesn't matter, have you tried?
attach a single file using enterprise manager, otherwise
you need to read more of this in BOL for details on the command you were asking in another post of yours

--------------------
keeping it simple...
Go to Top of Page

shallu1_gupta
Constraint Violating Yak Guru

394 Posts

Posted - 2006-03-01 : 03:41:05
Hi,
open your query analyzer window and select master DB.
write
sp_attach_single_file_db '<DBname>' ,'<MDF File>'
replace <DBname> with the database name
replace <MDF File> with the colplete path of your .mdf file you want to attach..
Or you can also use Enterprise Manager to attach DB as specified by jen
Go to Top of Page
   

- Advertisement -