Getting Started With MS SQL
Getting Started With MS SQL
MSSQL
Quick Start
Guide
This guide will help you:
Contents
Introduction ......................................................................................... 1
Before you start .................................................................................. 1
Fasthosts database management screen .......................................... 2
Add an MS SQL database to your account .................................... 3
Find your Database ............................................................................ 5
Add users to your database ............................................................... 6
Setting your user permissions ............................................................ 8
Connect to your database ................................................................ 14
Move an existing Database to Fasthosts ......................................... 16
Back up your Microsoft SQL database ............................................ 20
Back up your database content .................................................... 20
Backing up stored procedures and functions ................................ 25
Importing Microsoft SQL database content .................................. 27
Further reading ................................................................................ 31
Page 1
Customer Support | MSSQL Quick Start Guide
Introduction
SQL databases provide many benefits to the web designer, allowing you to
dynamically update your web pages, collect and maintain customer data and
allowing customers to contribute to your website with content of their own. In
addition, many software applications, such as blogs, forums and content
management systems require a database to store their information.
We offer two types of database: MySQL and Microsoft SQL Server. Most popular
web applications require one of these database types. You can find out which
database type you need on your chosen application's website.
Through the Graphical User Interface (GUI) you are able to create tables,
schema, objects and users. You can also set permissions and run scripts directly
on your database.
https://www.microsoft.com/en-us/sql-server/sql-server-downloads
Page 1
Customer Support | MSSQL Quick Start Guide
Step 1
Log in to your account and select Databases under Hosting & Domains.
Step 2
You will see a list of all MSSQL and MySQL databases in your account.
Page 2
Customer Support | MSSQL Quick Start Guide
Step 1
Follow the steps above to navigate to Fasthosts database management screen.
Step 2
Click Add New database.
Page 3
Customer Support | MSSQL Quick Start Guide
Step 3
Choose MSSQL Server as the database type, and enter a name for the new
database. This name must be unique on our system, so you may be asked to try
again if another customer has already chosen that name.
Click Add Database when you’ve entered a name for your database.
Page 4
Customer Support | MSSQL Quick Start Guide
Step 4
Confirm your order, if necessary, by clicking the Order Now button. The
database will be added to your package, and you will see an on-screen
confirmation message.
Once you have created a database the Database name and IP address are
shown on the Database management screen. Follow the steps shown in the
section entitled “Fasthosts database management screen” to view your database
details.
Page 5
Customer Support | MSSQL Quick Start Guide
If you'd like to give other people, or software, access to your database, but want
to restrict what they can do, create a new database user with different
permissions.
Step 1
Follow the steps shown in the section entitled “Fasthosts database management
screen”
Step 2
In the list of databases, click the database name.
Step 3
Click the Add User button.
Page 6
Customer Support | MSSQL Quick Start Guide
Step 4
Choose a username for this user and enter it into the Username text box.
Select the Give this user DBO access box if you want this user to be a Database
Owner. Database Owners have full permission to add, modify, and remove tables
and data within the database. If you do not tick this box you can modify the user’s
permissions later.
You also need to choose a password, and confirm it in the boxes provided.
Click Add User to create the new user. You will receive on-screen confirmation
that the user has been created.
Page 7
Customer Support | MSSQL Quick Start Guide
In the following example we have already created a new user, which our website
will use to connect to our database with. For this reason, we will limit the access
this user will have to our database.
Step 1
Open SQL Server Management Studio 18.
Step 2
Enter your database IP address in the text box marked Server name.
Step 3
Select Use SQL Server authentication from the list, enter your database owner
(DBO) username and password in the text boxes provided, then click Connect.
Page 8
Customer Support | MSSQL Quick Start Guide
Step 4
In the left hand Object explorer window, open your database, then double click
on the user you want to set permissions on.
Page 9
Customer Support | MSSQL Quick Start Guide
Step 5
A new window will open. Click Server Roles. To change the role of the user across
the entire database select the box appropriate to the new role of your user.
Role Permissions
bulkadmin Can run the BULK INSERT statement.
dbcreator Can create, alter, drop, and restore any database.
diskadmin Used for managing disk files.
processadmin Can end processes that are running in an instance of SQL Server.
public Every SQL Server login belongs to the public server role
securityadmin Can manage logins and their properties.
serveradmin Can change server-wide configuration options and shut down the
server.
setupadmin Can add and remove linked servers by using Transact-SQL
statements
sysadmin Can perform any activity in the server.
Page 10
Customer Support | MSSQL Quick Start Guide
Now we may want to enable this user to make changes to a particular table
within the database.
Step 6
To set custom permissions to specific areas of your database, click Securables
in the top left corner of the screen.
Step 7
Click the Search button to find the objects within your database to set
permissions for. In this example we will set the permissions on two tables within
the database.
Step 8
Select Specific objects then click OK.
Page 11
Customer Support | MSSQL Quick Start Guide
Step 9
Click Object Types, select the objects that you want to edit and click OK.
Step 10
Enter the object names in the text box provided, or click Browse to choose your
objects from a list. When you have selected all the tables and objects you want to
modify the users’ permissions for, click OK.
Page 12
Customer Support | MSSQL Quick Start Guide
Step 11
You should now be back on the Securables window, so select the object you
want to modify to highlight it, and use the check boxes in the lower pane (on the
Explicit tab) to set the permissions for your user.
Page 13
Customer Support | MSSQL Quick Start Guide
Step 2
Enter your database IP address in the text box marked Server name.
Step 3
Select Use SQL Server authentication from the list, enter your database
username and password in the text boxes provided, then click Connect.
Page 14
Customer Support | MSSQL Quick Start Guide
Step 4
Your database can be found in the list titled Object Explorer.
Page 15
Customer Support | MSSQL Quick Start Guide
This example will show you how to transfer the data from another Microsoft SQL
database.
Step 1
Open SQL Server Management Studio.
Step 2
Connect to your database using the database owner username and password
(see the section Connect to your database earlier in this guide for assistance).
Page 16
Customer Support | MSSQL Quick Start Guide
Step 3
Right-click on your database and select Tasks > Import Data from the popup
menu.
Step 4
The Import and Export Wizard will open, click Next.
Page 17
Customer Support | MSSQL Quick Start Guide
Step 5
Select SQL Server Native Client 11.0 from the list, and enter the database server
and connection details required to connect to the source database. Once you
have entered these, select the source Database from the list, then click Next.
Step 6
Enter the details of your MSSQL database, as follows:
Destination: Select SQL Server Native Client 11.0 from the drop down
menu.
Server name: Enter the IP address of your MSSQL database. This
information is shown within your Fasthosts control panel.
Page 18
Customer Support | MSSQL Quick Start Guide
Step 7
Select the option Copy data from one or more tables or views and click Next.
Step 8
Select the tables you wish to import, and then click Next.
Page 19
Customer Support | MSSQL Quick Start Guide
Step 9
Click Next, then Finish to import your data.
You will receive confirmation that your data has been imported to your database.
Step 1
Open SQL Server Management Studio.
Step 2
Connect to your database using the database owner username and password
(see the section Connect to your database earlier in this guide for assistance).
Page 20
Customer Support | MSSQL Quick Start Guide
Step 3
Right-click on your database and select Tasks, then Export Data from the popup
menus.
Step 4
The Import/Export wizard will open, click Next.
Page 21
Customer Support | MSSQL Quick Start Guide
Step 5
In the form provided, enter the following details:
Data source: Select SQL Server Native Client 11.0 from the drop down
menu.
Server Name: Enter the IP address of your database server. This is shown
within your Fasthosts control panel.
Authentication: Select Use SQL Server Authentication, then enter your
database username and password. This is the username and password you
chose when you created your database.
Database: Enter the name of your database from the drop down menu.
Click Next once you have entered all the required information.
Page 22
Customer Support | MSSQL Quick Start Guide
Step 6
You will be asked where to export the database contents to. Select Flat File
Destination from the drop down menu and choose a filename and location for
your backup.
In this example we have also changed the Locale to English (United Kingdom)
and selected the option marked Column names in the first data row.
Page 23
Customer Support | MSSQL Quick Start Guide
Step 7
Select Copy data from one or more tables or views and click Next.
Step 8
Finally, choose which tables or views you want to export and select how you
would like the file to be formatted. Once done click Next.
Step 9
Click Next, then Finish to export your file. You will receive confirmation that your
database content has been backed up.
Page 24
Customer Support | MSSQL Quick Start Guide
Step 1
Open SQL Server Management Studio.
Step 2
Connect to your database using the database owner username and password
(see the section Connect to your database earlier in this guide for assistance).
Step 3
Right-click on your database and select Tasks, then Generate Scripts... from the
drop down menus.
Page 25
Customer Support | MSSQL Quick Start Guide
Step 4
Choose Select specific database objects and then Stored Procedures then
click Next.
Step 5
Choose a location to save your stored procedure and a file name for this backup.
Then click Save.
Page 26
Customer Support | MSSQL Quick Start Guide
Step 1
Open SQL Server Management Studio.
Step 2
Connect to your database using the database owner username and password
(see the section Connect to your database earlier in this guide for assistance).
Step 3
Right-click on your database and select Tasks > Import Data from the popup
menu.
Page 27
Customer Support | MSSQL Quick Start Guide
Step 4
The Import and Export Wizard will open, click Next.
Step 5
Choose a data source for the data you wish to import from the Data source list.
Page 28
Customer Support | MSSQL Quick Start Guide
Step 6
Define the formatting of your data source, then click Next.
Page 29
Customer Support | MSSQL Quick Start Guide
Step 7
Enter the details of your MSSQL database, as follows:
Destination: Select SQL Server Native Client 11.0 from the drop down
menu.
Server name: Enter the IP address of your MSSQL database. This
information is shown within your Fasthosts control panel.
Authentication: Select Use SQL Server Authentication and enter your
database username and password. This is the same username and
password you chose when you created your database.
Database: Select your database from the drop down menu.
Click Next when you have entered all the required information.
Page 30
Customer Support | MSSQL Quick Start Guide
Step 8
Select the tables you wish to import, then click Next.
Step 9
Click Next, then Finish to import your data.
The import process may take a few minutes, and you will receive a confirmation
that the data has been successfully imported.
Further reading
Download Microsoft SQL Server Management Studio
https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-
management-studio-ssms?view=sql-server-ver15
http://www.microsoft.com/express/sql/default.aspx
Page 31