Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error with drop database 1

Status
Not open for further replies.

FALCONSEYE

Programmer
Jul 30, 2004
1,158
US
I created a database a while ago. It's called tempDB. Since we run out of space on the hard drive, I have to get rid of this database. The tempdb.mdf takes over 4 gigs of space. When I try to run
drop database tempdb
i get the following error:
Server: Msg 3708, Level 16, State 7, Line 1
Cannot drop the database 'tempdb' because it is a system database.

All the tempDB has is bunch of system tables. Is there a way to either shrink the mdf file or get rid of the database?
thanks

 
>> I created a database a while ago.

Uh... no you didn't. TempDB is a system database. You cannot create a database named TempDB because it already exists (it's created at the time you install SQL Server).



-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
erm, you created a user database called tempDB? *supress shudder...*

surprised you were able to do that since tempDB is a system database used by sql server to store temporary processing information and other stuff.
are you sure you weren't just using the existing tempDB?

you cannot get rid of tempDB but you can shrink it, however you may need to restart the server/agent services first, this should automatically clear the tempDB.

p.s. I would recommend you read a book or go on a course before messing about with any live production server...

--------------------
Procrastinate Now!
 
By restarting services or the server it doesn't shrink the Tempdb but creates a new one. Take a look at the create date of the tempdb next time you restart services or reboot the server.


- Paul
- If at first you don't succeed, find out if the loser gets anything.
 
Anyone want to hazard as guess as to what J.E.T.A.N. might stand for? ;-)

< M!ke >
[small]Holidays cause stress. Crazy people crack under stress. Consider yourself warned.[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top