---
title: "What is .mdf and .ldf file in SQL Server and where to locate these files in MS SQL Server?"  
description: "What is .mdf and .ldf file in SQL Server and where to locate these files in MS SQL Server?"  
author: "Revati S Misra"  
published: 2023-01-27  
updated: 2023-01-27  
canonical: https://www.mindstick.com/forum/157354/what-is-mdf-and-ldf-file-in-sql-server-and-where-to-locate-these-files-in-ms-sql-server  
category: "mssql server"  
tags: ["mssql server", "sql server", "sql"]  
reading_time: 2 minutes  

---

# What is .mdf and .ldf file in SQL Server and where to locate these files in MS SQL Server?

What is .mdf and .ldf [file](https://www.mindstick.com/articles/59/encrypting-and-decrypting-files-using-c-sharp) in [SQL Server](https://www.mindstick.com/articles/12999/what-is-table-valued-function-in-sql-server) and where to locate these [files](https://www.mindstick.com/articles/23302/the-importance-and-advantage-of-keeping-your-important-files-on-the-cloud) in [MS SQL](https://answers.mindstick.com/qa/96619/what-are-the-advantages-of-ms-access-over-ms-sql-server) Server?

## Replies

### Reply by Ashutosh Patel

Microsoft [SQL](https://www.mindstick.com/articles/13115/types-of-keys-in-sql-or-oracle-database) [Server](https://www.mindstick.com/articles/43769/what-is-serverless-architecture-is-it-worth-switching-over) is a relational database management system (RDBMS). It is a software product that stores and retrieves the data requested by other applications. It stored the data in the form of a table (row and column).

There are two different files used are d by SQL servers named .mdf and .ldf. the file with mdf stands for the main data file or master database file and ldf stands for the log data file. .mdf file stores all the data and information related to users in the table and ldf file records all the transactions and changes to the database.

## Location of .mdf and .ldf files in MS SQL Server:

First, open Microsoft SQL Server then selects your database name from object explorer -> Right click on your database name -> Click on its property -> From the open popup Select the Files option on the right side -> then see the right side in the popup in the table has a column name ‘Path’. This is the location of the .mdf and .ldf files of the database.


---

Original Source: https://www.mindstick.com/forum/157354/what-is-mdf-and-ldf-file-in-sql-server-and-where-to-locate-these-files-in-ms-sql-server

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
