Because the database used by the customer often causes the hard disk space to be insufficient because the log is too large, or the backup file cannot be transmitted via mail.
Leisure, refer to SQLServer's help file, write the following script, can truncate logs to achieve the purpose of narrowing the file. Have a space, you can test the effect on your own SQL Server. . . :) Perhaps the logs caused by some cases have no great effect, which can be exchanged with each other.
- Execute the following script (using Query Analyzer) declare @dbname varchar (50) in the MASTER database declare temp_cur cursor scroll for select name from sysdatabasesopen temp_curfetch first from temp_cur into @dbnamewhile @@ fetch_status = 0 begin exec ( 'backup log' @ dbname 'with no_log') exec ( 'dbcc shrinkdatabase (' @ dbname ')') exec ( 'dbcc checkcatalog (' @ dbname ')') exec ( 'dump transaction' @ dbname 'with no_log') Fetch next from temp_cur @dbnamendclose temp_curdeallocate temp_cur