Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a database running on MSDE with the 2GB limit. I noticed that over the last few days I've been hitting the 2GB limit. I opened the enterprise manager to run a SHRINK.

That didn't do anything, so I run a query to delete table rows for data older than Jan 1, 2009.

After I clicked to run the query, I got a connection error message. When I clicked OK and went back to the database list, I saw that it said "suspect" next to the database.

So, I restarted the SQL Server, and now the database is completely gone. The data files are still in the Data folder.

Is it possible to get the database back?

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

Have you tried attaching the .mdf file? Use the Management Studio Express or sp_attach_db.

JR

Open Enterprise Manager and connect to your SQL server instance. Now right click Databases and find "Attach Database" (I can't remember if it's under a sub menu). Browse to the .mdf file. I would backup the database files first.

share|improve this answer
    
I have no idea how to do that, I basically never deal with SQL Server. –  Chris Thompson Jun 30 '09 at 16:02
    
See my edit for the details –  John Rennie Jun 30 '09 at 16:20
    
It won't let me attach the database because the there isn't enough room in the PRIMARY filegroup, presumably because it's over the 2GB limit! –  Chris Thompson Jun 30 '09 at 16:43
    
Do you have a full version of SQL Server to hand that you could use to shrink the database? There are eval versions of SQL Server you can use, after all you only need it once! –  John Rennie Jun 30 '09 at 17:00
    
That's a good suggestion. I'll see what I can do. –  Chris Thompson Jun 30 '09 at 18:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.