Tuesday, August 23, 2011

Shrink Database Files

ALTER DATABASE --DatabaseName--
SET RECOVERY SIMPLE;

SELECT name FROM sys.database_files

DBCC SHRINKFILE (--name--, 3);

ALTER DATABASE --DatabaseName--
SET RECOVERY FULL;