Can not find the database

  • When i query like

    SELECT name,physical_name FROM sys.master_files

    I can see the database name in the result set but when i look from SSMS i can not see the database. why?

  • I can see the mdf and ldf files located on the disk which are used, how can i find the database name for those files?

  • Tara-1044200 (11/23/2009)


    I can see the mdf and ldf files located on the disk which are used, how can i find the database name for those files?

    My first guess was may be the databases were detached, but after detaching they should not be shown in the result set for the query you ran. So the database is not detached..

    Can't guess what is the security permissions you have when accessing the Instance?

    It's difficult to do guesswork with little info.


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • Did you try this query?

    select name

    from master.sys.master_files

    where physical_name = 'RightFileWithFullPathHere'

    Adi

    --------------------------------------------------------------
    To know how to ask questions and increase the chances of getting asnwers:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • that is what i did , i can see the db name but its not visible when look at mgmt studio. what if that was renamed?

  • Are you looking at the right place? I've had a case when someone told me that he can only see the database's files, but he can't see the database it self. After talking with him I found out that he was looking for the master database that can be seen in the system databases branch, but he was looking in the databases branch. Could be something similar to your case. Can you tell us the name of the database that you are trying to see (according to the query's results)?

    Adi

    --------------------------------------------------------------
    To know how to ask questions and increase the chances of getting asnwers:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

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

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