Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Any way to import data files into a new database?

Status
Not open for further replies.

gcazian

MIS
Dec 4, 2002
61
US
We have some data files that contain some important data that we need. Unfortunately, the SQL Server they were attached to crashed.

My question is: Is there any possible way to import raw data files into a fresh database?

Thanks in advance.
 
Have you tried Import data from the Enterprise manager? (If you have the entrise edition). Do you have backups? Are the databases on drives that are still good? If so, try coping the db to a new drive and try using the stored proc called sp_attach_db. Look at books on-line for the syntax (as you will need to attach 2 files).
 
Yes. The easiest way is to build a new instance of SQL Server. Then as pweegar suggested, copy the .mdf and .ldf files (that's the database and log files) to the new server and use the attach command (Attach database via Enterprise Manager, or sp_attach_db via Query Analyzer). Depending on the severity of the crash, your database may be corrupted or have other problems attaching. Search this and the Microsoft SQL Server: Programming forum for the keywords attach database.

-SQLBill
 
Thanks.

I cannot use the import feature because the database is down, and I believe that the source database needs to be up and running in order to perform an export...
 
CAn you copy the files to a new computer? If so just attach them.

You may need to restore your backup if the files got corrupted when your server crashed.

Questions about posting. See faq183-874
 
you'll probabbly have torn framentations in the database but thats another story .... if you have a backup.. then make a new database with the same name as the last one,just an a empty shell and then restore the backup on that ..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top