The following describes how to setup a database user with read-only access to the AdventureWorks database.

Using SQL Server Management Studio 2008:

  1. Connect to your database server.
  2. Expand Security > Logins.
  3. Right-click on the user who will be set as having read-only access (in this example "adventureworksro").
  4. Select Properties.
  5. Select User Mapping.
  6. Map the login to the database they will have access to.
  7. Tick the boxes for role membership next to public and db_datareader.
  8. Confirm by clicking OK.
You should get something like the following:
Login Properties - Adventureworksro

Download Connectors from

MySQL Connector/Net

Type: .NET Framework Class Library
Usage: MySql.Data.MySqlClient.MySqlConnection
Manufacturer: MySQL

Default port is 3306.

Specifying port

This is an article on how to do a restore from backup on a database but when you get the error: "... database is in use".

-- SQL Server 2005
EXEC SP_WHO          // details on who is logged in

-- SQL Server 2008
EXEC SP_WHO2         // even more details

-- Run as database owner to see ALL connected processes as well.

For every DBA this is a doddle and doesn't warrant its own article but for those of us who merely use SQL Server Management Studio (SSMS) and Microsoft's SQL Server 2008 R2 for development purposes, the once-in-a-blue-moon restore from backup process is quickly forgotten.

You need to set the database to single-user mode.