Search code examples
sql-serversql-server-ce

How do you open an SDF file (SQL Server Compact Edition)?


I have an SDF file and I would like to retrieve its schema and query it with some UI. How can I do this? I have no Visual Studio installed on the machine and I would like to install as little software as possible.


Solution

  • Try the sql server management studio (version 2008 or earlier) from Microsoft. Download it from here. Not sure about the license, but it seems to be free if you download the EXPRESS EDITION.

    You might also be able to use later editions of SSMS. For 2016, you will need to install an extension.

    If you have the option you can copy the sdf file to a different machine which you are allowed to pollute with additional software.

    Update: comment from Nick Westgate in nice formatting

    The steps are not all that intuitive:

    1. Open SQL Server Management Studio, or if it's running select File -> Connect Object Explorer...
    2. In the Connect to Server dialog change Server type to SQL Server Compact Edition
    3. From the Database file dropdown select < Browse for more...>
    4. Open your SDF file.