2010-04-22

TSQL - Database backup with compression

The scripts below contrast a typical backup script, versus one that uses compression. You might want to consider compressing to save space.


Typical backup script:

BACKUP DATABASE xxx
TO DISK = 'C:\Backup\xxx.BAK'
WITH FORMAT,
MEDIANAME = 'C_Backup',
NAME = 'Full database backup of xxx';


This one compresses your backup, saving you, in my experience, about 75% of the space (an 800 MB dbase compresses, typically, to around 200 MB).

BACKUP DATABASE xxx
TO DISK = 'C:\Backup\xxx.BAK'
WITH COMPRESSION,
MEDIANAME = 'C_Backup',
NAME = 'Full database backup of xxx';


Compatibility tested on: MS SQL Server 2008 Standard.

SharePoint - Calculated month name

You can create a new calculated column (calcualtion based on other columns), and display the year, name of the month, etc. This is really useful for when you create views that group by year and/or month.


This formula gives you the name of the month, based on an existing data column in your list/library.

=TEXT([Modified],"MMMM")


This formula, will give you the name of the month, prefixed by the month number, from any date column in a list.

=IF(MONTH([Modified])<10,"0","")&MONTH([Modified])&" "&TEXT([Modified],"MMMM")


This one gives you the year, as a text. This helps so that the year doesn't get formatted as a number, with a comma.

=YEAR([Modified])&""



Tested compatibility: WSS 3.0.