Questions tagged [mdf]

Master Database File (.MDF) is the starting point of a SQL Server database. It is the primary data file and also points to the other files in the database.

See the Wikipedia article on Microsoft SQL Server.

Related Tags:

429 questions
150
votes
2 answers

What is an MDF file?

Is this like an “embedded” database of sorts? A file containing a built in database?
NewGuy
80
votes
3 answers

What are NDF Files?

SQL Server uses .mdf for data files and .ldf for log files, but what are .ndf files? What are the benefits of these files?
Nasser Hadjloo
  • 12,312
  • 15
  • 69
  • 100
48
votes
6 answers

SQL Server: Importing database from .mdf?

I have an .mdf file on my local box. I have SQL Server 2008 Express and SQL Management Studio 2008 Express installed on my local box. How in the world do I import this .mdf file as a new database into my SQL Server? This seems like a ridiculously…
31
votes
8 answers

SQL - How to backup a database and export as a MDF file with MS SQL 2008 R2

I have created a database "test" with some tables in MS SQL Server 2008 R2 (i.e. MS SQL Server Management Studio). Now, I need to export this database as a MDF file. What should I do?
q0987
  • 34,938
  • 69
  • 242
  • 387
28
votes
5 answers

Attach (open) mdf file database with SQL Server Management Studio

How can I open a *.mdf file of a database created with Visual Studio 2010, into SQL Server Management Studio? I tried to attach it by myself, but I cannot navigate to that file for (I guess) some security reason.
user198003
  • 11,029
  • 28
  • 94
  • 152
21
votes
3 answers

Is it possible to access a .mdf database without SQL Server?

I created a .mdf file by SQL Server and put it to a local file. I run my program in a computer which has no SQL Server installed. And also I used classes from the System.Data.SqlClient namespace (i.e. SqlConnection..) I want to make some kind access…
unbalanced
  • 1,192
  • 5
  • 19
  • 44
19
votes
4 answers

Connecting to sql server database mdf file without installing sql server on client machine?

I am creating a window application that need to use sql server database. I want to install this application to client machine without installing sql server so that my application can still connect to a database i.e mdf file that i will be providing…
Shantanu Gupta
  • 20,688
  • 54
  • 182
  • 286
18
votes
3 answers

Connection String to Connect to .MDF

I've created a new project in VS2008, and added a .MDF file to the project. This is the first time I've tried to use the MDF files and .SQLEXPRESS databases (I've always used extenal Oracle servers in the past). I'm trying to document everything as…
kdmurray
  • 2,988
  • 3
  • 32
  • 47
18
votes
7 answers

How to rename the Physical Database Files

I have used tsql to detach a database like this: EXEC sp_detach_db @dbname = 'my_db' I then made use of PHP to rename the physical files. I was able to rename the mdf file but not the ldf file! I even tried a dos command REN but that didn't work…
Abs
  • 56,052
  • 101
  • 275
  • 409
15
votes
8 answers

How to recover database from MDF in SQL Server 2005?

I have an MDF file and no LDF files for a database created in MS SQL Server 2005. When I try to attach the MDF file to a different SQL Server, I get the following error message. The log cannot be rebuilt because there were open…
Martin
  • 5,945
  • 7
  • 50
  • 77
14
votes
2 answers

How do I fix "incorrect syntax near GO" errors in scripts generated with Microsoft's Database Publishing Wizard?

I've been searching for a "definitive" solution to this for a couple of hours now and can't find out exactly what the problem is so am hoping someone can point me in the right direction. I'm trying to create a script for a database (an MDF file DB)…
Kevin Wilson
  • 7,753
  • 8
  • 35
  • 39
13
votes
7 answers

Where does SQL Server 2005 keep the .mdf files?

I'm upgrading from SQL Server 2005 to 2008. I've detached the database I need, but can't find it on the file system. Where does a default installation of SQL Server 2005 store these?
kirk.burleson
  • 1,211
  • 2
  • 18
  • 29
12
votes
5 answers

What is the best local-database solution for WPF applications?

What is currently the best solution for WPF applications which are meant to be used on one computer where various users log into them and use them to get/save information locally? Here's how I see the options: MDF would seem to be the best choice…
Edward Tanguay
  • 189,012
  • 314
  • 712
  • 1,047
10
votes
2 answers

convert sql-server *.mdf file into sqlite file

Just wondering if it is possible to convert sql-server *.mdf file into sqlite file ?
Lydon Ch
  • 8,637
  • 20
  • 79
  • 132
10
votes
1 answer

Can LinqPad connect to an mdf file?

Can LinqPad query from a loose mdf file? How would it happen? (Joe Albahari, are you out there?)
Rap
  • 6,851
  • 3
  • 50
  • 88
1
2 3
28 29