Someone got a clue? :)Maybe create a stored procedure that runs a transaction log backup and then calls DBCC ShrinkDatabase (If you want to shrink it)? The user you use to connect to the database will need the proper permissions.|||I think backing up the transaction log automatically truncates the inactive portion of the log. Or is that incorrect...?
-Ian|||i sure would like to know because i have a program that uses transactions and uses it extremely frquently so the log grows in size in a geometric rate :)|||Every change to the database is written to the log first whether it's within a transaction or not. The log grows depending on the write activity against the database, not whether or not a transaction is used.|||ok, but how do i empty it programmaticly?
i wanna build a page where the user can empty it.|||When you backup the transaction log it truncates it. You can even do a BACKUP LOG <dbname> WITH TRUNCATE_ONLY which just removes the extra log entries, but its not recommended. Either option will truncate the log, so it most likely will not grow for a while, but it does not shrink the actual log, which you need to do a DBCC SHRINKDATABASE or DBCC SHRINKFILE to do. The SQL Server Books Online tells you all about it onShrinking the Transaction Log andTruncating the Transaction Log.
No comments:
Post a Comment