Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

how to compress /  shrink an msde 2000 database

Posted on 2006-06-28
3
Medium Priority
?
3,220 Views
Last Modified: 2012-08-13
I have a windows 2000 server running msde.  It now has a database file that is almost 2 gb, the max it will allow.  I know one of my options is to move it to a sql standard server, but this database is just not worth the work or cost.  I have cleaned out some of the junk data in the database.  I am hoping I can run some sort of maintenance on the database to compress/shrink/defrag it.  It looks like I will be using the osql command, but I can only find documentation on how to use this to backup, move or restore the file, not perform any other maintenance on it.  Any advice would be helpful
0
Comment
Question by:lrpage
3 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17000640
if the file size has grown to 2GB, keep it there. if you cleaned out some tables, there will be free space available for new records
0
 
LVL 1

Accepted Solution

by:
terjoh earned 1000 total points
ID: 17043778
As long as you have OSQL installed, run the following at a command prompt to compress the database:

osql -U [user name] -P [password] -S (local)\[Server Instance Name] -d [database name] -Q "DBCC SHRINKDATABASE ([database name])"

Let me know if you have any problems!!
0
 
LVL 3

Author Comment

by:lrpage
ID: 17044376
That was the command I was looking for.  Thank you.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

879 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question