Reputation: 1454
I have log file which is grown to 1TB. I have no need of log file. Just want to delete the old log file and create a new one instead of old log file.
How can I achieve that ? will it cause any other problem? pleas help.
Upvotes: 5
Views: 25777
Reputation: 550
I made a backup of the database (very important just in case something fails or trying something else you brake up things!) and then I detached and reatached the database, but deleting the ldf file from the reataching window. This creates a new ldf file as expected in the original database but empty.
More details here: https://inapp.com/delete-sql-server-database-transaction-log-file/
Upvotes: 1
Reputation: 1
use this :
create database cmsdb on
(filename = 'd:\programfiles\microsoft sqsl server \msql12.mssqlserver\mssql\data\cmsdb.mdf')
for attach_rebuild_log
go
Upvotes: 0
Reputation: 1454
Brought database to offline and deleted log file manually from file system. And bring database back to online. Thats worked out.
Upvotes: -2
Reputation: 796
Right mouse button on the database and
TASKS -> SHRINK -> FILES
Then choose the option that interests you
More :
Upvotes: 3