Created
December 9, 2015 09:38
-
-
Save johnmmoss/5916348c7c5b8e4c0c73 to your computer and use it in GitHub Desktop.
Shrinking a database file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE AdeventureWorksDb | |
-- Set the datbase into simple mode which will truncate the log and close any connections | |
ALTER DATABASE AdeventureWorksDb | |
SET RECOVERY Simple; | |
GO | |
-- Shrink the file | |
DBCC SHRINKFILE('AdeventureWorksDb_Log') | |
-- Return reocvery mode back to Full | |
ALTER DATABASE AdeventureWorksDb | |
SET RECOVERY Full; | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment