SQLism

Logging and Blogging SQL Server Experiences.

Wednesday, August 22, 2018

List out all MDF and LDF File locations of SQL Sever Databases

SELECT
    db.name AS DBName,
    type_desc AS FileType,
    Physical_Name AS Location
FROM
    sys.master_files mf
INNER JOIN
    sys.databases db ON db.database_id = mf.database_id
Posted by SQLism at 8:49 AM
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Labels: all, and, databases, file, ldf, List, locations, MDF, of, out, Script, Sever, SQL

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2020 (6)
    • ►  July (1)
    • ►  March (1)
    • ►  February (4)
  • ▼  2018 (3)
    • ▼  August (3)
      • List out all MDF and LDF File locations of SQL Sev...
      • Move User Databases
      • Space occupied by each Schema in SQL Server database
  • ►  2017 (10)
    • ►  December (1)
    • ►  October (1)
    • ►  June (1)
    • ►  May (1)
    • ►  February (4)
    • ►  January (2)
  • ►  2016 (7)
    • ►  December (1)
    • ►  November (3)
    • ►  October (1)
    • ►  September (1)
    • ►  August (1)
  • ►  2015 (10)
    • ►  September (1)
    • ►  April (9)
  • ►  2014 (53)
    • ►  October (19)
    • ►  September (33)
    • ►  June (1)
  • ►  2013 (12)
    • ►  October (2)
    • ►  September (1)
    • ►  August (5)
    • ►  July (1)
    • ►  March (1)
    • ►  February (1)
    • ►  January (1)
  • ►  2012 (9)
    • ►  September (1)
    • ►  August (6)
    • ►  July (2)
Simple theme. Theme images by luoman. Powered by Blogger.