How do i find the primary data file for a database

  • Hi

    I have a database with the files not having the standard extensions of .mdf,.ldf,.ndf. How do i find which is the primary data file among them. Any table where that info is logged?

    Thanks in Advance

    Hari

  • select * from sysfiles.

    or go to database properties.

  • you can also go with

    select * from sys.database_files - for specific files of db

    select * from sys.masterfiles - details of all files

  • select * from sys.database_files

    where file_id=1

    MJ

  • Another method is to use the stored procedure:

    sp_helpdb 'db_name' -- of course replace db_name with your database name

    It will provide information on the database other than just the files which compose that particular database.

Viewing 5 posts - 1 through 4 (of 4 total)

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