C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Shrink transaction log file in Sql Server
WhatsApp
Manish Dwivedi
15y
12.7
k
0
1
25
Blog
Command are as follows:
For Sql Server 2005
BACKUP LOG
[DBNAME]
WITH TRUNCATE_ONLY
DBCC SHRINKFILE(
[DBNAME]
_log)
For Sql Server 2008
ALTER
DATABASE
[DBName]
SET
RECOVERY
SIMPLE
;
GO
-- Shrink the truncated log file to 1 MB.
DBCC
SHRINKFILE
(
DBName_log
,
1
);
GO
-- Reset the database recovery model.
ALTER
DATABASE
[DBName]
SET
RECOVERY
FULL
;
People also reading
Membership not found