467,081 Members | 1,251 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,081 developers. It's quick & easy.

restore .dat

I am trying to restore a SQL Server database from a .dat file. An earlier question on how to do this elicited the following answer.

"

You need to know how the '.dat' file was created in order to import it. Use
RESTORE FILELISTONLY to determine if this is a database backup:

RESTORE FILELISTONLY
FROM DISK='C:\MyDatabase.dat'

You can then execute a RESTORE with the desired MOVE options.

RESTORE MyDatabase
FROM DISK='C:\MyDatabase.dat'
WITH
MOVE 'MyDatabase' TO 'C:\DBDataFiles\MyDatabase.mdf',
MOVE 'MyDatabase_Log' TO 'C:\DBDataFiles\MyDatabase_Log.ldf'

If you get an error during the RESTORE FILELISTONLY that states the file
isn't a valid backup, you'll need to investigate further. You might try
opening it using a text editor to see of that provides a clue of the file
format.

"

When I do the RESTORE FILELISTONLY command I get a table with two rows

LogicalName :: PhysicalName :: FileGroupName

Data_V2_1_Data :: C:DATABASES\Data_V2_1_Data.MDF :: PRIMARY
Data_V2_1_Log :: C:DATABASES\Data_V2_1_Log.LDF :: NULL

The .MDF and .LDF files were not provided to me. Are those something I
need?
What does this result mean? What are possible next steps to extract .MDF, ,LDF files?

The RESTORE with MOVE doesn't work, but I am hoping that if I can get help figuring out teh RESTORE FILELISTONLY commands results the other part will fall into place.

Thank you in advance!
-Nik
Aug 1 '08 #1
  • viewed: 5934
Share:
1 Reply
Dököll
Expert 2GB
Hello!

Are the column names provided to you legitimate (LogicalName :: PhysicalName :: FileGroupName), you probably have found your answer there...

If you were restoring a database, the extension is the .MDF portion. Although I suspect you alreay know that.

Also, do you have a copy of this database (.MDF file). If you have the data elsewhere, you may find it easier to just make up a different .MDF (database) and update/transfer the data to it.

Not too conventional, but if you need simpler solutions and have a copy, try it:-)
Aug 2 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by For example John Smith | last post: by
3 posts views Thread by butatista | last post: by
4 posts views Thread by Hardy | last post: by
9 posts views Thread by GL | last post: by
11 posts views Thread by Chris | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.