Local StudioDATABASE TOOLS MDF to SQL Script Converter
100% Offline Download Tool Tools Catalog

MDF to SQL Script

Convert MDF to SQL for just the tables you choose. Open a SQL Server MDF and its required NDF files, then download a UTF-8 script to replay in a separate database.

Source Database

SQL Script Output

Target Dialect
SQL Server (Transact-SQL)
File Format
UTF-8 SQL (.sql)

Open a database to choose tables for the script.

Instructions

  1. Select Open Sample or choose one MDF and any required NDF files. Add missing companion files with Add NDF Files.
  2. Select the tables you want. Choose Preview to inspect a table’s column definitions and up to 100 stored rows.
  3. Select Generate SQL Script, then Download. Use Save As where your browser makes it available.
  4. Run the UTF-8 script as one batch in an empty SQL Server 2025 user database with compatible collation and SQLCMD mode off. Compare the resulting tables and row counts.

Verified with cleanly detached SQL Server 2025 MDF and NDF files. The reader requires complete data files totaling up to 2 GB and may reject layouts or values it cannot verify. The script carries base column definitions and rows as decoded. SQL Server features such as indexes, constraints, identities, original collations, filegroups, triggers, permissions, and stored code are omitted.

Security Check

MDF to SQL Script

Convert local SQL Server tables into a script on your device.

  • Open SQL Server FilesChoose one MDF and its required NDF files.
  • Select TablesReview tables, columns, and stored row counts.
  • Save the ScriptDownload UTF-8 SQL for an empty SQL Server database.

Local Security Check

Checking This Tool

Checking the launch, browser policy, and resources.

    These checks cover this tool page. Website links open only when selected.

    File Access

    The converter reads only the files you select or the built-in sample. Files stay on this device and the originals remain unchanged.