I believe sp_detach_db will ensure no transactions need to be rolled forward
or back. Consequently, the log isn't needed when attaching a database with
a single log file that was properly detached.
Attaching a database that wasn't properly detached is a crap shoot because
SQL Server might need the log to roll transactions forward/back. The
frequent newsgroup postings from folks who've tried this and failed are the
proof.
In any case, I'd keep the log and/or backups around until the database was
successfully attached.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Erland Sommarskog" <es****@sommars kog.se> wrote in message
news:Xn******** *************@1 27.0.0.1...
DBA (ka******@yahoo .com) writes: If I detach a database on a server, then attach the database with a
single file only using the data file...will I lose any transactions
that were in the original log file? There is a debate going on here at
work where some people think that during the detach, transactions in
the log file are saved to the data file.
If the database is shut down cleanly, there will be nothing to lose.
If the database feels that there is something that needs to be rolled
forward or backward it will cry out for the log, and
sp_attach_db_si ngle_file will not succeed. If you at this point to not
have the log file around anywhere, you are in trouble.
--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp