Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 10th, 2006, 05:50 AM
Authorized User
 
Join Date: Aug 2006
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ankur_icfai
Default Query to shrink a Database

Hi...Everyone

Can any one provide a sproc or a Query to shrink a database,
I know it can be done through Enterprise Manager..but is there
any query available...
 
Old October 10th, 2006, 07:57 AM
SQLScott's Avatar
Wrox Author
 
Join Date: Dec 2004
Posts: 338
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Look in BOL at DBCC SHRINKFILE. That will give you what you need..

Scott Klein
Author - Professional SQL Server 2005 XML
http://www.wrox.com/WileyCDA/WroxTit...764597922.html
 
Old October 16th, 2006, 11:50 PM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
Default

...and then don't use it... the database grew for a reason. It'll grow again. If you keep shrinking it, you'll not only make queries and procs wait while it grows again, you'll also be fragging your database more and more.

--Jeff Moden





Similar Threads
Thread Thread Starter Forum Replies Last Post
Shrink Detail section on a report TimLB Access 2 January 23rd, 2007 08:45 AM
Shrink Great Problem alyeng2000 SQL Server 2000 3 June 30th, 2004 11:29 AM
Shrink Log without SQL service restart. happygv SQL Server 2000 9 May 12th, 2004 09:24 AM
Log Shrink acko SQL Server 2000 1 March 25th, 2004 10:57 AM
Shrink Trans Log Walden SQL Server 2000 2 November 3rd, 2003 09:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.