|
First, the question is whether to empty the t-logs. Those are like backups; if your server crashes and leaves the database in a bad way, you can play changes forward and recreate it up to the point of failure. If you don't need this type of functionality, or the space is more important to you, the steps are below ... I just wanted to point out the trade-off so you can make a good decision before you take my advice and (possibly) shoot yourself in the foot.
You can use DBCC to shrink the transaction logs. How depends on what version ( 97, 2000, 2005 ). There's a dbcc option called "backup log" and a modifier "with truncate_only" which will empty the .ldf file for a given database. Check Books Online ( the SQL Server help file ) or MSDN.com for more info.
Or ... if you're using the UI, either Enterprise Manager or Management Studio, you can right click on the node for the particular database, go to the "All Tasks" sub menu, and there should be options to shrink the entire database, the data file, or the log file. You can do all of this with the mouse and avoid dealing with DBCC syntax.
Also, you might want to change your recovery model to "simple" ( it's probably set to "full" now ), which will cause the t-logs to fill more slowly.
Finally, if you really don't need them, you can use SQL Agent to run a job nightly to clear out your transaction logs for you.
|