SQL Server Databases

Creating SQL Server Database and Database User
Backing up and Restoring SQL Server Database
Connecting to SQL Server Database

Creating SQL Server Database and Database User
Open “Hosting Space home” page.

To see the list of SQL Server databases and users point “Databases” in the hosting space left navigation menu and click select “SQL Server” from the popup menu:

To create a new SQL Server database click “Create Database” button:

Specify database name and click “Save” button to finish the wizard.

The next step is to create database user account and associate it with the database.

To create database user account click “Create User” button:

Specify username, password and then in “Databases” sections tick those databases you want to grant access for this user account. Database user will granted “db_owner” role in the selected databases.

You could specify “Default database” as well. It’s optional field, but once selected the name of the database could be omitted from connection string of your application.

Backing up and Restoring SQL Server Database
To backup SQL Server database open its properties screen:

and then click “Backup” button:

Specify backup name and select preferred method for storing backup. You could download it immediately or copy to some folder within your hosting space.

Control panel produces SQL Server backups in BAK format. Resulting file could be very large (it depends on actual size of database and its transaction log), but you have an option to compress it by ticking “ZIP Backup” option.

To restore SQL Server database click “Restore” button on database properties screen:

Click “Browse…” button to select backup file from your local file system or tick “Hosting Space File” option and then pick backup file from hosting space file system.

Click “Restore” to finish restoration wizard.

To reduce the size of SQL Server database data and log files, you can truncate database files. To truncate database files click “Truncate Files” button on database properties screen.

Connecting to SQL Server Database
Open “Hosting Space home” page.

To see connection information for SQL Server databases under your hosting space open “Space Summary information” page and scroll down to “Databases” section:

If external connections to SQL Server are allowed by your hosting provider you should see server address in the section. Use this address to manage your databases from your local machine using Microsoft SQL Server 2008 Management Studio Express. It’s a free product that can be downloaded from Microsoft web site: http://www.microsoft.com/downloads/details.aspx?FamilyID=08e52ac2-1d62-45f6-9a4a-4b76a8564a2b&displaylang=en

In “Databases” section there are also connection string samples for both classic ASP and ASP.NET. You could find more connection string samples at www.connectionstrings.com web site.