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 Administration (2000)
 Detach - Attach in SQL Server 7

Author  Topic 

oepirobo
Starting Member

36 Posts

Posted - 2004-07-12 : 11:28:24
In SQL 2000 I detach-attach a database in order to get rid of a log file. This works great because no matter how big the file is it is completely erased and a new one starts from scratch.

How do I do this in SQL 7? Shrinkfile is not a viable option since it doesn't really release that much space. How do I erase the log file and start a new one in this version?

Wanderer
Master Smack Fu Yak Hacker

1168 Posts

Posted - 2004-07-12 : 11:58:31
I strongly recommend you do not use this detach/attach method for a production database, or an important environment. You can (and I did) have problems recreating the database.

If you need to shrink the log, do a full backup and then to a:
backup log 'dbname' with truncate_only
then do :
dbcc shrinkfile or
dbcc shrinkdb (I think that is the SQL 7 version)

CiaO



*##* *##* *##* *##*

Chaos, Disorder and Panic ... my work is done here!
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2004-07-12 : 13:57:12
Is the database Recovery Model set to SIMPLE? That will help (if you don't need recovery to point-in-time)

Kristen
Go to Top of Page
   

- Advertisement -