January 13, 2004 at 10:57 am
Hi all. I have some databases that I can sometimes attach to a
new SQL server (2kE) without the log file,
and other times I can't.
It was my understanding that it's not possible to attach a database
without both the MDF and LDF, but it appears I can do so, usually after a backup and truncate.
Anyone else seen this?
Thanks!
January 13, 2004 at 11:41 am
If the database was detached Properly, You can attach it without LDF.
January 13, 2004 at 12:22 pm
Of course you can, that's why the stored procedure sp_attach_single_file_db exists.
January 13, 2004 at 12:28 pm
Wow. This has been one of those "every day I learn something new is a successful day" days.
Thanks to both of you!
Jeff
January 14, 2004 at 12:29 am
But if you have two or more log files this SP will not work. Read about it there http://www.sqlservercentral.com/columnists/awarren/attachanddetachagain.asp and there:http://www.sqlservercentral.com/scripts/contributions/599.asp
January 16, 2004 at 12:00 am
I'm trying to attach a database and "drop" TWO log files. I've used Andy Warren's article "Attach and Detach - Again" (http://www.sqlservercentral.com/columnists/awarren/attachanddetachagain.asp). I can successfully attach using one of the log files (the first in order from the original creation of the database). If I use Andy's code, I can't drop the second log file or drop both log files. Neither situation is a real surprise given some of the comments in Andy's article and in other articles, but I still need to resolve this problem some how. Has anyone tried to do what I'm doing? Has anyone had any different experience than this? Thoughts? Comments? I'd appreciate any help anyone can provide. My log files are 18 GB and 4 GB, and I'd like to simply "drop" both when I attach the database. Thanks.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply