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!

Re-installed SQL Server, need old databases!

Status
Not open for further replies.

QAZXSWEDC

Technical User
Sep 6, 2002
5
US
Hello all,

I recently ran out of time on my 120 day MS SQL Server trial. I decided to reinstall it again. I saved the old mdf and ldf files from the "data" directory and have placed them in the re-installed "data" directory but they don't show up in enterprise manager. I was wondering if there is a way to import the data from these or somehow get the reinstalled version to see these databases. Any help appreciated.
 
Hi

THe databases are still there but you have a new master database which doesn't contain any entries for your old databases and thats why they are not visible. You can't use DTS as you can't see the databases as they are still just files.

You can use sp_attach_db to re-attach the databases via Query Analyser. You can read up on it in BOL but here is the example from BOL:

EXEC sp_attach_db @dbname = N'pubs',
@filename1 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs.mdf',
@filename2 = N'c:\Program Files\Microsoft SQL Server\MSSQL\Data\pubs_log.ldf'


Alternatively you can do this in Enterprise Manager by right clicking on the Database node and choosing the "attach database option". Then browse to the files and fill in all the relevant options.

Hope this helps

John
 
The 120 day evaluation version of SQL Server is supposed to be used for 120 days. Then if you want to use the product, you need to purchase it. Not only is reinstalling illegal and unethical, but it could end up costing you and your company, if this is done at work, a lot of money.

If you want to get the best answer for your question read faq183-874 and faq183-3179.
Terry L. Broadbent - DBA
SQL Server Page:
 
Hmm, thanks for pointing that out. I am only using it at home to learn db administration. I didn't realize this was unethical. I guess I will go uninstall it immediately and move to a free database such as MySql on linux.
 
Also, take some time to read Microsoft's current EULA. You might be suprised to learn that you have given MS the right to see which of their products are on your computer and if they are authorized versions. Basically, the EULA gives MS the right to make sure you are complying with DECA at all times.

-SQLBill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top