Script to obtain database name and associated files

  • I'm an looking for a script that will give me the database name and associated files (data and log) for that db.  For example, the result of the script will show:

    DBName         DataFile        LogFile

    TEST             TEST.MDF      TEST.LDF

     

    Thank you.

  • Take a look at this script SQL Server Database File Sizes.

    It also will give you file sizes and both physical and logical data file names.



    ----------------
    Jim P.

    A little bit of this and a little byte of that can cause bloatware.

  • Profiler - is your best friend!!!

    Start profiler and open properties for the DB. Profiler will show you the query EM used to retrieve this information.

    Remember: you've paid for this functionality when you purchased SQL Server. So use it!

    _____________
    Code for TallyGenerator

Viewing 3 posts - 1 through 2 (of 2 total)

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