AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
 Syntax for Shrinking SQL Server database mdf and log file
Posted by Moderator1 on  12/26/2007 8:26:24 AM 3074 Views
Try the following code through your Query Analyser to shrink the database.

backup log <database_name> with truncate_only
use <database_name>
dbcc SHRINKFILE (<database_name_Log>,2)
dbcc ShrinkDatabase (<database_name>, 2)


Post New Tips/Tricks View all Tips/Tricks

Featured Resources:
Web Application Security — How to Minimize Prevalent Risk of Attacks
Vulnerabilities in web applications are now the largest vector of enterprise security attacks.
Introduction to Web Applications Development
This 376 page eBook "Introduction to Web Applications Development", starts with an introduction to the internet, including a brief history of the TCT/IP protocol and World Wide Web.
100% Free Subscription until Stock lost.View complete list.
Sponsored by