DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    robert Guest

    Importing old data to new database


    New user

    I have installed sql 7 on a new computer having trouble getting database
    to work with old data
    after installing sql 7 I copies old database to the data dir under MCSQL7
    when I go to enterprise manager I only see default databases
    Do I have to import it ,I thought since its in native format it would be
    recogize it.

  2. #2
    Andrew Prosser Guest

    Re: Importing old data to new database


    "robert" <robert9@telus.net> wrote:
    >
    >New user
    >
    >I have installed sql 7 on a new computer having trouble getting database
    >to work with old data
    >after installing sql 7 I copies old database to the data dir under MCSQL7
    >when I go to enterprise manager I only see default databases
    >Do I have to import it ,I thought since its in native format it would be
    > recogize it.


    SQL Server cannot magically 'pick up' databases because they happen to reside
    in a directory, you need to do the following for each of your databases;

    Detach the datafiles for each of your old databases;

    sp_detach_db my_database_name

    Now copy these files to your new machine.

    In the new server run for each database;

    CREATE DATABASE database_name
    ON PRIMARY (FILENAME = 'c:\my_database_name.mdf')
    FOR ATTACH

    That should be that.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links