kagundajm
kagundajm

Reputation: 1200

Restore data file from sql server backup file without restoring the log file

I have a client who needs support with SQL Server. The client has provided a backup of the database. Upon trying to restore the database for testing, I realized that the data file is 100MB while the log file is 250GB which makes it impossible to restore on my development computer.

I have seen it is possible to create SQL virtual databases using idera SQL virtual database and Redgate SQL Virtual Restore but I haven't done any testing on these tools.

Is is possible to extract or restore the data file (mdf) alone without the log file (ldf)?

Upvotes: 0

Views: 4556

Answers (1)

Dan P
Dan P

Reputation: 1999

I don't think there is way to only restore one and not both. Instead of having the client sending you a backup have them send you the .MDF only in a single file. They may have to detach the database first before they can copy the .MDF file. Another alternative is to stop the SQL Service temporarily while they copy the file.

You should be able to attach the database with just the MDF file. If the LDF file does not exist it will create one automatically for you.

Upvotes: 1

Related Questions