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
2
votes
1 answer

Cannot restore mssql database because .mdf file is missing

I am trying to backup a database from SqlServer 2014 (in Windows 10 OS) and restore it to SqlServer 2017 (in Ubunutu 18.04 Digital Ocean). I'm used the following SQL Command to Backup: USE [master] GO BACKUP DATABASE [SampleDb] TO DISK = 'C:\Program…
Ahmed Faizan
  • 446
  • 5
  • 12
  • 22
2
votes
1 answer

Primary key on auto increment when mdf database is cleared

I removed all data from my mdf database by using delete commands. Now when I run program, the primary key on auto increment does not start from 1. Instead it auto increments the last deleted id number. The primary key should start from 1 after…
Umer Saeed
  • 63
  • 4
2
votes
2 answers

Opening MDF4 (.mf4) file using python

I am trying to read .mf4 file using python 3.7 (Spyder IDE). The main idea of reading .mf4 file is to see if I can access each information separately. That means, for example, to check the Road Signs detection points only or Pedestrian…
Rakesh
  • 21
  • 1
  • 1
  • 4
2
votes
1 answer

Connecting to SQL server using Pyodbc & SQLAlchemy

Here is some background on what I am trying to accomplish: My work created an application that stores information in a SQL database for each job we work on. I am trying to automate some of our workflow process using python, but I would like to have…
J.Vo
  • 385
  • 6
  • 12
2
votes
1 answer

Determine MDF and LDF file match

Is there a way to determine what MDF goes with what LDF file for SQL Server? We had a server crash and pull these files off and were only named with a random integer for the file name. So now we need to guess which MDF and LDF go together to get…
Mike Flynn
  • 22,342
  • 54
  • 182
  • 341
2
votes
2 answers

Is it possible to merge ndf files and mdf file into one single mdf file?

I have an .mdf file, and two .ndf files of the same mdf file. Is it possible to merge those files into one single .mdf file without loosing any data ?
Mehdi Souregi
  • 3,153
  • 5
  • 36
  • 53
2
votes
0 answers

SQL Server add user to database MDF

Before you ask, I'm not trying to hack anywhere, just debugging a faulty application for issues that support doesn't cover. I have a MDF file from SQL Server 2012 where a limited-rights user was created. I have installed another copy of SQL Server…
tsmr
  • 198
  • 11
2
votes
1 answer

Attach a database using MDF file that is Read-only and without LDF file in SQL Server

I want to attach a DB to SQL Server. I have the mdf files for it but those are in read-only state. Also the LDF file is not present. I use the following command to attach the DB. Create database TrackData on (Filename = N'F:\Data\Bill_Data.mdf')…
Madhur Maurya
  • 1,016
  • 4
  • 19
  • 42
2
votes
2 answers

How do I refer to APP_Data from another project

I have the following project solution: There is a ASP.NET MVC Web Application where I have a SQL database (mdf file) in the App_Data directory. There is a class library where I have some migrations from migratordotnet. In my build file I have to…
Spoike
  • 119,724
  • 44
  • 140
  • 158
2
votes
5 answers

sql server mdf file database attachment

I'm having a bear of a time getting visual studio 2010 (ultimate I think) to properly attach to my database. It was moved from it's original spot to #MYAPP#/#MYAPP#.Web/App_Data/#MDF_FILE#.mdf. I have three instances of SQL Server running on this…
jnsohnumr
  • 159
  • 1
  • 2
  • 13
2
votes
1 answer

Bind DataGridView to a Table in Database

I want to bind the DataGridView to a Table in my Database. I've found several topics about this, but I can't get it to work. Perhaps I'm missing something. I'm building a "monitor" in which I want to see any Database changes of a specific table. So,…
Daniel Bonetti
  • 2,306
  • 2
  • 24
  • 33
2
votes
2 answers

Entity Framework code first causes exception on database access

Recently started trying to dig into code first approach for Entity Framework. I have crated some database tables following various tutorials but none of them did the trick. Starting from scratch about 3 to 4 times now because the exceptions get more…
2
votes
0 answers

Can I create a database file without install a Database in c# Entity Framework first code?

hi I want to use Entity Framework for my Application. With my Application I create a Helpdesk Ticket and I want do this without install a Database on the server. for this I want to create only a file with the database data and content. For SQL…
Tarasov
  • 3,625
  • 19
  • 68
  • 128
2
votes
0 answers

Read a database MDF without SQL Server installed by an instance WPF

I read several questions and answers , but I can not find an exact solution for my problem , so I open a question too. We're doing a program that uses the DLL inside of another project I call A. A then the project is evidence to a database mdf . The…
Mr. Developer
  • 3,295
  • 7
  • 43
  • 110
2
votes
1 answer

SQL Server MDF file grows much too big for the amount of data inserted

I have a table which stores binary data. It has 490,409 rows. When I sum the datalength of the binary varbinary(MAX) column, the total size comes to about 12gb. However, every time I insert new rows, the .MDF files grows in GBs, even when I'm…
jdf35w
  • 29
  • 2