Connecting Tech Pros Worldwide Forums | Help | Site Map

restore .dat

Newbie
 
Join Date: Aug 2008
Posts: 1
#1: Aug 1 '08
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

Dököll's Avatar
Moderator
 
Join Date: Nov 2006
Location: Upstate NY - US
Posts: 2,268
#2: Aug 2 '08

re: restore .dat


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:-)
Reply


Similar Microsoft SQL Server bytes