Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 help with shrink

Author  Topic 

dadiT
Starting Member

2 Posts

Posted - 2010-05-05 : 00:03:05
hey all!
i have noticed that in sql server 2005, when you choose to shrink, you can either choose to shrink databse and shrink files.
now, what is the different between this two?
10x, Daniel

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-05-05 : 00:20:04
I never use DBCC SHRINKFDATABASE.

From BOL:
quote:

To shrink all data and log files for a specific database, execute the DBCC SHRINKDATABASE command. To shrink one data or log file at a time for a specific database, execute the DBCC SHRINKFILE command.



Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2010-05-05 : 03:57:31
One shrinks the entire database, one shrinks a single file, neither should be regularly used.

Shrinking causes massive fragmentation and will just result in the data file growing again next time data gets added. When that happens, the entire system will slow down as the file is expanded. Also repeated shrinks and grows will cause fragmentation at the file-system level, which is hard to fix.

See - [url]http://sqlinthewild.co.za/index.php/2007/09/08/shrinking-databases/[/url]



--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -