Cannot see database in Management Studio

  • I cannot see database in Management studio but when I want to delete MDF file, gives me an error like

    Cannot delete, it is being used by another person or program.

  • Is the database detached, or do you just not have the rights to see it?

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • Nope, It was not detached. I restore from SQL 2000 database and somehow got disappear.

    When I try to attached it , getting same error like it is being used by another process.

    I am trying to delete the MDF file but no success.

    I have admin rights on the server. I tried using SA account but no success.

    I cannot even see database when I use following command.

    Select * from sys.sysdatabases

  • I've had the pleasure of venturing onto a box where someone had created a database with the file name having no similarity to the database name. If you run the following code, it'll show you all the physical names associated with that SQL instance and tell you what database is associated with it.

    It may also be being used by a different instance on the same server. If this doesn't turn up the file on the first instance, look for other instances running and see if it is in there.

    Kyle

    use master;

    select physical_name, name type_desc, state_desc, * from sys.master_files

  • check the NTFS file permissions on the data files

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Kyle.. You are right. I restore the database with a different name and the files are associated with the new database name. When I run following command, the database name was different. Very stupid of me.

    use master;

    select physical_name, name type_desc, state_desc, * from sys.master_files

    where physical_name like '%sca%'

    Thanks a lot.

  • Glad to help!

    Kyle

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply