Publishing your SQL 2008 database to the SQL 2008 Server

Databases > MS SQL 2008
Note: before you attempt the following, make sure you have created a database in Control Panel. You can use the Restore tool in the control panel to restore your backup to our SQL Server.  However, this procedure is an alternative to migrate your SQL 2008 or SQL 2008 R2 database to our SQL 2008 R2 Server.

Required applications:  Visual Web Developer 2008 or Visual Studio 2008, and SQL Server 2008 Express (see: for downloads).
  1. Open Visual Web Developer Express 2008
  2. Open Database Explorer (View -> Database Explorer) (in Visual Studio 2008 you will open "Server Explorer").
  3. The Database Explorer should show up on the right side of the IDE.
  4. Right click Data Connections and select Add Connection.
  5. Enter the server name in the first text box (type the name of your local SQL Server).
  6. Type the name of the database in the database name field and click "OK."
  7. In Database Explorer you will see your local database.  Right click on it and choose Publish to Provider.
To generate the script that will create the backup of your database follow the steps listed below.
  1. Click "Next" on the welcome screen of Publishing Wizard.
  2. Insure that your database is selected, check Script all objects in the selected database and click "Next."
  3. Choose the Script to file option and type the name of the script you will be generating. Click "Next."
  4. Leave the default Publishing Options and click "Next."
  5. Click "Finish."
To run the script that will publish your database to our SQL 2008 R2 Server you will use SQL Server Management Studio Express or SQL Server 2008.  Follow the steps below to publish the database to the SQL 2008 R2 Server:
  1. Open your database in SQL Server Management Studio 2008.
  2. Click File/Open/File and navigate to the SQL script you just created from your SQL Server.
  3. Type the SQL database name provided for you in Control Panel.
  4. Choose SQL Server Authentication in the "Authentication" drop down box.
  5. Enter your database login and password from Control Panel (see #3).
  6. Once the script is opened, navigate to the very top of the page and type:
    • USE [database name] (without the brackets)
    • GO
  7. Click the "Execute" button.