What are JFM, MDL files in Visual Studio Database Project?

Deepak Vasudevan 96 Reputation points
2021-04-02T07:19:39.387+00:00

I am trying to create a Visual Studio Database project to ensure my databases are scripted and version controlled. Post creating the project file I see the following files being created in the folder

.sln (Solution File) (Need to checkin, IMHO)
.sqlproj (.SQL Project File) (Need to checkin, IMHO)
.sqlproj.user (My guess is that it can be added to .gitignore)

.jfm (Could not understand the significance of this file)
.mdl (Could not understand the significance of this file)

SQL Server | Other
{count} vote

Accepted answer
  1. Vaibhav Chaudhari 38,921 Reputation points Volunteer Moderator
    2021-04-02T07:36:29.507+00:00

    JFM, MDL should be temporary files. I usually stage only required files like .sln, .sqlproject and checking the staged changes


    Please don't forget to Accept Answer and Up-vote if the response helped -- Vaibhav

    4 people found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Johnny Serup 0 Reputation points
    2025-01-09T09:25:23.9966667+00:00

    In a Visual Studio Database Project, JFM and MDL files are auxiliary files that play specific roles in managing the project's state and schema information. Here’s an explanation of each:


    JFM (Journal File for Model)

    • Purpose:
      • The .jfm file is a journal file used internally by Visual Studio to manage and track the state of changes made to the database project.
        • It acts as a kind of transaction log for the project, ensuring the integrity of operations, such as schema changes, by recording the sequence of modifications.
        • Location:
          • Found within the .sqlproj directory or its subdirectories.
          • Usage:
            • Helps Visual Studio handle undo/redo operations and synchronize the state of the database project with the actual database schema.
              • Typically not meant for manual editing or interaction by the user.

    MDL (Model File)

    • Purpose:
      • The .mdl file is a schema model file that contains a compiled version of the database schema.
        • It is used internally by Visual Studio to represent the database schema in a structured, intermediate format.
          • The model file is essential for performing tasks like schema comparison, generating deployment scripts, or validating the database project.
          • Location:
            • Found in the same directories as the .jfm files.
            • Usage:
              • Serves as a core file for Visual Studio to manage schema changes and ensure that the project accurately reflects the intended database structure.
                • Not intended for direct manipulation.

    Why Are They Important?

    • Both .jfm and .mdl files are part of the database project's internal mechanism to ensure the correctness and synchronization of the database schema and associated operations.
    • They are typically not included in version control systems like Git because they are generated dynamically by Visual Studio and can vary depending on the state of the project.

    Best Practices:

    • Avoid manually editing or deleting these files unless you are troubleshooting specific issues and are sure of what you’re doing.
    • If these files get corrupted, you can often resolve issues by:
    1. Rebuilding the project in Visual Studio.
    2. Deleting the files and letting Visual Studio regenerate them (close the project, delete the files, and reopen the project).In a Visual Studio Database Project, JFM and MDL files are auxiliary files that play specific roles in managing the project's state and schema information. Here’s an explanation of each: JFM (Journal File for Model)
      • Purpose:
      • The .jfm file is a journal file used internally by Visual Studio to manage and track the state of changes made to the database project.
      • It acts as a kind of transaction log for the project, ensuring the integrity of operations, such as schema changes, by recording the sequence of modifications.
      • Location:
      • Found within the .sqlproj directory or its subdirectories.
      • Usage:
      • Helps Visual Studio handle undo/redo operations and synchronize the state of the database project with the actual database schema.
      • Typically not meant for manual editing or interaction by the user.
      MDL (Model File)
      • Purpose:
      • The .mdl file is a schema model file that contains a compiled version of the database schema.
      • It is used internally by Visual Studio to represent the database schema in a structured, intermediate format.
      • The model file is essential for performing tasks like schema comparison, generating deployment scripts, or validating the database project.
      • Location:
      • Found in the same directories as the .jfm files.
      • Usage:
      • Serves as a core file for Visual Studio to manage schema changes and ensure that the project accurately reflects the intended database structure.
      • Not intended for direct manipulation.
      Why Are They Important?
      • Both .jfm and .mdl files are part of the database project's internal mechanism to ensure the correctness and synchronization of the database schema and associated operations.
      • They are typically not included in version control systems like Git because they are generated dynamically by Visual Studio and can vary depending on the state of the project.
      Best Practices:
      • Avoid manually editing or deleting these files unless you are troubleshooting specific issues and are sure of what you’re doing.
      • If these files get corrupted, you can often resolve issues by:
      1. Rebuilding the project in Visual Studio.
      2. Deleting the files and letting Visual Studio regenerate them (close the project, delete the files, and reopen the project).
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.