Skip to content

Instantly share code, notes, and snippets.

@pedroinfo
Last active February 14, 2017 19:01
Show Gist options
  • Save pedroinfo/78bfca716a8486d3ee7af447b7dd1c71 to your computer and use it in GitHub Desktop.
Save pedroinfo/78bfca716a8486d3ee7af447b7dd1c71 to your computer and use it in GitHub Desktop.
SHRINK - SQL Server
USE SEUDB
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE SEUDB
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (SEUDB_Log, 1);
GO
-- Reset the database recovery model.
ALTER DATABASE SEUDB
SET RECOVERY FULL;
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment