Click here to Skip to main content
15,884,237 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am testing bulk data uploading in SQL 2008.
For my DB, I want to remove my default (Primary) log file (.ldf) and want to add new one.

I have tried to remove it using DB->propertis->files->Remove option but its giving an error that can not remove primary log file.

Any suggestion?

Thanks in advance.

Neal.
Posted

Hi,

I got good solution-

Anyone can try this.

CSS
USE CDCTest
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE CDCTest
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (CDCTest_Log, 1);
GO
-- Reset the database recovery model.
ALTER DATABASE CDCTest
SET RECOVERY FULL;
GO



Regards,

Nilesh Shah
 
Share this answer
 
Thanks

Good Solution

i facing same problem and resolve quickly using this article
thanks again
 
Share this answer
 
Comments
Deepu S Nair 19-Mar-15 1:51am    
Don't post your comment as solution.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900