Wednesday, 12 February 2014

Somthings got a hold on .... Your Log

There are times when shrinking a log on a database is needed.  This could be if your transaction backups have failed for a period of time.  And have now grown.

However there are times when they dont shrink.  Here is a nice script to see why they dont:-

DECLARE @DatabaseName VARCHAR(50);

 SET @DatabaseName = 'YourDataBASE'


 SELECT name, recovery_model_desc, log_reuse_wait_desc

   FROM sys.databases

   WHERE name = @DatabaseName