How to Shrink SQL Server database files?
How to Shrink SQL Server database files?
You can shrink the database file by using the following method.
Code
DECLARE @strDatabaseName nvarchar(255)
SET @strDatabaseName = "YourDatabaseName"
DBCC SHRINKDATABASE (@strDatabaseName, 0)--Parameters are Database Name & Target %
Working in both SQL 2005 & 2008.