Tutorial: Deploying a Data Driven Web Site to your Hoster

This tutorial will walk you through the steps involved in deploying a website that uses a database to your hoster by using the SQL Server Database Publishing Wizard.

For the purpose of this tutorial, we'll be using the TimeTracker ASP.NET starter kit as our data driven website.

Install requisite components

Generate T-SQL script using Database Publishing Wizard

  • Use the SQL Server Database Publishing Wizard to generate the T-SQL. From the command prompt, type:
Syntax: SqlPubWiz script -d <databaseName> <outputPath>
Example: SqlPubWiz script -d TimeTracker C:\temp\TimeTracker.sql


Here is an example of the generated T-SQL file.

Deploy to your hosted account

  • Log into your hosted account, navigate to your SQL Server database, and open your hosting account's script execution window (may look something like this):
QueryAnalyser.JPG
  • Copy the contents of your edited T-SQL file and paste them into the text area of your hosting account's script execution window. Execute the T-SQL. Wait for successful confirmation from your hosting account's script execution window that your T-SQL has been executed.
  • Modify the web.config you'll be uploading with valid connection strings for the database on your hosted account. Click here for an example hoster's (GoDaddy) instructions on how to get an example connection string for your hosted account.
  • Upload the ASP.NET starter kit files up to your hosted account.
  • You're done!

Potential Error: GOTO incorrectly interpreted

Some of the tools available from different hosters do not properly interpret GOTO statements, so any GOTO statements that may appear in your generated T-SQL script must be moved to the line before it to avoid it being interpreted as "GO". Not moving the GOTO statements to the line before it will result in an error when executing it in your hosting account's script execution window.
  • Open the output script in a text editor of your choice, and move all GOTO statements to the end of the line before it.

Before edit:
IF @ERROR > 0
BEGIN
GOTO Label
END

After edit:
IF @ERROR > 0
BEGIN GOTO Label
END

Here is an example of the edited T-SQL file.

If you run into any issues as you are trying to do this, please feel free to get assistance in the Discussions area.

Last edited Oct 30, 2006 at 3:58 PM by ibrabordsen, version 16

Comments

shahidkhi68 Nov 26, 2010 at 7:43 AM 
Hi where is the Query Analyzer in SQL server 2008 ?????