Microsoft SQL Database File Size Reduction

If you are having problems with your server running out of hdd space and can’t figure out why, chances are your databases are causing the problem.

Don’t jump in and start deleting files there is an easy solution!

When logged into your Server Management Studio right click on any database name.

Select properties, options and set the recovery model to simple then click ok. Now right click on that database again 

Select tasks, shrink, files and set the file type to log. Then click ok.

Chances are you have just cleared out a couple of gigs worth of log data that has built up over the last few months/years.

Just be aware that the transaction log file that has been shrunk is used to back up the database but chances are you are already using some 3rd party hard drive image tool and this log isn’t really needed.

Anyway if you are concerned about the recovery models here is some light reading on SQL Server Recovery Models.

Windows Easy Transfer

I’m upgrading my pc in work from XP Pro to Win7 Ultimate. The whole thing to do though is a bit of a nightmare with data.

There is no Win7 upgrade  so you have to back up all your data, fun times. =(

However there is a tool Microsoft offer called Windows Easy Transfer that backs all your data up for you, profile stuff and all.

All you gotta do then is re-install your applications afterwards.

ASP.NET App_Code folder

The App_Code folder in a website project in Visual Web Develop is something I didn’t quite fully understand till recently.

You can drop into that folder any sort of CSharp (.cs) file you please and provided you include “using System.Web.UI.WebControls;” you can directly interact with any .aspx page on the website and it’s web control elements.

Just instantiate the class in the aspx.cs file for any aspx file and away you go! =D