Below code will shrink 80% free space and remains 20% free for database files. DBCC SHRINKDATABASE command shrink all data and log files for a specific database. To shrink one data or log file at a time for a specific database, execute the DBCC SHRINKFILE command.
DBCC SHRINKDATABASE (databasename, 20);
Charith Silva is a Microsoft certified SQL Server developer and database administrator who was graduated at Buckinghamshire New university in the UK. His career was started in 1998, primarily into Web application development, and later diversified into database development.
He has got a vast experience in SQL Server database development, Database administration and Business Intelligence development. He believes that sharing the knowledge is key to the success.
Number of Posts : 87