What to use to open an .mdf (SQL Database) file

断了今生、忘了曾经 提交于 2019-12-03 11:14:30
Brad Christie

.sdf is, in fact, a Compact Database file (unless you've changed the extension which would be problematic). SQL Server would be .mdf.

SQL Server (.mdf)

You can attach the database to your local SQLEXPRESS instance and view it. An example of attaching it can be found on msdn: How to: attach a Database File to SQL Server Express. Essentially you're calling:

USE [master]
GO

CREATE DATABASE [database_name] ON 
    ( FILENAME = N'C:\Path\To\<database name>.mdf' ),
    ( FILENAME = N'C:\Path\To\<database name>.ldf' )
    FOR ATTACH ;
GO

SQL Compact Edition (.sdf)

The best tool I've found to open them is CompactView.

hailinzeng

SysTools SQL MDF Viewer can be used to view the table contents. I tried with the free trial version.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!