Copy SQL Database On Client Site!

  • Hi

    I am running a dummy SQL server at my office. I have created the database. now i want to copy this database on to clients machine. I dont have any remote access to the clients machine. How can i copy the database on a disk and load the database on the clients machine..Please help me ASAP.

    sriram kakani


    sriram kakani

  • Which SQL Server are you running?!

    If you are running SQL Server 7.0 or SQL Server 2000, the easiest way is to

    1. Stop the Services on your machine.

    2. Copy YourDatabaseName.MDF & YourDatabaseName.LDF to client machine (by tape or CD or whatever)

    3. Attach them at client machine.

    DONE.

    .

  • Another way is to Backup the database, use RAR to compress.

    Email the file (depending on size) and restore on the client machine.

    ... shame you cannot use replication via email ..

    Probably best to make sure that both machines are running at the same SQL SP level anyway.

  • If you just want to copy the structure you can generate sql script using the enterprise manager.

    Pay Respect to People on your way up. For you will meet the same People on your way down.


    He who knows others is learned but the wise one is one who knows himself.

  • Sriram,

    I'd go along the lines of what mdamera states. Either stop the services on your DB or detach the database (sp_detach_db @dbname = 'database_name').

    Then zip and e-mail, post... the .MDF file. You don't necessarily need to send the log file (LDF) as it will automatically be created in the same directory as the data file.

    I'm assuming the client can run code. Have them run:

    EXEC sp_attach_db @dbname = 'database_name',

    @filename1 = 'G:\MSSQL_DATA\database_name_dat.mdf',

    @filename2 = 'F:\MSSQL_LOG\database_name_log.ldf'

    @filename2 is only necessary if you included the LDF log file in what you sent them. Obviously, the partition paths... will need adjusting.

    You also may need to fix the logins. Here's a sample of what that would look like:

    sp_change_users_login 'Update_One', 'sysdba', 'sysdba'

    Where 'sysdba' is the login name.

    Hope this helps,

    Jeff

  • Sorry, I should have first stated:

    If the user has Enterprise Manager I would do as andoi states and simply make a backup and have the user do a restore.

Viewing 6 posts - 1 through 5 (of 5 total)

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