Manually Attaching Kingdom SQL Database

There are two types of Kingdom SQL projects: Manual and Auto.

Insight will automatically try to attach the Kingdom project's database files whether it is a manual or auto SQL project (see Downloading and Installing SQL Server). However, there are rare occasions when database files need to be manually attached. This page will take you through how to manually attach an SQL database.

Background information:

Auto SQL projects automatically attach the SQL database when Kingdom is opened. Insight will automatically connect these databases to the SQL Server when the link is connected. When the link is disconnected, the database will be automatically detached. The Kingdom project should then be safe to copy.

Manual SQL projects are a little different. Kingdom does not automatically attach these databases (mdf/ldf files) to SQL Server, the user will have to manually do it. The manual mdf/ldf files are already attached to the instance if the Kingdom project is running. The Kingdom Reader will automatically connect to these projects. If the manual databases are not attached, Insight will still attempt to attach these files automatically.  

Open the SQL Server Management Studio

Open the SQL Server Management Studio
  1. Open the SQL Server Management Studio. (If you are using a Windows machine, click the Start button to access the Start menu. At the Start menu, click on All Programs and select Microsoft SQL Server XXXX.

Note: If SQL Server reports a message similar to "Not able to access the database 'xxxxx' under the current security context", right-click the program and select 'Run as administrator'.

  1. Type the Server name. This is the name of the computer on which SQL Server is installed. If SQL Server is installed on your local machine, you can also use LOCALHOST as the server name.
  2. Click Connect to connect to the Kingdom instance.

Attach databases

Attach databases
  1. Right-click Databases.
  2. Click Attach.

Select database file to attach

Select database file to attach
  1. In the Databases to attach section, Click Add.
  2. Browse to the .mdf file in the Kingdom project directory.
  3. Click OK.
  4. In the Attach Databases window, click OK.

Detach a database

Detach a database
  1. Open the SQL Server Management Studio as described in the preceding steps.
  2. Expand the Databases folder.
  3. Select the database that you want to detach.
  4. Right-click the folder and click Tasks, and select Detach.
  5. In the Detach Database window, click OK.