Showing posts with label SHRINKDATABASE. Show all posts
Showing posts with label SHRINKDATABASE. Show all posts

Thursday, July 5, 2012

Honey I Shrunk The Database


As a developer or a dba you may in your life have to shrink the log file of a database or you will have to shrink the database, because the server that the database is on is running low on space.
The syntax for a shrink statement is:

DBCC SHRINKDATABASE
( database_name | database_id | 0
     [ , target_percent ]  *
     [ , { NOTRUNCATE | TRUNCATEONLY } ]
)
[ WITH NO_INFOMSGS ]              

*For more information about how the target_percent or any of the relevant areas of the shrink database query works, reference the following link: