Wednesday, April 20, 2011

Copying Databases to Other Servers

Sometimes it is required to copy a database to some other computer, for example for testing, checking consistency, developing software, running reports, creating a mirror database, or making the database available to remote-branch operations.

There are several ways to copy a database:
  • Using the Copy Database Wizard
    You can use the Copy Database Wizard to copy or move databases between servers. For more information, see Using the Copy Database Wizard.

  • Restoring a database backup
    To copy an entire database, you can use the BACKUP and RESTORE Transact-SQL statements. Typically, restoring a full backup of a database is used to copy the database from one computer to another for a variety of reasons. For information on using backup and restore to copy a database, see Copying Databases with Backup and Restore.

    • Copying databases from SQL Server 6.5 or earlier
      For information about upgrading databases, see Copying Databases from SQL Server 7.0 or Earlier.
    • Using the Generate and Publish Scripts Wizard to transfer databases
      You can use the Generate and Publish Scripts Wizard to transfer a database from either a local instance of the Database Engine or from SQL Azure. You can use the wizard in two ways:
      • Use the wizard to generate a script of the database, and then run the script on either another instance of the Database Engine or SQL Azure.
      • Use the wizard and a publishing provider to publish a database directly to a Web service created by using the Database Publishing Services project from CodePlex.

No comments:

Post a Comment