Moving DataBase from one place to another

  • I work on office and home, My office Sql Server has a different name and login password what so ever and my home computer has different but both are SQL Server 2000 enterprise editions.

    After working from office, i copy the database and bring home and when i try to attach the database of the office to my home computer. It says that they are from different sources. If i delete the LDF , it says SUSPECTED database.

    If i create a new database with the same name and overwrite its MDF with my office MDF then again it shows error.

    Please suggest me the best way to cope up with this problem. I mean how can i work on same copy of the database and copy from home to office , work at office and then bring and attach the same with my home computer.

    Please reply soon , my work is stopped because of it .

     

  • Your attach statement should look something like this (substitute the drive, directory, and filename for your drive, directory and filename):

    In Query analyzer:

    use master

    go

    sp_attach_db 'mydb','E:\Sqldata\mydb.mdf','E:\Sqldata\mydb.ldf'

    go

    You can also use enterprise manager and right click on Database then do attach database and modify the paths.

  • hey heart throb

    if u got trouble in copying the entire database then try to copy table by table using bulk copy...bcp!! this might work but u need to execute bcp for each table.

    or else u must try as said by eric...

    Rajiv.

  • Ok thank you i will try both of the methods

     

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply