Is there somebody ho can tell me how to import a '.dat' file in Microsoft
SQL Server 2000 Developer?
The '.dat' file contain a fully database, with many different tables. Each
of them contain many different rows.
Thank you very much.
Christian.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.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Christian R" <Christian.Rosseel@.pandora.be> wrote in message
news:Zn65f.26124$z_6.1075248@.phobos.telenet-ops.be...
> Hello,
>
> Is there somebody ho can tell me how to import a '.dat' file in Microsoft
> SQL Server 2000 Developer?
> The '.dat' file contain a fully database, with many different tables. Each
> of them contain many different rows.
> Thank you very much.
>
> Christian.
>|||Do you know what format the file is? .DAT could be anything because
plenty of different applications and data sources use DAT as a file
extension. If you know what format the file is then you can proceed to
look for an ODBC driver for that format.
If you really have no idea then try taking a look at the file in a hex
editor or file viewer. Maybe there will be something in the header that
indicates the source. Otherwise you may have to consult whoever was the
originator of the file.
If the file is in some readable text format like a delimited or fixed
width ASCII file then you could use DTS to import it.
Maybe this is in fact a SQL Server database file with a non-standard
file extension. In that case you may be able to attach it using
sp_attach_single_file_db so take a look at that topic in Books Online.
If you do attempt that, make sure you have a backup of the file first
because the server may write to the file.
--
David Portas
SQL Server MVP
--|||Thanks for the help that you given me.
I'm sorry, but Microsoft SQL Server 2000 is pretty new for me, and I really
do not now what kind of format the database (.dat) is.
I have trying to open it with a text editor, because I don't have a hex
editor and the only thing is have seen is computer language. I also tried a
'RESTORE FILELISTONLY' from the command prompt, but that didn't work. It my
be look a little stupid that I have tried it from the command prompt, but I
don't now what else it means. I suppose I have to search it in the server
itself, but my version is in Dutch. Perhaps you can tell me where I can find
that option in the menu of the Enterprise Manager?
What I not have tried is 'sp_attach_single_file_db'. Can you explain me a
little more about that possibility, perhaps that work?
Again, thank you very mouth for the help, and sorry for my imperfect
English! I live in Flanders.
Christian.|||Christian R (Christian.Rosseel@.pandora.be) writes:
> I'm sorry, but Microsoft SQL Server 2000 is pretty new for me, and I
> really do not now what kind of format the database (.dat) is.
As David said, it could be anything. All I know is that you said:
The '.dat' file contain a fully database, with many different tables.
Each of them contain many different rows.
Do you know that this is actually SQL 2000? .dat is not normal file
extension in SQL 2000. This could be Ingress, Informix, Oracle or
whatever. (Well, maybe none of them would ever use .dat, but since I
don't know them, I will have to assume that they may.)
There is one SQL Server context where .dat appears though, and that is
an SQL 6.5 device file. If this really is such a file, you cannot
access it with SQL 2000. SQL 6.5 had a completely architecture, and
the only program that can read SQL 6.5 device files is SQL 6.5. Which,
thankfully, is available on MSDN Subscriber Downloads.
> I have trying to open it with a text editor, because I don't have a hex
> editor and the only thing is have seen is computer language. I also
> tried a 'RESTORE FILELISTONLY' from the command prompt, but that didn't
> work. It my be look a little stupid that I have tried it from the
> command prompt, but I don't now what else it means. I suppose I have to
> search it in the server itself, but my version is in Dutch. Perhaps you
> can tell me where I can find that option in the menu of the Enterprise
> Manager?
Use Query Analyzer to run T-SQL commands.
> What I not have tried is 'sp_attach_single_file_db'. Can you explain me a
> little more about that possibility, perhaps that work?
exec sp_attach_single_file_db 'yourdb', 'C:\temp\yourfile.dat'
Note that the file path relates to the server, not your workstation
(unelss you run SQL Server locally).
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp
No comments:
Post a Comment