June 1, 2011 at 7:40 am
Hi,
I've a SQL data file (.mdf) I would like to find out to which database it's linked to ?
Is there a way to find out database name using .mdf file?
Thanks
June 1, 2011 at 7:50 am
June 1, 2011 at 7:52 am
Hi,
You can query sp_helpdb databasename for each DB on your SQL instance. This will list out the filenames (Primary, secondary) and the log file associated with the DB.
PS.- Its difficult to find the DB just by looking at the .mdf filename, simply coz' people are at their free will to name files for a database. I have seen totally unrelated names given to files 🙂
Thanks,
Ninad
June 1, 2011 at 7:52 am
yep or check sys.database_files for the name and compare to your mdf.
June 1, 2011 at 9:20 am
thank you all 🙂
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply