go
dump transaction
go
use
go
DBCC SHRINKFILE (
go
-- then you can call to check that all went fine
dbcc checkdb(
(or)
To Truncate the log file:
Backup the database
Detach the database, either by using Enterprise Manager or by executing : *Sp_DetachDB [DBName]*
Delete the transaction log file. (or rename the file, just in case)
Re-attach the database again using: *Sp_AttachDB [DBName]*
When the database is attached, a new transaction log file is created.
To Shrink the log file:
Backup log [DBName] with No_Log
Shrink the database by either:
Using Enterprise manager :- Right click on the database, All tasks, Shrink database, Files, Select log file, OK.
Using T-SQL :- *Dbcc Shrinkfile ([Log_Logical_Name])*
You can find the logical name of the log file by running sp_helpdb or by looking in the properties of the database in Enterprise Manager.
No comments:
Post a Comment