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 |
|
Malbster
Starting Member
1 Post |
Posted - 2002-05-01 : 02:19:32
|
| Hi,I've screwed up big time and accidently deleted my intranet DB logfile... Now when I try and re attach the database, using:sp_attach_single_file_db @dbname = 'Intranet', @physname = 'X:\Databases\Intranet_Data.MDF'I get the errors:erver: Msg 5171, Level 16, State 2, Line 1D:\Databases\Intranet_Log_New_Log.LDF is not a primary database file.Server: Msg 5105, Level 16, State 1, Line 1Device activation error. The physical file name 'D:\Databases\Intranet_Log_New_Log.LDF' may be incorrect.Server: Msg 945, Level 14, State 1, Line 1Database 'Intranet' cannot be opened because some of the files could not be activated.Server: Msg 1813, Level 16, State 1, Line 1Could not open new database 'Intranet'. CREATE DATABASE is aborted.I can't get the log file back, and I don't have a recent backup of it (Yep, I know I know)..Is there any way I can restore the database without a log file?Regards |
|
|
DavidD
Yak Posting Veteran
73 Posts |
Posted - 2002-05-01 : 03:04:17
|
| Yep, You can do it using SQL-DMO, I think the command is attachDBSingleFile and then specify without log so that SQL Server creates one for the .mdf. Give me a yell if you can't find it on Books onlineregardsDD |
 |
|
|
|
|
|
|
|